Quellcode durchsuchen

Merge branch 'wyp/1118-firstCrawlerDaysDecrease' of Server/long-article-recommend into master

wangyunpeng vor 7 Monaten
Ursprung
Commit
481845573b
12 geänderte Dateien mit 47 neuen und 28 gelöschten Zeilen
  1. 4 2
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV10Strategy.java
  2. 6 4
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV11Strategy.java
  3. 6 4
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV12Strategy.java
  4. 4 2
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV13Strategy.java
  5. 4 2
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV14Strategy.java
  6. 2 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV3Strategy.java
  7. 2 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV4Strategy.java
  8. 2 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV5Strategy.java
  9. 4 2
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV7Strategy.java
  10. 5 3
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV8Strategy.java
  11. 4 2
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV9Strategy.java
  12. 4 4
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/score/strategy/CrawlerDaysDecreaseStrategy.java

+ 4 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV10Strategy.java

@@ -56,13 +56,15 @@ public class RankV10Strategy implements RankStrategy {
             double score;
             int index = weightService.getIndex(item.getContent().getContentPoolType(), contentPools);
             if (contentPools[0].equals(item.getContent().getContentPoolType())) {
-                score = item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_SUM_RATE.value());
+                score = item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_SUM_RATE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
             } else if (contentPools[1].equals(item.getContent().getContentPoolType())) {
                 score = item.getScore(ScoreStrategyEnum.SIMILARITY.value())
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
                         ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value());
                 }

+ 6 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV11Strategy.java

@@ -56,10 +56,11 @@ public class RankV11Strategy implements RankStrategy {
             if (contentPools[0].equals(item.getContent().getContentPoolType())) {
                 score = item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
-                        ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value());
-                score += item.getScore(ScoreStrategyEnum.SIMILARITY.value())
+                        ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value())
+                        + item.getScore(ScoreStrategyEnum.SIMILARITY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
-                        ScoreStrategyEnum.SIMILARITY.value());
+                        ScoreStrategyEnum.SIMILARITY.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
@@ -72,7 +73,8 @@ public class RankV11Strategy implements RankStrategy {
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
                         ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,

+ 6 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV12Strategy.java

@@ -56,10 +56,11 @@ public class RankV12Strategy implements RankStrategy {
             if (contentPools[0].equals(item.getContent().getContentPoolType())) {
                 score = item.getScore(ScoreStrategyEnum.HIS_FISSION_DE_WEIGHT_AVG_READ_SUM_RATE.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
-                        ScoreStrategyEnum.HIS_FISSION_DE_WEIGHT_AVG_READ_SUM_RATE.value());
-                score += item.getScore(ScoreStrategyEnum.SIMILARITY.value())
+                        ScoreStrategyEnum.HIS_FISSION_DE_WEIGHT_AVG_READ_SUM_RATE.value())
+                        + item.getScore(ScoreStrategyEnum.SIMILARITY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
-                        ScoreStrategyEnum.SIMILARITY.value());
+                        ScoreStrategyEnum.SIMILARITY.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
@@ -72,7 +73,8 @@ public class RankV12Strategy implements RankStrategy {
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
                         ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,

+ 4 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV13Strategy.java

@@ -59,7 +59,8 @@ public class RankV13Strategy implements RankStrategy {
                                 ScoreStrategyEnum.SIMILARITY.value()));
                 score = item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
-                        ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value());
+                        ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
@@ -73,7 +74,8 @@ public class RankV13Strategy implements RankStrategy {
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
                         ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,

+ 4 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV14Strategy.java

@@ -59,7 +59,8 @@ public class RankV14Strategy implements RankStrategy {
                                 ScoreStrategyEnum.SIMILARITY.value()));
                 score = item.getScore(ScoreStrategyEnum.HIS_FISSION_DE_WEIGHT_AVG_READ_SUM_RATE.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
-                        ScoreStrategyEnum.HIS_FISSION_DE_WEIGHT_AVG_READ_SUM_RATE.value());
+                        ScoreStrategyEnum.HIS_FISSION_DE_WEIGHT_AVG_READ_SUM_RATE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
@@ -73,7 +74,8 @@ public class RankV14Strategy implements RankStrategy {
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
                         ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,

+ 2 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV3Strategy.java

@@ -55,7 +55,8 @@ public class RankV3Strategy implements RankStrategy {
                     || contentPools[1].equals(item.getContent().getContentPoolType())) {
                 score = item.getScore(ScoreStrategyEnum.SIMILARITY.value())
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value());
                 }

+ 2 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV4Strategy.java

@@ -55,7 +55,8 @@ public class RankV4Strategy implements RankStrategy {
                     || contentPools[1].equals(item.getContent().getContentPoolType())) {
                 score = item.getScore(ScoreStrategyEnum.SIMILARITY.value())
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE_CORRELATION.value());
                 }

