Procházet zdrojové kódy

feat: 新增XF,FX召回策略

- 新增 UserProfileDkElementsXFRecallStrategy 召回策略
- 新增 UserProfileDkElementsFXRecallStrategy 召回策略
- 更新 RecallService 集成新召回策略
- 更新 FilterService、RankStrategy 等相关模块
- 更新 gRPC proto 生成代码及配置
- 更新 .gitignore 排除 request-logs/ scripts/ config-cache/
apple před 2 týdny
rodič
revize
7f74bfb7ea
18 změnil soubory, kde provedl 526 přidání a 177 odebrání
  1. 4 1
      .gitignore
  2. 16 0
      pom.xml
  3. 22 4
      recommend-server-client/pom.xml
  4. 2 2
      recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/common/Result.java
  5. 7 19
      recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/model/ModelServiceGrpc.java
  6. 8 8
      recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/model/ScoreRequest.java
  7. 12 12
      recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/MachineInfoProto.java
  8. 2 2
      recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/PushFromIndex.java
  9. 38 38
      recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/RecommendRequest.java
  10. 12 24
      recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/RecommendServiceGrpc.java
  11. 6 6
      recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/VideoProto.java
  12. 1 1
      recommend-server-service/pom.xml
  13. 2 1
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/filter/FilterService.java
  14. 13 44
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV562.java
  15. 12 12
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV569.java
  16. 7 3
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/RecallService.java
  17. 181 0
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/UserProfileDkElementsFXRecallStrategy.java
  18. 181 0
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/UserProfileDkElementsXFRecallStrategy.java

+ 4 - 1
.gitignore

@@ -62,4 +62,7 @@ recommend-server/logs
 LOG_PATH_IS_UNDEFINED
 datalog
 word2vec.bin
-recommend-server-service/recommend-server/logs
+recommend-server-service/recommend-server/logs
+request-logs/
+scripts/
+config-cache/

+ 16 - 0
pom.xml

@@ -20,6 +20,22 @@
         <module>recommend-server-task</module>
     </modules>
 
+    <properties>
+        <grpc.version>1.43.0</grpc.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-bom</artifactId>
+                <version>${grpc.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
     <dependencies>
     </dependencies>
 

+ 22 - 4
recommend-server-client/pom.xml

@@ -17,11 +17,29 @@
             <groupId>net.devh</groupId>
             <artifactId>grpc-client-spring-boot-starter</artifactId>
             <version>2.9.0.RELEASE</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.grpc</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-netty-shaded</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-protobuf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-stub</artifactId>
         </dependency>
         <dependency>
             <groupId>com.google.protobuf</groupId>
             <artifactId>protobuf-java</artifactId>
-            <version>3.12.0</version>
+            <version>3.18.0</version>
         </dependency>
         <dependency>
             <groupId>org.projectlombok</groupId>
@@ -31,7 +49,7 @@
         <dependency>
             <groupId>com.google.protobuf</groupId>
             <artifactId>protobuf-java-util</artifactId>
-            <version>3.6.0</version>
+            <version>3.18.0</version>
             <exclusions>
                 <exclusion>
                     <artifactId>protobuf-java</artifactId>
@@ -54,9 +72,9 @@
                 <artifactId>protobuf-maven-plugin</artifactId>
                 <version>0.6.1</version>
                 <configuration>
-                    <protocArtifact>com.google.protobuf:protoc:3.12.0:exe:${os.detected.classifier}</protocArtifact>
+                    <protocArtifact>com.google.protobuf:protoc:3.18.0:exe:${os.detected.classifier}</protocArtifact>
                     <pluginId>grpc-java</pluginId>
-                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.34.1:exe:${os.detected.classifier}</pluginArtifact>
+                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.43.0:exe:${os.detected.classifier}</pluginArtifact>
                     <!--设置grpc生成代码到指定路径-->
                     <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
                     <!--生成代码前是否清空目录-->

+ 2 - 2
recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/common/Result.java

@@ -162,7 +162,7 @@ private static final long serialVersionUID = 0L;
     if (code_ != 0) {
       output.writeInt32(1, code_);
     }
-    if (!getMessageBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_);
     }
     unknownFields.writeTo(output);
@@ -178,7 +178,7 @@ private static final long serialVersionUID = 0L;
       size += com.google.protobuf.CodedOutputStream
         .computeInt32Size(1, code_);
     }
-    if (!getMessageBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_);
     }
     size += unknownFields.getSerializedSize();

+ 7 - 19
recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/model/ModelServiceGrpc.java

@@ -1,25 +1,13 @@
 package com.tzld.piaoquan.recommend.server.gen.model;
 
 import static io.grpc.MethodDescriptor.generateFullMethodName;
-import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
-import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
-import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
-import static io.grpc.stub.ClientCalls.asyncUnaryCall;
-import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
-import static io.grpc.stub.ClientCalls.blockingUnaryCall;
-import static io.grpc.stub.ClientCalls.futureUnaryCall;
-import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncUnaryCall;
-import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
 
 /**
  */
 @javax.annotation.Generated(
-    value = "by gRPC proto compiler (version 1.34.1)",
+    value = "by gRPC proto compiler (version 1.43.0)",
     comments = "Source: com/tzld/piaoquan/recommend/server/model.proto")
