Переглянути джерело

Merge branch 'feature/rank_v6' of algorithm/recommend-server into master

jiachanghui 1 місяць тому
батько
коміт
7aa0ee7035

+ 1 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/FeatureService.java

@@ -266,6 +266,7 @@ public class FeatureService {
             protos.add(genWithVidAndProvince("alg_vid_feature_feed_province_root_return_v2", vid, province));
 
             // ********************* new vid ******************
+            protos.add(genWithKeyMap("alg_recsys_feature_video_clean_stat", vid, ImmutableMap.of("vid", vid)));
             protos.add(genWithKeyMap("alg_vid_global_feature_20250212", vid, ImmutableMap.of("vid", vid)));
             protos.add(genWithKeyMap("alg_vid_recommend_exp_feature_20250212", vid, ImmutableMap.of("vid", vid)));
             protos.add(genWithKeyMap("alg_vid_recommend_flowpool_exp_feature_20250212", vid, ImmutableMap.of("vid", vid)));

+ 310 - 31
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV564.java

@@ -1,14 +1,30 @@
 package com.tzld.piaoquan.recommend.server.service.rank.strategy;
 
+import com.alibaba.fastjson.JSON;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
+import com.tzld.piaoquan.recommend.server.common.ThreadPoolFactory;
+import com.tzld.piaoquan.recommend.server.common.base.RankItem;
+import com.tzld.piaoquan.recommend.server.model.MachineInfo;
 import com.tzld.piaoquan.recommend.server.model.Video;
+import com.tzld.piaoquan.recommend.server.service.FeatureService;
 import com.tzld.piaoquan.recommend.server.service.rank.RankParam;
+import com.tzld.piaoquan.recommend.server.service.rank.bo.UserSRBO;
+import com.tzld.piaoquan.recommend.server.service.rank.bo.UserShareReturnProfile;
+import com.tzld.piaoquan.recommend.server.service.rank.tansform.FeatureV6;
+import com.tzld.piaoquan.recommend.server.service.recall.strategy.*;
+import com.tzld.piaoquan.recommend.server.service.score.ScorerUtils;
+import com.tzld.piaoquan.recommend.server.util.CommonCollectionUtils;
+import com.tzld.piaoquan.recommend.server.util.FeatureBucketUtils;
+import com.tzld.piaoquan.recommend.server.util.JSONUtils;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.math3.util.Pair;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 @Service
 @Slf4j
@@ -17,52 +33,315 @@ public class RankStrategy4RegionMergeModelV564 extends RankStrategy4RegionMergeM
     private Map<String, Double> mergeWeight;
 
     @Autowired
-    private RankStrategy4RegionMergeModelV563 modelV563Service;
+    private FeatureService featureService;
 
     @Override
     public List<Video> mergeAndRankRovRecall(RankParam param) {
         Map<String, Double> mergeWeight = this.mergeWeight != null ? this.mergeWeight : new HashMap<>(0);
+        //-------------------融-------------------
+        //-------------------合-------------------
+        //-------------------逻-------------------
+        //-------------------辑-------------------
 
-        List<Video> result = modelV563Service.mergeAndRankRovRecall(param);
-        if (null != result && !result.isEmpty()) {
-            try {
-                int sortType = mergeWeight.getOrDefault("sortType", 0D).intValue();
-                if (sortType > 0) {
-                    String scoreKey;
-                    if (1 == sortType) {
-                        scoreKey = "fmRov";
-                    } else {
-                        scoreKey = "hasReturnRovScore";
+        long currentMs = System.currentTimeMillis();
+        List<Video> oldRovs = new ArrayList<>();
+        oldRovs.addAll(extractAndSort(param, RegionHRecallStrategy.PUSH_FORM));
+        oldRovs.addAll(extractAndSort(param, RegionHDupRecallStrategy.PUSH_FORM));
+        oldRovs.addAll(extractAndSort(param, Region24HRecallStrategy.PUSH_FORM));
+        oldRovs.addAll(extractAndSort(param, RegionRelative24HRecallStrategy.PUSH_FORM));
+        oldRovs.addAll(extractAndSort(param, RegionRelative24HDupRecallStrategy.PUSH_FORM));
+        removeDuplicate(oldRovs);
+        int sizeReturn = param.getSize();
+        List<Video> v0 = oldRovs.size() <= sizeReturn
+                ? oldRovs
+                : oldRovs.subList(0, sizeReturn);
+        Set<Long> setVideo = new HashSet<>();
+        this.duplicate(setVideo, v0);
+        setVideo.addAll(v0.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+        List<Video> rovRecallRank = new ArrayList<>(v0);
+        //-------------------return相似召回------------------
+        List<Video> v6 = extractAndSort(param, ReturnVideoRecallStrategy.PUSH_FORM);
+        v6 = v6.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+        v6 = v6.subList(0, Math.min(mergeWeight.getOrDefault("v6", 5.0).intValue(), v6.size()));
+        rovRecallRank.addAll(v6);
+        setVideo.addAll(v6.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+        //-------------------新地域召回------------------
+        List<Video> v1 = extractAndSort(param, RegionRealtimeRecallStrategyV1.PUSH_FORM);
+        v1 = v1.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+        v1 = v1.subList(0, Math.min(mergeWeight.getOrDefault("v1", 5.0).intValue(), v1.size()));
+        rovRecallRank.addAll(v1);
+        setVideo.addAll(v1.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+        //-------------------scene cf rovn------------------
+        List<Video> sceneCFRovn = extractAndSort(param, SceneCFRovnRecallStrategy.PUSH_FORM);
+        sceneCFRovn = sceneCFRovn.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+        sceneCFRovn = sceneCFRovn.subList(0, Math.min(mergeWeight.getOrDefault("sceneCFRovn", 5.0).intValue(), sceneCFRovn.size()));
+        rovRecallRank.addAll(sceneCFRovn);
+        setVideo.addAll(sceneCFRovn.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+        //-------------------scene cf rosn------------------
+        List<Video> sceneCFRosn = extractAndSort(param, SceneCFRosnRecallStrategy.PUSH_FORM);
+        sceneCFRosn = sceneCFRosn.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+        sceneCFRosn = sceneCFRosn.subList(0, Math.min(mergeWeight.getOrDefault("sceneCFRosn", 5.0).intValue(), sceneCFRosn.size()));
+        rovRecallRank.addAll(sceneCFRosn);
+        setVideo.addAll(sceneCFRosn.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+        // -------------------cate1------------------
+        int cate1RecallN = mergeWeight.getOrDefault("cate1RecallN", 5.0).intValue();
+        addRecall(param, cate1RecallN, UserCate1RecallStrategy.PUSH_FORM, setVideo, rovRecallRank);
+        // -------------------cate2------------------
+        int cate2RecallN = mergeWeight.getOrDefault("cate2RecallN", 5.0).intValue();
+        addRecall(param, cate2RecallN, UserCate2RecallStrategy.PUSH_FORM, setVideo, rovRecallRank);
+        // -------------------head province cate1------------------
+        int headCate1RecallN = mergeWeight.getOrDefault("headCate1RecallN", 5.0).intValue();
+        addRecall(param, headCate1RecallN, HeadProvinceCate1RecallStrategy.PUSH_FORM, setVideo, rovRecallRank);
+        // -------------------head province cate2------------------
+        int headCate2RecallN = mergeWeight.getOrDefault("headCate2RecallN", 5.0).intValue();
+        addRecall(param, headCate2RecallN, HeadProvinceCate2RecallStrategy.PUSH_FORM, setVideo, rovRecallRank);
+
+        //-------------------排-------------------
+        //-------------------序-------------------
+        //-------------------逻-------------------
+        //-------------------辑-------------------
+
+        // 1. 批量获取特征  省份参数要对齐  headvid  要传递过来!
+        // k1:视频、k2:表、k3:特征、v:特征值
+        List<String> vids = CommonCollectionUtils.toListDistinct(rovRecallRank, v -> String.valueOf(v.getVideoId()));
+        String headVid = String.valueOf(param.getHeadVid());
+        Map<String, Map<String, Map<String, String>>> videoBaseInfoMap = featureService.getVideoBaseInfo(headVid, vids);
+        FeatureService.Feature feature = featureService.getFeatureV3(param, videoBaseInfoMap, vids);
+        Map<String, Map<String, String>> featureOriginUser = feature.getUserFeature();
+        Map<String, Map<String, Map<String, String>>> featureOriginVideo = feature.getVideoFeature();
+        Map<String, String> headVideoInfo = videoBaseInfoMap.getOrDefault(headVid, new HashMap<>()).getOrDefault("alg_vid_feature_basic_info", new HashMap<>());
+
+        // 2. 用户信息预处理
+        Map<String, Map<String, String[]>> newC7Map = FeatureV6.parseUCFScore(featureOriginUser.getOrDefault("alg_mid_feature_sharecf", new HashMap<>()));
+        Map<String, Map<String, String[]>> newC8Map = FeatureV6.parseUCFScore(featureOriginUser.getOrDefault("alg_mid_feature_returncf", new HashMap<>()));
+        UserShareReturnProfile userProfile = parseUserProfile(featureOriginUser);
+        Map<String, Map<String, String>> userBehaviorVideoMap = getUserBehaviorVideoMap(userProfile);
+
+        // 3. 特征处理
+        List<RankItem> rankItems = CommonCollectionUtils.toList(rovRecallRank, RankItem::new);
+        Map<String, String> userFeatureMap = getUserFeature(currentMs, param, headVideoInfo, userProfile, featureOriginUser);
+        batchGetVideoFeature(currentMs, userProfile, headVideoInfo, videoBaseInfoMap,
+                newC7Map, newC8Map, featureOriginUser, userBehaviorVideoMap, featureOriginVideo, rankItems);
+
+        // 4. 排序模型计算
+        Map<String, String> sceneFeatureMap = new HashMap<>(0);
+        List<RankItem> items = ScorerUtils.getScorerPipeline("feeds_score_config_fm_xgb_20250317.conf").scoring(sceneFeatureMap, userFeatureMap, userFeatureMap, rankItems);
+
+        // 5. 排序公式特征
+        double xgbRovNegRate = mergeWeight.getOrDefault("xgbRovNegRate", 0.059);
+        double xgbNorPowerWeight = mergeWeight.getOrDefault("xgbNorPowerWeight", 1.22);
+        double xgbNorPowerExp = mergeWeight.getOrDefault("xgbNorPowerExp", 1.24);
+        Map<String, Map<String, String>> vid2MapFeature = this.getVideoRedisFeature(vids, "redis:vid_hasreturn_vor:");
+        List<Video> result = new ArrayList<>();
+        for (RankItem item : items) {
+            double score;
+            double fmRovOrigin = item.getScoreRov();
+            item.getScoresMap().put("fmRovOrigin", fmRovOrigin);
+            double fmRov = restoreScore(fmRovOrigin, xgbRovNegRate);
+            item.getScoresMap().put("fmRov", fmRov);
+            double hasReturnRovScore = Double.parseDouble(vid2MapFeature.getOrDefault(item.getVideoId() + "", new HashMap<>()).getOrDefault("rov", "0"));
+            item.getScoresMap().put("hasReturnRovScore", hasReturnRovScore);
+            double norXGBScore = item.getScoresMap().getOrDefault("NorXGBScore", 0d);
+            double newNorXGBScore = norPowerCalibration(xgbNorPowerWeight, xgbNorPowerExp, norXGBScore);
+            double vor = Double.parseDouble(vid2MapFeature.getOrDefault(item.getVideoId() + "", new HashMap<>()).getOrDefault("vor", "0"));
+            item.getScoresMap().put("vor", vor);
+            score = fmRov * (0.1 + newNorXGBScore) * (0.1 + vor);
+            Video video = item.getVideo();
+            video.setScore(score);
+            video.setSortScore(score);
+            video.setScoresMap(item.getScoresMap());
+            video.setAllFeatureMap(item.getAllFeatureMap());
+            if (MapUtils.isNotEmpty(feature.getVideoFeature()) && MapUtils.isNotEmpty(feature.getVideoFeature().get(item.getVideoId() + ""))) {
+                video.getMetaFeatureMap().putAll(feature.getVideoFeature().get(item.getVideoId() + ""));
+            }
+            if (MapUtils.isNotEmpty(videoBaseInfoMap) && MapUtils.isNotEmpty(videoBaseInfoMap.get(item.getVideoId() + ""))) {
+                video.getMetaFeatureMap().putAll(videoBaseInfoMap.get(item.getVideoId() + ""));
+            }
+            if (MapUtils.isNotEmpty(headVideoInfo)) {
+                video.getMetaFeatureMap().put("head_video", headVideoInfo);
+            }
+            if (MapUtils.isNotEmpty(feature.getUserFeature())) {
+                video.getMetaFeatureMap().putAll(feature.getUserFeature());
+            }
+            result.add(video);
+        }
+        result.sort(Comparator.comparingDouble(o -> -o.getSortScore()));
+        return result;
+    }
+
+    private UserShareReturnProfile parseUserProfile(Map<String, Map<String, String>> userOriginInfo) {
+        if (null != userOriginInfo) {
+            Map<String, String> c9 = userOriginInfo.get("alg_recsys_feature_user_share_return_stat");
+            if (null != c9 && !c9.isEmpty()) {
+                String c9Str = JSONUtils.toJson(c9);
+                if (!c9Str.isEmpty()) {
+                    try {
+                        return JSON.parseObject(c9Str, UserShareReturnProfile.class);
+                    } catch (Exception e) {
+                        log.error("parseObject user profile error! value=[{}]", c9Str, e);
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    private Map<String, Map<String, String>> getUserBehaviorVideoMap(UserShareReturnProfile userProfile) {
+        Set<String> vidSet = new HashSet<>();
+        if (null != userProfile) {
+            for (List<UserSRBO> list : Arrays.asList(userProfile.getM_s_s(), userProfile.getM_r_s(), userProfile.getL_s_s(), userProfile.getL_r_s())) {
+                if (null != list) {
+                    for (UserSRBO u : list) {
+                        if (null != u) {
+                            vidSet.add(u.getId() + "");
+                        }
                     }
-                    return resort(scoreKey, result);
+                }
+            }
+        }
+
+        Map<String, Map<String, String>> historyVideoMap = new HashMap<>();
+        if (!vidSet.isEmpty()) {
+            Map<String, Map<String, Map<String, String>>> videoMap = featureService.getVideoBaseInfo("", new ArrayList<>(vidSet));
+            if (null != videoMap && !videoMap.isEmpty()) {
+                for (Map.Entry<String, Map<String, Map<String, String>>> entry : videoMap.entrySet()) {
+                    String vid = entry.getKey();
+                    Map<String, Map<String, String>> map = entry.getValue();
+                    if (null != map && map.containsKey("alg_vid_feature_basic_info")) {
+                        historyVideoMap.put(vid, map.get("alg_vid_feature_basic_info"));
+                    }
+                }
+            }
+        }
+        return historyVideoMap;
+    }
+
+    private Map<String, String> getUserFeature(long currentMs, RankParam param, Map<String, String> headInfo, UserShareReturnProfile userProfile, Map<String, Map<String, String>> userOriginInfo) {
+        Map<String, Double> featMap = new HashMap<>();
+        // context feature
+        String appType = String.valueOf(param.getAppType());
+        String hotSceneType = String.valueOf(param.getHotSceneType());
+        FeatureV6.getContextFeature(currentMs, appType, hotSceneType, featMap);
+
+        // head video feature
+        FeatureV6.getVideoBaseFeature("h", currentMs, headInfo, featMap);
+
+        // user feature
+        Map<String, String> baseInfo = getUserBaseInfo(param);
+        FeatureV6.getUserFeature(userOriginInfo, featMap);
+        FeatureV6.getUserProfileFeature(userProfile, baseInfo, featMap);
+
+        return FeatureBucketUtils.noBucketFeature(featMap);
+    }
+
+    private Map<String, String> getVideoFeature(long currentMs, String vid,
+                                                UserShareReturnProfile userProfile,
+                                                Map<String, String> headInfo, Map<String, String> rankInfo,
+                                                Map<String, Map<String, String[]>> c7Map,
+                                                Map<String, Map<String, String[]>> c8Map,
+                                                Map<String, Map<String, String>> userOriginInfo,
+                                                Map<String, Map<String, String>> historyVideoMap,
+                                                Map<String, Map<String, Map<String, String>>> videoOriginInfo) {
+        Map<String, Double> featMap = new HashMap<>();
+        // user & video feature
+        FeatureV6.getUserTagsCrossVideoFeature("c5", rankInfo, userOriginInfo.get("alg_mid_feature_return_tags"), featMap);
+        FeatureV6.getUserTagsCrossVideoFeature("c6", rankInfo, userOriginInfo.get("alg_mid_feature_share_tags"), featMap);
+        FeatureV6.getUserCFFeature("c7", vid, c7Map, featMap);
+        FeatureV6.getUserCFFeature("c8", vid, c8Map, featMap);
+
+        // rank video feature
+        FeatureV6.getVideoBaseFeature("r", currentMs, rankInfo, featMap);
+        FeatureV6.getVideoFeature(vid, videoOriginInfo, featMap);
+
+        // head&rank cross feature
+        FeatureV6.getHeadRankVideoCrossFeature(headInfo, rankInfo, featMap);
+
+        // user profile & rank cross
+        FeatureV6.getProfileVideoCrossFeature(currentMs, userProfile, rankInfo, historyVideoMap, featMap);
+
+        return FeatureBucketUtils.noBucketFeature(featMap);
+    }
+
+    private void batchGetVideoFeature(long currentMs,
+                                      UserShareReturnProfile userProfile,
+                                      Map<String, String> headInfo,
+                                      Map<String, Map<String, Map<String, String>>> videoBaseInfoMap,
+                                      Map<String, Map<String, String[]>> c7Map,
+                                      Map<String, Map<String, String[]>> c8Map,
+                                      Map<String, Map<String, String>> userOriginInfo,
+                                      Map<String, Map<String, String>> historyVideoMap,
+                                      Map<String, Map<String, Map<String, String>>> videoOriginInfo,
+                                      List<RankItem> rankItems) {
+        if (null != rankItems && !rankItems.isEmpty()) {
+            List<Future<Integer>> futures = new ArrayList<>();
+            for (RankItem item : rankItems) {
+                String vid = item.getVideoId() + "";
+                Map<String, String> rankInfo = videoBaseInfoMap.getOrDefault(vid, new HashMap<>()).getOrDefault("alg_vid_feature_basic_info", new HashMap<>());
+                Future<Integer> future = ThreadPoolFactory.defaultPool().submit(() -> {
+                    item.featureMap = getVideoFeature(currentMs, vid, userProfile, headInfo, rankInfo, c7Map, c8Map, userOriginInfo, historyVideoMap, videoOriginInfo);
+                    item.norFeatureMap = item.featureMap;
+                    return 1;
+                });
+                futures.add(future);
+            }
+
+            try {
+                for (Future<Integer> future : futures) {
+                    future.get(1000, TimeUnit.MILLISECONDS);
                 }
             } catch (Exception e) {
-                log.error("diversity resort error", e);
+                log.error("get feature error", e);
             }
         }
-        return result;
     }
 
-    private List<Video> resort(String scoreKey, List<Video> videos) {
-        Map<Long, Video> videoMap = new HashMap<>();
-        List<Pair<Long, Double>> list = new ArrayList<>();
-        for (Video video : videos) {
-            long vid = video.getVideoId();
-            videoMap.put(vid, video);
+    private Map<String, String> getUserBaseInfo(RankParam param) {
+        Map<String, String> baseInfo = new HashMap<>();
+        String province = param.getProvince();
+        if (null != province && !province.isEmpty()) {
+            baseInfo.put("province", province.replaceAll("省$", ""));
+        }
 
-            Map<String, Double> scoreMap = video.getScoresMap();
-            list.add(Pair.create(vid, scoreMap.getOrDefault(scoreKey, 0d)));
+        String city = param.getCity();
+        if (null != city && !city.isEmpty()) {
+            baseInfo.put("city", city.replaceAll("市$", ""));
         }
-        list.sort(Comparator.comparingDouble(o -> -o.getSecond()));
-        return fillVideo(list, videoMap);
+
+        MachineInfo machineInfo = param.getMachineInfo();
+        if (null != machineInfo) {
+            String model = machineInfo.getModel();
+            if (null != model && !model.isEmpty()) {
+                baseInfo.put("model", model);
+            }
+            String brand = machineInfo.getBrand();
+            if (null != brand && !brand.isEmpty()) {
+                baseInfo.put("brand", brand);
+            }
+            String system = machineInfo.getSystem();
+            if (null != system && !system.isEmpty()) {
+                baseInfo.put("system", system);
+            }
+        }
+        return baseInfo;
     }
 
-    private List<Video> fillVideo(List<Pair<Long, Double>> list, Map<Long, Video> videoMap) {
-        List<Video> result = new ArrayList<>();
-        for (Pair<Long, Double> pair : list) {
-            Video video = videoMap.get(pair.getFirst());
-            result.add(video);
+    private double norPowerCalibration(double weight, double exp, double score) {
+        double newScore = weight * Math.pow(score, exp);
+        if (newScore > 100) {
+            newScore = 100;
+        } else if (newScore < score) {
+            newScore = score;
+        }
+        return newScore;
+    }
+
+    private void addRecall(RankParam param, int recallNum, String recallName, Set<Long> setVideo, List<Video> rovRecallRank) {
+        if (recallNum > 0) {
+            List<Video> list = extractAndSort(param, recallName);
+            list = list.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+            list = list.subList(0, Math.min(recallNum, list.size()));
+            rovRecallRank.addAll(list);
+            setVideo.addAll(list.stream().map(Video::getVideoId).collect(Collectors.toSet()));
         }
-        return result;
     }
 }

+ 36 - 67
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV566.java

@@ -3,13 +3,14 @@ package com.tzld.piaoquan.recommend.server.service.rank.strategy;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.tzld.piaoquan.recommend.server.model.Video;
 import com.tzld.piaoquan.recommend.server.service.rank.RankParam;
-import com.tzld.piaoquan.recommend.server.util.MathUtil;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.math3.util.Pair;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Service
 @Slf4j
@@ -20,33 +21,20 @@ public class RankStrategy4RegionMergeModelV566 extends RankStrategy4RegionMergeM
     @Autowired
     private RankStrategy4RegionMergeModelV563 modelV563Service;
 
-    @Autowired
-    private RankStrategy4RegionMergeModelV567 modelV567Service;
-
     @Override
     public List<Video> mergeAndRankRovRecall(RankParam param) {
         Map<String, Double> mergeWeight = this.mergeWeight != null ? this.mergeWeight : new HashMap<>(0);
 
-        List<Video> result;
-        String rosScoreKey;
-        int baseRankId = mergeWeight.getOrDefault("baseRankId", 563D).intValue();
-        if (567 == baseRankId) {
-            rosScoreKey = "NorXGBScore";
-            result = modelV567Service.mergeAndRankRovRecall(param);
-        } else {
-            rosScoreKey = "hasReturnRovScore";
-            result = modelV563Service.mergeAndRankRovRecall(param);
-        }
+        List<Video> result = modelV563Service.mergeAndRankRovRecall(param);
         if (null != result && !result.isEmpty()) {
             try {
                 Integer versionCode = param.getVersionCode();
                 int orderVersionCode = mergeWeight.getOrDefault("orderVersionCode", 1500D).intValue();
                 if (null != versionCode && versionCode == orderVersionCode) {
                     int keepTopN = mergeWeight.getOrDefault("keepTopN", 1D).intValue();
-                    boolean useRandFlag = mergeWeight.getOrDefault("useRandFlag", 0D).intValue() > 0;
-                    boolean firstRovFlag = mergeWeight.getOrDefault("firstRovFlag", 1D).intValue() > 0;
-                    double rovRandRate = mergeWeight.getOrDefault("rovRandRate", 0.5);
-                    return resort(keepTopN, useRandFlag, firstRovFlag, rovRandRate, rosScoreKey, result);
+                    int secondN = mergeWeight.getOrDefault("secondN", 4D).intValue();
+                    boolean secondFirstFlag = mergeWeight.getOrDefault("secondFirstFlag", 1D).intValue() > 0;
+                    return resort(keepTopN, secondN, secondFirstFlag, result);
                 }
             } catch (Exception e) {
                 log.error("diversity resort error", e);
@@ -55,60 +43,41 @@ public class RankStrategy4RegionMergeModelV566 extends RankStrategy4RegionMergeM
         return result;
     }
 
-    private List<Video> resort(int keepTopN, boolean useRandFlag, boolean firstRovFlag, double rovRandRate, String rosScoreKey, List<Video> videos) {
-        Map<Long, Video> videoMap = new HashMap<>();
-        List<Pair<Long, Double>> rovList = new ArrayList<>();
-        List<Pair<Long, Double>> rosList = new ArrayList<>();
-        for (Video video : videos) {
-            long vid = video.getVideoId();
-            videoMap.put(vid, video);
-
-            Map<String, Double> scoreMap = video.getScoresMap();
-            rovList.add(Pair.create(vid, scoreMap.getOrDefault("fmRov", 0d)));
-            rosList.add(Pair.create(vid, scoreMap.getOrDefault(rosScoreKey, 0d)));
-        }
-        rovList.sort(Comparator.comparingDouble(o -> -o.getSecond()));
-        rosList.sort(Comparator.comparingDouble(o -> -o.getSecond()));
-
-        // top
-        Set<Long> hit = new HashSet<>();
+    private List<Video> resort(int keepTopN, int secondN, boolean secondFirstFlag, List<Video> videos) {
+        // split
         List<Video> result = new ArrayList<>();
-        for (int i = 0; i < keepTopN && i < videos.size(); i++) {
-            Video video = videos.get(i);
-            hit.add(video.getVideoId());
-            result.add(video);
-        }
-
-        // alternate
-        int rovIndex = 0;
-        int rosIndex = 0;
-        boolean flag = firstRovFlag;
-        for (int i = keepTopN; i < videos.size(); i++) {
-            if (useRandFlag) {
-                flag = MathUtil.nextDouble(0, 1) < rovRandRate;
-            }
-            if (flag) {
-                rovIndex = fillVideo(rovIndex, rovList, videoMap, hit, result);
+        List<Video> list2nd = new ArrayList<>();
+        List<Video> list3rd = new ArrayList<>();
+        for (int i = 0; i < videos.size(); i++) {
+            if (i < keepTopN) {
+                result.add(videos.get(i));
+            } else if (i < secondN) {
+                list2nd.add(videos.get(i));
             } else {
-                rosIndex = fillVideo(rosIndex, rosList, videoMap, hit, result);
+                list3rd.add(videos.get(i));
             }
-            flag = !flag;
+        }
+
+        // merge
+        if (secondFirstFlag) {
+            fillVideo(list2nd, list3rd, result);
+        } else {
+            fillVideo(list3rd, list2nd, result);
         }
         return result;
     }
 
-    private int fillVideo(int start, List<Pair<Long, Double>> list, Map<Long, Video> videoMap, Set<Long> hit, List<Video> result) {
-        for (int i = start; i < list.size(); i++) {
-            start++;
-            Pair<Long, Double> pair = list.get(i);
-            long vid = pair.getFirst();
-            if (!hit.contains(vid)) {
-                Video video = videoMap.get(vid);
-                hit.add(vid);
-                result.add(video);
-                break;
-            }
+    private void fillVideo(List<Video> list1, List<Video> list2, List<Video> result) {
+        int index = 0;
+        for (; index < list1.size() && index < list2.size(); index++) {
+            result.add(list1.get(index));
+            result.add(list2.get(index));
+        }
+        for (; index < list1.size(); index++) {
+            result.add(list1.get(index));
+        }
+        for (; index < list2.size(); index++) {
+            result.add(list2.get(index));
         }
-        return start;
     }
 }

+ 27 - 11
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV568.java

@@ -39,6 +39,8 @@ public class RankStrategy4RegionMergeModelV568 extends RankStrategy4RegionMergeM
         //-------------------合-------------------
         //-------------------逻-------------------
         //-------------------辑-------------------
+        Set<Long> setVideo = new HashSet<>();
+        List<Video> rovRecallRank = new ArrayList<>();
 
         List<Video> oldRovs = new ArrayList<>();
         oldRovs.addAll(extractAndSort(param, RegionHRecallStrategy.PUSH_FORM));
@@ -51,22 +53,36 @@ public class RankStrategy4RegionMergeModelV568 extends RankStrategy4RegionMergeM
         List<Video> v0 = oldRovs.size() <= sizeReturn
                 ? oldRovs
                 : oldRovs.subList(0, sizeReturn);
-        Set<Long> setVideo = new HashSet<>();
-        this.duplicate(setVideo, v0);
-        setVideo.addAll(v0.stream().map(Video::getVideoId).collect(Collectors.toSet()));
-        List<Video> rovRecallRank = new ArrayList<>(v0);
-        //-------------------return相似召回------------------
-        List<Video> v6 = extractAndSort(param, ReturnVideoRecallStrategy.PUSH_FORM);
-        v6 = v6.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
-        v6 = v6.subList(0, Math.min(mergeWeight.getOrDefault("v6", 5.0).intValue(), v6.size()));
-        rovRecallRank.addAll(v6);
-        setVideo.addAll(v6.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+        //this.duplicate(setVideo, v0);
 
         Matcher matcher = FeatureUtils.getChannelMatcher(param.getRootSourceId());
         if (null != matcher && matcher.find() && FeatureUtils.firstLevel(param.getUserShareDepth())) {
-            int channelROVN = mergeWeight.getOrDefault("channelROVN", 5.0).intValue();
+            // channel rovn
+            int channelROVN = mergeWeight.getOrDefault("channelROVN", 4.0).intValue();
             addRecall(param, channelROVN, ChannelROVRecallStrategy.PUSH_FORM, setVideo, rovRecallRank);
+            //-------------------return相似召回------------------
+            List<Video> v6 = extractAndSort(param, ReturnVideoRecallStrategy.PUSH_FORM);
+            v6 = v6.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+            v6 = v6.subList(0, Math.min(mergeWeight.getOrDefault("v6", 4.0).intValue(), v6.size()));
+            rovRecallRank.addAll(v6);
+            setVideo.addAll(v6.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+            // 老地域
+            v0 = v0.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+            rovRecallRank.addAll(v0);
+            setVideo.addAll(v0.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+            // 不排序,直接返回
+            return rovRecallRank;
         } else {
+            // 老地域
+            v0 = v0.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+            rovRecallRank.addAll(v0);
+            setVideo.addAll(v0.stream().map(Video::getVideoId).collect(Collectors.toSet()));
+            //-------------------return相似召回------------------
+            List<Video> v6 = extractAndSort(param, ReturnVideoRecallStrategy.PUSH_FORM);
+            v6 = v6.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());
+            v6 = v6.subList(0, Math.min(mergeWeight.getOrDefault("v6", 5.0).intValue(), v6.size()));
+            rovRecallRank.addAll(v6);
+            setVideo.addAll(v6.stream().map(Video::getVideoId).collect(Collectors.toSet()));
             //-------------------新地域召回------------------
             List<Video> v1 = extractAndSort(param, RegionRealtimeRecallStrategyV1.PUSH_FORM);
             v1 = v1.stream().filter(r -> !setVideo.contains(r.getVideoId())).collect(Collectors.toList());

+ 515 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/tansform/FeatureV6.java

@@ -0,0 +1,515 @@
+package com.tzld.piaoquan.recommend.server.service.rank.tansform;
+
+import com.tzld.piaoquan.recommend.server.service.rank.bo.UserSRBO;
+import com.tzld.piaoquan.recommend.server.service.rank.bo.UserShareReturnProfile;
+import com.tzld.piaoquan.recommend.server.service.rank.bo.VideoAttrSRBO;
+import com.tzld.piaoquan.recommend.server.service.rank.extractor.ExtractorUtils;
+import com.tzld.piaoquan.recommend.server.util.FeatureUtils;
+import com.tzld.piaoquan.recommend.server.util.SimilarityUtils;
+
+import java.util.*;
+
+public class FeatureV6 {
+    private static final int seqMaxN = 2;
+    private static final int seqLastN = 2;
+    private static final double smoothPlus = 5.0;
+    private static final double log1Scale = 10.0;
+    private static final List<String> c1Periods = Arrays.asList("72h", "168h");
+    private static final List<String> c4Periods = Arrays.asList("72h", "168h");
+    private static final List<String> b0Periods = Arrays.asList("1h", "3h", "6h", "12h");
+    private static final List<String> b1Periods = Arrays.asList("1h", "3h", "24h", "72h", "168h");
+    private static final List<String> b2Periods = Arrays.asList("1h", "3h", "24h");
+    private static final List<String> b3Periods = Arrays.asList("24h", "168h");
+    private static final List<String> b4Periods = Arrays.asList("1h", "12h");
+    private static final List<String> b5Periods = Arrays.asList("72h", "168h");
+    private static final List<String> b6Periods = Arrays.asList("1h", "24h");
+    private static final List<String> b7Periods = Arrays.asList("24h", "168h");
+    private static final List<String> b8Periods = Arrays.asList("24h");
+    private static final List<String> b9Periods = Arrays.asList("24h");
+    private static final List<String> b10Periods = Arrays.asList("1h", "12h");
+    private static final List<String> b11Periods = Arrays.asList("12h", "168h");
+    private static final List<String> b13Periods = Arrays.asList("24h", "168h");
+    private static final List<String> dayPeriods = Arrays.asList("7d", "14d", "30d", "60d");
+    private static final List<String> videoCateAttrs = Arrays.asList(FeatureUtils.cate1Attr, FeatureUtils.cate2Attr, FeatureUtils.festive1Attr, FeatureUtils.channelAttr);
+    private static final List<String> videoSimAttrs = Arrays.asList("title", "cate2", "cate2_list", "keywords");
+    private static final List<String> hVideoSimAttrs = Arrays.asList("title");
+    private static final List<String> cfList = Arrays.asList("share", "return");
+    private static final List<String> userAttrList = Arrays.asList("province", "city", "model", "brand", "system");
+    private static final Set<String> hotSceneSet = new HashSet<>(Arrays.asList("1008", "1007", "1058", "1074", "1010"));
+
+    public static void getContextFeature(long currentMs, String appType, String hotSceneType, Map<String, Double> featureMap) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeInMillis(currentMs);
+
+        int week = calendar.get(Calendar.DAY_OF_WEEK);
+        int hour = calendar.get(Calendar.HOUR_OF_DAY) + 1;
+        featureMap.put(String.format("%s@%d", "week", week), 1.0);
+        featureMap.put(String.format("%s@%d", "hour", hour), 1.0);
+        featureMap.put("hour", hour * 1.0);
+        featureMap.put(String.format("%s@%s", "app", appType), 1.0);
+        String hot;
+        if (hotSceneSet.contains(hotSceneType)) {
+            hot = hotSceneType;
+        } else {
+            hot = "other";
+        }
+        featureMap.put(String.format("%s@%s", "hot", hot), 1.0);
+    }
+
+    public static void getUserFeature(Map<String, Map<String, String>> userOriginInfo, Map<String, Double> featMap) {
+        oneTypeStatFeature("c1", "return_1_uv", c1Periods, userOriginInfo.get("mid_global_feature_20250212"), featMap);
+    }
+
+    public static void getUserProfileFeature(UserShareReturnProfile profile, Map<String, String> userInfo, Map<String, Double> featMap) {
+        if (null != profile) {
+            long s_pv = profile.getS_pv();              // share_pv(分享pv)
+            long s_cnt = profile.getS_cnt();            // share_cnt(分享次数)
+            long r_pv = profile.getR_pv();              // return_pv(回流pv)
+            long r_uv = profile.getR_uv();              // return_uv(回流uv)
+            long m_s_cnt = profile.getM_s_cnt();        // max_share_cnt(最大分享次数)
+            long m_r_uv = profile.getM_r_uv();          // max_return_uv(最大回流uv)
+            if (s_pv > 0) {
+                double s_pv_s = FeatureUtils.log1(s_pv, log1Scale);
+                double s_cnt_s = FeatureUtils.log1(s_cnt, log1Scale);
+                double r_pv_s = FeatureUtils.log1(r_pv, log1Scale);
+                double r_uv_s = FeatureUtils.log1(r_uv, log1Scale);
+                double m_s_cnt_s = FeatureUtils.log1(m_s_cnt, log1Scale);
+                double m_r_uv_s = FeatureUtils.log1(m_r_uv, log1Scale);
+                double ros_one = FeatureUtils.wilsonScore(r_pv, s_pv);
+                double ros = FeatureUtils.plusSmooth(r_uv, s_pv, smoothPlus);
+                double ros_minus = FeatureUtils.plusSmooth(r_uv, r_pv, smoothPlus);
+                featMap.put("c9@s_pv", s_pv_s);
+                featMap.put("c9@s_cnt", s_cnt_s);
+                featMap.put("c9@r_pv", r_pv_s);
+                featMap.put("c9@r_uv", r_uv_s);
+                featMap.put("c9@m_s_cnt", m_s_cnt_s);
+                featMap.put("c9@m_r_uv", m_r_uv_s);
+                featMap.put("c9@ros_one", ros_one);
+                featMap.put("c9@ros", ros);
+                featMap.put("c9@ros_minus", ros_minus);
+            }
+        }
+        if (null != userInfo && !userInfo.isEmpty()) {
+            for (String attr : userAttrList) {
+                if (userInfo.containsKey(attr)) {
+                    String value = userInfo.get(attr).trim().replaceAll("(\\s+|\\t|:)", "_");
+                    if (!value.isEmpty()) {
+                        String key = String.format("%s@%s", attr, value.toLowerCase());
+                        featMap.put(key, 1.0);
+                    }
+                }
+            }
+        }
+    }
+
+    public static void getUserTagsCrossVideoFeature(String prefix, Map<String, String> videoInfo, Map<String, String> infoMap, Map<String, Double> featMap) {
+        if (null == videoInfo || videoInfo.isEmpty() || null == infoMap || infoMap.isEmpty()) {
+            return;
+        }
+        String title = videoInfo.getOrDefault("title", "");
+        if (title.isEmpty()) {
+            return;
+        }
+        for (String period : Arrays.asList("tags_1d", "tags_3d", "tags_7d")) {
+            String tags = infoMap.getOrDefault(period, "");
+            if (!tags.isEmpty()) {
+                Double[] doubles = ExtractorUtils.funcC34567ForTagsNew(tags, title);
+                featMap.put(prefix + "_" + period + "@matchnum", doubles[0]);
+                featMap.put(prefix + "_" + period + "@maxscore", doubles[1]);
+                featMap.put(prefix + "_" + period + "@avgscore", doubles[2]);
+            }
+        }
+    }
+
+    public static void getUserCFFeature(String prefix, String vid, Map<String, Map<String, String[]>> infoMap, Map<String, Double> featMap) {
+        if (vid.isEmpty() || null == infoMap || infoMap.isEmpty()) {
+            return;
+        }
+        for (String cfType : cfList) {
+            if (infoMap.containsKey(cfType)) {
+                Map<String, String[]> cfScoresMap = infoMap.get(cfType);
+                if (null != cfScoresMap && cfScoresMap.containsKey(vid)) {
+                    String[] scores = cfScoresMap.get(vid);
+                    Double score1 = Double.parseDouble(scores[0]);
+                    Double score2 = Double.parseDouble(scores[1]);
+                    Double score3 = Double.parseDouble(scores[2]) <= 0 ? 0D : 1.0 / Double.parseDouble(scores[2]);
+                    featMap.put(prefix + "_" + cfType + "@score", score1);
+                    featMap.put(prefix + "_" + cfType + "@num", score2);
+                    featMap.put(prefix + "_" + cfType + "@rank", score3);
+                }
+            }
+        }
+    }
+
+    public static void getVideoFeature(String vid, Map<String, Map<String, Map<String, String>>> videoOriginInfo, Map<String, Double> featMap) {
+        oneTypeStatFeature("b0", b0Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_recsys_feature_video_clean_stat"), featMap);
+        oneTypeStatFeature("b1", "return_1_uv", b1Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_vid_global_feature_20250212"), featMap);
+        oneTypeStatFeature("b2", "return_n_uv", b2Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_vid_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b3", "return_n_uv", b3Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_vid_recommend_flowpool_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b4", "return_n_uv", b4Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_vid_apptype_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b5", "return_n_uv", b5Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_vid_province_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b6", "return_n_uv", b6Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_vid_brand_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b7", "return_n_uv", b7Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_vid_hotsencetype_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b8", "return_n_uv", b8Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_merge_cate1_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b9", "return_n_uv", b9Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_merge_cate2_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b10", "return_n_uv", b10Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_channel_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b11", "return_n_uv", b11Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_festive_recommend_exp_feature_20250212"), featMap);
+        oneTypeStatFeature("b13", "return_n_uv", b13Periods, videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_video_unionid_recommend_exp_feature_20250212"), featMap);
+
+        // head video cf
+        headVideoCFD1Feature("d1", videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("scene_type_vid_cf_feature_20250212"), featMap);
+        headVideoCFD2Feature("d2", videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("vid_click_cf_feature_20250212"), featMap);
+        headVideoCFD3Feature("d3", videoOriginInfo.getOrDefault(vid, new HashMap<>()).get("alg_recsys_feature_cf_i2i_v2"), featMap);
+    }
+
+    public static void getVideoBaseFeature(String prefix, long currentMs, Map<String, String> videoInfo, Map<String, Double> featMap) {
+        if (null == videoInfo || videoInfo.isEmpty()) {
+            return;
+        }
+        featMap.put(prefix + "@total_time", FeatureUtils.log1(Double.parseDouble(videoInfo.getOrDefault("total_time", "0")), log1Scale));
+        featMap.put(prefix + "@bit_rate", FeatureUtils.log1(Double.parseDouble(videoInfo.getOrDefault("bit_rate", "0")), log1Scale));
+        if (videoInfo.containsKey("width") && videoInfo.containsKey("height")) {
+            String resolution = String.format("%s@%s@%s_%s", prefix, "wh", videoInfo.get("width"), videoInfo.get("height"));
+            featMap.put(resolution, 1.0);
+        }
+
+        // cate
+        getVideoCateFeature(prefix, videoInfo, featMap);
+        if (videoInfo.containsKey("title")) {
+            int id = FeatureUtils.judgeVideoTimeType(videoInfo.get("title"));
+            if (id > 0) {
+                String key = String.format("%s@%s@%d", prefix, "tt", id);
+                featMap.put(key, 1.0);
+            }
+        }
+
+        // time
+        try {
+            if (videoInfo.containsKey("gmt_create_timestamp")) {
+                String createMsStr = videoInfo.get("gmt_create_timestamp");
+                long createMs = Long.parseLong(createMsStr);
+                double createTime = FeatureUtils.getTimeDiff(currentMs, createMs);
+                featMap.put(prefix + "@ts", 1 - createTime);
+            }
+        } catch (Exception ignored) {
+        }
+    }
+
+    public static void getHeadRankVideoCrossFeature(Map<String, String> headInfo, Map<String, String> rankInfo, Map<String, Double> featMap) {
+        getTwoVideoCrossFeature("hr_sim", videoSimAttrs, headInfo, rankInfo, featMap);
+    }
+
+    public static void getProfileVideoCrossFeature(long currentMs, UserShareReturnProfile profile, Map<String, String> rankVideo, Map<String, Map<String, String>> hVideoMap, Map<String, Double> featMap) {
+        if (null == profile) {
+            return;
+        }
+        getRSCrossFeature("c9_mss", currentMs, seqMaxN, profile.getM_s_s(), rankVideo, hVideoMap, featMap);
+        getRSCrossFeature("c9_mrs", currentMs, seqMaxN, profile.getM_r_s(), rankVideo, hVideoMap, featMap);
+        getRSCrossFeature("c9_lss", currentMs, seqLastN, profile.getL_s_s(), rankVideo, hVideoMap, featMap);
+        getRSCrossFeature("c9_lrs", currentMs, seqLastN, profile.getL_r_s(), rankVideo, hVideoMap, featMap);
+
+        if (null == rankVideo || rankVideo.isEmpty()) {
+            return;
+        }
+        getVideoAttrSRCrossFeature("c9_c1s", rankVideo.getOrDefault("merge_first_level_cate", ""), profile.getC1_s(), featMap);
+        getVideoAttrSRCrossFeature("c9_c2s", rankVideo.getOrDefault("merge_second_level_cate", ""), profile.getC2_s(), featMap);
+        getVideoAttrSRCrossFeature("c9_l1s", rankVideo.getOrDefault("festive_label1", ""), profile.getL1_s(), featMap);
+        getVideoAttrSRCrossFeature("c9_l2s", rankVideo.getOrDefault("festive_label2", ""), profile.getL2_s(), featMap);
+    }
+
+    private static void getRSCrossFeature(String prefix, long currentMs, int maxN, List<UserSRBO> list, Map<String, String> rankVideo, Map<String, Map<String, String>> hVideoMap, Map<String, Double> featMap) {
+        if (null != list && !list.isEmpty()) {
+            for (int i = 0; i < list.size() && i < maxN; i++) {
+                UserSRBO u = list.get(i);
+                if (null != u) {
+                    long id = u.getId();
+                    long cnt = u.getCnt();
+                    long uv = u.getUv();
+                    long ts = u.getTs();
+                    if (id > 0) {
+                        String vid = id + "";
+                        String baseKey = String.format("%s@%d", prefix, i + 1);
+                        if (cnt > 0) {
+                            featMap.put(baseKey + "@cnt", FeatureUtils.log1(cnt, log1Scale));
+                        }
+                        if (uv > 0) {
+                            featMap.put(baseKey + "@uv", FeatureUtils.log1(uv, log1Scale));
+                        }
+                        if (ts > 0) {
+                            long historyMs = ts * 1000;
+                            featMap.put(baseKey + "@ts", 1 - FeatureUtils.getTimeDiff(currentMs, historyMs));
+
+                            // history week & hour
+                            Calendar calendar = Calendar.getInstance();
+                            calendar.setTimeInMillis(historyMs);
+                            featMap.put(String.format("%s_week@%d", baseKey, calendar.get(Calendar.DAY_OF_WEEK)), 1.0);
+                            featMap.put(String.format("%s_hour@%d", baseKey, calendar.get(Calendar.HOUR_OF_DAY) + 1), 1.0);
+                        }
+                        if (null != hVideoMap && hVideoMap.containsKey(vid)) {
+                            Map<String, String> hVideo = hVideoMap.get(vid);
+                            //getVideoCateFeature(baseKey, hVideo, featMap);
+                            getTwoVideoCrossFeature(baseKey, hVideoSimAttrs, hVideo, rankVideo, featMap);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private static void getVideoAttrSRCrossFeature(String prefix, String attr, Map<String, VideoAttrSRBO> attrMap, Map<String, Double> featMap) {
+        if (null == attrMap || attrMap.isEmpty()) {
+            return;
+        }
+        attr = attr.trim();
+        if (attrMap.containsKey(attr)) {
+            VideoAttrSRBO bo = attrMap.get(attr);
+            if (null != bo) {
+                long sp = bo.getSp();    // share_pv
+                long rp = bo.getRp();    // return_n_pv_noself
+                long ru = bo.getRu();    // return_n_uv_noself
+                long mu = bo.getMu();    // max_return_uv
+                if (sp > 0) {
+                    double sp_s = FeatureUtils.log1(sp, log1Scale);
+                    double rp_s = FeatureUtils.log1(rp, log1Scale);
+                    double ru_s = FeatureUtils.log1(ru, log1Scale);
+                    double mu_s = FeatureUtils.log1(mu, log1Scale);
+
+                    double ros_one = FeatureUtils.wilsonScore(rp, sp);
+                    double ros = FeatureUtils.plusSmooth(ru, sp, smoothPlus);
+                    double ros_minus = FeatureUtils.plusSmooth(ru, rp, smoothPlus);
+
+                    featMap.put(prefix + "@sp", sp_s);
+                    featMap.put(prefix + "@rp", rp_s);
+                    featMap.put(prefix + "@ru", ru_s);
+                    featMap.put(prefix + "@mu", mu_s);
+                    featMap.put(prefix + "@ros_one", ros_one);
+                    featMap.put(prefix + "@ros", ros);
+                    featMap.put(prefix + "@ros_minus", ros_minus);
+                }
+            }
+        }
+    }
+
+    private static void getVideoCateFeature(String prefix, Map<String, String> videoInfo, Map<String, Double> featMap) {
+        if (null == videoInfo || videoInfo.isEmpty()) {
+            return;
+        }
+        for (String attr : videoCateAttrs) {
+            String attrVal = videoInfo.getOrDefault(attr, "");
+            attrVal = attrVal.trim();
+            if (!attrVal.isEmpty()) {
+                String key = String.format("%s@%s@%s", prefix, attr, attrVal);
+                featMap.put(key, 1.0);
+            }
+        }
+        if (videoInfo.containsKey("keywords")) {
+            String keywords = videoInfo.get("keywords");
+            if (null != keywords && !keywords.isEmpty()) {
+                for (String kw : keywords.split(",")) {
+                    kw = kw.replaceAll("(\\s+|\\t|:)", "");
+                    if (!kw.isEmpty()) {
+                        String featKey = String.format("%s@kw@%s", prefix, kw);
+                        featMap.put(featKey, 1.0);
+                    }
+                }
+            }
+        }
+    }
+
+    private static void getTwoVideoCrossFeature(String prefix, List<String> attrs, Map<String, String> video1, Map<String, String> video2, Map<String, Double> featMap) {
+        if (null == video1 || video1.isEmpty() || null == video2 || video2.isEmpty()) {
+            return;
+        }
+        for (String attr : attrs) {
+            String attr1 = video1.getOrDefault(attr, "");
+            String attr2 = video2.getOrDefault(attr, "");
+            if (!"".equals(attr1) && !"unknown".equals(attr1) && !"".equals(attr2) && !"unknown".equals(attr2)) {
+                double simScore = SimilarityUtils.word2VecSimilarity(attr1, attr2);
+                featMap.put(prefix + "@" + attr, simScore);
+            }
+        }
+    }
+
+    private static void headVideoCFD1Feature(String prefix, Map<String, String> infoMap, Map<String, Double> featMap) {
+        double ros_cf_score = getOneInfo("ros_cf_score", infoMap);
+        double ros_cf_rank = getOneInfo("ros_cf_rank", infoMap);
+        double rov_cf_score = getOneInfo("rov_cf_score", infoMap);
+        double rov_cf_rank = getOneInfo("rov_cf_rank", infoMap);
+        featMap.put(prefix + "@ros_cf_score", ros_cf_score);
+        featMap.put(prefix + "@ros_cf_rank", ros_cf_rank);
+        featMap.put(prefix + "@rov_cf_score", rov_cf_score);
+        featMap.put(prefix + "@rov_cf_rank", rov_cf_rank);
+    }
+
+    private static void headVideoCFD2Feature(String prefix, Map<String, String> infoMap, Map<String, Double> featMap) {
+        double score = getOneInfo("score", infoMap);
+        double rank = getOneInfo("rank", infoMap);
+        featMap.put(prefix + "@score", score);
+        featMap.put(prefix + "@rank", rank);
+    }
+
+    private static void headVideoCFD3Feature(String prefix, Map<String, String> infoMap, Map<String, Double> featMap) {
+        double exp = getOneInfo("exp", infoMap);
+        double return_n = getOneInfo("return_n", infoMap);
+        double rovn = FeatureUtils.plusSmooth(return_n, exp, smoothPlus);
+        featMap.put(prefix + "@exp", FeatureUtils.log1(exp, log1Scale));
+        featMap.put(prefix + "@return_n", FeatureUtils.log1(return_n, log1Scale));
+        featMap.put(prefix + "@rovn", rovn);
+    }
+
+    public static Map<String, Map<String, String[]>> parseUCFScore(Map<String, String> mapInfo) {
+        Map<String, Map<String, String[]>> allScoresMap = new HashMap<>();
+        for (String cfType : cfList) {
+            String data = mapInfo.getOrDefault(cfType, "");
+            if (!data.isEmpty()) {
+                Map<String, String[]> oneScoresMap = new HashMap<>();
+                String[] entries = data.split(",");
+                for (String entry : entries) {
+                    String[] rList = entry.split(":");
+                    if (rList.length >= 4) { // 确保分割后有四个元素
+                        String key = rList[0];
+                        String value1 = rList[1];
+                        String value2 = rList[2];
+                        String value3 = rList[3];
+                        String[] strs = {value1, value2, value3};
+                        oneScoresMap.put(key, strs);
+                    }
+                }
+                if (!oneScoresMap.isEmpty()) {
+                    allScoresMap.put(cfType, oneScoresMap);
+                }
+            }
+        }
+        return allScoresMap;
+    }
+
+    private static void getRateStatFeature(String prefix, String calType, List<String> periods, Map<String, String> infoMap, Map<String, Double> featMap) {
+        if (null == infoMap || infoMap.isEmpty()) {
+            return;
+        }
+        for (String period : periods) {
+            double str_one = getOneInfo(calType + "str_one_" + period, infoMap);
+            double ros_one = getOneInfo(calType + "ros_one_" + period, infoMap);
+            double str = getOneInfo(calType + "str_" + period, infoMap);
+            double ros = getOneInfo(calType + "ros_" + period, infoMap);
+            double str_plus = getOneInfo(calType + "str_plus_" + period, infoMap);
+            double ros_minus = getOneInfo(calType + "ros_minus_" + period, infoMap);
+            double rovn = getOneInfo(calType + "rovn_" + period, infoMap);
+
+            featMap.put(prefix + "_" + period + "@" + calType + "str_one", str_one);
+            featMap.put(prefix + "_" + period + "@" + calType + "ros_one", ros_one);
+            featMap.put(prefix + "_" + period + "@" + calType + "str", str);
+            featMap.put(prefix + "_" + period + "@" + calType + "ros", ros);
+            featMap.put(prefix + "_" + period + "@" + calType + "str_plus", str_plus);
+            featMap.put(prefix + "_" + period + "@" + calType + "ros_minus", ros_minus);
+            featMap.put(prefix + "_" + period + "@" + calType + "rovn", rovn);
+        }
+    }
+
+    private static void oneTypeStatFeature(String prefix, String uvPrefix, List<String> periods, Map<String, String> infoMap, Map<String, Double> featMap) {
+        if (null == infoMap || infoMap.isEmpty()) {
+            return;
+        }
+        for (String period : periods) {
+            double exp = getOneInfo("exp_" + period, infoMap);
+            if (!FeatureUtils.greaterThanZero(exp)) {
+                continue;
+            }
+            double is_share = getOneInfo("is_share_" + period, infoMap);
+            double share_cnt = getOneInfo("share_cnt_" + period, infoMap);
+            double is_return_1 = getOneInfo("is_return_1_" + period, infoMap);
+            double return_n_uv = getOneInfo(uvPrefix + "_" + period, infoMap);
+
+            double exp_s = FeatureUtils.log1(exp, log1Scale);
+            double is_share_s = FeatureUtils.log1(is_share, log1Scale);
+            double share_cnt_s = FeatureUtils.log1(share_cnt, log1Scale);
+            double is_return_1_s = FeatureUtils.log1(is_return_1, log1Scale);
+            double return_n_uv_s = FeatureUtils.log1(return_n_uv, log1Scale);
+
+            double str = FeatureUtils.wilsonScore(is_share, exp);
+            double str_plus = FeatureUtils.wilsonScore(is_return_1, exp);
+            double ros_one = FeatureUtils.wilsonScore(is_return_1, is_share);
+
+            double rovn = FeatureUtils.plusSmooth(return_n_uv, exp, smoothPlus);
+            double ros = FeatureUtils.plusSmooth(return_n_uv, is_share, smoothPlus);
+            double ros_n = FeatureUtils.plusSmooth(return_n_uv, share_cnt, smoothPlus);
+            double ros_minus = FeatureUtils.plusSmooth(return_n_uv, is_return_1, smoothPlus);
+
+            featMap.put(prefix + "_" + period + "@" + "exp", exp_s);
+            featMap.put(prefix + "_" + period + "@" + "is_share", is_share_s);
+            featMap.put(prefix + "_" + period + "@" + "share_cnt", share_cnt_s);
+            featMap.put(prefix + "_" + period + "@" + "is_return_1", is_return_1_s);
+            featMap.put(prefix + "_" + period + "@" + "return_n_uv", return_n_uv_s);
+            featMap.put(prefix + "_" + period + "@" + "str", str);
+            featMap.put(prefix + "_" + period + "@" + "str_plus", str_plus);
+            featMap.put(prefix + "_" + period + "@" + "ros_one", ros_one);
+            featMap.put(prefix + "_" + period + "@" + "rovn", rovn);
+            featMap.put(prefix + "_" + period + "@" + "ros", ros);
+            featMap.put(prefix + "_" + period + "@" + "ros_n", ros_n);
+            featMap.put(prefix + "_" + period + "@" + "ros_minus", ros_minus);
+        }
+    }
+
+    private static void oneTypeStatFeature(String prefix, List<String> periods, Map<String, String> infoMap, Map<String, Double> featMap) {
+        if (null == infoMap || infoMap.isEmpty()) {
+            return;
+        }
+        for (String period : periods) {
+            double exp = getOneInfo("exp_" + period, infoMap);
+            if (!FeatureUtils.greaterThanZero(exp)) {
+                continue;
+            }
+            double is_share = getOneInfo("is_share_" + period, infoMap);
+            double share_cnt = getOneInfo("share_cnt_" + period, infoMap);
+            double is_return_1 = getOneInfo("is_return_1_" + period, infoMap);
+            double return_1_uv = getOneInfo("return_1_uv_" + period, infoMap);
+            double return_n_uv = getOneInfo("return_n_uv_" + period, infoMap);
+
+            double exp_s = FeatureUtils.log1(exp, log1Scale);
+            double is_share_s = FeatureUtils.log1(is_share, log1Scale);
+            double share_cnt_s = FeatureUtils.log1(share_cnt, log1Scale);
+            double is_return_1_s = FeatureUtils.log1(is_return_1, log1Scale);
+            double return_1_uv_s = FeatureUtils.log1(return_1_uv, log1Scale);
+            double return_n_uv_s = FeatureUtils.log1(return_n_uv, log1Scale);
+
+            double str = FeatureUtils.wilsonScore(is_share, exp);
+            double str_plus = FeatureUtils.wilsonScore(is_return_1, exp);
+            double ros_one = FeatureUtils.wilsonScore(is_return_1, is_share);
+
+            double rovn1 = FeatureUtils.plusSmooth(return_1_uv, exp, smoothPlus);
+            double ros1 = FeatureUtils.plusSmooth(return_1_uv, is_share, smoothPlus);
+            double ros_n1 = FeatureUtils.plusSmooth(return_1_uv, share_cnt, smoothPlus);
+            double ros_minus1 = FeatureUtils.plusSmooth(return_1_uv, is_return_1, smoothPlus);
+
+            double rovn = FeatureUtils.plusSmooth(return_n_uv, exp, smoothPlus);
+            double ros = FeatureUtils.plusSmooth(return_n_uv, is_share, smoothPlus);
+            double ros_n = FeatureUtils.plusSmooth(return_n_uv, share_cnt, smoothPlus);
+            double ros_minus = FeatureUtils.plusSmooth(return_n_uv, is_return_1, smoothPlus);
+
+            featMap.put(prefix + "_" + period + "@" + "exp", exp_s);
+            featMap.put(prefix + "_" + period + "@" + "is_share", is_share_s);
+            featMap.put(prefix + "_" + period + "@" + "share_cnt", share_cnt_s);
+            featMap.put(prefix + "_" + period + "@" + "is_return_1", is_return_1_s);
+            featMap.put(prefix + "_" + period + "@" + "return_1_uv", return_1_uv_s);
+            featMap.put(prefix + "_" + period + "@" + "return_n_uv", return_n_uv_s);
+            featMap.put(prefix + "_" + period + "@" + "str", str);
+            featMap.put(prefix + "_" + period + "@" + "str_plus", str_plus);
+            featMap.put(prefix + "_" + period + "@" + "ros_one", ros_one);
+            featMap.put(prefix + "_" + period + "@" + "rovn1", rovn1);
+            featMap.put(prefix + "_" + period + "@" + "ros1", ros1);
+            featMap.put(prefix + "_" + period + "@" + "ros_n1", ros_n1);
+            featMap.put(prefix + "_" + period + "@" + "ros_minus1", ros_minus1);
+            featMap.put(prefix + "_" + period + "@" + "rovn", rovn);
+            featMap.put(prefix + "_" + period + "@" + "ros", ros);
+            featMap.put(prefix + "_" + period + "@" + "ros_n", ros_n);
+            featMap.put(prefix + "_" + period + "@" + "ros_minus", ros_minus);
+        }
+    }
+
+    private static double getOneInfo(String name, Map<String, String> map) {
+        if (null == map) {
+            return 0.0;
+        }
+        return map.isEmpty() ? 0 : Double.parseDouble(map.getOrDefault(name, "0.0"));
+    }
+}

+ 1 - 5
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/score/ScorerUtils.java

@@ -33,12 +33,8 @@ public final class ScorerUtils {
         ScorerUtils.init(VIDEO_SCORE_CONF_FOR_AD);
         ScorerUtils.init("feeds_score_config_20240609.conf");
         ScorerUtils.init("feeds_score_config_20240807.conf");
-        ScorerUtils.init("feeds_score_config_fm_xgb_20250221.conf");
         ScorerUtils.init("feeds_score_config_fm_xgb_20250303.conf");
-        ScorerUtils.init("feeds_score_config_xgb_20241209.conf");
-        ScorerUtils.init("feeds_score_config_xgb_20250109.conf");
-        ScorerUtils.init("feeds_score_config_xgb_rov_20241209.conf");
-        ScorerUtils.init("feeds_score_config_xgb_rov_20250109.conf");
+        ScorerUtils.init("feeds_score_config_fm_xgb_20250317.conf");
         ScorerUtils.init("feeds_score_config_xgb_str_20250228.conf");
         ScorerUtils.init("feeds_score_config_xgb_ros_20250311.conf");
         ScorerUtils.init("feeds_score_config_xgb_ros_binary_20250319.conf");

+ 8 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/util/FeatureUtils.java

@@ -9,6 +9,7 @@ public class FeatureUtils {
     public static final String cate1Attr = "cate1_list";
     public static final String cate2Attr = "cate2";
     public static final String festive1Attr = "festive_label1";
+    public static final String channelAttr = "channel";
     private static final Map<String, Integer> cate1MAP = new HashMap<>();
     private static final Map<String, Integer> cate2MAP = new HashMap<>();
     private static final Map<String, Integer> festive1Map = new HashMap<>();
@@ -121,6 +122,13 @@ public class FeatureUtils {
         return Math.log(data + 1.0);
     }
 
+    public static double log1(double data, double scale) {
+        if (data <= 0) {
+            return 0D;
+        }
+        return Math.log(data + 1.0) / scale;
+    }
+
     public static double plusSmooth(double a, double b, double plus) {
         if (a == 0 || b == 0) {
             return 0D;

+ 467 - 0
recommend-server-service/src/main/resources/feeds_score_config_fm_xgb_20250317.conf

@@ -0,0 +1,467 @@
+scorer-config = {
+  rov-score-config = {
+     scorer-name = "com.tzld.piaoquan.recommend.server.service.score.VlogRovFMScorer"
+     scorer-priority = 96
+     model-path = "zhangbo/model_fm_for_recsys_v6_rov.txt"
+  }
+  nor-score-config = {
+    scorer-name = "com.tzld.piaoquan.recommend.server.service.score.NorXGBRegressionScorer"
+    scorer-priority = 97
+    model-path = "zhangbo/model_xgb_for_recsys_v6_nor.tar.gz"
+    param = {
+      localDir = "xgboost/recsys_v6_nor"
+      features = [
+      "b0_12h@exp",
+      "b0_12h@is_return_1",
+      "b0_12h@is_share",
+      "b0_12h@return_1_uv",
+      "b0_12h@return_n_uv",
+      "b0_12h@ros",
+      "b0_12h@ros1",
+      "b0_12h@ros_minus",
+      "b0_12h@ros_minus1",
+      "b0_12h@ros_n",
+      "b0_12h@ros_n1",
+      "b0_12h@ros_one",
+      "b0_12h@rovn",
+      "b0_12h@rovn1",
+      "b0_12h@share_cnt",
+      "b0_12h@str",
+      "b0_12h@str_plus",
+      "b0_1h@exp",
+      "b0_1h@is_return_1",
+      "b0_1h@is_share",
+      "b0_1h@return_1_uv",
+      "b0_1h@return_n_uv",
+      "b0_1h@ros",
+      "b0_1h@ros1",
+      "b0_1h@ros_minus",
+      "b0_1h@ros_minus1",
+      "b0_1h@ros_n",
+      "b0_1h@ros_n1",
+      "b0_1h@ros_one",
+      "b0_1h@rovn",
+      "b0_1h@rovn1",
+      "b0_1h@share_cnt",
+      "b0_1h@str",
+      "b0_1h@str_plus",
+      "b0_3h@exp",
+      "b0_3h@is_return_1",
+      "b0_3h@is_share",
+      "b0_3h@return_1_uv",
+      "b0_3h@return_n_uv",
+      "b0_3h@ros",
+      "b0_3h@ros1",
+      "b0_3h@ros_minus",
+      "b0_3h@ros_minus1",
+      "b0_3h@ros_n",
+      "b0_3h@ros_n1",
+      "b0_3h@ros_one",
+      "b0_3h@rovn",
+      "b0_3h@rovn1",
+      "b0_3h@share_cnt",
+      "b0_3h@str",
+      "b0_3h@str_plus",
+      "b0_6h@exp",
+      "b0_6h@is_return_1",
+      "b0_6h@is_share",
+      "b0_6h@return_1_uv",
+      "b0_6h@return_n_uv",
+      "b0_6h@ros",
+      "b0_6h@ros1",
+      "b0_6h@ros_minus",
+      "b0_6h@ros_minus1",
+      "b0_6h@ros_n",
+      "b0_6h@ros_n1",
+      "b0_6h@ros_one",
+      "b0_6h@rovn",
+      "b0_6h@rovn1",
+      "b0_6h@share_cnt",
+      "b0_6h@str",
+      "b0_6h@str_plus",
+      "b10_12h@is_share",
+      "b10_12h@return_n_uv",
+      "b10_12h@ros",
+      "b10_12h@ros_minus",
+      "b10_12h@rovn",
+      "b10_12h@str",
+      "b10_12h@str_plus",
+      "b10_1h@is_share",
+      "b10_1h@return_n_uv",
+      "b10_1h@ros",
+      "b10_1h@ros_minus",
+      "b10_1h@rovn",
+      "b10_1h@str",
+      "b10_1h@str_plus",
+      "b11_12h@is_share",
+      "b11_12h@return_n_uv",
+      "b11_12h@ros",
+      "b11_12h@ros_minus",
+      "b11_12h@rovn",
+      "b11_12h@str",
+      "b11_12h@str_plus",
+      "b11_168h@is_share",
+      "b11_168h@return_n_uv",
+      "b11_168h@ros",
+      "b11_168h@ros_minus",
+      "b11_168h@rovn",
+      "b11_168h@str",
+      "b11_168h@str_plus",
+      "b13_168h@is_share",
+      "b13_168h@return_n_uv",
+      "b13_168h@ros",
+      "b13_168h@ros_minus",
+      "b13_168h@ros_n",
+      "b13_168h@ros_one",
+      "b13_168h@rovn",
+      "b13_168h@str",
+      "b13_168h@str_plus",
+      "b13_24h@is_share",
+      "b13_24h@return_n_uv",
+      "b13_24h@ros",
+      "b13_24h@ros_minus",
+      "b13_24h@ros_n",
+      "b13_24h@ros_one",
+      "b13_24h@rovn",
+      "b13_24h@str",
+      "b13_24h@str_plus",
+      "b1_168h@exp",
+      "b1_168h@is_return_1",
+      "b1_168h@is_share",
+      "b1_168h@return_n_uv",
+      "b1_168h@ros",
+      "b1_168h@ros_minus",
+      "b1_168h@ros_n",
+      "b1_168h@ros_one",
+      "b1_168h@rovn",
+      "b1_168h@share_cnt",
+      "b1_168h@str",
+      "b1_168h@str_plus",
+      "b1_1h@exp",
+      "b1_1h@is_return_1",
+      "b1_1h@is_share",
+      "b1_1h@return_n_uv",
+      "b1_1h@ros",
+      "b1_1h@ros_minus",
+      "b1_1h@ros_n",
+      "b1_1h@ros_one",
+      "b1_1h@rovn",
+      "b1_1h@share_cnt",
+      "b1_1h@str",
+      "b1_1h@str_plus",
+      "b1_24h@exp",
+      "b1_24h@is_return_1",
+      "b1_24h@is_share",
+      "b1_24h@return_n_uv",
+      "b1_24h@ros",
+      "b1_24h@ros_minus",
+      "b1_24h@ros_n",
+      "b1_24h@ros_one",
+      "b1_24h@rovn",
+      "b1_24h@share_cnt",
+      "b1_24h@str",
+      "b1_24h@str_plus",
+      "b1_3h@exp",
+      "b1_3h@is_return_1",
+      "b1_3h@is_share",
+      "b1_3h@return_n_uv",
+      "b1_3h@ros",
+      "b1_3h@ros_minus",
+      "b1_3h@ros_n",
+      "b1_3h@ros_one",
+      "b1_3h@rovn",
+      "b1_3h@share_cnt",
+      "b1_3h@str",
+      "b1_3h@str_plus",
+      "b1_72h@exp",
+      "b1_72h@is_return_1",
+      "b1_72h@is_share",
+      "b1_72h@return_n_uv",
+      "b1_72h@ros",
+      "b1_72h@ros_minus",
+      "b1_72h@ros_n",
+      "b1_72h@ros_one",
+      "b1_72h@rovn",
+      "b1_72h@share_cnt",
+      "b1_72h@str",
+      "b1_72h@str_plus",
+      "b2_1h@is_return_1",
+      "b2_1h@is_share",
+      "b2_1h@return_n_uv",
+      "b2_1h@ros",
+      "b2_1h@ros_minus",
+      "b2_1h@ros_n",
+      "b2_1h@ros_one",
+      "b2_1h@rovn",
+      "b2_1h@share_cnt",
+      "b2_1h@str",
+      "b2_1h@str_plus",
+      "b2_24h@is_return_1",
+      "b2_24h@is_share",
+      "b2_24h@return_n_uv",
+      "b2_24h@ros",
+      "b2_24h@ros_minus",
+      "b2_24h@ros_n",
+      "b2_24h@ros_one",
+      "b2_24h@rovn",
+      "b2_24h@share_cnt",
+      "b2_24h@str",
+      "b2_24h@str_plus",
+      "b2_3h@is_return_1",
+      "b2_3h@is_share",
+      "b2_3h@return_n_uv",
+      "b2_3h@ros",
+      "b2_3h@ros_minus",
+      "b2_3h@ros_n",
+      "b2_3h@ros_one",
+      "b2_3h@rovn",
+      "b2_3h@share_cnt",
+      "b2_3h@str",
+      "b2_3h@str_plus",
+      "b3_168h@is_return_1",
+      "b3_168h@is_share",
+      "b3_168h@return_n_uv",
+      "b3_168h@ros",
+      "b3_168h@ros_minus",
+      "b3_168h@ros_n",
+      "b3_168h@ros_one",
+      "b3_168h@rovn",
+      "b3_168h@share_cnt",
+      "b3_168h@str",
+      "b3_168h@str_plus",
+      "b3_24h@is_return_1",
+      "b3_24h@is_share",
+      "b3_24h@return_n_uv",
+      "b3_24h@ros",
+      "b3_24h@ros_minus",
+      "b3_24h@ros_n",
+      "b3_24h@ros_one",
+      "b3_24h@rovn",
+      "b3_24h@share_cnt",
+      "b3_24h@str",
+      "b3_24h@str_plus",
+      "b4_12h@is_return_1",
+      "b4_12h@is_share",
+      "b4_12h@return_n_uv",
+      "b4_12h@ros",
+      "b4_12h@ros_minus",
+      "b4_12h@ros_n",
+      "b4_12h@ros_one",
+      "b4_12h@rovn",
+      "b4_12h@share_cnt",
+      "b4_12h@str",
+      "b4_12h@str_plus",
+      "b4_1h@is_return_1",
+      "b4_1h@is_share",
+      "b4_1h@return_n_uv",
+      "b4_1h@ros",
+      "b4_1h@ros_minus",
+      "b4_1h@ros_n",
+      "b4_1h@ros_one",
+      "b4_1h@rovn",
+      "b4_1h@share_cnt",
+      "b4_1h@str",
+      "b4_1h@str_plus",
+      "b5_168h@is_share",
+      "b5_168h@return_n_uv",
+      "b5_168h@ros",
+      "b5_168h@ros_minus",
+      "b5_168h@ros_n",
+      "b5_168h@ros_one",
+      "b5_168h@rovn",
+      "b5_168h@str",
+      "b5_168h@str_plus",
+      "b5_72h@is_share",
+      "b5_72h@return_n_uv",
+      "b5_72h@ros",
+      "b5_72h@ros_minus",
+      "b5_72h@ros_n",
+      "b5_72h@ros_one",
+      "b5_72h@rovn",
+      "b5_72h@str",
+      "b5_72h@str_plus",
+      "b6_1h@is_share",
+      "b6_1h@return_n_uv",
+      "b6_1h@ros",
+      "b6_1h@ros_minus",
+      "b6_1h@ros_n",
+      "b6_1h@ros_one",
+      "b6_1h@rovn",
+      "b6_1h@str",
+      "b6_1h@str_plus",
+      "b6_24h@is_share",
+      "b6_24h@return_n_uv",
+      "b6_24h@ros",
+      "b6_24h@ros_minus",
+      "b6_24h@ros_n",
+      "b6_24h@ros_one",
+      "b6_24h@rovn",
+      "b6_24h@str",
+      "b6_24h@str_plus",
+      "b7_168h@is_share",
+      "b7_168h@return_n_uv",
+      "b7_168h@ros",
+      "b7_168h@ros_minus",
+      "b7_168h@rovn",
+      "b7_168h@str",
+      "b7_168h@str_plus",
+      "b7_24h@is_share",
+      "b7_24h@return_n_uv",
+      "b7_24h@ros",
+      "b7_24h@ros_minus",
+      "b7_24h@rovn",
+      "b7_24h@str",
+      "b7_24h@str_plus",
+      "b8_24h@is_share",
+      "b8_24h@return_n_uv",
+      "b8_24h@ros",
+      "b8_24h@ros_minus",
+      "b8_24h@rovn",
+      "b8_24h@str",
+      "b8_24h@str_plus",
+      "b9_24h@is_share",
+      "b9_24h@return_n_uv",
+      "b9_24h@ros",
+      "b9_24h@ros_minus",
+      "b9_24h@rovn",
+      "b9_24h@str",
+      "b9_24h@str_plus",
+      "c1_168h@is_return_1",
+      "c1_168h@is_share",
+      "c1_168h@return_n_uv",
+      "c1_168h@ros",
+      "c1_168h@ros_minus",
+      "c1_168h@ros_n",
+      "c1_168h@ros_one",
+      "c1_168h@rovn",
+      "c1_168h@share_cnt",
+      "c1_168h@str",
+      "c1_168h@str_plus",
+      "c1_72h@is_return_1",
+      "c1_72h@is_share",
+      "c1_72h@return_n_uv",
+      "c1_72h@ros",
+      "c1_72h@ros_minus",
+      "c1_72h@ros_n",
+      "c1_72h@ros_one",
+      "c1_72h@rovn",
+      "c1_72h@share_cnt",
+      "c1_72h@str",
+      "c1_72h@str_plus",
+      "c5_tags_1d@avgscore",
+      "c5_tags_1d@matchnum",
+      "c5_tags_1d@maxscore",
+      "c5_tags_3d@avgscore",
+      "c5_tags_3d@matchnum",
+      "c5_tags_3d@maxscore",
+      "c5_tags_7d@avgscore",
+      "c5_tags_7d@matchnum",
+      "c5_tags_7d@maxscore",
+      "c6_tags_1d@avgscore",
+      "c6_tags_1d@matchnum",
+      "c6_tags_1d@maxscore",
+      "c6_tags_3d@avgscore",
+      "c6_tags_3d@matchnum",
+      "c6_tags_3d@maxscore",
+      "c6_tags_7d@avgscore",
+      "c6_tags_7d@matchnum",
+      "c6_tags_7d@maxscore",
+      "c7_return@num",
+      "c7_return@rank",
+      "c7_return@score",
+      "c7_share@num",
+      "c7_share@rank",
+      "c7_share@score",
+      "c8_return@num",
+      "c8_return@rank",
+      "c8_return@score",
+      "c8_share@num",
+      "c8_share@rank",
+      "c8_share@score",
+      "c9@m_r_uv",
+      "c9@m_s_cnt",
+      "c9@r_pv",
+      "c9@r_uv",
+      "c9@ros",
+      "c9@ros_minus",
+      "c9@ros_one",
+      "c9@s_cnt",
+      "c9@s_pv",
+      "c9_c1s@mu",
+      "c9_c1s@ros",
+      "c9_c1s@ros_minus",
+      "c9_c1s@ros_one",
+      "c9_c1s@rp",
+      "c9_c1s@ru",
+      "c9_c1s@sp",
+      "c9_c2s@mu",
+      "c9_c2s@ros",
+      "c9_c2s@ros_minus",
+      "c9_c2s@ros_one",
+      "c9_c2s@rp",
+      "c9_c2s@ru",
+      "c9_c2s@sp",
+      "c9_l1s@mu",
+      "c9_l1s@ros",
+      "c9_l1s@ros_minus",
+      "c9_l1s@ros_one",
+      "c9_l1s@rp",
+      "c9_l1s@ru",
+      "c9_l1s@sp",
+      "c9_l2s@mu",
+      "c9_l2s@ros",
+      "c9_l2s@ros_minus",
+      "c9_l2s@ros_one",
+      "c9_l2s@rp",
+      "c9_l2s@ru",
+      "c9_l2s@sp",
+      "c9_lrs@1@title",
+      "c9_lrs@1@ts",
+      "c9_lrs@1@uv",
+      "c9_lrs@2@title",
+      "c9_lrs@2@ts",
+      "c9_lrs@2@uv",
+      "c9_lss@1@cnt",
+      "c9_lss@1@title",
+      "c9_lss@1@ts",
+      "c9_lss@2@cnt",
+      "c9_lss@2@title",
+      "c9_lss@2@ts",
+      "c9_mrs@1@title",
+      "c9_mrs@1@ts",
+      "c9_mrs@1@uv",
+      "c9_mrs@2@title",
+      "c9_mrs@2@ts",
+      "c9_mrs@2@uv",
+      "c9_mss@1@cnt",
+      "c9_mss@1@title",
+      "c9_mss@1@ts",
+      "c9_mss@2@cnt",
+      "c9_mss@2@title",
+      "c9_mss@2@ts",
+      "d1@ros_cf_rank",
+      "d1@ros_cf_score",
+      "d1@rov_cf_rank",
+      "d1@rov_cf_score",
+      "d2@rank",
+      "d2@score",
+      "d3@exp",
+      "d3@return_n",
+      "d3@rovn",
+      "h@bit_rate",
+      "h@total_time",
+      "h@ts",
+      "h@tt@1",
+      "hour",
+      "hr_sim@cate2",
+      "hr_sim@cate2_list",
+      "hr_sim@keywords",
+      "hr_sim@title",
+      "r@bit_rate",
+      "r@total_time",
+      "r@ts",
+      "r@tt@1"
+      ]
+    }
+  }
+}