From 176d7d8283e66ccf63878c9ab823e900df94b748 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 05 八月 2025 17:20:58 +0800 Subject: [PATCH] 2025.8.5 1. 动态溯源模块添加延迟数据周期异常合并功能 --- src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RealTimeExceptionValueMutation.kt | 29 ++++++++++++++++++----------- 1 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RealTimeExceptionValueMutation.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RealTimeExceptionValueMutation.kt index f5eb79f..2a3d11c 100644 --- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RealTimeExceptionValueMutation.kt +++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RealTimeExceptionValueMutation.kt @@ -1,7 +1,9 @@ package com.flightfeather.uav.biz.sourcetrace.exceptiontype +import com.flightfeather.uav.biz.dataanalysis.model.ExceptionTag import com.flightfeather.uav.biz.dataanalysis.model.ExceptionType import com.flightfeather.uav.biz.sourcetrace.RealTimeAnalysisConfig +import com.flightfeather.uav.biz.sourcetrace.model.RealTimeExceptionResult import com.flightfeather.uav.common.utils.MapUtil import com.flightfeather.uav.domain.entity.BaseRealTimeData import com.flightfeather.uav.socket.eunm.FactorType @@ -14,11 +16,12 @@ * @date 2025/5/13 * @author feiyu02 */ -class RealTimeExceptionValueMutation : BaseRealTimeException { +@Deprecated("2025.5.29, 閫昏緫涓庝笟鍔′笉鍖归厤锛屽悗缁垹闄�") +class RealTimeExceptionValueMutation : BaseRealTimeException<ExceptionTag> { - constructor(config: RealTimeAnalysisConfig) : super(config) + constructor(config: RealTimeAnalysisConfig) : super(config, ExceptionTag::class.java) - constructor(config: RealTimeAnalysisConfig, callback: NewExceptionCallback) : super(config, callback) + constructor(config: RealTimeAnalysisConfig, callback: NewExceptionCallback) : super(config, callback, ExceptionTag::class.java) /** * 鏈紓甯哥殑杩炵画鍙戠敓娆℃暟浼氭牴鎹紓甯哥殑绋嬪害鍙樺寲 @@ -29,6 +32,8 @@ override fun getExceptionType(): ExceptionType { return ExceptionType.TYPE4 } + + override var judgeMethod: JudgeMethod = JudgeMethod.M2 override fun judgeException(p: BaseRealTimeData?, n: BaseRealTimeData): MutableMap<FactorType, Boolean> { val res = mutableMapOf<FactorType, Boolean>() @@ -51,23 +56,21 @@ return res } - override fun judgeExceptionCount(tag: Tag): Boolean { - // 棣栦釜鏁版嵁娌℃湁鍓嶄竴涓暟鎹弬鐓э紝涓嶇畻寮傚父鍊硷紝鏈�鍚庝竴涓暟鎹槸鍒ゆ柇缁撴潫鐨勬甯稿�硷紝鍥犳寮傚父鏁版嵁涓暟鐨勮绠椾笅鏍囦负sIndex鍜宔Index - 1 - val sIndex = tag.sIndex - val eIndex = tag.eIndex - 1 + override fun judgeExceptionCount(tag: ExceptionTag, factorType: FactorType?): Boolean { + val count = tag.exceptionData.size - val b1 = special && (eIndex - sIndex) >= (config.mutationNum / 2) - val b2 = (eIndex - sIndex) >= config.mutationNum + val b1 = special && count >= (config.mutationNum / 2) + val b2 = count >= config.mutationNum special = false return b1 || b2 } - override fun needCut(tag: Tag): Boolean { + override fun needCut(tag: ExceptionTag, hasException: Boolean?, data: BaseRealTimeData): Boolean { // 鎸夌収鏃堕暱鍜岃窛绂婚檺鍒跺皢寮傚父鎴彇 if (tag.exceptionData.isEmpty()) return false val se = tag.exceptionData.first() - val ee = tag.exceptionData.last() + val ee = data val sTime = LocalDateTime.ofInstant(se.dataTime?.toInstant(), ZoneId.systemDefault()) val eTime = LocalDateTime.ofInstant(ee.dataTime?.toInstant(), ZoneId.systemDefault()) @@ -88,4 +91,8 @@ return b1 || b2 } + + override fun onNewResult(result: List<RealTimeExceptionResult>) { + TODO("Not yet implemented") + } } \ No newline at end of file -- Gitblit v1.9.3