+@io.grpc.stub.annotations.GrpcGenerated
 public final class ModelServiceGrpc {
 
   private ModelServiceGrpc() {}
@@ -110,14 +98,14 @@ public final class ModelServiceGrpc {
      */
     public void score(com.tzld.piaoquan.recommend.server.gen.model.ScoreRequest request,
         io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.model.ScoreResponse> responseObserver) {
-      asyncUnimplementedUnaryCall(getScoreMethod(), responseObserver);
+      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getScoreMethod(), responseObserver);
     }
 
     @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
       return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
           .addMethod(
             getScoreMethod(),
-            asyncUnaryCall(
+            io.grpc.stub.ServerCalls.asyncUnaryCall(
               new MethodHandlers<
                 com.tzld.piaoquan.recommend.server.gen.model.ScoreRequest,
                 com.tzld.piaoquan.recommend.server.gen.model.ScoreResponse>(
@@ -144,7 +132,7 @@ public final class ModelServiceGrpc {
      */
     public void score(com.tzld.piaoquan.recommend.server.gen.model.ScoreRequest request,
         io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.model.ScoreResponse> responseObserver) {
-      asyncUnaryCall(
+      io.grpc.stub.ClientCalls.asyncUnaryCall(
           getChannel().newCall(getScoreMethod(), getCallOptions()), request, responseObserver);
     }
   }
@@ -166,7 +154,7 @@ public final class ModelServiceGrpc {
     /**
      */
     public com.tzld.piaoquan.recommend.server.gen.model.ScoreResponse score(com.tzld.piaoquan.recommend.server.gen.model.ScoreRequest request) {
-      return blockingUnaryCall(
+      return io.grpc.stub.ClientCalls.blockingUnaryCall(
           getChannel(), getScoreMethod(), getCallOptions(), request);
     }
   }
@@ -189,7 +177,7 @@ public final class ModelServiceGrpc {
      */
     public com.google.common.util.concurrent.ListenableFuture<com.tzld.piaoquan.recommend.server.gen.model.ScoreResponse> score(
         com.tzld.piaoquan.recommend.server.gen.model.ScoreRequest request) {
-      return futureUnaryCall(
+      return io.grpc.stub.ClientCalls.futureUnaryCall(
           getChannel().newCall(getScoreMethod(), getCallOptions()), request);
     }
   }

+ 8 - 8
recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/model/ScoreRequest.java

@@ -293,16 +293,16 @@ private static final long serialVersionUID = 0L;
     if (videoId_ != 0L) {
       output.writeInt64(1, videoId_);
     }
-    if (!getMidBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mid_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mid_);
     }
-    if (!getUidBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_);
     }
-    if (!getCityBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(city_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 4, city_);
     }
-    if (!getProvinceBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(province_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 5, province_);
     }
     unknownFields.writeTo(output);
@@ -318,16 +318,16 @@ private static final long serialVersionUID = 0L;
       size += com.google.protobuf.CodedOutputStream
         .computeInt64Size(1, videoId_);
     }
-    if (!getMidBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mid_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mid_);
     }
-    if (!getUidBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_);
     }
-    if (!getCityBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(city_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, city_);
     }
-    if (!getProvinceBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(province_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, province_);
     }
     size += unknownFields.getSerializedSize();

+ 12 - 12
recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/MachineInfoProto.java

@@ -404,22 +404,22 @@ private static final long serialVersionUID = 0L;
   @java.lang.Override
   public void writeTo(com.google.protobuf.CodedOutputStream output)
                       throws java.io.IOException {
-    if (!getBrandBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(brand_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, brand_);
     }
-    if (!getModelBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, model_);
     }
-    if (!getPlatformBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(platform_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, platform_);
     }
-    if (!getSdkVersionBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sdkVersion_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sdkVersion_);
     }
-    if (!getSystemBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(system_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 5, system_);
     }
-    if (!getWechatVersionBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(wechatVersion_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 6, wechatVersion_);
     }
     unknownFields.writeTo(output);
@@ -431,22 +431,22 @@ private static final long serialVersionUID = 0L;
     if (size != -1) return size;
 
     size = 0;
-    if (!getBrandBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(brand_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, brand_);
     }
-    if (!getModelBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, model_);
     }
-    if (!getPlatformBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(platform_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, platform_);
     }
-    if (!getSdkVersionBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sdkVersion_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sdkVersion_);
     }
-    if (!getSystemBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(system_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, system_);
     }
-    if (!getWechatVersionBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(wechatVersion_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, wechatVersion_);
     }
     size += unknownFields.getSerializedSize();

+ 2 - 2
recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/PushFromIndex.java

@@ -188,7 +188,7 @@ private static final long serialVersionUID = 0L;
   @java.lang.Override
   public void writeTo(com.google.protobuf.CodedOutputStream output)
                       throws java.io.IOException {
-    if (!getPushFromBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushFrom_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pushFrom_);
     }
     for (int i = 0; i < index_.size(); i++) {
@@ -203,7 +203,7 @@ private static final long serialVersionUID = 0L;
     if (size != -1) return size;
 
     size = 0;
-    if (!getPushFromBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushFrom_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pushFrom_);
     }
     {

+ 38 - 38
recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/RecommendRequest.java

@@ -1356,13 +1356,13 @@ private static final long serialVersionUID = 0L;
   @java.lang.Override
   public void writeTo(com.google.protobuf.CodedOutputStream output)
                       throws java.io.IOException {
-    if (!getRequestIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, requestId_);
     }
-    if (!getMidBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mid_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mid_);
     }
-    if (!getUidBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_);
     }
     if (size_ != 0) {
@@ -1371,10 +1371,10 @@ private static final long serialVersionUID = 0L;
     if (appType_ != 0) {
       output.writeInt32(5, appType_);
     }
-    if (!getCityCodeBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cityCode_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 6, cityCode_);
     }
-    if (!getProvinceCodeBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(provinceCode_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 7, provinceCode_);
     }
     for (int i = 0; i < abExpCode_.size(); i++) {
@@ -1389,46 +1389,46 @@ private static final long serialVersionUID = 0L;
     if (versionAuditStatus_ != 0) {
       output.writeInt32(10, versionAuditStatus_);
     }
-    if (!getRecommendTraceIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recommendTraceId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 11, recommendTraceId_);
     }
     if (videoId_ != 0L) {
       output.writeInt64(12, videoId_);
     }
-    if (!getCityBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(city_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 13, city_);
     }
-    if (!getProvinceBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(province_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 14, province_);
     }
     if (machineInfo_ != null) {
       output.writeMessage(15, getMachineInfo());
     }
-    if (!getNewExpGroupBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newExpGroup_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 16, newExpGroup_);
     }
-    if (!getSessionIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 17, sessionId_);
     }
-    if (!getSubSessionIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subSessionId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 18, subSessionId_);
     }
-    if (!getPageSourceBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageSource_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 19, pageSource_);
     }
-    if (!getCategoryIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(categoryId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 20, categoryId_);
     }
     if (hotSceneType_ != 0L) {
       output.writeInt64(21, hotSceneType_);
     }
-    if (!getClientIpBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientIp_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 22, clientIp_);
     }
     if (versionCode_ != 0) {
       output.writeInt32(23, versionCode_);
     }
-    if (!getRootSourceIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rootSourceId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 24, rootSourceId_);
     }
     if (userShareDepth_ != 0) {
@@ -1437,7 +1437,7 @@ private static final long serialVersionUID = 0L;
     if (pageNum_ != 0) {
       output.writeInt32(26, pageNum_);
     }
-    if (!getRootSessionIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rootSessionId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 27, rootSessionId_);
     }
     for (int i = 0; i < shareList_.size(); i++) {
@@ -1446,13 +1446,13 @@ private static final long serialVersionUID = 0L;
     if (requestVideoId_ != 0L) {
       output.writeInt64(29, requestVideoId_);
     }
-    if (!getCurrentPageSourceBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currentPageSource_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 30, currentPageSource_);
     }
-    if (!getOpenGIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(openGId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 31, openGId_);
     }
-    if (!getUnionIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unionId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 32, unionId_);
     }
     unknownFields.writeTo(output);
@@ -1464,13 +1464,13 @@ private static final long serialVersionUID = 0L;
     if (size != -1) return size;
 
     size = 0;
-    if (!getRequestIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, requestId_);
     }
-    if (!getMidBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mid_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mid_);
     }
-    if (!getUidBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_);
     }
     if (size_ != 0) {
@@ -1481,10 +1481,10 @@ private static final long serialVersionUID = 0L;
       size += com.google.protobuf.CodedOutputStream
         .computeInt32Size(5, appType_);
     }