+ 2 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV5Strategy.java

@@ -65,7 +65,8 @@ public class RankV5Strategy implements RankStrategy {
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
                         ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value())
                             * weightService.getWeight(param.getStrategy(), param.getGhId(), index,

+ 4 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV7Strategy.java

@@ -52,11 +52,13 @@ public class RankV7Strategy implements RankStrategy {
             item.setScoreMap(scoreMap.get(c.getId()));
             double score;
             if (contentPools[0].equals(item.getContent().getContentPoolType())) {
-                score = item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_CORRELATION_RATE.value());
+                score = item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_CORRELATION_RATE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
             } else if (contentPools[1].equals(item.getContent().getContentPoolType())) {
                 score = item.getScore(ScoreStrategyEnum.SIMILARITY.value())
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value());
                 }

+ 5 - 3
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV8Strategy.java

@@ -58,12 +58,14 @@ public class RankV8Strategy implements RankStrategy {
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
                         * weightService.getWeight(param.getStrategy(), param.getGhId(), index,
                         ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
-                score += item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value())
+                        + item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value());
             } else if (contentPools[1].equals(item.getContent().getContentPoolType())) {
                 score = item.getScore(ScoreStrategyEnum.SIMILARITY.value())
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value());
                 }

+ 4 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV9Strategy.java

@@ -52,11 +52,13 @@ public class RankV9Strategy implements RankStrategy {
             item.setScoreMap(scoreMap.get(c.getId()));
             double score;
             if (contentPools[0].equals(item.getContent().getContentPoolType())) {
-                score = item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value());
+                score = item.getScore(ScoreStrategyEnum.HIS_FISSION_AVG_READ_RATE_RATE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
             } else if (contentPools[1].equals(item.getContent().getContentPoolType())) {
                 score = item.getScore(ScoreStrategyEnum.SIMILARITY.value())
                         + item.getScore(ScoreStrategyEnum.CATEGORY.value())
-                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value());
+                        + item.getScore(ScoreStrategyEnum.FLOW_CTL_DECREASE.value())
+                        + item.getScore(ScoreStrategyEnum.CRAWLER_DAYS_DECREASE_STRATEGY.value());
                 if (item.getScore(ScoreStrategyEnum.PUBLISH_TIMES.value()) >= 0) {
                     score += item.getScore(ScoreStrategyEnum.VIEW_COUNT_RATE.value());
                 }

+ 4 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/score/strategy/CrawlerDaysDecreaseStrategy.java

@@ -32,10 +32,10 @@ public class CrawlerDaysDecreaseStrategy implements ScoreStrategy {
         }
         long now = DateUtils.getTodayStart();
         for (Content content : param.getContents()) {
-            String[] contentPools = accountContentPoolConfigService.getContentPools(param.getAccountName());
-            if (!contentPools[2].equals(content.getContentPoolType())) {
-                continue;
-            }
+//            String[] contentPools = accountContentPoolConfigService.getContentPools(param.getAccountName());
+//            if (!contentPools[2].equals(content.getContentPoolType())) {
+//                continue;
+//            }
             Score score = new Score();
             score.setStrategy(this);
             score.setContentId(content.getId());