WANG 5 gadi atpakaļ
vecāks
revīzija
9819bb2e46

+ 35 - 33
examcloud-core-oe-face-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/service/impl/BaiduFaceLivenessWorker.java

@@ -1,5 +1,8 @@
 package cn.com.qmth.examcloud.core.oe.student.face.service.impl;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.Worker;
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.WorkerController;
@@ -7,45 +10,44 @@ import cn.com.qmth.examcloud.core.oe.common.base.Constants;
 import cn.com.qmth.examcloud.core.oe.common.entity.ExamCaptureQueueEntity;
 import cn.com.qmth.examcloud.core.oe.student.face.service.ExamCaptureService;
 import cn.com.qmth.examcloud.web.support.SpringContextHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 /**
  * 百度活体检测工作线程
  *
  * @author lideyin 20190620
  */
-public class BaiduFaceLivenessWorker implements Worker {
-    private final Log captureLog = LogFactory.getLog("PROCESS_EXAM_CAPTURE_TASK_LOGGER");
+public class BaiduFaceLivenessWorker implements Worker<ExamCaptureQueueEntity> {
+	private final Log captureLog = LogFactory.getLog("PROCESS_EXAM_CAPTURE_TASK_LOGGER");
 
-    @Override
-    public void process(WorkerController controller, Object element) {
-        ExamCaptureProcessStatisticController.increaseFaceLivenessDetectCount();
-        if (captureLog.isDebugEnabled()){
-            captureLog.debug("[BAIDU_FACELIVENESS_WORKER.] 图片处理数量+1,count= " + ExamCaptureProcessStatisticController.getFaceLivenessDetectCount());
-        }
-        ExamCaptureService examCaptureService = SpringContextHolder.getBean(ExamCaptureService.class);
-        ExamCaptureQueueEntity examCaptureQueue = (ExamCaptureQueueEntity) element;
-        try {
-            examCaptureService.disposeBaiDuFaceLiveness(examCaptureQueue);
-        } catch (StatusException e) {
+	@Override
+	public void process(WorkerController controller, ExamCaptureQueueEntity element) {
+		ExamCaptureProcessStatisticController.increaseFaceLivenessDetectCount();
+		if (captureLog.isDebugEnabled()) {
+			captureLog.debug("[BAIDU_FACELIVENESS_WORKER.] 图片处理数量+1,count= "
+					+ ExamCaptureProcessStatisticController.getFaceLivenessDetectCount());
+		}
+		ExamCaptureService examCaptureService = SpringContextHolder
+				.getBean(ExamCaptureService.class);
+		try {
+			examCaptureService.disposeBaiDuFaceLiveness(element);
+		} catch (StatusException e) {
 
-            //异常处理
-            examCaptureQueue.setErrorMsg(e.getDesc());
-            examCaptureService.disposeBaiDuFaceLivenessFaild(examCaptureQueue);
-            if ((e.getCode().equals(Constants.BAIDU_FACELIVENESS_QPS_LIMIT_EXCEEDED_CODE))) {
-                // 如果超过并发次数,则添加异常次数
-                controller.addConcurrencyWarn();
-            } else {
-                ExamCaptureProcessStatisticController.increaseFaceLivenessDetectCount();
-                captureLog.error("[BAIDU_FACELIVENESS_WORKER.] 自定义异常 " + e.getDesc(), e);
-            }
-        } catch (Exception e) {
-            ExamCaptureProcessStatisticController.increaseFaceLivenessDetectCount();
-            //异常处理
-            examCaptureQueue.setErrorMsg(e.getMessage());
-            examCaptureService.disposeBaiDuFaceLivenessFaild(examCaptureQueue);
-            captureLog.error("[BAIDU_FACELIVENESS_WORKER.] 系统异常 " + e.getMessage(), e);
-        }
-    }
+			// 异常处理
+			element.setErrorMsg(e.getDesc());
+			examCaptureService.disposeBaiDuFaceLivenessFaild(element);
+			if ((e.getCode().equals(Constants.BAIDU_FACELIVENESS_QPS_LIMIT_EXCEEDED_CODE))) {
+				// 如果超过并发次数,则添加异常次数
+				controller.addConcurrencyWarn();
+			} else {
+				ExamCaptureProcessStatisticController.increaseFaceLivenessDetectCount();
+				captureLog.error("[BAIDU_FACELIVENESS_WORKER.] 自定义异常 " + e.getDesc(), e);
+			}
+		} catch (Exception e) {
+			ExamCaptureProcessStatisticController.increaseFaceLivenessDetectCount();
+			// 异常处理
+			element.setErrorMsg(e.getMessage());
+			examCaptureService.disposeBaiDuFaceLivenessFaild(element);
+			captureLog.error("[BAIDU_FACELIVENESS_WORKER.] 系统异常 " + e.getMessage(), e);
+		}
+	}
 }

+ 36 - 37
examcloud-core-oe-face-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/service/impl/FacePPCompareWorker.java

@@ -1,5 +1,8 @@
 package cn.com.qmth.examcloud.core.oe.student.face.service.impl;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.Worker;
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.WorkerController;
@@ -7,48 +10,44 @@ import cn.com.qmth.examcloud.core.oe.common.base.Constants;
 import cn.com.qmth.examcloud.core.oe.common.entity.ExamCaptureQueueEntity;
 import cn.com.qmth.examcloud.core.oe.student.face.service.ExamCaptureService;
 import cn.com.qmth.examcloud.web.support.SpringContextHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * face++人脸比对工作线程
  *
  * @author lideyin 20190620
  */
-public class FacePPCompareWorker implements Worker {
-    private final Log captureLog = LogFactory.getLog("PROCESS_EXAM_CAPTURE_TASK_LOGGER");
+public class FacePPCompareWorker implements Worker<ExamCaptureQueueEntity> {
+	private final Log captureLog = LogFactory.getLog("PROCESS_EXAM_CAPTURE_TASK_LOGGER");
 
-    @Override
-    public void process(WorkerController controller, Object element) {
-        //图片处理数量+1
-        ExamCaptureProcessStatisticController.increaseFaceCompareCount();
-        if (captureLog.isDebugEnabled()){
-            captureLog.debug("[FACEPP_COMPARE_WORKER.] 图片处理数量+1,count= " + ExamCaptureProcessStatisticController.getFaceCompareCount());
-        }
-        ExamCaptureService examCaptureService = SpringContextHolder
-                .getBean(ExamCaptureService.class);
-        ExamCaptureQueueEntity examCaptureQueueEntity = (ExamCaptureQueueEntity) element;
-        try {
-            examCaptureService.disposeFaceCompare(examCaptureQueueEntity);
-        } catch (StatusException e) {
-            //异常处理
-            examCaptureQueueEntity.setErrorMsg(e.getDesc());
-            examCaptureService.disposeFaceCompareFaild(examCaptureQueueEntity);
-            if ((e.getCode().equals(Constants.FACE_COMPARE_CONCURRENCY_LIMIT_EXCEEDED))) {
-                // 如果超过并发次数,则添加异常次数
-                controller.addConcurrencyWarn();
-            } else {
-                ExamCaptureProcessStatisticController.increaseFaceCompareFailedCount();
-                captureLog.error("[FACEPP_COMPARE_WORKER.] 自定义异常 " + e.getDesc(), e);
-            }
-        } catch (Exception e) {
-            ExamCaptureProcessStatisticController.increaseFaceCompareFailedCount();
-            //异常处理
-            examCaptureQueueEntity.setErrorMsg(e.getMessage());
-            examCaptureService.disposeFaceCompareFaild(examCaptureQueueEntity);
-            captureLog.error("[FACEPP_COMPARE_WORKER.] 系统异常 " + e.getMessage(), e);
-        }
-    }
+	@Override
+	public void process(WorkerController controller, ExamCaptureQueueEntity element) {
+		// 图片处理数量+1
+		ExamCaptureProcessStatisticController.increaseFaceCompareCount();
+		if (captureLog.isDebugEnabled()) {
+			captureLog.debug("[FACEPP_COMPARE_WORKER.] 图片处理数量+1,count= "
+					+ ExamCaptureProcessStatisticController.getFaceCompareCount());
+		}
+		ExamCaptureService examCaptureService = SpringContextHolder
+				.getBean(ExamCaptureService.class);
+		try {
+			examCaptureService.disposeFaceCompare(element);
+		} catch (StatusException e) {
+			// 异常处理
+			element.setErrorMsg(e.getDesc());
+			examCaptureService.disposeFaceCompareFaild(element);
+			if ((e.getCode().equals(Constants.FACE_COMPARE_CONCURRENCY_LIMIT_EXCEEDED))) {
+				// 如果超过并发次数,则添加异常次数
+				controller.addConcurrencyWarn();
+			} else {
+				ExamCaptureProcessStatisticController.increaseFaceCompareFailedCount();
+				captureLog.error("[FACEPP_COMPARE_WORKER.] 自定义异常 " + e.getDesc(), e);
+			}
+		} catch (Exception e) {
+			ExamCaptureProcessStatisticController.increaseFaceCompareFailedCount();
+			// 异常处理
+			element.setErrorMsg(e.getMessage());
+			examCaptureService.disposeFaceCompareFaild(element);
+			captureLog.error("[FACEPP_COMPARE_WORKER.] 系统异常 " + e.getMessage(), e);
+		}
+	}
 }

+ 72 - 62
examcloud-core-oe-face-starter/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/starter/config/ProcessBaiduFacelivenessTask.java

@@ -26,67 +26,77 @@ import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
 @Order(201)
 public class ProcessBaiduFacelivenessTask implements ApplicationRunner {
 
-    private static final Logger log = LoggerFactory.getLogger(ProcessBaiduFacelivenessTask.class);
-    @Autowired
-    ExamCaptureQueueRepo examCaptureQueueRepo;
-    private final Log captureLog = LogFactory.getLog("PROCESS_EXAM_CAPTURE_TASK_LOGGER");
-
-    private void start() {
-        ConcurrentTask concurrentTask = new ConcurrentTask();
-        concurrentTask.setMaxActiveThreadSize(PropertyHolder.getInt("$capture.thread.maxActiveThreadSize", 100));
-        concurrentTask.setMinThreadSize(PropertyHolder.getInt("$capture.thread.minThreadSize", 2));
-        concurrentTask.setWorker(new BaiduFaceLivenessWorker());
-        concurrentTask.start();
-        //当前获取数据的批次号(默认用时间戳)
-        String processBatchNum = "B_" + System.currentTimeMillis();
-
-        captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 启动百度处理服务...");
-        while (true) {
-            try {
-                //如果队列没满,则从数据库中查数据并插入
-                List<ExamCaptureQueueEntity> examCaptureQueueList = examCaptureQueueRepo.
-                        findNeedFacelivenessDetectExamCaptureQueuesLimit(PropertyHolder.getInt("$capture.queue.limit", 100), processBatchNum);
-                //如果队列中没取到数据,则2秒钟后再取
-                if (null == examCaptureQueueList || examCaptureQueueList.isEmpty()) {
-                    captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 抓拍队列中没有取到数据,2秒后重试");
-
-                    Util.sleep(PropertyHolder.getInt("$capture.queue.read.sleepSeconds.", 2));
-                    continue;
-                }
-
-                captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 抓拍队列中的数据条数为:" + examCaptureQueueList.size());
-
-                for (ExamCaptureQueueEntity offeredQueueEntity : examCaptureQueueList) {
-                    while (true) {
-                        boolean offerSuccess = concurrentTask.offerElement(offeredQueueEntity);
-                        if (offerSuccess) {
-                            offeredQueueEntity.setProcessBatchNum(processBatchNum);
-                            examCaptureQueueRepo.save(offeredQueueEntity);
-
-                            captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 向工作队列中添加数据成功:fileUrl=" + offeredQueueEntity.getFileUrl());
-                            break;
-                        }
-
-                        captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 向工作队列中添加数据失败,30秒后重试:fileUrl=" + offeredQueueEntity.getFileUrl());
-
-                        Util.sleep(PropertyHolder.getInt("$capture.queue.offer.sleepSeconds.", 30));
-                    }
-                }
-                Util.sleep(4);
-            } catch (Exception e) {
-                log.error("300002", "启动百度活体检测队列出现异常", e);
-                captureLog.error("[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 百度活体检测出出异常,3秒后重试", e);
-                Util.sleep(3);
-            }
-        }
-    }
-
-
-    @Override
-    public void run(ApplicationArguments args) {
-        new Thread(() -> {
-            start();
-        }).start();
-    }
+	private static final Logger log = LoggerFactory.getLogger(ProcessBaiduFacelivenessTask.class);
+
+	@Autowired
+	ExamCaptureQueueRepo examCaptureQueueRepo;
+
+	private final Log captureLog = LogFactory.getLog("PROCESS_EXAM_CAPTURE_TASK_LOGGER");
+
+	private void start() {
+		ConcurrentTask<ExamCaptureQueueEntity> concurrentTask = new ConcurrentTask<ExamCaptureQueueEntity>();
+		concurrentTask.setMaxActiveThreadSize(
+				PropertyHolder.getInt("$capture.thread.maxActiveThreadSize", 100));
+		concurrentTask.setMinThreadSize(PropertyHolder.getInt("$capture.thread.minThreadSize", 2));
+		concurrentTask.setWorker(new BaiduFaceLivenessWorker());
+		concurrentTask.start();
+		// 当前获取数据的批次号(默认用时间戳)
+		String processBatchNum = "B_" + System.currentTimeMillis();
+
+		captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 启动百度处理服务...");
+		while (true) {
+			try {
+				// 如果队列没满,则从数据库中查数据并插入
+				List<ExamCaptureQueueEntity> examCaptureQueueList = examCaptureQueueRepo
+						.findNeedFacelivenessDetectExamCaptureQueuesLimit(
+								PropertyHolder.getInt("$capture.queue.limit", 100),
+								processBatchNum);
+				// 如果队列中没取到数据,则2秒钟后再取
+				if (null == examCaptureQueueList || examCaptureQueueList.isEmpty()) {
+					captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum
+							+ "] 抓拍队列中没有取到数据,2秒后重试");
+
+					Util.sleep(PropertyHolder.getInt("$capture.queue.read.sleepSeconds.", 2));
+					continue;
+				}
+
+				captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 抓拍队列中的数据条数为:"
+						+ examCaptureQueueList.size());
+
+				for (ExamCaptureQueueEntity offeredQueueEntity : examCaptureQueueList) {
+					while (true) {
+						boolean offerSuccess = concurrentTask.offerElement(offeredQueueEntity);
+						if (offerSuccess) {
+							offeredQueueEntity.setProcessBatchNum(processBatchNum);
+							examCaptureQueueRepo.save(offeredQueueEntity);
+
+							captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum
+									+ "] 向工作队列中添加数据成功:fileUrl=" + offeredQueueEntity.getFileUrl());
+							break;
+						}
+
+						captureLog.debug("[PROCESS_BAIDUFACELIVENESS." + processBatchNum
+								+ "] 向工作队列中添加数据失败,30秒后重试:fileUrl="
+								+ offeredQueueEntity.getFileUrl());
+
+						Util.sleep(PropertyHolder.getInt("$capture.queue.offer.sleepSeconds.", 30));
+					}
+				}
+				Util.sleep(4);
+			} catch (Exception e) {
+				log.error("300002", "启动百度活体检测队列出现异常", e);
+				captureLog.error(
+						"[PROCESS_BAIDUFACELIVENESS." + processBatchNum + "] 百度活体检测出出异常,3秒后重试", e);
+				Util.sleep(3);
+			}
+		}
+	}
+
+	@Override
+	public void run(ApplicationArguments args) {
+		new Thread(() -> {
+			start();
+		}).start();
+	}
 
 }