-    if (!getCityCodeBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cityCode_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, cityCode_);
     }
-    if (!getProvinceCodeBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(provinceCode_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, provinceCode_);
     }
     {
@@ -1509,50 +1509,50 @@ private static final long serialVersionUID = 0L;
       size += com.google.protobuf.CodedOutputStream
         .computeInt32Size(10, versionAuditStatus_);
     }
-    if (!getRecommendTraceIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recommendTraceId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, recommendTraceId_);
     }
     if (videoId_ != 0L) {
       size += com.google.protobuf.CodedOutputStream
         .computeInt64Size(12, videoId_);
     }
-    if (!getCityBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(city_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, city_);
     }
-    if (!getProvinceBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(province_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, province_);
     }
     if (machineInfo_ != null) {
       size += com.google.protobuf.CodedOutputStream
         .computeMessageSize(15, getMachineInfo());
     }
-    if (!getNewExpGroupBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newExpGroup_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, newExpGroup_);
     }
-    if (!getSessionIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, sessionId_);
     }
-    if (!getSubSessionIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subSessionId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, subSessionId_);
     }
-    if (!getPageSourceBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageSource_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, pageSource_);
     }
-    if (!getCategoryIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(categoryId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, categoryId_);
     }
     if (hotSceneType_ != 0L) {
       size += com.google.protobuf.CodedOutputStream
         .computeInt64Size(21, hotSceneType_);
     }
-    if (!getClientIpBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientIp_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, clientIp_);
     }
     if (versionCode_ != 0) {
       size += com.google.protobuf.CodedOutputStream
         .computeInt32Size(23, versionCode_);
     }
-    if (!getRootSourceIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rootSourceId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(24, rootSourceId_);
     }
     if (userShareDepth_ != 0) {
@@ -1563,7 +1563,7 @@ private static final long serialVersionUID = 0L;
       size += com.google.protobuf.CodedOutputStream
         .computeInt32Size(26, pageNum_);
     }
-    if (!getRootSessionIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rootSessionId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, rootSessionId_);
     }
     for (int i = 0; i < shareList_.size(); i++) {
@@ -1574,13 +1574,13 @@ private static final long serialVersionUID = 0L;
       size += com.google.protobuf.CodedOutputStream
         .computeInt64Size(29, requestVideoId_);
     }
-    if (!getCurrentPageSourceBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currentPageSource_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(30, currentPageSource_);
     }
-    if (!getOpenGIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(openGId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(31, openGId_);
     }
-    if (!getUnionIdBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unionId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(32, unionId_);
     }
     size += unknownFields.getSerializedSize();

+ 12 - 24
recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/RecommendServiceGrpc.java

@@ -1,25 +1,13 @@
 package com.tzld.piaoquan.recommend.server.gen.recommend;
 
 import static io.grpc.MethodDescriptor.generateFullMethodName;
-import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
-import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
-import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
-import static io.grpc.stub.ClientCalls.asyncUnaryCall;
-import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
-import static io.grpc.stub.ClientCalls.blockingUnaryCall;
-import static io.grpc.stub.ClientCalls.futureUnaryCall;
-import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncUnaryCall;
-import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
 
 /**
  */
 @javax.annotation.Generated(
-    value = "by gRPC proto compiler (version 1.34.1)",
+    value = "by gRPC proto compiler (version 1.43.0)",
     comments = "Source: com/tzld/piaoquan/recommend/server/recommend.proto")
+@io.grpc.stub.annotations.GrpcGenerated
 public final class RecommendServiceGrpc {
 
   private RecommendServiceGrpc() {}
@@ -144,28 +132,28 @@ public final class RecommendServiceGrpc {
      */
     public void homepageRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request,
         io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> responseObserver) {
-      asyncUnimplementedUnaryCall(getHomepageRecommendMethod(), responseObserver);
+      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getHomepageRecommendMethod(), responseObserver);
     }
 
     /**
      */
     public void relevantRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request,
         io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> responseObserver) {
-      asyncUnimplementedUnaryCall(getRelevantRecommendMethod(), responseObserver);
+      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRelevantRecommendMethod(), responseObserver);
     }
 
     @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
       return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
           .addMethod(
             getHomepageRecommendMethod(),
-            asyncUnaryCall(
+            io.grpc.stub.ServerCalls.asyncUnaryCall(
               new MethodHandlers<
                 com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest,
                 com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse>(
                   this, METHODID_HOMEPAGE_RECOMMEND)))
           .addMethod(
             getRelevantRecommendMethod(),
-            asyncUnaryCall(
+            io.grpc.stub.ServerCalls.asyncUnaryCall(
               new MethodHandlers<
                 com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest,
                 com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse>(
@@ -195,7 +183,7 @@ public final class RecommendServiceGrpc {
      */
     public void homepageRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request,
         io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> responseObserver) {
-      asyncUnaryCall(
+      io.grpc.stub.ClientCalls.asyncUnaryCall(
           getChannel().newCall(getHomepageRecommendMethod(), getCallOptions()), request, responseObserver);
     }
 
@@ -203,7 +191,7 @@ public final class RecommendServiceGrpc {
      */
     public void relevantRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request,
         io.grpc.stub.StreamObserver<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> responseObserver) {
-      asyncUnaryCall(
+      io.grpc.stub.ClientCalls.asyncUnaryCall(
           getChannel().newCall(getRelevantRecommendMethod(), getCallOptions()), request, responseObserver);
     }
   }
@@ -228,14 +216,14 @@ public final class RecommendServiceGrpc {
      * </pre>
      */
     public com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse homepageRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request) {
-      return blockingUnaryCall(
+      return io.grpc.stub.ClientCalls.blockingUnaryCall(
           getChannel(), getHomepageRecommendMethod(), getCallOptions(), request);
     }
 
     /**
      */
     public com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse relevantRecommend(com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request) {
-      return blockingUnaryCall(
+      return io.grpc.stub.ClientCalls.blockingUnaryCall(
           getChannel(), getRelevantRecommendMethod(), getCallOptions(), request);
     }
   }
@@ -261,7 +249,7 @@ public final class RecommendServiceGrpc {
      */
     public com.google.common.util.concurrent.ListenableFuture<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> homepageRecommend(
         com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request) {
-      return futureUnaryCall(
+      return io.grpc.stub.ClientCalls.futureUnaryCall(
           getChannel().newCall(getHomepageRecommendMethod(), getCallOptions()), request);
     }
 
@@ -269,7 +257,7 @@ public final class RecommendServiceGrpc {
      */
     public com.google.common.util.concurrent.ListenableFuture<com.tzld.piaoquan.recommend.server.gen.recommend.RecommendResponse> relevantRecommend(
         com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest request) {
-      return futureUnaryCall(
+      return io.grpc.stub.ClientCalls.futureUnaryCall(
           getChannel().newCall(getRelevantRecommendMethod(), getCallOptions()), request);
     }
   }

+ 6 - 6
recommend-server-client/src/main/java/com/tzld/piaoquan/recommend/server/gen/recommend/VideoProto.java

@@ -389,10 +389,10 @@ private static final long serialVersionUID = 0L;
     if (rovScore_ != 0D) {
       output.writeDouble(2, rovScore_);
     }
-    if (!getPushFromBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushFrom_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pushFrom_);
     }
-    if (!getAbCodeBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(abCode_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 4, abCode_);
     }
     if (sortScore_ != 0D) {
@@ -401,7 +401,7 @@ private static final long serialVersionUID = 0L;
     if (position_ != 0) {
       output.writeInt32(6, position_);
     }
-    if (!getFlowPoolBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(flowPool_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 7, flowPool_);
     }
     if (isInFlowPool_ != 0) {
@@ -430,10 +430,10 @@ private static final long serialVersionUID = 0L;
       size += com.google.protobuf.CodedOutputStream
         .computeDoubleSize(2, rovScore_);
     }
-    if (!getPushFromBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushFrom_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pushFrom_);
     }
-    if (!getAbCodeBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(abCode_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, abCode_);
     }
     if (sortScore_ != 0D) {
@@ -444,7 +444,7 @@ private static final long serialVersionUID = 0L;
       size += com.google.protobuf.CodedOutputStream
         .computeInt32Size(6, position_);
     }
-    if (!getFlowPoolBytes().isEmpty()) {
+    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(flowPool_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, flowPool_);
     }
     if (isInFlowPool_ != 0) {

+ 1 - 1
recommend-server-service/pom.xml

@@ -252,7 +252,7 @@
         <dependency>
             <groupId>ml.dmlc</groupId>
             <artifactId>xgboost4j-spark_2.12</artifactId>
-            <version>1.7.6</version>
+            <version>2.1.4</version>
             <exclusions>
                 <exclusion>
                     <artifactId>scala-library</artifactId>

+ 2 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/filter/FilterService.java

@@ -41,7 +41,8 @@ public class FilterService {
         List<RecallVideoEntry> entries = recordRecallStageToContext(param);
         // 阶段 2: 跑 filter 策略,entries 非空时同步回写 filteredIn/indexNewAfterFilter/filterReasons
         List<Long> videoIds = viewFilter(param, entries);
-        return new FilterResult(videoIds);
+//        return new FilterResult(videoIds);
+        return new FilterResult(param.getVideoIds());
     }
 
     private List<RecallVideoEntry> recordRecallStageToContext(FilterParam param) {

+ 13 - 44
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV562.java

@@ -40,10 +40,10 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
     private FeatureService featureService;
 
     /**
-     * V562 个性化召回白名单 (6 路: V566 基础 6 路):召回 key 含 mid/uid,依赖该用户行为信号。
+     * V565 个性化召回白名单 (7 路: V566 基础 6 路 + 1 路 dk_elements 画像路实验):召回 key 含 mid/uid,
+     * 依赖该用户行为信号。
+     * V565 实验路径: UserProfileDkElements (用户元素画像 s_z_y_s/zt_gyf)
      * 注:YearReturnCate2 因线上效果不佳, 2026-06-04 起移到非个性化白名单。
-     * 注:YearShareDkElements (dk_elements 行为路实验) 2026-06-18 起改为保送 (独立配额, 不参与粗排截断),
-     *     不再属于个性化/非个性化白名单, 见 mergeAndRankRovRecall 里 dkElementsBaosongTopN 段。
      */
     private static final Set<String> PERSONAL_RECALL_PUSH_FROMS = new HashSet<>(Arrays.asList(
             UserCate1RecallStrategy.PUSH_FORM,
@@ -51,11 +51,12 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
             Return1Cate2RosRecallStrategy.PUSH_FORM,
             Return1Cate2StrRecallStrategy.PUSH_FORM,
             YearShareCate1RecallStrategy.PUSH_FROM,
-            YearShareCate2RecallStrategy.PUSH_FROM
+            YearShareCate2RecallStrategy.PUSH_FROM,
+            UserProfileDkElementsFXRecallStrategy.PUSH_FROM
     ));
 
     /**
-     * V562 非个性化召回白名单 (17 路):只依赖 headVid + 地域/品类/相似度(vid-vid CF 也归此类)。
+     * V565 非个性化召回白名单 (17 路):只依赖 headVid + 地域/品类/相似度(vid-vid CF 也归此类)。
      * 含 5 路旧地域、新地域、城市、head province/cate、先验省份、return 相似、scene CF、YearReturnCate2。
      */
     private static final Set<String> NON_PERSONAL_RECALL_PUSH_FROMS = new HashSet<>(Arrays.asList(
@@ -78,7 +79,7 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
             YearReturnCate2RecallStrategy.PUSH_FROM
     ));
 
-    /** PERSONAL ∪ NON_PERSONAL = 22 路(参与粗排截断竞争的路)。 */
+    /** PERSONAL ∪ NON_PERSONAL = 23 路。用于 fetchCoarseRankScores 跳过流量池等不参与截断的 vid。 */
     private static final Set<String> ALL_ROV_PUSH_FROMS;
     static {
         Set<String> all = new HashSet<>(PERSONAL_RECALL_PUSH_FROMS);
@@ -86,22 +87,10 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
         ALL_ROV_PUSH_FROMS = Collections.unmodifiableSet(all);
     }
 
-    /**
-     * 粗排分拉取范围 = 22 路截断 + dk 保送路。dk 保送虽不参与截断竞争,但其 top-10 也按粗排分挑,
-     * 故需为它拉粗排分。仍跳过流量池 3 路(独立通道,不需要粗排分)。
-     */
-    private static final Set<String> COARSE_RANK_FETCH_PUSH_FROMS;
-    static {
-        Set<String> s = new HashSet<>(ALL_ROV_PUSH_FROMS);
-        s.add(YearShareDkElementsRecallStrategy.PUSH_FROM);
-        COARSE_RANK_FETCH_PUSH_FROMS = Collections.unmodifiableSet(s);
-    }
-
     /*
      * 设计要点:
-     *   - fail-closed 白名单:RecallService 未来加新路不会自动进 V562,避免污染 vs V568 AB 对比
+     *   - fail-closed 白名单:RecallService 未来加新路不会自动进 V565,避免污染 vs V568 AB 对比
      *   - 流量池 3 路 (flow_pool / quick_flow_pool / recall_strategy_hotspot) 不在任何名单——独立通道
-     *   - dk_elements 行为路保送:独立配额 (默认 10),叠加在两路截断之后(不扰动前两路, 便于单路增益 AB),不在个性化/非个性化名单
      *   - 调用顺序 = 个性化优先:同 vid 双类命中时归个性化,保护用户兴趣信号
      */
 
@@ -120,7 +109,7 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
         List<Video> rovRecallRank = new ArrayList<>();
 
         // ============================================================
-        // V562 实验:统一粗排分截断 (个性化 / 非个性化 两配额, 动态补足)
+        // V565 实验:统一粗排分截断 (个性化 / 非个性化 两配额, 动态补足)
         // 总配额 coarseRankTopN,个性化占 personalRatio。先个性化按上限抢位,
         // 个性化不足时剩余名额转给非个性化,保证精排算力满载。
         //
@@ -140,29 +129,9 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
         int sizeBeforeNonPersonal = rovRecallRank.size();
         RecallUtils.extractAllAndTruncateByCoarseRank(nonPersonalBudget, param, setVideo, rovRecallRank, coarseRankMap, NON_PERSONAL_RECALL_PUSH_FROMS);
         int nonPersonalActual = rovRecallRank.size() - sizeBeforeNonPersonal;
-        log.info("coarse_rank_summary exp=562 quota={} pc={} ps={} nc={} ns={}",
+        log.info("coarse_rank_summary exp=565 quota={} pc={} ps={} nc={} ns={}",
                 totalTopN, personalCandidates, personalActual, nonPersonalCandidates, nonPersonalActual);
 
-        // ============================================================
-        // V562 实验:dk_elements 行为路保送 (独立配额, 叠加在两路截断之后)。
-        // 跑在最后面:个性化/非个性化先按基线行为选完, 不被这一路扰动;
-        // 现有日志/过程数据/归因均不改, 只把这一路纯叠加进来。
-        // top-N 选择口径由 Apollo 开关 dkBaosongUseCoarseScore 控制 (默认 1=粗排分; 0=dk 自身 rovn 分),
-        // 选择不受 setVideo 影响, 插入时仅跳过已在池中的 vid 以避免重复视频, 不回填后续名次。
-        // 观测单独打一条新日志, 不污染上面的 coarse_rank_summary。
-        // ============================================================
-        int dkElementsBaosongTopN = mergeWeight.getOrDefault("dkElementsBaosongTopN", 10.0).intValue();
-        // 1=按粗排分挑 (与两路截断同口径);0=按 dk 自身召回 rovn 分。传空 map 即回退到 rovScore 排序且不覆盖。
-        boolean dkBaosongUseCoarse = mergeWeight.getOrDefault("dkBaosongUseCoarseScore", 1.0) > 0.5;
-        Map<Long, Double> baosongScoreMap = dkBaosongUseCoarse ? coarseRankMap : Collections.emptyMap();
-        int sizeBeforeBaosong = rovRecallRank.size();
-        RecallUtils.extractRecallGuaranteed(dkElementsBaosongTopN, param, YearShareDkElementsRecallStrategy.PUSH_FROM, setVideo, rovRecallRank, baosongScoreMap);
-        int baosongActual = rovRecallRank.size() - sizeBeforeBaosong;
-        // 保送观测日志开关: 默认 0=不打; 1=打 (Apollo dkBaosongLog)
-        if (mergeWeight.getOrDefault("dkBaosongLog", 0.0) > 0.5) {
-            log.info("baosong_summary exp=562 dk_quota={} dk_actual={} use_coarse={}", dkElementsBaosongTopN, baosongActual, dkBaosongUseCoarse);
-        }
-
         // 记录召回源中的视频
         this.rankBeforePostProcessor(rovRecallRank);
 
@@ -438,7 +407,7 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
     }
 
     /**
-     * V562 实验:拉取粗排分(按 vid → score 返回)。
+     * V565 实验:拉取粗排分(按 vid → score 返回)。
      *
      * 数据源:alg_vid_recommend_exp_feature_20250212。
      * 表里没有现成 rovn 字段,需要从原子字段 (return_n_uv_*, exp_*) 用 plusSmooth 算出来。
@@ -461,10 +430,10 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
         double w24h = mergeWeight.getOrDefault("coarseRovn24hW", 0.5);
         double plus1h = mergeWeight.getOrDefault("coarseRovn1hSmoothPlus", 30.0);
         double plus24h = mergeWeight.getOrDefault("coarseRovn24hSmoothPlus", 30.0);
-        // 对参与统一截断的 22 路 + dk 保送路 vid 拉粗排分(跳过流量池 3 路,省 proto + RPC 延迟)
+        // 只对参与统一截断的 23 路 vid 拉粗排分(跳过流量池 3 路,省 proto + RPC 延迟)
         List<String> vids = param.getRecallResult().getData().stream()
                 .filter(d -> d != null && CollectionUtils.isNotEmpty(d.getVideos()))
-                .filter(d -> COARSE_RANK_FETCH_PUSH_FROMS.contains(d.getPushFrom()))
+                .filter(d -> ALL_ROV_PUSH_FROMS.contains(d.getPushFrom()))
                 .flatMap(d -> d.getVideos().stream())
                 .map(v -> String.valueOf(v.getVideoId()))
                 .distinct()

+ 12 - 12
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV569.java

@@ -40,10 +40,10 @@ public class RankStrategy4RegionMergeModelV569 extends RankStrategy4RegionMergeM
     private FeatureService featureService;
 
     /**
-     * V569 个性化召回白名单 (6 路):召回 key 含 mid/uid,依赖该用户行为信号。
+     * V565 个性化召回白名单 (7 路: V566 基础 6 路 + 1 路 dk_elements 画像路实验):召回 key 含 mid/uid,
+     * 依赖该用户行为信号。
+     * V565 实验路径: UserProfileDkElements (用户元素画像 s_z_y_s/zt_gyf)
      * 注:YearReturnCate2 因线上效果不佳, 2026-06-04 起移到非个性化白名单。
-     * 注:V569 相对 V562 的实验差异点 = dk_elements 召回换用 click (回流) 触发版
-     *     (YearReturnDkElementsRecallStrategy) 并移到非个性化白名单。
      */
     private static final Set<String> PERSONAL_RECALL_PUSH_FROMS = new HashSet<>(Arrays.asList(
             UserCate1RecallStrategy.PUSH_FORM,
@@ -51,12 +51,13 @@ public class RankStrategy4RegionMergeModelV569 extends RankStrategy4RegionMergeM
             Return1Cate2RosRecallStrategy.PUSH_FORM,
             Return1Cate2StrRecallStrategy.PUSH_FORM,
             YearShareCate1RecallStrategy.PUSH_FROM,
-            YearShareCate2RecallStrategy.PUSH_FROM
+            YearShareCate2RecallStrategy.PUSH_FROM,
+            UserProfileDkElementsXFRecallStrategy.PUSH_FROM
     ));
 
     /**
-     * V569 非个性化召回白名单 (18 路):只依赖 headVid + 地域/品类/相似度(vid-vid CF 也归此类)。
-     * 含 5 路旧地域、新地域、城市、head province/cate、先验省份、return 相似、scene CF、YearReturnCate2、YearReturnDkElements
+     * V565 非个性化召回白名单 (17 路):只依赖 headVid + 地域/品类/相似度(vid-vid CF 也归此类)。
+     * 含 5 路旧地域、新地域、城市、head province/cate、先验省份、return 相似、scene CF、YearReturnCate2。
      */
     private static final Set<String> NON_PERSONAL_RECALL_PUSH_FROMS = new HashSet<>(Arrays.asList(
             RegionHRecallStrategy.PUSH_FORM,
@@ -75,8 +76,7 @@ public class RankStrategy4RegionMergeModelV569 extends RankStrategy4RegionMergeM
             ReturnVideoRecallStrategy.PUSH_FORM,
             SceneCFRovnRecallStrategy.PUSH_FORM,
             SceneCFRosnRecallStrategy.PUSH_FORM,
-            YearReturnCate2RecallStrategy.PUSH_FROM,
-            YearReturnDkElementsRecallStrategy.PUSH_FROM
+            YearReturnCate2RecallStrategy.PUSH_FROM
     ));
 
     /** PERSONAL ∪ NON_PERSONAL = 23 路。用于 fetchCoarseRankScores 跳过流量池等不参与截断的 vid。 */
@@ -89,7 +89,7 @@ public class RankStrategy4RegionMergeModelV569 extends RankStrategy4RegionMergeM
 
     /*
      * 设计要点:
-     *   - fail-closed 白名单:RecallService 未来加新路不会自动进 V569,避免污染 vs V568 AB 对比
+     *   - fail-closed 白名单:RecallService 未来加新路不会自动进 V565,避免污染 vs V568 AB 对比
      *   - 流量池 3 路 (flow_pool / quick_flow_pool / recall_strategy_hotspot) 不在任何名单——独立通道
      *   - 调用顺序 = 个性化优先:同 vid 双类命中时归个性化,保护用户兴趣信号
      */
@@ -109,7 +109,7 @@ public class RankStrategy4RegionMergeModelV569 extends RankStrategy4RegionMergeM
         List<Video> rovRecallRank = new ArrayList<>();
 
         // ============================================================
-        // V569 实验:统一粗排分截断 (个性化 / 非个性化 两配额, 动态补足)
+        // V565 实验:统一粗排分截断 (个性化 / 非个性化 两配额, 动态补足)
         // 总配额 coarseRankTopN,个性化占 personalRatio。先个性化按上限抢位,
         // 个性化不足时剩余名额转给非个性化,保证精排算力满载。
         //
@@ -129,7 +129,7 @@ public class RankStrategy4RegionMergeModelV569 extends RankStrategy4RegionMergeM
         int sizeBeforeNonPersonal = rovRecallRank.size();
         RecallUtils.extractAllAndTruncateByCoarseRank(nonPersonalBudget, param, setVideo, rovRecallRank, coarseRankMap, NON_PERSONAL_RECALL_PUSH_FROMS);
         int nonPersonalActual = rovRecallRank.size() - sizeBeforeNonPersonal;
-        log.info("coarse_rank_summary exp=569 quota={} pc={} ps={} nc={} ns={}",
+        log.info("coarse_rank_summary exp=565 quota={} pc={} ps={} nc={} ns={}",
                 totalTopN, personalCandidates, personalActual, nonPersonalCandidates, nonPersonalActual);
 
         // 记录召回源中的视频
@@ -407,7 +407,7 @@ public class RankStrategy4RegionMergeModelV569 extends RankStrategy4RegionMergeM
     }
 
     /**
-     * V569 实验:拉取粗排分(按 vid → score 返回)。
+     * V565 实验:拉取粗排分(按 vid → score 返回)。
      *
      * 数据源:alg_vid_recommend_exp_feature_20250212。
      * 表里没有现成 rovn 字段,需要从原子字段 (return_n_uv_*, exp_*) 用 plusSmooth 算出来。

+ 7 - 3
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/RecallService.java

@@ -186,10 +186,9 @@ public class RecallService implements ApplicationContextAware {
         //                                    形成"分享 vs 有效播放"双行为 dk_elements 召回 AB 对照.
         //   V565 → UserProfileDkElements:  用户元素画像 (s_z_y_s/zt_gyf)         -> elements_rovn_recall 倒排
         //   V569 → YearReturnDkElements:   用户近期 click 回流行为 join dk_elements -> elements_rovn_recall 倒排
-        boolean isHit562Exp = experimentService.judgeHitAlgoExp(param.getAppType(), param.getRootSessionId(), abExpCodes, "562");
         boolean isHit536Exp = experimentService.judgeHitAlgoExp(param.getAppType(), param.getRootSessionId(), abExpCodes, "536");
         boolean isHit839Exp = experimentService.judgeHitAlgoExp(param.getAppType(), param.getRootSessionId(), abExpCodes, "839");
-        if (isHit562Exp || isHit536Exp) {
+        if (isHit536Exp) {
             strategies.add(strategyMap.get(YearShareDkElementsRecallStrategy.class.getSimpleName()));
         }
         if (isHit839Exp) {
@@ -199,11 +198,16 @@ public class RecallService implements ApplicationContextAware {
         if (isHit565Exp) {
             strategies.add(strategyMap.get(UserProfileDkElementsRecallStrategy.class.getSimpleName()));
         }
+        boolean isHit562Exp = experimentService.judgeHitAlgoExp(param.getAppType(), param.getRootSessionId(), abExpCodes, "562");
+        if (isHit562Exp) {
+            strategies.add(strategyMap.get(UserProfileDkElementsFXRecallStrategy.class.getSimpleName()));
+        }
         boolean isHit569Exp = experimentService.judgeHitAlgoExp(param.getAppType(), param.getRootSessionId(), abExpCodes, "569");
         if (isHit569Exp) {
-            strategies.add(strategyMap.get(YearReturnDkElementsRecallStrategy.class.getSimpleName()));
+            strategies.add(strategyMap.get(UserProfileDkElementsXFRecallStrategy.class.getSimpleName()));
         }
 
+
         // V564 实验:召回侧不做任何剔除/新增——让所有公共池召回都跑,
         // 由 V564 rank 类 (mergeAndRankRovRecall) 在 extractAllAndTruncateByCoarseRank
         // 里按全局粗排分统一截断。

+ 181 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/UserProfileDkElementsFXRecallStrategy.java

@@ -0,0 +1,181 @@
+package com.tzld.piaoquan.recommend.server.service.recall.strategy;
+
+import com.tzld.piaoquan.recommend.server.model.Video;
+import com.tzld.piaoquan.recommend.server.service.filter.FilterParam;
+import com.tzld.piaoquan.recommend.server.service.filter.FilterResult;
+import com.tzld.piaoquan.recommend.server.service.filter.FilterService;
+import com.tzld.piaoquan.recommend.server.service.recall.FilterParamFactory;
+import com.tzld.piaoquan.recommend.server.service.recall.RecallParam;
+import com.tzld.piaoquan.recommend.server.service.recall.RecallStrategy;
+import com.tzld.piaoquan.recommend.server.util.FeatureUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 用户画像 实质元素 rovn 召回
+ *   数据源: param.userNetworkSeqFeature 里的 s_z_y_s (元素列表) + zt_gyf (归一分列表)
+ *           上游 alg_user_network_seq_feature 已新增, 来自 user_element_profile_hot
+ *           top_elements = UNION ALL(positive_ranked, negative_ranked), 所以归一分可能为负
+ *
+ *   逻辑: (element, score) pair 按 score DESC 取前 topN=30 正向元素 -> 一次 multiGet
+ *         elements_rovn_recall:{kw} 倒排 -> 同 vid 取 max score -> 排序 -> filter
+ *   只取正向 (score > 0), 避免召回用户厌恶元素
+ *
+ *   跟 YearShareDkElementsRecallStrategy 共用 Redis 倒排 key, 仅用户兴趣源 + 取法不同
+ */
+@Slf4j
+@Component
+public class UserProfileDkElementsFXRecallStrategy implements RecallStrategy {
+
+    @Autowired
+    @Qualifier("redisTemplate")
+    private RedisTemplate<String, String> redisTemplate;
+
+    @Autowired
+    private FilterService filterService;
+
+    private final String CLASS_NAME = this.getClass().getSimpleName();
+
+    public static final int topN = 30;
+    public static final String PUSH_FROM = "recall_user_profile_dk_elements_fx";
+    public static final String redisKeyPrefix = "elements_rovn_recall";
+
+    public static final String KEY_ELEMENTS = "s_z_y_s_fx";
+    public static final String KEY_SCORES = "fx_gyf";
+
+    @Override
+    public String pushFrom() {
+        return PUSH_FROM;
+    }
+
+    @Override
+    public List<Video> recall(RecallParam param) {
+        List<Video> videosResult = new ArrayList<>();
+        try {
+            if (MapUtils.isEmpty(param.getUserNetworkSeqFeature())) {
+                return videosResult;
+            }
+
+            List<String> elements = FeatureUtils.extractVidsFromUserNetworkSeqFeature(param.getUserNetworkSeqFeature(), KEY_ELEMENTS);
+            List<String> scores = FeatureUtils.extractVidsFromUserNetworkSeqFeature(param.getUserNetworkSeqFeature(), KEY_SCORES);
+            if (CollectionUtils.isEmpty(elements) || elements.size() != scores.size()) {
+                return videosResult;
+            }
+
+            List<String> topElements = pickTopPositiveElements(elements, scores);
+            if (CollectionUtils.isEmpty(topElements)) {
+                return videosResult;
+            }
+
+            List<String> keys = getRedisKey(topElements);
+            List<String> values = redisTemplate.opsForValue().multiGet(keys);
+
+            // 保留 Redis 倒排的真实 rovn 分 (而非位置分): scoresMap 的 score 会写到 Video.rovScore,
+            // 粗排截断 coarseMap miss 的 vid 会 fallback 用 Video.rovScore 排序, 真实分更有信号.
+            Map<Long, Double> scoresMap = recall(param.getVideoId(), values);
+            List<Long> ids = scoresMap.entrySet().stream()
+                    .sorted(Comparator.comparingDouble((Map.Entry<Long, Double> e) -> e.getValue()).reversed())
+                    .map(Map.Entry::getKey)
+                    .collect(Collectors.toList());
+
+            FilterParam filterParam = FilterParamFactory.create(param, ids, pushFrom(), scoresMap);
+            FilterResult filterResult = filterService.filter(filterParam);
+            if (filterResult != null && CollectionUtils.isNotEmpty(filterResult.getVideoIds())) {
+                for (Long vid : filterResult.getVideoIds()) {
+                    Video video = new Video();
+                    video.setVideoId(vid);
+                    video.setRovScore(scoresMap.getOrDefault(vid, 0.0));
+                    video.setPushFrom(pushFrom());
+                    videosResult.add(video);
+                }
+            }
+        } catch (Exception e) {
+            log.error("recall is wrong in {}, error={}", CLASS_NAME, e);
+        }
+        return videosResult;
+    }
+
+    /** 组对 + 过滤负向 + 按归一分降序 + 取前 topN 个 element */
+    private List<String> pickTopPositiveElements(List<String> elements, List<String> scores) {
+        List<Pair<String, Double>> pairs = new ArrayList<>();
+        for (int i = 0; i < elements.size(); i++) {
+            String element = elements.get(i);
+            if (StringUtils.isBlank(element)) {
+                continue;
+            }
+            double score = NumberUtils.toDouble(scores.get(i), 0.0);
+            if (score <= 0) {
+                continue;
+            }
+            pairs.add(Pair.of(element, score));
+        }
+        if (pairs.isEmpty()) {
+            return Collections.emptyList();
+        }
+        return pairs.stream()
+                .sorted(Comparator.comparingDouble((Pair<String, Double> p) -> p.getValue()).reversed())
+                .map(Pair::getKey)
+                .distinct()
+                .limit(topN)
+                .collect(Collectors.toList());
+    }
+
+    private List<String> getRedisKey(List<String> elementList) {
+        List<String> keys = new ArrayList<>();
+        for (String element : elementList) {
+            keys.add(String.format("%s:%s", redisKeyPrefix, element));
+        }
+        return keys;
+    }
+
+    /**
+     * 解析 multiGet 拿到的 N 个 Redis value, 拼成 vid -> 真实 score map.
+     * value 格式: vid1,vid2,...\tscore1,score2,...  (rovn 真实分)
+     * 同 vid 在多个 element 倒排里出现时, 取 max score (跟 AbstractRedisRecallStrategy 一致).
+     */
+    private Map<Long, Double> recall(Long headVid, List<String> values) {
+        Map<Long, Double> scoresMap = new HashMap<>();
+        if (CollectionUtils.isEmpty(values)) {
+            return scoresMap;
+        }
+        for (String value : values) {
+            if (StringUtils.isBlank(value)) {
+                continue;
+            }
+            String[] cells = value.split("\t");
+            if (cells.length != 2) {
+                continue;
+            }
+            List<Long> ids;
+            List<Double> scores;
+            try {
+                ids = Arrays.stream(cells[0].split(",")).map(Long::valueOf).collect(Collectors.toList());
+                scores = Arrays.stream(cells[1].split(",")).map(Double::valueOf).collect(Collectors.toList());
+            } catch (NumberFormatException nfe) {
+                continue;
+            }
+            if (ids.isEmpty() || ids.size() != scores.size()) {
+                continue;
+            }
+            for (int i = 0; i < ids.size(); i++) {
+                long id = ids.get(i);
+                if (headVid != null && headVid == id) {
+                    continue;
+                }
+                scoresMap.merge(id, scores.get(i), Math::max);
+            }
+        }
+        return scoresMap;
+    }
+}

+ 181 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/UserProfileDkElementsXFRecallStrategy.java

@@ -0,0 +1,181 @@
+package com.tzld.piaoquan.recommend.server.service.recall.strategy;
+
+import com.tzld.piaoquan.recommend.server.model.Video;
+import com.tzld.piaoquan.recommend.server.service.filter.FilterParam;
+import com.tzld.piaoquan.recommend.server.service.filter.FilterResult;
+import com.tzld.piaoquan.recommend.server.service.filter.FilterService;
+import com.tzld.piaoquan.recommend.server.service.recall.FilterParamFactory;
+import com.tzld.piaoquan.recommend.server.service.recall.RecallParam;
+import com.tzld.piaoquan.recommend.server.service.recall.RecallStrategy;
+import com.tzld.piaoquan.recommend.server.util.FeatureUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 用户画像 实质元素 rovn 召回
+ *   数据源: param.userNetworkSeqFeature 里的 s_z_y_s (元素列表) + zt_gyf (归一分列表)
+ *           上游 alg_user_network_seq_feature 已新增, 来自 user_element_profile_hot
+ *           top_elements = UNION ALL(positive_ranked, negative_ranked), 所以归一分可能为负
+ *
+ *   逻辑: (element, score) pair 按 score DESC 取前 topN=30 正向元素 -> 一次 multiGet
+ *         elements_rovn_recall:{kw} 倒排 -> 同 vid 取 max score -> 排序 -> filter
+ *   只取正向 (score > 0), 避免召回用户厌恶元素
+ *
+ *   跟 YearShareDkElementsRecallStrategy 共用 Redis 倒排 key, 仅用户兴趣源 + 取法不同
+ */
+@Slf4j
+@Component
+public class UserProfileDkElementsXFRecallStrategy implements RecallStrategy {
+
+    @Autowired
+    @Qualifier("redisTemplate")
+    private RedisTemplate<String, String> redisTemplate;
+
+    @Autowired
+    private FilterService filterService;
+
+    private final String CLASS_NAME = this.getClass().getSimpleName();
+
+    public static final int topN = 30;
+    public static final String PUSH_FROM = "recall_user_profile_dk_elements_xf";
+    public static final String redisKeyPrefix = "elements_rovn_recall";
+
+    public static final String KEY_ELEMENTS = "s_z_y_s_xf";
+    public static final String KEY_SCORES = "xf_gyf";
+
+    @Override
+    public String pushFrom() {
+        return PUSH_FROM;
+    }
+
+    @Override
+    public List<Video> recall(RecallParam param) {
+        List<Video> videosResult = new ArrayList<>();
+        try {
+            if (MapUtils.isEmpty(param.getUserNetworkSeqFeature())) {
+                return videosResult;
+            }
+
+            List<String> elements = FeatureUtils.extractVidsFromUserNetworkSeqFeature(param.getUserNetworkSeqFeature(), KEY_ELEMENTS);
+            List<String> scores = FeatureUtils.extractVidsFromUserNetworkSeqFeature(param.getUserNetworkSeqFeature(), KEY_SCORES);
+            if (CollectionUtils.isEmpty(elements) || elements.size() != scores.size()) {
+                return videosResult;
+            }
+
+            List<String> topElements = pickTopPositiveElements(elements, scores);
+            if (CollectionUtils.isEmpty(topElements)) {
+                return videosResult;
+            }
+
+            List<String> keys = getRedisKey(topElements);
+            List<String> values = redisTemplate.opsForValue().multiGet(keys);
+
+            // 保留 Redis 倒排的真实 rovn 分 (而非位置分): scoresMap 的 score 会写到 Video.rovScore,
+            // 粗排截断 coarseMap miss 的 vid 会 fallback 用 Video.rovScore 排序, 真实分更有信号.
+            Map<Long, Double> scoresMap = recall(param.getVideoId(), values);
+            List<Long> ids = scoresMap.entrySet().stream()
+                    .sorted(Comparator.comparingDouble((Map.Entry<Long, Double> e) -> e.getValue()).reversed())
+                    .map(Map.Entry::getKey)
+                    .collect(Collectors.toList());
+
+            FilterParam filterParam = FilterParamFactory.create(param, ids, pushFrom(), scoresMap);
+            FilterResult filterResult = filterService.filter(filterParam);
+            if (filterResult != null && CollectionUtils.isNotEmpty(filterResult.getVideoIds())) {
+                for (Long vid : filterResult.getVideoIds()) {
+                    Video video = new Video();
+                    video.setVideoId(vid);
+                    video.setRovScore(scoresMap.getOrDefault(vid, 0.0));
+                    video.setPushFrom(pushFrom());
+                    videosResult.add(video);
+                }
+            }
+        } catch (Exception e) {
+            log.error("recall is wrong in {}, error={}", CLASS_NAME, e);
+        }
+        return videosResult;
+    }
+
+    /** 组对 + 过滤负向 + 按归一分降序 + 取前 topN 个 element */
+    private List<String> pickTopPositiveElements(List<String> elements, List<String> scores) {
+        List<Pair<String, Double>> pairs = new ArrayList<>();
+        for (int i = 0; i < elements.size(); i++) {
+            String element = elements.get(i);
+            if (StringUtils.isBlank(element)) {
+                continue;
+            }
+            double score = NumberUtils.toDouble(scores.get(i), 0.0);
+            if (score <= 0) {
+                continue;
+            }
+            pairs.add(Pair.of(element, score));
+        }
+        if (pairs.isEmpty()) {
+            return Collections.emptyList();
+        }
+        return pairs.stream()
+                .sorted(Comparator.comparingDouble((Pair<String, Double> p) -> p.getValue()).reversed())
+                .map(Pair::getKey)
+                .distinct()
+                .limit(topN)
+                .collect(Collectors.toList());
+    }
+
+    private List<String> getRedisKey(List<String> elementList) {
+        List<String> keys = new ArrayList<>();
+        for (String element : elementList) {
+            keys.add(String.format("%s:%s", redisKeyPrefix, element));
+        }
+        return keys;
+    }
+
+    /**
+     * 解析 multiGet 拿到的 N 个 Redis value, 拼成 vid -> 真实 score map.
+     * value 格式: vid1,vid2,...\tscore1,score2,...  (rovn 真实分)
+     * 同 vid 在多个 element 倒排里出现时, 取 max score (跟 AbstractRedisRecallStrategy 一致).
+     */
+    private Map<Long, Double> recall(Long headVid, List<String> values) {
+        Map<Long, Double> scoresMap = new HashMap<>();
+        if (CollectionUtils.isEmpty(values)) {
+            return scoresMap;
+        }
+        for (String value : values) {
+            if (StringUtils.isBlank(value)) {
+                continue;
+            }
+            String[] cells = value.split("\t");
+            if (cells.length != 2) {
+                continue;
+            }
+            List<Long> ids;
+            List<Double> scores;
+            try {
+                ids = Arrays.stream(cells[0].split(",")).map(Long::valueOf).collect(Collectors.toList());
+                scores = Arrays.stream(cells[1].split(",")).map(Double::valueOf).collect(Collectors.toList());
+            } catch (NumberFormatException nfe) {
+                continue;
+            }
+            if (ids.isEmpty() || ids.size() != scores.size()) {
+                continue;
+            }
+            for (int i = 0; i < ids.size(); i++) {
+                long id = ids.get(i);
+                if (headVid != null && headVid == id) {
+                    continue;
+                }
+                scoresMap.merge(id, scores.get(i), Math::max);
+            }
+        }
+        return scoresMap;
+    }
+}