+ 82 - 79
examcloud-core-oe-face-starter/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/starter/config/ProcessFaceCompareQueueTask.java

@@ -1,23 +1,22 @@
 package cn.com.qmth.examcloud.core.oe.student.face.starter.config;
 
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.ConcurrentTask;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
 import cn.com.qmth.examcloud.commons.util.Util;
 import cn.com.qmth.examcloud.core.oe.common.entity.ExamCaptureQueueEntity;
 import cn.com.qmth.examcloud.core.oe.common.repository.ExamCaptureQueueRepo;
-import cn.com.qmth.examcloud.core.oe.student.face.service.impl.ExamCaptureProcessStatisticController;
 import cn.com.qmth.examcloud.core.oe.student.face.service.impl.FacePPCompareWorker;
 import cn.com.qmth.examcloud.exchange.inner.api.SmsCloudService;
 import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 /**
  * 启动人脸比对任务
@@ -26,72 +25,76 @@ import java.util.concurrent.TimeUnit;
 @Order(200)
 public class ProcessFaceCompareQueueTask implements ApplicationRunner {
 
-    @Autowired
-    ExamCaptureQueueRepo examCaptureQueueRepo;
-    private final Log captureLog = LogFactory.getLog("PROCESS_EXAM_CAPTURE_TASK_LOGGER");
-    private final ExamCaptureProcessStatisticController statisticController = new ExamCaptureProcessStatisticController();
-    //失败率预警阈值
-    private static final double RATE_WARN_THRESHOLD = 0.5;
-    //总数量预警阈值
-    private static final int COUNT_WARN_THRESHOLD = 10;
-    @Autowired
-    SmsCloudService smsCloudService;
-
-    private void start() {
-        ConcurrentTask concurrentTask = new ConcurrentTask();
-        concurrentTask.setMaxActiveThreadSize(PropertyHolder.getInt("$capture.thread.maxActiveThreadSize", 100));
-        concurrentTask.setMinThreadSize(PropertyHolder.getInt("$capture.thread.minThreadSize", 2));
-        concurrentTask.setWorker(new FacePPCompareWorker());
-        concurrentTask.start();
-        //当前获取数据的批次号(默认用时间戳)
-        String processBatchNum = "A_" + System.currentTimeMillis();
-
-        captureLog.debug("[PROCESS_FACEPP." + processBatchNum + "] 启动face++人脸比对服务...");
-        while (true) {
-            try {
-                //如果队列没满,则从数据库中查数据并插入
-                List<ExamCaptureQueueEntity> examCaptureQueueList = examCaptureQueueRepo.
-                        findNeedFaceCompareExamCaptureQueuesLimitByProcessBatchNum(PropertyHolder.getInt("$capture.queue.limit", 100), processBatchNum);
-                //如果队列中没取到数据,则2秒钟后再取
-                if (null == examCaptureQueueList || examCaptureQueueList.isEmpty()) {
-                    captureLog.debug("[PROCESS_FACEPP." + processBatchNum + "] 抓拍队列中没有取到数据,2秒后重试");
-
-                    Util.sleep(PropertyHolder.getInt("$capture.queue.read.sleepSeconds.", 2));
-                    continue;
-                }
-
-                captureLog.debug("[PROCESS_FACEPP." + processBatchNum + "] 抓拍队列中的数据条数为:" + examCaptureQueueList.size());
-
-                for (ExamCaptureQueueEntity offeredQueueEntity : examCaptureQueueList) {
-                    while (true) {
-                        boolean offerSuccess = concurrentTask.offerElement(offeredQueueEntity);
-                        //如果向队列中添加数据成功,则更新标识
-                        if (offerSuccess) {
-                            offeredQueueEntity.setProcessBatchNum(processBatchNum);
-                            examCaptureQueueRepo.save(offeredQueueEntity);
-
-                            captureLog.debug("[PROCESS_FACEPP." + processBatchNum + "] 向工作队列中添加数据成功:fileUrl=" + offeredQueueEntity.getFileUrl());
-                            break;
-                        }
-
-                        captureLog.debug("[PROCESS_FACEPP." + processBatchNum + "] 向工作队列中添加数据失败,30秒后重试:fileUrl=" + offeredQueueEntity.getFileUrl());
-
-                        Util.sleep(PropertyHolder.getInt("$capture.queue.offer.sleepSeconds.", 30));
-                    }
-                }
-                Util.sleep(2);
-            } catch (Exception e) {
-                captureLog.error("[PROCESS_FACEPP." + processBatchNum + "] 百度活体检测出出异常,3秒后重试", e);
-                Util.sleep(3);
-            }
-        }
-    }
-
-
-    @Override
-    public void run(ApplicationArguments args) {
-        new Thread(() -> {
-            start();
-        }).start();
-    }
+	private final ExamCloudLog captureLog = ExamCloudLogFactory
+			.getLog("PROCESS_EXAM_CAPTURE_TASK_LOGGER");
+
+	@Autowired
+	ExamCaptureQueueRepo examCaptureQueueRepo;
+
+	@Autowired
+	SmsCloudService smsCloudService;
+
+	private void start() {
+		ConcurrentTask<ExamCaptureQueueEntity> concurrentTask = new ConcurrentTask<ExamCaptureQueueEntity>();
+		concurrentTask.setMaxActiveThreadSize(
+				PropertyHolder.getInt("$capture.thread.maxActiveThreadSize", 100));
+		concurrentTask.setMinThreadSize(PropertyHolder.getInt("$capture.thread.minThreadSize", 2));
+		concurrentTask.setWorker(new FacePPCompareWorker());
+		concurrentTask.start();
+		// 当前获取数据的批次号(默认用时间戳)
+		String processBatchNum = "A_" + System.currentTimeMillis();
+
+		captureLog.debug("[PROCESS_FACEPP." + processBatchNum + "] 启动face++人脸比对服务...");
+		while (true) {
+			try {
+				// 如果队列没满,则从数据库中查数据并插入
+				List<ExamCaptureQueueEntity> examCaptureQueueList = examCaptureQueueRepo
+						.findNeedFaceCompareExamCaptureQueuesLimitByProcessBatchNum(
+								PropertyHolder.getInt("$capture.queue.limit", 100),
+								processBatchNum);
+				// 如果队列中没取到数据,则2秒钟后再取
+				if (null == examCaptureQueueList || examCaptureQueueList.isEmpty()) {
+					captureLog.debug("[PROCESS_FACEPP." + processBatchNum + "] 抓拍队列中没有取到数据,2秒后重试");
+
+					Util.sleep(PropertyHolder.getInt("$capture.queue.read.sleepSeconds.", 2));
+					continue;
+				}
+
+				captureLog.debug("[PROCESS_FACEPP." + processBatchNum + "] 抓拍队列中的数据条数为:"
+						+ examCaptureQueueList.size());
+
+				for (ExamCaptureQueueEntity offeredQueueEntity : examCaptureQueueList) {
+					while (true) {
+						boolean offerSuccess = concurrentTask.offerElement(offeredQueueEntity);
+						// 如果向队列中添加数据成功,则更新标识
+						if (offerSuccess) {
+							offeredQueueEntity.setProcessBatchNum(processBatchNum);
+							examCaptureQueueRepo.save(offeredQueueEntity);
+
+							captureLog.debug("[PROCESS_FACEPP." + processBatchNum
+									+ "] 向工作队列中添加数据成功:fileUrl=" + offeredQueueEntity.getFileUrl());
+							break;
+						}
+
+						captureLog.debug("[PROCESS_FACEPP." + processBatchNum
+								+ "] 向工作队列中添加数据失败,30秒后重试:fileUrl="
+								+ offeredQueueEntity.getFileUrl());
+
+						Util.sleep(PropertyHolder.getInt("$capture.queue.offer.sleepSeconds.", 30));
+					}
+				}
+				Util.sleep(2);
+			} catch (Exception e) {
+				captureLog.error("[PROCESS_FACEPP." + processBatchNum + "] 百度活体检测出出异常,3秒后重试", e);
+				Util.sleep(3);
+			}
+		}
+	}
+
+	@Override
+	public void run(ApplicationArguments args) {
+		new Thread(() -> {
+			start();
+		}).start();
+	}
 }