警告:"System.Configuration.ConfigurationSettings.GetConfig(string)”已过时

本文解决VS2005中ConfigurationSettings类已过时的问题,介绍如何替换为ConfigurationManager,并提供具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在VS 2005中,经常会使用到ConfigurationSettings类来读取应用程序配置文件的信息,以获取数据库连接的字符串,但是,经常会出现如下的错误:
警告“System.Configuration.ConfigurationSettings.GetConfig(string)”已过时:“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection”
警告   1 “System.Configuration.ConfigurationSettings.AppSettings”已过时:“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings”


解决方法:
首先添加对System.Configuration.dll 文件的引用,既在该项目中添加引用,在浏览中找到System.Configuration.dll文件,一般该文件在C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727文件夹中;
其次再把.net 1.0下的“System.Configuration.ConfigurationSettings.AppSettings”索引器换成.net 2.0下的“System.Configuration.ConfigurationManager.AppSettings”索引器。把"System.Configuration.ConfigurationSettings.GetConfig换成System.Configuration.ConfigurationManager.GetSection

package com.tongchuang.realtime.mds; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.tongchuang.realtime.bean.ULEParamConfig; import com.tongchuang.realtime.util.KafkaUtils; import org.apache.flink.api.common.eventtime.WatermarkStrategy; import org.apache.flink.api.common.state.*; import org.apache.flink.api.common.time.Time; import org.apache.flink.api.common.typeinfo.BasicTypeInfo; import org.apache.flink.api.common.typeinfo.TypeHint; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.configuration.Configuration; import org.apache.flink.connector.kafka.source.KafkaSource; import org.apache.flink.connector.kafka.source.enumerator.initializer.OffsetsInitializer; import org.apache.flink.streaming.api.datastream.*; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; import org.apache.flink.streaming.api.functions.co.KeyedBroadcastProcessFunction; import org.apache.flink.streaming.api.functions.source.RichSourceFunction; import org.apache.flink.util.Collector; import org.apache.flink.util.OutputTag; import java.io.Serializable; import java.sql.*; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.Duration; import java.util.*; import java.util.Date; import java.util.concurrent.TimeUnit; public class ULEDataanomalyanalysis { public static void main(String[] args) throws Exception { final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); env.getConfig().setAutoWatermarkInterval(1000); // 设置水位线生成间隔 // 创建Kafka消费者 KafkaSource<String> kafkaConsumer = KafkaUtils.getKafkaConsumer( "realdata_minute", "minutedata_uledataanomalyanalysis", OffsetsInitializer.latest() ); // 修改Watermark策略为有界乱序 DataStreamSource<String> kafkaDS = env.fromSource( kafkaConsumer, WatermarkStrategy.<String>forBoundedOutOfOrderness(Duration.ofMinutes(1)) .withTimestampAssigner((event, timestamp) -> { try { JSONObject json = JSON.parseObject(event); return new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(json.getString("times")).getTime(); } catch (ParseException e) { return System.currentTimeMillis(); // 使用当前时间作为回退 } }), "realdata_uledataanomalyanalysis" ); kafkaDS.print("分钟数据流"); // 解析JSON并拆分每个tag的数据 SingleOutputStreamOperator<JSONObject> splitStream = kafkaDS .map(JSON::parseObject) .returns(TypeInformation.of(JSONObject.class)) // 显式指定返回类型 .flatMap((JSONObject value, Collector<JSONObject> out) -> { JSONObject data = value.getJSONObject("datas"); String time = value.getString("times"); for (String tag : data.keySet()) { JSONObject tagData = data.getJSONObject(tag); JSONObject newObj = new JSONObject(); newObj.put("time", time); newObj.put("tag", tag); newObj.put("ontime", tagData.getDouble("ontime")); newObj.put("avg", tagData.getDouble("avg")); out.collect(newObj); } }) .returns(TypeInformation.of(JSONObject.class)) // 显式指定返回类型 .name("Split-By-Tag"); // 每5分钟加载参数配置 DataStream<ConfigCollection> configDataStream = env .addSource(new MysqlConfigSource()) .setParallelism(1) .filter(Objects::nonNull) .name("Config-Source"); // 创建标签值数据流(修复类型擦除问题) DataStream<Map<String, Object>> tagValueStream = splitStream .map(json -> { Map<String, Object> valueMap = new HashMap<>(); valueMap.put("tag", json.getString("tag")); // 根据数据类型选择合适的值 valueMap.put("value", "436887485805570949".equals(json.getString("datatype")) ? json.getDouble("ontime") : json.getDouble("avg")); return valueMap; }) .returns(new TypeHint<Map<String, Object>>() {}) // 显式指定返回类型 .name("Tag-Value-Stream"); // 合并配置流和标签值流(修复类型擦除问题) DataStream<Object> broadcastStream = configDataStream .map(config -> (Object) config) .returns(TypeInformation.of(Object.class)) // 显式指定返回类型 .union( tagValueStream.map(tagValue -> (Object) tagValue) .returns(TypeInformation.of(Object.class)) // 显式指定返回类型 ); // 广播合并流(使用两个状态描述符) BroadcastStream<Object> finalBroadcastStream = broadcastStream .broadcast(Descriptors.configStateDescriptor, Descriptors.tagValuesDescriptor); // 按tag分组并连接广播流 KeyedStream<JSONObject, String> keyedStream = splitStream .keyBy(json -> json.getString("tag")); BroadcastConnectedStream<JSONObject, Object> connectedStream = keyedStream.connect(finalBroadcastStream); // 异常检测处理 SingleOutputStreamOperator<JSONObject> anomalyStream = connectedStream .process(new OptimizedAnomalyDetectionFunction()) .name("Anomaly-Detection"); anomalyStream.print("异常检测结果"); // 获取侧输出流(离线检测结果)并打印 DataStream<String> offlineCheckStream = anomalyStream.getSideOutput(OptimizedAnomalyDetectionFunction.OFFLINE_CHECK_TAG); offlineCheckStream.print("离线检测结果"); env.execute("uledataanomalyanalysis"); } // 配置集合类 public static class ConfigCollection implements Serializable { private static final long serialVersionUID = 1L; public final Map<String, List<ULEParamConfig>> tagToConfigs; public final Map<String, ULEParamConfig> encodeToConfig; public final Set<String> allTags; public final long checkpointTime; // 配置加载的时间戳 public ConfigCollection(Map<String, List<ULEParamConfig>> tagToConfigs, Map<String, ULEParamConfig> encodeToConfig) { this.tagToConfigs = new HashMap<>(tagToConfigs); this.encodeToConfig = new HashMap<>(encodeToConfig); this.allTags = new HashSet<>(tagToConfigs.keySet()); this.checkpointTime = System.currentTimeMillis(); // 记录配置加载时间 } } // MySQL配置源 public static class MysqlConfigSource extends RichSourceFunction<ConfigCollection> { private volatile boolean isRunning = true; private final long interval = TimeUnit.MINUTES.toMillis(5); @Override public void run(SourceContext<ConfigCollection> ctx) throws Exception { while (isRunning) { ConfigCollection newConfig = loadParams(); if (newConfig != null) { ctx.collect(newConfig); System.out.println("配置加载完成,检查点时间: " + new Date(newConfig.checkpointTime)); } else { System.out.println("配置加载失败"); } Thread.sleep(interval); } } private ConfigCollection loadParams() { Map<String, List<ULEParamConfig>> tagToConfigs = new HashMap<>(5000); Map<String, ULEParamConfig> encodeToConfig = new HashMap<>(5000); String url = "jdbc:mysql://10.51.37.73:3306/eps?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8"; String user = "root"; String password = "6CKIm5jDVsLrahSw"; String query = "SELECT F_tag AS tag, F_enCode AS encode, F_dataTypes AS datatype, " + "F_isConstantValue AS constantvalue, F_isOnline AS isonline, " + "F_isSync AS issync, F_syncParaEnCode AS syncparaencode, " + "F_isZero AS iszero, F_isHigh AS ishigh, F_highThreshold AS highthreshold, " + "F_isLow AS islow, F_lowThreshold AS lowthreshold, F_duration AS duration " + "FROM t_equipmentparameter " + "WHERE F_enabledmark = '1' AND (F_isConstantValue ='1' OR F_isZero= '1' " + "OR F_isHigh = '1' OR F_isLow = '1' OR F_isOnline = '1' OR F_isSync = '1')"; try (Connection conn = DriverManager.getConnection(url, user, password); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(query)) { while (rs.next()) { ULEParamConfig config = new ULEParamConfig(); config.tag = rs.getString("tag"); config.encode = rs.getString("encode"); config.datatype = rs.getString("datatype"); config.constantvalue = rs.getInt("constantvalue"); config.iszero = rs.getInt("iszero"); config.ishigh = rs.getInt("ishigh"); config.highthreshold = rs.getDouble("highthreshold"); config.islow = rs.getInt("islow"); config.lowthreshold = rs.getDouble("lowthreshold"); config.duration = rs.getLong("duration"); config.isonline = rs.getInt("isonline"); config.issync = rs.getInt("issync"); config.syncparaencode = rs.getString("syncparaencode"); // 跳过无效配置 if (config.encode == null || config.encode.isEmpty()) { System.err.println("忽略无效配置: 空encode"); continue; } String tag = config.tag; tagToConfigs.computeIfAbsent(tag, k -> new ArrayList<>(10)).add(config); encodeToConfig.put(config.encode, config); } System.out.println("加载配置: " + encodeToConfig.size() + " 个参数"); return new ConfigCollection(tagToConfigs, encodeToConfig); } catch (SQLException e) { System.err.println("加载参数配置错误:"); e.printStackTrace(); return null; } } @Override public void cancel() { isRunning = false; } } // 状态描述符 public static class Descriptors { // 配置状态描述符 public static final MapStateDescriptor<Void, ConfigCollection> configStateDescriptor = new MapStateDescriptor<>( "configState", TypeInformation.of(Void.class), TypeInformation.of(ConfigCollection.class) ); // 标签值广播状态描述符 public static final MapStateDescriptor<String, Double> tagValuesDescriptor = new MapStateDescriptor<>( "tagValuesBroadcastState", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.DOUBLE_TYPE_INFO); } // 优化后的异常检测函数 public static class OptimizedAnomalyDetectionFunction extends KeyedBroadcastProcessFunction<String, JSONObject, Object, JSONObject> { // 状态管理 private transient MapState<String, AnomalyState> stateMap; // key=encode private transient MapState<String, Double> lastValuesMap; // key=tag private transient MapState<String, Long> lastDataTimeMap; // key=tag private transient ValueState<Long> lastCheckpointState; // 记录该tag上次处理的检查点时间 private transient MapState<String, Long> offlineTimerState; // 离线检测定时器状态 (修复点1) private transient SimpleDateFormat timeFormat; // 日志频率控制 private transient long lastSyncLogTime = 0; // 侧输出标签用于离线检测 public static final OutputTag<String> OFFLINE_CHECK_TAG = new OutputTag<String>("offline-check"){}; @Override public void open(Configuration parameters) { // 状态TTL配置(30天自动清理) StateTtlConfig ttlConfig = StateTtlConfig.newBuilder(Time.days(30)) .setUpdateType(StateTtlConfig.UpdateType.OnCreateAndWrite) .setStateVisibility(StateTtlConfig.StateVisibility.NeverReturnExpired) .cleanupFullSnapshot() .build(); // 初始化异常状态存储(启用TTL) MapStateDescriptor<String, AnomalyState> stateDesc = new MapStateDescriptor<>( "anomalyState", BasicTypeInfo.STRING_TYPE_INFO, TypeInformation.of(AnomalyState.class) ); stateDesc.enableTimeToLive(ttlConfig); stateMap = getRuntimeContext().getMapState(stateDesc); // 初始化最新值存储(启用TTL) MapStateDescriptor<String, Double> valuesDesc = new MapStateDescriptor<>( "lastValuesState", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.DOUBLE_TYPE_INFO ); valuesDesc.enableTimeToLive(ttlConfig); lastValuesMap = getRuntimeContext().getMapState(valuesDesc); // 初始化最后数据时间存储(启用TTL) MapStateDescriptor<String, Long> timeDesc = new MapStateDescriptor<>( "lastDataTimeState", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); timeDesc.enableTimeToLive(ttlConfig); lastDataTimeMap = getRuntimeContext().getMapState(timeDesc); // 初始化检查点状态(记录上次处理的配置时间) ValueStateDescriptor<Long> checkpointDesc = new ValueStateDescriptor<>( "lastCheckpointState", BasicTypeInfo.LONG_TYPE_INFO ); checkpointDesc.enableTimeToLive(ttlConfig); lastCheckpointState = getRuntimeContext().getState(checkpointDesc); // 初始化离线检测定时器状态 (修复点1) MapStateDescriptor<String, Long> timerDesc = new MapStateDescriptor<>( "offlineTimerState", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); timerDesc.enableTimeToLive(ttlConfig); offlineTimerState = getRuntimeContext().getMapState(timerDesc); timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); } @Override public void processElement(JSONObject data, ReadOnlyContext ctx, Collector<JSONObject> out) throws Exception { String tag = ctx.getCurrentKey(); String timeStr = data.getString("time"); long eventTime = timeFormat.parse(timeStr).getTime(); // 更新最后数据时间 lastDataTimeMap.put(tag, eventTime); // 获取广播配置 ConfigCollection configCollection = getBroadcastConfig(ctx); if (configCollection == null) { return; } List<ULEParamConfig> configs = configCollection.tagToConfigs.get(tag); if (configs == null || configs.isEmpty()) { return; } // 清理无效状态 List<String> keysToRemove = new ArrayList<>(); for (String encode : stateMap.keys()) { boolean found = false; for (ULEParamConfig cfg : configs) { if (cfg.encode.equals(encode)) { found = true; break; } } if (!found) { System.out.println("清理过期状态: " + encode); keysToRemove.add(encode); } } for (String encode : keysToRemove) { stateMap.remove(encode); } double value = 0; boolean valueSet = false; // 检查该tag是否需要离线检测 (修复点2) boolean hasOnlineConfig = false; long minDuration = Long.MAX_VALUE; for (ULEParamConfig config : configs) { if (config.isonline == 1) { hasOnlineConfig = true; minDuration = Math.min(minDuration, config.duration); } } // 管理离线检测定时器 (修复点3) if (hasOnlineConfig) { // 删除现有定时器 Long currentTimer = offlineTimerState.get(tag); if (currentTimer != null) { ctx.timerService().deleteEventTimeTimer(currentTimer); } // 注册新定时器(使用最小duration) long offlineTimeout = eventTime + minDuration * 60 * 1000; ctx.timerService().registerEventTimeTimer(offlineTimeout); offlineTimerState.put(tag, offlineTimeout); // 重置离线状态(数据到达表示恢复) for (ULEParamConfig config : configs) { if (config.isonline == 1) { AnomalyState state = getOrCreateState(config.encode); AnomalyStatus status = state.getStatus(6); if (status.reported) { // 数据恢复,发送恢复事件 reportAnomaly(6, 0, 0.0, timeStr, config, out); status.reset(); stateMap.put(config.encode, state); } } } } // 遍历配置项进行异常检测 for (ULEParamConfig config : configs) { if (!valueSet) { value = "436887485805570949".equals(config.datatype) ? data.getDouble("ontime") : data.getDouble("avg"); lastValuesMap.put(tag, value); valueSet = true; } // 获取或初始化状态 AnomalyState state = getOrCreateState(config.encode); // 处理异常类型 checkConstantValueAnomaly(config, value, timeStr, state, out); // 1. 恒值检测 checkZeroValueAnomaly(config, value, timeStr, state, out); // 2. 零值检测 checkThresholdAnomaly(config, value, timeStr, state, out); // 3. 上阈值, 4. 下阈值 checkSyncAnomaly(config, value, timeStr, state, configCollection, ctx, out); // 5. 同步检测 // 保存状态 stateMap.put(config.encode, state); } } @Override public void onTimer(long timestamp, OnTimerContext ctx, Collector<JSONObject> out) throws Exception { String tag = ctx.getCurrentKey(); Long lastEventTime = lastDataTimeMap.get(tag); // 获取配置 ConfigCollection configCollection = getBroadcastConfig(ctx); if (configCollection == null) return; List<ULEParamConfig> configs = configCollection.tagToConfigs.get(tag); if (configs == null) return; // 检查所有需要离线检测的配置项 (修复点4) boolean hasOnlineConfig = false; for (ULEParamConfig config : configs) { if (config.isonline == 1) { hasOnlineConfig = true; AnomalyState state = getOrCreateState(config.encode); AnomalyStatus status = state.getStatus(6); // 6表示离线异常 // 检查是否超时 if (lastEventTime != null && (timestamp - lastEventTime) >= config.duration * 60 * 1000) { if (!status.reported) { String triggerTime = timeFormat.format(new Date(timestamp)); reportAnomaly(6, 1, 0.0, triggerTime, config, out); status.reported = true; // 输出到侧输出流 ctx.output(OFFLINE_CHECK_TAG, String.format("离线异常: tag=%s, encode=%s, 最后数据时间=%s, 超时时间=%s", config.tag, config.encode, lastEventTime != null ? timeFormat.format(new Date(lastEventTime)) : "N/A", triggerTime)); } } else { // 数据已恢复,重置状态 if (status.reported) { reportAnomaly(6, 0, 0.0, timeFormat.format(new Date()), config, out); status.reset(); } } stateMap.put(config.encode, state); } } // 重新注册定时器(如果tag仍然存在)(修复点5) if (hasOnlineConfig) { long newTimeout = timestamp + TimeUnit.MINUTES.toMillis(1); // 每分钟检查一次 ctx.timerService().registerEventTimeTimer(newTimeout); offlineTimerState.put(tag, newTimeout); } else { offlineTimerState.remove(tag); } } // 恒值检测 - 异常类型1 private void checkConstantValueAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector<JSONObject> out) { if (config.constantvalue != 1) return; try { AnomalyStatus status = state.getStatus(1); long durationThreshold = config.duration * 60 * 1000; Date timestamp = timeFormat.parse(timeStr); if (status.lastValue == null) { status.lastValue = currentValue; status.lastChangeTime = timestamp; return; } if (Math.abs(currentValue - status.lastValue) > 0.001) { status.lastValue = currentValue; status.lastChangeTime = timestamp; if (status.reported) { reportAnomaly(1, 0, currentValue, timeStr, config, out); } status.reset(); return; } long elapsed = timestamp.getTime() - status.lastChangeTime.getTime(); if (elapsed > durationThreshold) { if (!status.reported) { reportAnomaly(1, 1, currentValue, timeStr, config, out); status.reported = true; } } } catch (Exception e) { System.err.println("恒值检测错误: " + config.encode + " - " + e.getMessage()); } } // 零值检测 - 异常类型2 private void checkZeroValueAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector<JSONObject> out) { if (config.iszero != 1) return; try { AnomalyStatus status = state.getStatus(2); Date timestamp = timeFormat.parse(timeStr); boolean isZero = Math.abs(currentValue) < 0.001; if (isZero) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(2, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(2, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (Exception e) { System.err.println("零值检测错误:极速版 " + config.encode + " - " + e.getMessage()); } } // 阈值检测 - 异常类型3(上阈值)和4(下阈值) private void checkThresholdAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector<JSONObject> out) { try { if (config.ishigh == 1) { AnomalyStatus highStatus = state.getStatus(3); processThresholdAnomaly(highStatus, currentValue, timeStr, currentValue > config.highthreshold, config, 3, out); } if (config.islow == 1) { AnomalyStatus lowStatus = state.getStatus(4); processThresholdAnomaly(lowStatus, currentValue, timeStr, currentValue < config.lowthreshold, config, 4, out); } } catch (Exception e) { System.err.println("阈值检测错误: " + config.encode + " - " + e.getMessage()); } } private void processThresholdAnomaly(AnomalyStatus status, double currentValue, String timeStr, boolean isAnomaly, ULEParamConfig config, int anomalyType, Collector<JSONObject> out) { try { Date timestamp = timeFormat.parse(timeStr); if (isAnomaly) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(anomalyType, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(anomalyType, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (Exception e) { System.err.println("阈值处理错误: " + config.encode + " - " + e.getMessage()); } } // 同步检测 - 异常类型5 private void checkSyncAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, ConfigCollection configCollection, ReadOnlyContext ctx, Collector<JSONObject> out) { if (config.issync != 1 || config.syncparaencode == null || config.syncparaencode.isEmpty()) { return; } try { // 1. 通过encode获取关联配置 ULEParamConfig relatedConfig = configCollection.encodeToConfig.get(config.syncparaencode); if (relatedConfig == null) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.println("同步检测: 未找到关联配置, encode=" + config.syncparaencode); lastSyncLogTime = System.currentTimeMillis(); } return; } // 2. 获取关联配置的tag String relatedTag = relatedConfig.tag; if (relatedTag == null || relatedTag.isEmpty()) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.println("同步检测: 关联配置没有tag, encode=" + config.syncparaencode); lastSyncLogTime = System.currentTimeMillis(); } return; } // 3. 从广播状态获取关联值 ReadOnlyBroadcastState<String, Double> tagValuesState = ctx.getBroadcastState(Descriptors.tagValuesDescriptor); Double relatedValue = tagValuesState.get(relatedTag); if (relatedValue == null) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.println("同步检测: 关联值未初始化, tag=" + relatedTag); lastSyncLogTime = System.currentTimeMillis(); } return; } // 4. 同步检测逻辑 AnomalyStatus status = state.getStatus(5); Date timestamp = timeFormat.parse(timeStr); // 根据业务需求调整同步异常判断逻辑 boolean isAnomaly = (currentValue >= 0.99) && (Math.abs(relatedValue) < 0.01); // 记录调试信息 if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.printf("同步检测: %s (%.4f) vs %s (%.4f) -> %b%n", config.tag, currentValue, relatedTag, relatedValue, isAnomaly); lastSyncLogTime = System.currentTimeMillis(); } // 5. 处理异常状态 if (isAnomaly) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(5, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(5, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (ParseException e) { System.err.println("同步检测时间解析错误: " + config.encode + " - " + e.getMessage()); } catch (Exception e) { System.err.println("同步检测错误: " + config.encode + " - " + e.getMessage()); } } // 报告异常 private void reportAnomaly(int anomalyType, int statusFlag, double value, String time, ULEParamConfig config, Collector<JSONObject> out) { JSONObject event = new JSONObject(); event.put("tag", config.tag); event.put("paracode", config.encode); event.put("abnormaltype", anomalyType); event.put("statusflag", statusFlag); event.put("datavalue", value); event.put("triggertime", time); out.collect(event); } @Override public void processBroadcastElement(Object broadcastElement, Context ctx, Collector<JSONObject> out) throws Exception { // 处理配置更新 if (broadcastElement instanceof ConfigCollection) { ConfigCollection newConfig = (ConfigCollection) broadcastElement; BroadcastState<Void, ConfigCollection> configState = ctx.getBroadcastState(Descriptors.configStateDescriptor); // 获取旧配置 ConfigCollection oldConfig = configState.get(null); // 处理配置变更:清理不再启用的报警 if (oldConfig != null) { for (Map.Entry<String, ULEParamConfig> entry : oldConfig.encodeToConfig.entrySet()) { String encode = entry.getKey(); ULEParamConfig oldCfg = entry.getValue(); // 检查配置是否被删除或禁用 ULEParamConfig newCfg = newConfig.encodeToConfig.get(encode); if (newCfg == null || !isAlarmEnabled(newCfg, oldCfg)) { // 发送恢复事件 sendRecoveryEvents(encode, oldCfg, ctx, out); } } } // 更新广播状态 configState.put(null, newConfig); System.out.println("广播配置更新完成, 配置项: " + newConfig.encodeToConfig.size()); } // 处理标签值更新 else if (broadcastElement instanceof Map) { @SuppressWarnings("unchecked") Map<String, Object> tagValue = (Map<String, Object>) broadcastElement; String tag = (String) tagValue.get("tag"); Double value = (Double) tagValue.get("value"); if (tag != null && value != null) { BroadcastState<String, Double> tagValuesState = ctx.getBroadcastState(Descriptors.tagValuesDescriptor); tagValuesState.put(tag, value); // System.out.println("更新标签值: " + tag + " = " + value); } } } // 检查报警是否启用 private boolean isAlarmEnabled(ULEParamConfig newCfg, ULEParamConfig oldCfg) { // 检查所有报警类型是否被禁用 return (oldCfg.constantvalue == 1 && newCfg.constantvalue == 1) || (oldCfg.iszero == 1 && newCfg.iszero == 1) || (oldCfg.ishigh == 1 && newCfg.ishigh == 1) || (oldCfg.islow == 1 && newCfg.islow == 1) || (oldCfg.isonline == 1 && newCfg.isonline == 1) || (oldCfg.issync == 1 && newCfg.issync == 1); } // 发送恢复事件 private void sendRecoveryEvents(String encode, ULEParamConfig config, Context ctx, Collector<JSONObject> out) { try { AnomalyState state = stateMap.get(encode); if (state == null) return; // 遍历所有可能的报警类型 for (int type = 1; type <= 6; type++) { // 包括1-6所有异常类型 AnomalyStatus status = state.getStatus(type); if (status.reported) { JSONObject recoveryEvent = new JSONObject(); recoveryEvent.put("tag", config.tag); recoveryEvent.put("paracode", config.encode); recoveryEvent.put("abnormaltype", type); recoveryEvent.put("statusflag", 0); // 恢复事件 recoveryEvent.put("datavalue", 0.0); recoveryEvent.put("triggertime", timeFormat.format(new Date())); out.collect(recoveryEvent); status.reset(); } } // 更新状态 stateMap.put(encode, state); } catch (Exception e) { System.err.println("发送恢复事件失败: " + e.getMessage()); } } // 辅助方法 private ConfigCollection getBroadcastConfig(ReadOnlyContext ctx) throws Exception { return ctx.getBroadcastState(Descriptors.configStateDescriptor).get(null); } private AnomalyState getOrCreateState(String encode) throws Exception { AnomalyState state = stateMap.get(encode); if (state == null) { state = new AnomalyState(); } return state; } } // 异常状态类 public static class AnomalyState implements Serializable { private static final long serialVersionUID = 1L; private final Map<Integer, AnomalyStatus> statusMap = new HashMap<>(); public AnomalyStatus getStatus(int type) { return statusMap.computeIfAbsent(type, k -> new AnomalyStatus()); } } // 异常状态详情 public static class AnomalyStatus implements Serializable { private static final long serialVersionUID = 1L; public Date startTime; // 异常开始时间 public Double lastValue; // 用于恒值检测 public Date lastChangeTime; // 值最后变化时间 public boolean reported; // 是否已报告 public void reset() { startTime = null; lastValue = null; lastChangeTime = null; reported = false; } } } 运行的日志为:"C:\Program Files (x86)\Java\jdk1.8.0_102\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:7630,suspend=y,server=n -javaagent:C:\Users\Administrator\AppData\Local\JetBrains\IntelliJIdea2021.2\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath C:\Users\Administrator\AppData\Local\Temp\classpath1753622630.jar com.tongchuang.realtime.mds.ULEDataanomalyanalysis 已连接到目标 VM, 地址: ''127.0.0.1:7630',传输: '套接字'' SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/F:/flink/flinkmaven/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.10.0/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/F:/flink/flinkmaven/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] 加载配置: 30 个参数 配置加载完成,检查点时间: Mon Aug 04 16:21:14 CST 2025 广播配置更新完成, 配置项: 30 分钟数据流> {"times":"2025-08-04 16:21","datas":{"DA-LT-5BT0001":{"ontime":3037.4404,"avg":3077.54,"min":3005.2964,"max":3135.881},"DA-LT-6BT008":{"ontime":198.4506,"avg":198.5478,"min":197.0177,"max":199.7854},"DA-LT-5BT0005":{"ontime":402.36,"avg":402.44,"min":402.3,"max":402.9},"DA-LT-5BT0004":{"ontime":1214.5,"avg":1214.445,"min":1214.0,"max":1214.8},"DA-LT-6BT004":{"ontime":1161.2792,"avg":1160.9088,"min":1160.5784,"max":1161.2792},"DA-LT-6BT005":{"ontime":414.5838,"avg":413.8847,"min":413.5434,"max":414.5838},"DA-LT-5BT0008":{"ontime":185.76,"avg":185.0393,"min":184.14,"max":186.14},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":131.2875,"avg":131.565,"min":130.6875,"max":133.4125},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1212.0,"avg":1212.1667,"min":1212.0,"max":1213.0},"DA-LT-6BT001":{"ontime":175613.78,"avg":174877.3988,"min":173555.9,"max":175931.95},"DA-LT-4BT0005":{"ontime":299.1875,"avg":299.7167,"min":299.1875,"max":301.3125},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":347.71,"avg":322.291,"min":289.95,"max":350.66},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":125349.98,"avg":125412.9004,"min":124370.07,"max":126346.016}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-NY-LG1ZL-2-001 (0.0000) -> true 分钟数据流> {"times":"2025-08-04 16:22","datas":{"DA-LT-5BT0001":{"ontime":3041.0771,"avg":3072.9736,"min":3028.683,"max":3123.0447},"DA-LT-6BT008":{"ontime":197.0373,"avg":196.8917,"min":195.6044,"max":197.4495},"DA-LT-5BT0005":{"ontime":402.96,"avg":403.963,"min":402.96,"max":405.0},"DA-LT-5BT0004":{"ontime":1214.1,"avg":1213.68,"min":1213.2001,"max":1214.2001},"DA-LT-6BT004":{"ontime":1160.6451,"avg":1160.5345,"min":1160.445,"max":1160.6451},"DA-LT-6BT005":{"ontime":413.5827,"avg":412.9968,"min":412.0712,"max":413.5827},"DA-LT-5BT0008":{"ontime":186.12,"avg":186.4123,"min":185.64,"max":188.18},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":131.75,"avg":130.3521,"min":129.1,"max":131.75},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1212.0,"avg":1211.45,"min":1211.0,"max":1212.0},"DA-LT-6BT001":{"ontime":174958.58,"avg":174779.7565,"min":173817.05,"max":175997.95},"DA-LT-4BT0005":{"ontime":300.25,"avg":299.2271,"min":297.875,"max":300.25},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":331.25,"avg":321.6138,"min":275.13,"max":379.05},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":126701.664,"avg":125684.668,"min":124417.31,"max":126701.664}}} 异常检测结果> {"abnormaltype":2,"paracode":"EP000022","datavalue":0.0,"tag":"DA-NY-LG1ZL-2-001","triggertime":"2025-08-04 16:22","statusflag":1} 异常检测结果> {"abnormaltype":4,"paracode":"EP000022","datavalue":0.0,"tag":"DA-NY-LG1ZL-2-001","triggertime":"2025-08-04 16:22","statusflag":1} 异常检测结果> {"abnormaltype":4,"paracode":"EP000001","datavalue":1.0,"tag":"DA-DB195-RH-B-0201","triggertime":"2025-08-04 16:22","statusflag":1} 异常检测结果> {"abnormaltype":5,"paracode":"EP000001","datavalue":1.0,"tag":"DA-DB195-RH-B-0201","triggertime":"2025-08-04 16:22","statusflag":1} 分钟数据流> {"times":"2025-08-04 16:23","datas":{"DA-LT-5BT0001":{"ontime":3044.751,"avg":3069.1905,"min":3008.8462,"max":3128.2627},"DA-LT-6BT008":{"ontime":195.6829,"avg":195.4408,"min":195.0744,"max":195.7418},"DA-LT-5BT0005":{"ontime":404.94,"avg":405.705,"min":404.94,"max":406.56},"DA-LT-5BT0004":{"ontime":1213.3,"avg":1213.6267,"min":1213.2001,"max":1213.9},"DA-LT-6BT004":{"ontime":1160.5117,"avg":1160.5178,"min":1160.445,"max":1160.5784},"DA-LT-6BT005":{"ontime":412.0712,"avg":411.3963,"min":410.6972,"max":412.0712},"DA-LT-5BT0008":{"ontime":187.58,"avg":188.0983,"min":186.38,"max":189.72},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":129.1,"avg":127.8775,"min":126.85,"max":129.4375},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1211.0,"avg":1210.1333,"min":1210.0,"max":1211.0},"DA-LT-6BT001":{"ontime":175726.77,"avg":175410.6785,"min":173584.17,"max":176879.33},"DA-LT-4BT0005":{"ontime":298.0,"avg":297.3938,"min":296.75,"max":298.4375},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":306.47,"avg":318.4022,"min":288.74,"max":349.25},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":126455.56,"avg":127003.1363,"min":125744.39,"max":128161.19}}} 异常检测结果> {"abnormaltype":1,"paracode":"EP000022","datavalue":0.0,"tag":"DA-NY-LG1ZL-2-001","triggertime":"2025-08-04 16:23","statusflag":1} 异常检测结果> {"abnormaltype":1,"paracode":"EP000001","datavalue":1.0,"tag":"DA-DB195-RH-B-0201","triggertime":"2025-08-04 16:23","statusflag":1} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-NY-LG1ZL-2-001 (0.0000) -> true 分钟数据流> {"times":"2025-08-04 16:24","datas":{"DA-LT-5BT0001":{"ontime":3111.352,"avg":3073.2331,"min":3020.7065,"max":3119.5767},"DA-LT-6BT008":{"ontime":195.2314,"avg":194.6716,"min":193.4844,"max":195.4277},"DA-LT-5BT0005":{"ontime":406.56,"avg":406.781,"min":406.5,"max":407.22},"DA-LT-5BT0004":{"ontime":1213.9,"avg":1213.85,"min":1213.5,"max":1214.0},"DA-LT-6BT004":{"ontime":1160.5784,"avg":1160.2836,"min":1160.178,"max":1160.5784},"DA-LT-6BT005":{"ontime":410.7364,"avg":410.1293,"min":408.9895,"max":410.9131},"DA-LT-5BT0008":{"ontime":189.84,"avg":189.193,"min":188.48,"max":189.98},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":127.225,"avg":126.9273,"min":126.1875,"max":128.375},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1210.0,"avg":1209.7667,"min":1209.0,"max":1210.0},"DA-LT-6BT001":{"ontime":174950.36,"avg":175419.8677,"min":174526.08,"max":176501.6},"DA-LT-4BT0005":{"ontime":297.125,"avg":296.1365,"min":295.0625,"max":297.9375},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":331.64,"avg":313.9772,"min":244.04,"max":366.26},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":126926.016,"avg":127288.5532,"min":125888.73,"max":128539.445},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0}}} 分钟数据流> {"times":"2025-08-04 16:25","datas":{"DA-LT-5BT0001":{"ontime":3068.1875,"avg":3084.6569,"min":3029.6409,"max":3132.9768},"DA-LT-6BT008":{"ontime":193.4844,"avg":193.0935,"min":192.3459,"max":193.504},"DA-LT-5BT0005":{"ontime":407.16,"avg":407.241,"min":406.68,"max":407.82},"DA-LT-5BT0004":{"ontime":1213.7001,"avg":1213.3367,"min":1212.8,"max":1213.7001},"DA-LT-6BT004":{"ontime":1160.2113,"avg":1160.4494,"min":1160.2113,"max":1160.6451},"DA-LT-6BT005":{"ontime":408.9699,"avg":408.4026,"min":406.7125,"max":409.0287},"DA-LT-5BT0008":{"ontime":189.08,"avg":189.1157,"min":188.56,"max":189.66},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":126.55,"avg":125.8396,"min":124.975,"max":126.675},"DA-LT-4BT0007":{"ontime":170.1,"avg":169.9971,"min":169.9,"max":170.1},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1210.0,"avg":1210.2833,"min":1210.0,"max":1211.0},"DA-LT-6BT001":{"ontime":175928.02,"avg":175488.7758,"min":174117.22,"max":176299.47},"DA-LT-4BT0005":{"ontime":295.25,"avg":295.1146,"min":294.375,"max":295.875},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":336.0,"avg":307.7993,"min":277.32,"max":336.0},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":127632.9,"avg":127259.8896,"min":126023.78,"max":128512.48},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-NY-LG1ZL-2-001 (0.0000) -> true 加载配置: 30 个参数 配置加载完成,检查点时间: Mon Aug 04 16:26:15 CST 2025 广播配置更新完成, 配置项: 30 分钟数据流> {"times":"2025-08-04 16:26","datas":{"DA-LT-5BT0001":{"ontime":3089.0852,"avg":3081.6447,"min":3023.4312,"max":3131.394},"DA-LT-6BT008":{"ontime":193.4255,"avg":190.9974,"min":190.3045,"max":193.4255},"DA-LT-5BT0005":{"ontime":407.64,"avg":407.753,"min":407.58,"max":407.94},"DA-LT-6BT004":{"ontime":1160.6451,"avg":1160.7808,"min":1160.5784,"max":1161.1123},"DA-LT-5BT0004":{"ontime":1212.8,"avg":1212.5433,"min":1212.3,"max":1212.9},"DA-LT-6BT005":{"ontime":406.6929,"avg":404.4842,"min":403.6111,"max":406.6929},"DA-LT-5BT0008":{"ontime":189.48,"avg":191.0483,"min":189.48,"max":193.24},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":125.7875,"avg":126.7077,"min":125.4,"max":128.525},"DA-LT-4BT0007":{"ontime":170.1,"avg":169.5867,"min":167.8,"max":170.4},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1211.0,"avg":1210.9833,"min":1210.0,"max":1211.0},"DA-LT-6BT001":{"ontime":173767.36,"avg":174096.6812,"min":173192.05,"max":175292.27},"DA-LT-4BT0005":{"ontime":295.1875,"avg":295.5802,"min":295.0,"max":296.3125},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":296.59,"avg":298.6618,"min":269.42,"max":327.57},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":126023.78,"avg":126936.1062,"min":126023.78,"max":128062.195},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-NY-LG1ZL-2-001 (0.0000) -> true 分钟数据流> {"times":"2025-08-04 16:27","datas":{"DA-LT-5BT0001":{"ontime":3078.3193,"avg":3074.8627,"min":3028.1882,"max":3144.5798},"DA-LT-6BT008":{"ontime":190.4026,"avg":189.0279,"min":187.8116,"max":190.4026},"DA-LT-5BT0005":{"ontime":407.58,"avg":405.809,"min":404.52,"max":407.58},"DA-LT-6BT004":{"ontime":1161.1123,"avg":1161.5489,"min":1161.0455,"max":1162.1802},"DA-LT-5BT0004":{"ontime":1213.0,"avg":1212.945,"min":1212.7001,"max":1213.2001},"DA-LT-6BT005":{"ontime":403.8074,"avg":404.5788,"min":403.5326,"max":405.3777},"DA-LT-5BT0008":{"ontime":193.22,"avg":190.887,"min":187.94,"max":193.22},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":128.3625,"avg":129.4944,"min":128.3625,"max":130.7625},"DA-LT-4BT0007":{"ontime":167.9,"avg":168.3533,"min":167.0,"max":169.2},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1211.0,"avg":1210.0333,"min":1210.0,"max":1211.0},"DA-LT-6BT001":{"ontime":174390.52,"avg":173943.3158,"min":172872.81,"max":175370.92},"DA-LT-4BT0005":{"ontime":295.5625,"avg":297.4156,"min":295.5625,"max":303.3125},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":321.92,"avg":305.068,"min":263.8899,"max":346.09},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":127858.77,"avg":126108.6027,"min":124724.13,"max":127858.77},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0}}} 异常检测结果> {"abnormaltype":3,"paracode":"EP100010","datavalue":173943.3158,"tag":"DA-LT-6BT001","triggertime":"2025-08-04 16:27","statusflag":1} 异常检测结果> {"abnormaltype":3,"paracode":"EP000010","datavalue":173943.3158,"tag":"DA-LT-6BT001","triggertime":"2025-08-04 16:27","statusflag":1} 异常检测结果> {"abnormaltype":3,"paracode":"EP000002","datavalue":126108.6027,"tag":"DA-LT-4BT0001","triggertime":"2025-08-04 16:27","statusflag":1} 分钟数据流> {"times":"2025-08-04 16:28","datas":{"DA-LT-5BT0001":{"ontime":3082.3467,"avg":3070.6012,"min":3015.203,"max":3126.656},"DA-LT-6BT008":{"ontime":187.9686,"avg":188.8153,"min":187.9097,"max":190.7167},"DA-LT-5BT0005":{"ontime":404.58,"avg":405.2197,"min":404.52,"max":405.72},"DA-LT-6BT004":{"ontime":1162.1467,"avg":1162.5732,"min":1162.1467,"max":1162.9476},"DA-LT-5BT0004":{"ontime":1213.0,"avg":1212.5797,"min":1212.2001,"max":1213.0},"DA-LT-6BT005":{"ontime":404.9851,"avg":405.6479,"min":404.7496,"max":407.3603},"DA-LT-5BT0008":{"ontime":187.94,"avg":187.4739,"min":186.82,"max":187.94},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":129.2875,"avg":129.897,"min":128.9375,"max":130.5875},"DA-LT-4BT0007":{"ontime":169.1,"avg":168.7357,"min":168.4,"max":169.1},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1210.0,"avg":1209.0847,"min":1209.0,"max":1210.0},"DA-LT-6BT001":{"ontime":174846.1,"avg":174846.2295,"min":173931.02,"max":176264.19},"DA-LT-4BT0005":{"ontime":297.6875,"avg":298.3242,"min":297.5,"max":299.25},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":254.28,"avg":285.6975,"min":252.32,"max":312.48},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":125919.79,"avg":126324.2331,"min":125535.38,"max":128088.09}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-NY-LG1ZL-2-001 (0.0000) -> true 分钟数据流> {"times":"2025-08-04 16:29","datas":{"DA-LT-5BT0001":{"ontime":3114.428,"avg":3079.4239,"min":3031.606,"max":3132.4033},"DA-LT-6BT008":{"ontime":190.7167,"avg":191.5594,"min":190.4026,"max":193.4648},"DA-LT-5BT0005":{"ontime":405.66,"avg":405.757,"min":405.18,"max":405.96},"DA-LT-6BT004":{"ontime":1162.8809,"avg":1163.4343,"min":1162.8809,"max":1163.9487},"DA-LT-5BT0004":{"ontime":1212.2001,"avg":1211.8517,"min":1211.6,"max":1212.2001},"DA-LT-6BT005":{"ontime":407.4388,"avg":407.1944,"min":406.0255,"max":407.5762},"DA-LT-5BT0008":{"ontime":187.9,"avg":187.9337,"min":187.56,"max":189.02},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":128.9375,"avg":129.4512,"min":128.3375,"max":131.275},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1209.0,"avg":1209.0,"min":1209.0,"max":1209.0},"DA-LT-6BT001":{"ontime":174624.12,"avg":175485.3962,"min":174422.5,"max":179850.77},"DA-LT-4BT0005":{"ontime":298.4375,"avg":298.5146,"min":297.6875,"max":300.5625},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":298.83,"avg":289.549,"min":256.32,"max":324.0},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":127162.22,"avg":126424.0733,"min":125390.0,"max":127284.26},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0}}} 分钟数据流> {"times":"2025-08-04 16:30","datas":{"DA-LT-5BT0001":{"ontime":3079.0293,"avg":3082.0171,"min":3030.803,"max":3146.9097},"DA-LT-6BT008":{"ontime":191.1093,"avg":190.489,"min":190.1474,"max":191.1093},"DA-LT-5BT0005":{"ontime":405.18,"avg":404.955,"min":403.92,"max":405.48},"DA-LT-6BT004":{"ontime":1163.9487,"avg":1164.2807,"min":1163.882,"max":1164.5828},"DA-LT-5BT0004":{"ontime":1211.9,"avg":1211.845,"min":1211.6,"max":1212.1},"DA-LT-6BT005":{"ontime":406.0255,"avg":405.9211,"min":404.9851,"max":407.3014},"DA-LT-5BT0008":{"ontime":189.02,"avg":187.4583,"min":186.96,"max":189.02},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":129.0125,"avg":129.5408,"min":128.75,"max":131.6},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1209.0,"avg":1209.0,"min":1209.0,"max":1209.0},"DA-LT-6BT001":{"ontime":179878.38,"avg":183907.156,"min":179878.38,"max":186153.8},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0005":{"ontime":298.3125,"avg":299.3135,"min":298.3125,"max":301.5},"DA_DB195_RH_R_0281":{"ontime":290.75,"avg":276.7118,"min":246.3,"max":309.64},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":125779.055,"avg":125754.8013,"min":124004.805,"max":126982.71},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-NY-LG1ZL-2-001 (0.0000) -> true 加载配置: 30 个参数 配置加载完成,检查点时间: Mon Aug 04 16:31:15 CST 2025 广播配置更新完成, 配置项: 30 分钟数据流> {"times":"2025-08-04 16:31","datas":{"DA-LT-5BT0001":{"ontime":3114.7764,"avg":3081.8365,"min":3019.1914,"max":3128.7803},"DA-LT-6BT008":{"ontime":190.5793,"avg":191.6599,"min":190.5793,"max":192.0319},"DA-LT-5BT0005":{"ontime":403.98,"avg":403.115,"min":402.48,"max":403.98},"DA-LT-6BT004":{"ontime":1164.6161,"avg":1165.0488,"min":1164.516,"max":1165.5171},"DA-LT-5BT0004":{"ontime":1211.6,"avg":1211.3583,"min":1210.8,"max":1211.8},"DA-LT-6BT005":{"ontime":407.2817,"avg":407.8526,"min":407.2817,"max":408.165},"DA-LT-5BT0008":{"ontime":187.1,"avg":185.9303,"min":184.26,"max":187.18},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":130.7375,"avg":131.5027,"min":130.3875,"max":132.575},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1209.0,"avg":1209.0,"min":1209.0,"max":1209.0},"DA-LT-6BT001":{"ontime":185764.62,"avg":185297.1227,"min":183230.88,"max":186811.4},"DA-LT-4BT0005":{"ontime":299.9375,"avg":300.5354,"min":299.6875,"max":301.5},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":254.66,"avg":289.7815,"min":254.31,"max":317.79},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":124901.74,"avg":125146.3463,"min":124115.77,"max":125648.84},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0}}} 异常检测结果> {"abnormaltype":1,"paracode":"EP000004","datavalue":1209.0,"tag":"DA-LT-4BT0004","triggertime":"2025-08-04 16:31","statusflag":1} 异常检测结果> {"abnormaltype":1,"paracode":"EP000018","datavalue":1209.0,"tag":"DA-LT-4BT0004","triggertime":"2025-08-04 16:31","statusflag":1} 分钟数据流> {"times":"2025-08-04 16:32","datas":{"DA-LT-5BT0001":{"ontime":3040.7458,"avg":3076.3954,"min":3035.3533,"max":3126.1702},"DA-LT-6BT008":{"ontime":191.7374,"avg":191.2954,"min":190.6971,"max":192.6207},"DA-LT-5BT0005":{"ontime":403.02,"avg":402.402,"min":401.1,"max":403.2},"DA-LT-6BT004":{"ontime":1165.4836,"avg":1165.8358,"min":1165.4503,"max":1166.2512},"DA-LT-5BT0004":{"ontime":1210.9,"avg":1210.7933,"min":1210.5,"max":1211.1},"DA-LT-6BT005":{"ontime":407.8117,"avg":406.8695,"min":405.9666,"max":407.8117},"DA-LT-5BT0008":{"ontime":184.38,"avg":184.1247,"min":183.1,"max":184.8},"DA-NY-LG1ZL-2-001":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA-LT-4BT0008":{"ontime":132.4375,"avg":131.1617,"min":129.95,"max":132.4375},"DB5701P250A00_101":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0004":{"ontime":1209.0,"avg":1209.0,"min":1209.0,"max":1209.0},"DA-LT-6BT001":{"ontime":184554.66,"avg":184063.7695,"min":182927.33,"max":185175.73},"DA-LT-4BT0005":{"ontime":300.9375,"avg":300.9042,"min":299.75,"max":301.6875},"DA-NY-LG2ZL-2-003":{"ontime":0.0,"avg":0.0,"min":0.0,"max":0.0},"DA_DB195_RH_R_0281":{"ontime":291.06,"avg":293.2653,"min":255.49,"max":333.63},"DA-DB195-RH-B-0200":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-DB195-RH-B-0201":{"ontime":1.0,"avg":1.0,"min":1.0,"max":1.0},"DA-LT-4BT0001":{"ontime":125390.39,"avg":124370.5613,"min":123141.69,"max":125400.2}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-NY-LG1ZL-2-001 (0.0000) -> true 离线监测未实现,请分析原因,并生成完整修复后代码。
08-05
package com.tongchuang.realtime.mds; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.tongchuang.realtime.bean.ULEParamConfig; import com.tongchuang.realtime.util.KafkaUtils; import org.apache.flink.api.common.eventtime.WatermarkStrategy; import org.apache.flink.api.common.state.; import org.apache.flink.api.common.time.Time; import org.apache.flink.api.common.typeinfo.BasicTypeInfo; import org.apache.flink.api.common.typeinfo.TypeHint; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.configuration.Configuration; import org.apache.flink.connector.kafka.source.KafkaSource; import org.apache.flink.connector.kafka.source.enumerator.initializer.OffsetsInitializer; import org.apache.flink.streaming.api.datastream.; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; import org.apache.flink.streaming.api.functions.co.KeyedBroadcastProcessFunction; import org.apache.flink.streaming.api.functions.source.RichSourceFunction; import org.apache.flink.util.Collector; import org.apache.flink.util.OutputTag; import java.io.Serializable; import java.sql.; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.Duration; import java.util.; import java.util.Date; import java.util.concurrent.TimeUnit; public class ULEDataanomalyanalysis { public static void main(String[] args) throws Exception { final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); env.getConfig().setAutoWatermarkInterval(1000); // Kafka消费者配置 KafkaSource<String> kafkaConsumer = KafkaUtils.getKafkaConsumer( "realdata_minute", "minutedata_uledataanomalyanalysis", OffsetsInitializer.latest() ); // 修改Watermark策略 DataStreamSource<String> kafkaDS = env.fromSource( kafkaConsumer, WatermarkStrategy.<String>forBoundedOutOfOrderness(Duration.ofMinutes(1)) .withTimestampAssigner((event, timestamp) -> { try { JSONObject json = JSON.parseObject(event); return new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(json.getString("times")).getTime(); } catch (ParseException e) { return System.currentTimeMillis(); } }), "realdata_uledataanomalyanalysis" ); kafkaDS.print("分钟数据流"); // 解析JSON并拆分tag SingleOutputStreamOperator<JSONObject> splitStream = kafkaDS .map(JSON::parseObject) .returns(TypeInformation.of(JSONObject.class)) .flatMap((JSONObject value, Collector<JSONObject> out) -> { JSONObject data = value.getJSONObject("datas"); String time = value.getString("times"); for (String tag : data.keySet()) { JSONObject tagData = data.getJSONObject(tag); JSONObject newObj = new JSONObject(); newObj.put("time", time); newObj.put("tag", tag); newObj.put("ontime", tagData.getDouble("ontime")); newObj.put("avg", tagData.getDouble("avg")); out.collect(newObj); } }) .returns(TypeInformation.of(JSONObject.class)) .name("Split-By-Tag"); // 配置数据源 DataStream<ConfigCollection> configDataStream = env .addSource(new MysqlConfigSource()) .setParallelism(1) .filter(Objects::nonNull) .name("Config-Source"); // 标签值数据流 DataStream<Map<String, Object>> tagValueStream = splitStream .map(json -> { Map<String, Object> valueMap = new HashMap<>(); valueMap.put("tag", json.getString("tag")); valueMap.put("value", "436887485805570949".equals(json.getString("datatype")) ? json.getDouble("ontime") : json.getDouble("avg")); return valueMap; }) .returns(new TypeHint<Map<String, Object>>() {}) .name("Tag-Value-Stream"); // 合并配置流和标签值流 DataStream<Object> broadcastStream = configDataStream .map(config -> (Object) config) .returns(TypeInformation.of(Object.class)) .union( tagValueStream.map(tagValue -> (Object) tagValue) .returns(TypeInformation.of(Object.class)) ); // 广播流 BroadcastStream<Object> finalBroadcastStream = broadcastStream .broadcast(Descriptors.configStateDescriptor, Descriptors.tagValuesDescriptor); // 按tag分组 KeyedStream<JSONObject, String> keyedStream = splitStream .keyBy(json -> json.getString("tag")); BroadcastConnectedStream<JSONObject, Object> connectedStream = keyedStream.connect(finalBroadcastStream); // 异常检测处理 SingleOutputStreamOperator<JSONObject> anomalyStream = connectedStream .process(new OptimizedAnomalyDetectionFunction()) .name("Anomaly-Detection"); anomalyStream.print("异常检测结果"); // 离线检测结果侧输出 DataStream<String> offlineCheckStream = anomalyStream.getSideOutput(OptimizedAnomalyDetectionFunction.OFFLINE_CHECK_TAG); offlineCheckStream.print("离线检测结果"); env.execute("uledataanomalyanalysis"); } // 配置集合类 public static class ConfigCollection implements Serializable { private static final long serialVersionUID = 1L; public final Map<String, List<ULEParamConfig>> tagToConfigs; public final Map<String, ULEParamConfig> encodeToConfig; public final Set<String> allTags; public final long checkpointTime; public ConfigCollection(Map<String, List<ULEParamConfig>> tagToConfigs, Map<String, ULEParamConfig> encodeToConfig) { this.tagToConfigs = new HashMap<>(tagToConfigs); this.encodeToConfig = new HashMap<>(encodeToConfig); this.allTags = new HashSet<>(tagToConfigs.keySet()); this.checkpointTime = System.currentTimeMillis(); } } // MySQL配置源 public static class MysqlConfigSource extends RichSourceFunction<ConfigCollection> { private volatile boolean isRunning = true; private final long interval = TimeUnit.MINUTES.toMillis(5); @Override public void run(SourceContext<ConfigCollection> ctx) throws Exception { while (isRunning) { ConfigCollection newConfig = loadParams(); if (newConfig != null) { ctx.collect(newConfig); System.out.println("配置加载完成,检查点时间: " + new Date(newConfig.checkpointTime)); } else { System.out.println("配置加载失败"); } Thread.sleep(interval); } } private ConfigCollection loadParams() { Map<String, List<ULEParamConfig>> tagToConfigs = new HashMap<>(5000); Map<String, ULEParamConfig> encodeToConfig = new HashMap<>(5000); String url = "jdbc:mysql://10.51.37.73:3306/eps?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8"; String user = "root"; String password = "6CKIm5jDVsLrahSw"; String query = "SELECT F_tag AS tag, F_enCode AS encode, F_dataTypes AS datatype, " + "F_isConstantValue AS constantvalue, F_isOnline AS isonline, " + "F_isSync AS issync, F_syncParaEnCode AS syncparaencode, " + "F_isZero AS iszero, F_isHigh AS ishigh, F_highThreshold AS highthreshold, " + "F_isLow AS islow, F_lowThreshold AS lowthreshold, F_duration AS duration " + "FROM t_equipmentparameter " + "WHERE F_enabledmark = '1' AND (F_isConstantValue='1' OR F_isZero='1' " + "OR F_isHigh='1' OR F_isLow='1' OR F_isOnline='1' OR F_isSync='1')"; try (Connection conn = DriverManager.getConnection(url, user, password); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(query)) { while (rs.next()) { ULEParamConfig config = new ULEParamConfig(); config.tag = rs.getString("tag"); config.encode = rs.getString("encode"); config.datatype = rs.getString("datatype"); config.constantvalue = rs.getInt("constantvalue"); config.iszero = rs.getInt("iszero"); config.ishigh = rs.getInt("ishigh"); config.highthreshold = rs.getDouble("highthreshold"); config.islow = rs.getInt("islow"); config.lowthreshold = rs.getDouble("lowthreshold"); config.duration = rs.getLong("duration"); config.isonline = rs.getInt("isonline"); config.issync = rs.getInt("issync"); config.syncparaencode = rs.getString("syncparaencode"); if (config.encode == null || config.encode.isEmpty()) { System.err.println("忽略无效配置: 空encode"); continue; } String tag = config.tag; tagToConfigs.computeIfAbsent(tag, k -> new ArrayList<>(10)).add(config); encodeToConfig.put(config.encode, config); } System.out.println("加载配置: " + encodeToConfig.size() + " 个参数"); return new ConfigCollection(tagToConfigs, encodeToConfig); } catch (SQLException e) { System.err.println("加载参数配置错误:"); e.printStackTrace(); return null; } } @Override public void cancel() { isRunning = false; } } // 状态描述符 public static class Descriptors { public static final MapStateDescriptor<Void, ConfigCollection> configStateDescriptor = new MapStateDescriptor<>( "configState", TypeInformation.of(Void.class), TypeInformation.of(ConfigCollection.class) ); public static final MapStateDescriptor<String, Double> tagValuesDescriptor = new MapStateDescriptor<>( "tagValuesBroadcastState", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.DOUBLE_TYPE_INFO ); } // 重构后的异常检测函数(重点修复离线检测) public static class OptimizedAnomalyDetectionFunction extends KeyedBroadcastProcessFunction<String, JSONObject, Object, JSONObject> { public static final OutputTag<String> OFFLINE_CHECK_TAG = new OutputTag<String>("offline-check"){}; // 状态管理 private transient MapState<String, AnomalyState> stateMap; private transient MapState<String, Long> lastDataTimeMap; private transient MapState<String, Long> lastUpdateTimeState; // 最后更新时间(处理时间) private transient MapState<String, Long> processingTimerState; // 处理时间定时器状态 private transient SimpleDateFormat timeFormat; private transient long lastSyncLogTime = 0; @Override public void open(Configuration parameters) { StateTtlConfig ttlConfig = StateTtlConfig.newBuilder(Time.days(30)) .setUpdateType(StateTtlConfig.UpdateType.OnCreateAndWrite) .setStateVisibility(StateTtlConfig.StateVisibility.NeverReturnExpired) .cleanupFullSnapshot() .build(); // 异常状态存储 MapStateDescriptor<String, AnomalyState> stateDesc = new MapStateDescriptor<>( "anomalyState", BasicTypeInfo.STRING_TYPE_INFO, TypeInformation.of(AnomalyState.class) ); stateDesc.enableTimeToLive(ttlConfig); stateMap = getRuntimeContext().getMapState(stateDesc); // 最后数据时间存储(事件时间) MapStateDescriptor<String, Long> timeDesc = new MapStateDescriptor<>( "lastDataTimeState", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); timeDesc.enableTimeToLive(ttlConfig); lastDataTimeMap = getRuntimeContext().getMapState(timeDesc); // 最后更新时间状态(处理时间) MapStateDescriptor<String, Long> updateTimeDesc = new MapStateDescriptor<>( "lastUpdateTimeState", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); updateTimeDesc.enableTimeToLive(ttlConfig); lastUpdateTimeState = getRuntimeContext().getMapState(updateTimeDesc); // 处理时间定时器状态 MapStateDescriptor<String, Long> timerDesc = new MapStateDescriptor<>( "processingTimerState", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); timerDesc.enableTimeToLive(ttlConfig); processingTimerState = getRuntimeContext().getMapState(timerDesc); timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); } @Override public void processElement(JSONObject data, ReadOnlyContext ctx, Collector<JSONObject> out) throws Exception { String tag = ctx.getCurrentKey(); String timeStr = data.getString("time"); long eventTime = timeFormat.parse(timeStr).getTime(); long currentProcessingTime = System.currentTimeMillis(); // 更新最后数据时间(事件时间) lastDataTimeMap.put(tag, eventTime); // 更新最后处理时间(关键修改) lastUpdateTimeState.put(tag, currentProcessingTime); // 取消现有定时器(如有) Long existingTimer = processingTimerState.get(tag); if (existingTimer != null) { ctx.timerService().deleteProcessingTimeTimer(existingTimer); } // 获取广播配置 ConfigCollection configCollection = getBroadcastConfig(ctx); if (configCollection == null) return; List<ULEParamConfig> configs = configCollection.tagToConfigs.get(tag); if (configs == null || configs.isEmpty()) return; // 清理无效状态 List<String> keysToRemove = new ArrayList<>(); for (String encode : stateMap.keys()) { boolean found = false; for (ULEParamConfig cfg : configs) { if (cfg.encode.equals(encode)) { found = true; break; } } if (!found) { System.out.println("清理过期状态: " + encode); keysToRemove.add(encode); } } for (String encode : keysToRemove) { stateMap.remove(encode); } double value = 0; boolean valueSet = false; // 重置离线状态(数据到达表示恢复) for (ULEParamConfig config : configs) { if (config.isonline == 1) { AnomalyState state = getOrCreateState(config.encode); AnomalyStatus status = state.getStatus(6); if (status.reported) { reportAnomaly(6, 0, 0.0, timeStr, config, out); status.reset(); stateMap.put(config.encode, state); System.out.println("离线恢复: tag=" + tag + ", encode=" + config.encode); } } } // 注册新定时器(使用处理时间) long minDuration = getMinDuration(configs); if (minDuration != Long.MAX_VALUE) { long nextCheckTime = currentProcessingTime + minDuration * 60 * 1000; ctx.timerService().registerProcessingTimeTimer(nextCheckTime); processingTimerState.put(tag, nextCheckTime); } // 遍历配置项进行异常检测 for (ULEParamConfig config : configs) { if (!valueSet) { value = "436887485805570949".equals(config.datatype) ? data.getDouble("ontime") : data.getDouble("avg"); valueSet = true; } AnomalyState state = getOrCreateState(config.encode); // 处理异常类型 checkConstantValueAnomaly(config, value, timeStr, state, out); // 1. 恒值检测 checkZeroValueAnomaly(config, value, timeStr, state, out); // 2. 零值检测 checkThresholdAnomaly(config, value, timeStr, state, out); // 3. 上阈值, 4. 下阈值 checkSyncAnomaly(config, value, timeStr, state, configCollection, ctx, out); // 5. 同步检测 stateMap.put(config.encode, state); } } @Override public void onTimer(long timestamp, OnTimerContext ctx, Collector<JSONObject> out) throws Exception { String tag = ctx.getCurrentKey(); long currentTime = System.currentTimeMillis(); ConfigCollection configCollection = getBroadcastConfig(ctx); if (configCollection == null) return; List<ULEParamConfig> configs = configCollection.tagToConfigs.get(tag); if (configs == null) return; // 获取标签最后更新时间 Long lastUpdateTime = lastUpdateTimeState.get(tag); boolean hasOnlineConfig = false; long minDuration = Long.MAX_VALUE; for (ULEParamConfig config : configs) { if (config.isonline == 1) { hasOnlineConfig = true; minDuration = Math.min(minDuration, config.duration); AnomalyState state = getOrCreateState(config.encode); AnomalyStatus status = state.getStatus(6); // 检查是否超时 boolean isOffline = false; if (lastUpdateTime == null) { // 从未收到数据 Long initTime = state.getInitTime(); if (initTime == null) { initTime = configCollection.checkpointTime; state.setInitTime(initTime); } isOffline = (currentTime - initTime) >= config.duration * 60 * 1000; } else { // 已有数据但超时 isOffline = (currentTime - lastUpdateTime) >= config.duration * 60 * 1000; } if (isOffline) { if (!status.reported) { String triggerTime = timeFormat.format(new Date(currentTime)); reportAnomaly(6, 1, 0.0, triggerTime, config, out); status.reported = true; // 侧输出流日志 String message = lastUpdateTime == null ? String.format("离线异常(从未收到数据): tag=%s, encode=%s, 阈值=%d分钟", config.tag, config.encode, config.duration) : String.format("离线异常: tag=%s, encode=%s, 最后更新时间=%s, 当前时间=%s, 时间差=%.1f分钟 (阈值=%d分钟)", config.tag, config.encode, timeFormat.format(new Date(lastUpdateTime)), triggerTime, (currentTime - lastUpdateTime) / 60000.0, config.duration); ctx.output(OFFLINE_CHECK_TAG, message); System.out.println(message); } } else if (status.reported) { // 恢复在线状态 reportAnomaly(6, 0, 0.0, timeFormat.format(new Date()), config, out); status.reset(); System.out.println("离线恢复: tag=" + tag + ", encode=" + config.encode); } stateMap.put(config.encode, state); } } // 重新注册定时器(每分钟检查一次) if (hasOnlineConfig) { long nextCheckTime = currentTime + TimeUnit.MINUTES.toMillis(1); ctx.timerService().registerProcessingTimeTimer(nextCheckTime); processingTimerState.put(tag, nextCheckTime); } } // 辅助方法:获取最小duration private long getMinDuration(List<ULEParamConfig> configs) { long minDuration = Long.MAX_VALUE; for (ULEParamConfig config : configs) { if (config.isonline == 1) { minDuration = Math.min(minDuration, config.duration); } } return minDuration; } // 恒值检测 - 异常类型1 private void checkConstantValueAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector<JSONObject> out) { if (config.constantvalue != 1) return; try { AnomalyStatus status = state.getStatus(1); long durationThreshold = config.duration * 60 * 1000; Date timestamp = timeFormat.parse(timeStr); if (status.lastValue == null) { status.lastValue = currentValue; status.lastChangeTime = timestamp; return; } if (Math.abs(currentValue - status.lastValue) > 0.001) { status.lastValue = currentValue; status.lastChangeTime = timestamp; if (status.reported) { reportAnomaly(1, 0, currentValue, timeStr, config, out); } status.reset(); return; } long elapsed = timestamp.getTime() - status.lastChangeTime.getTime(); if (elapsed > durationThreshold) { if (!status.reported) { reportAnomaly(1, 1, currentValue, timeStr, config, out); status.reported = true; } } } catch (Exception e) { System.err.println("恒值检测错误: " + config.encode + " - " + e.getMessage()); } } // 零值检测 - 异常类型2 private void checkZeroValueAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector<JSONObject> out) { if (config.iszero != 1) return; try { AnomalyStatus status = state.getStatus(2); Date timestamp = timeFormat.parse(timeStr); boolean isZero = Math.abs(currentValue) < 0.001; if (isZero) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(2, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(2, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (Exception e) { System.err.println("零值检测错误: " + config.encode + " - " + e.getMessage()); } } // 阈值检测 - 异常类型3(上阈值)和4(下阈值) private void checkThresholdAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector<JSONObject> out) { try { if (config.ishigh == 1) { AnomalyStatus highStatus = state.getStatus(3); processThresholdAnomaly(highStatus, currentValue, timeStr, currentValue > config.highthreshold, config, 3, out); } if (config.islow == 1) { AnomalyStatus lowStatus = state.getStatus(4); processThresholdAnomaly(lowStatus, currentValue, timeStr, currentValue < config.lowthreshold, config, 4, out); } } catch (Exception e) { System.err.println("阈值检测错误: " + config.encode + " - " + e.getMessage()); } } private void processThresholdAnomaly(AnomalyStatus status, double currentValue, String timeStr, boolean isAnomaly, ULEParamConfig config, int anomalyType, Collector<JSONObject> out) { try { Date timestamp = timeFormat.parse(timeStr); if (isAnomaly) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(anomalyType, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(anomalyType, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (Exception e) { System.err.println("阈值处理错误:极速版 " + config.encode + " - " + e.getMessage()); } } // 同步检测 - 异常类型5(优化日志输出) private void checkSyncAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, ConfigCollection configCollection, ReadOnlyContext ctx, Collector<JSONObject> out) { if (config.issync != 1 || config.syncparaencode == null || config.syncparaencode.isEmpty()) { return; } try { // 通过encode获取关联配置 ULEParamConfig relatedConfig = configCollection.encodeToConfig.get(config.syncparaencode); if (relatedConfig == null) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.println("同步检测错误: 未找到关联配置, encode=" + config.syncparaencode); lastSyncLogTime = System.currentTimeMillis(); } return; } // 获取关联配置的tag String relatedTag = relatedConfig.tag; if (relatedTag == null || relatedTag.isEmpty()) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.println("同步检测错误: 关联配置没有tag, encode=" + config.syncparaencode); lastSyncLogTime = System.currentTimeMillis(); } return; } // 从广播状态获取关联值 ReadOnlyBroadcastState<String, Double> tagValuesState = ctx.getBroadcastState(Descriptors.tagValuesDescriptor); Double relatedValue = tagValuesState.get(relatedTag); if (relatedValue == null) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { // 优化日志:添加当前标签信息 System.out.printf("同步检测警告: 关联值未初始化 [主标签=%s(%s), 关联标签=%s(%s)]%n", config.tag, config.encode, relatedTag, config.syncparaencode); lastSyncLogTime = System.currentTimeMillis(); } return; } // 同步检测逻辑 AnomalyStatus status = state.getStatus(5); Date timestamp = timeFormat.parse(timeStr); // 业务逻辑:当前值接近1且关联值接近0时异常 boolean isAnomaly = (currentValue >= 0.99) && (Math.abs(relatedValue) < 0.01); // 日志记录 if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.printf("同步检测: %s (%.4f) vs %s (%.4f) -> %b%n", config.tag, currentValue, relatedTag, relatedValue, isAnomaly); lastSyncLogTime = System.currentTimeMillis(); } // 处理异常状态 if (isAnomaly) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(5, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(5, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (ParseException e) { System.err.println("同步检测时间解析错误: " + config.encode + " - " + e.getMessage()); } catch (Exception e) { System.err.println("同步检测错误: " + config.encode + " - " + e.getMessage()); } } // 报告异常(添加详细日志) private void reportAnomaly(int anomalyType, int statusFlag, double value, String time, ULEParamConfig config, Collector<JSONObject> out) { JSONObject event = new JSONObject(); event.put("tag", config.tag); event.put("paracode", config.encode); event.put("abnormaltype", anomalyType); event.put("statusflag", statusFlag); event.put("datavalue", value); event.put("triggertime", time); out.collect(event); // 添加详细日志输出 String statusDesc = statusFlag == 1 ? "异常开始" : "异常结束"; System.out.printf("报告异常: 类型=%d, 状态=%s, 标签=%s, 编码=%s, 时间=%s%n", anomalyType, statusDesc, config.tag, config.encode, time); } @Override public void processBroadcastElement(Object broadcastElement, Context ctx, Collector<JSONObject> out) throws Exception { // 处理配置更新 if (broadcastElement instanceof ConfigCollection) { ConfigCollection newConfig = (ConfigCollection) broadcastElement; BroadcastState<Void, ConfigCollection> configState = ctx.getBroadcastState(Descriptors.configStateDescriptor); // 获取旧配置 ConfigCollection oldConfig = configState.get(null); // 处理配置变更:清理不再启用的报警 if (oldConfig != null) { for (Map.Entry<String, ULEParamConfig> entry : oldConfig.encodeToConfig.entrySet()) { String encode = entry.getKey(); ULEParamConfig oldCfg = entry.getValue(); ULEParamConfig newCfg = newConfig.encodeToConfig.get(encode); if (newCfg == null || !isAlarmEnabled(newCfg, oldCfg)) { // 发送恢复事件 sendRecoveryEvents(encode, oldCfg, ctx, out); } } } // 更新广播状态 configState.put(null, newConfig); System.out.println("广播配置更新完成, 配置项: " + newConfig.encodeToConfig); } // 处理标签值更新 else if (broadcastElement instanceof Map) { @SuppressWarnings("unchecked") Map<String, Object> tagValue = (Map<String, Object>) broadcastElement; String tag = (String) tagValue.get("tag"); Double value = (Double) tagValue.get("value"); if (tag != null && value != null) { BroadcastState<String, Double> tagValuesState = ctx.getBroadcastState(Descriptors.tagValuesDescriptor); tagValuesState.put(tag, value); } } } // 检查报警是否启用 private boolean isAlarmEnabled(ULEParamConfig newCfg, ULEParamConfig oldCfg) { return (oldCfg.constantvalue == 1 && newCfg.constantvalue == 1) || (oldCfg.iszero == 1 && newCfg.iszero == 1) || (oldCfg.ishigh == 1 && newCfg.ishigh == 1) || (oldCfg.islow == 1 && newCfg.islow == 1) || (oldCfg.isonline == 1 && newCfg.isonline == 1) || (oldCfg.issync == 1 && newCfg.issync == 1); } // 发送恢复事件 private void sendRecoveryEvents(String encode, ULEParamConfig config, Context ctx, Collector<JSONObject> out) { try { AnomalyState state = stateMap.get(encode); if (state == null) return; // 遍历所有可能的报警类型 for (int type = 1; type <= 6; type++) { AnomalyStatus status = state.getStatus(type); if (status.reported) { JSONObject recoveryEvent = new JSONObject(); recoveryEvent.put("tag", config.tag); recoveryEvent.put("paracode", config.encode); recoveryEvent.put("abnormaltype", type); recoveryEvent.put("statusflag", 0); // 恢复事件 recoveryEvent.put("datavalue", 0.0); recoveryEvent.put("triggertime", timeFormat.format(new Date())); out.collect(recoveryEvent); System.out.println("发送恢复事件: 类型=" + type + ", 标签=" + config.tag); status.reset(); } } // 更新状态 stateMap.put(encode, state); } catch (Exception e) { System.err.println("发送恢复事件失败: " + e.getMessage()); } } // 辅助方法 private ConfigCollection getBroadcastConfig(ReadOnlyContext ctx) throws Exception { return ctx.getBroadcastState(Descriptors.configStateDescriptor).get(null); } private AnomalyState getOrCreateState(String encode) throws Exception { AnomalyState state = stateMap.get(encode); if (state == null) { state = new AnomalyState(); } return state; } } // 异常状态类(新增initTime字段) public static class AnomalyState implements Serializable { private static final long serialVersionUID = 1L; private final Map<Integer, AnomalyStatus> statusMap = new HashMap<>(); private Long initTime; // 初始化时间(用于从未收到数据的检测) public AnomalyStatus getStatus(int type) { return statusMap.computeIfAbsent(type, k -> new AnomalyStatus()); } public Long getInitTime() { return initTime; } public void setInitTime(Long initTime) { this.initTime = initTime; } } // 异常状态详情(保持不变) public static class AnomalyStatus implements Serializable { private static final long serialVersionUID = 1L; public Date startTime; // 异常开始时间 public Double lastValue; // 用于恒值检测 public Date lastChangeTime; // 值最后变化时间 public boolean reported; // 是否已报告 public void reset() { startTime = null; lastValue = null; lastChangeTime = null; reported = false; } } } 运行日志为:“C:\Program Files (x86)\Java\jdk1.8.0_102\bin\java.exe” -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:24763,suspend=y,server=n -javaagent:C:\Users\Administrator\AppData\Local\JetBrains\IntelliJIdea2021.2\captureAgent\debugger-agent.jar=file:/C:/Users/Administrator/AppData/Local/Temp/capture.props -Dfile.encoding=UTF-8 -classpath C:\Users\Administrator\AppData\Local\Temp\classpath1582414257.jar com.tongchuang.realtime.mds.ULEDataanomalyanalysis 已连接到目标 VM, 地址: ‘‘127.0.0.1:24763’,传输: ‘套接字’’ SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/F:/flink/flinkmaven/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.10.0/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/F:/flink/flinkmaven/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] 加载配置: 30 个参数 配置加载完成,检查点时间: Wed Aug 06 08:59:30 CST 2025 广播配置更新完成, 配置项: {EP000015=ULEParamConfig(tag=DA-LT-6BT005, encode=EP000015, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000014=ULEParamConfig(tag=DA_DB195_RH_R_0281, encode=EP000014, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000013=ULEParamConfig(tag=DA-LT-6BT008, encode=EP000013, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000012=ULEParamConfig(tag=DA-LT-6BT004, encode=EP000012, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000011=ULEParamConfig(tag=DA-LT-6BT005, encode=EP000011, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000010=ULEParamConfig(tag=DA-LT-6BT001, encode=EP000010, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100013=ULEParamConfig(tag=DA-LT-6BT008, encode=EP100013, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100014=ULEParamConfig(tag=DA_DB195_RH_R_0281, encode=EP100014, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000019=ULEParamConfig(tag=DA-LT-5BT0005, encode=EP000019, datatype=436887248101780357, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000018=ULEParamConfig(tag=DA-LT-4BT0004, encode=EP000018, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100010=ULEParamConfig(tag=DA-LT-6BT001, encode=EP100010, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000017=ULEParamConfig(tag=DA-LT-4BT0005, encode=EP000017, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100011=ULEParamConfig(tag=DA-LT-6BT005, encode=EP100011, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000016=ULEParamConfig(tag=DA-LT-6BT004, encode=EP000016, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100012=ULEParamConfig(tag=DA-LT-6BT004, encode=EP100012, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000004=ULEParamConfig(tag=DA-LT-4BT0004, encode=EP000004, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000003=ULEParamConfig(tag=DA-LT-4BT0008, encode=EP000003, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000002=ULEParamConfig(tag=DA-LT-4BT0001, encode=EP000002, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000001=ULEParamConfig(tag=DA-DB195-RH-B-0201, encode=EP000001, datatype=436887485805570949, constantvalue=1, iszero=1, isonline=1, issync=1, syncparaencode=EP000022, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000022=ULEParamConfig(tag=DA-LT-4BT0007, encode=EP000022, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000021=ULEParamConfig(tag=DA-LT-6BT008, encode=EP000021, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100007=ULEParamConfig(tag=DA-LT-5BT0005, encode=EP100007, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000020=ULEParamConfig(tag=DA-LT-6BT005, encode=EP000020, datatype=436887248101780357, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100008=ULEParamConfig(tag=DA-LT-5BT0005, encode=EP100008, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100009=ULEParamConfig(tag=DA-LT-5BT0008, encode=EP100009, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000009=ULEParamConfig(tag=DA-LT-5BT0008, encode=EP000009, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000008=ULEParamConfig(tag=DA-LT-5BT0004, encode=EP000008, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000007=ULEParamConfig(tag=DA-LT-5BT0004, encode=EP000007, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000006=ULEParamConfig(tag=DA-LT-5BT0001, encode=EP000006, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000005=ULEParamConfig(tag=DA-LT-4BT0005, encode=EP000005, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3)} 分钟数据流> {“times”:“2025-08-06 08:59”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3064.1802,“avg”:3067.4769,“min”:3020.7207,“max”:3103.9932},“DA-LT-6BT008”:{“ontime”:182.8847,“avg”:181.7926,“min”:180.9806,“max”:182.8847},“DA-LT-5BT0005”:{“ontime”:402.42,“avg”:403.339,“min”:402.42,“max”:404.28},“DA-LT-6BT004”:{“ontime”:1216.4056,“avg”:1216.0174,“min”:1215.5714,“max”:1216.439},“DA-LT-5BT0004”:{“ontime”:1195.0,“avg”:1196.3017,“min”:1194.8,“max”:1197.9},“DA-LT-6BT005”:{“ontime”:401.5108,“avg”:400.6736,“min”:399.7049,“max”:401.5108},“DA-LT-5BT0008”:{“ontime”:184.3,“avg”:185.3683,“min”:184.3,“max”:185.9},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:146.1625,“avg”:145.9867,“min”:144.8875,“max”:149.0875},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.0,“min”:1209.0,“max”:1209.0},“DA-LT-6BT001”:{“ontime”:178349.86,“avg”:178462.2957,“min”:176977.33,“max”:179571.25},“DA-NY-LG2ZL-2-003”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0005”:{“ontime”:316.5625,“avg”:315.4229,“min”:313.6875,“max”:318.6875},“DA_DB195_RH_R_0281”:{“ontime”:333.94,“avg”:345.6455,“min”:307.85,“max”:393.92},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:115738.414,“avg”:116529.9705,“min”:114829.37,“max”:117957.84}}} 同步检测警告: 关联值未初始化 [主标签=DA-DB195-RH-B-0201(EP000001), 关联标签=DA-LT-4BT0007(EP000022)] 分钟数据流> {“times”:“2025-08-06 09:00”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3070.2063,“avg”:3069.2265,“min”:3027.1624,“max”:3147.2275},“DA-LT-6BT008”:{“ontime”:181.1966,“avg”:183.026,“min”:181.1966,“max”:185.5542},“DA-LT-5BT0005”:{“ontime”:404.34,“avg”:404.731,“min”:404.28,“max”:405.06},“DA-LT-6BT004”:{“ontime”:1215.5381,“avg”:1215.0252,“min”:1214.4702,“max”:1215.6382},“DA-LT-5BT0004”:{“ontime”:1197.9,“avg”:1199.1767,“min”:1197.9,“max”:1200.3},“DA-LT-6BT005”:{“ontime”:399.8423,“avg”:400.2738,“min”:399.0375,“max”:402.0015},“DA-LT-5BT0008”:{“ontime”:185.94,“avg”:186.4097,“min”:185.94,“max”:186.7},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:145.1375,“avg”:145.8042,“min”:144.075,“max”:148.1625},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.0,“min”:1209.0,“max”:1209.0},“DA-LT-6BT001”:{“ontime”:178488.16,“avg”:178323.2988,“min”:177415.97,“max”:179328.48},“DA-LT-4BT0005”:{“ontime”:313.9375,“avg”:315.1292,“min”:313.8125,“max”:317.5625},“DA-NY-LG2ZL-2-003”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA_DB195_RH_R_0281”:{“ontime”:334.58,“avg”:337.786,“min”:311.45,“max”:367.58},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:117321.32,“avg”:116257.2892,“min”:115314.13,“max”:117696.305},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 同步检测警告: 关联值未初始化 [主标签=DA-DB195-RH-B-0201(EP000001), 关联标签=DA-LT-4BT0007(EP000022)] 分钟数据流> {“times”:“2025-08-06 09:01”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3094.005,“avg”:3066.9,“min”:3017.5212,“max”:3141.851},“DA-LT-6BT008”:{“ontime”:185.6327,“avg”:186.4932,“min”:185.5542,“max”:187.1049},“DA-LT-5BT0005”:{“ontime”:404.4,“avg”:402.804,“min”:401.04,“max”:404.4},“DA-LT-6BT004”:{“ontime”:1214.5369,“avg”:1213.9847,“min”:1213.4358,“max”:1214.5369},“DA-LT-5BT0004”:{“ontime”:1199.9,“avg”:1200.7833,“min”:1199.9,“max”:1201.6},“DA-LT-6BT005”:{“ontime”:402.1193,“avg”:403.8882,“min”:402.1193,“max”:405.4562},“DA-LT-5BT0008”:{“ontime”:186.56,“avg”:186.504,“min”:184.82,“max”:187.7},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:143.8125,“avg”:144.5035,“min”:143.475,“max”:145.3625},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.0,“min”:1209.0,“max”:1209.0},“DA-LT-6BT001”:{“ontime”:178296.28,“avg”:177633.015,“min”:176934.88,“max”:178406.75},“DA-NY-LG2ZL-2-003”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0005”:{“ontime”:314.3125,“avg”:314.1802,“min”:313.625,“max”:314.9375},“DA_DB195_RH_R_0281”:{“ontime”:336.73,“avg”:335.9752,“min”:293.96,“max”:361.86},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:117313.79,“avg”:116876.3563,“min”:115721.56,“max”:117964.16},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 同步检测警告: 关联值未初始化 [主标签=DA-DB195-RH-B-0201(EP000001), 关联标签=DA-LT-4BT0007(EP000022)] 分钟数据流> {“times”:“2025-08-06 09:02”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3083.3037,“avg”:3060.3783,“min”:3005.7114,“max”:3103.624},“DA-LT-6BT008”:{“ontime”:186.2216,“avg”:186.0545,“min”:185.5346,“max”:186.3983},“DA-LT-5BT0005”:{“ontime”:401.04,“avg”:399.802,“min”:399.3,“max”:401.04},“DA-LT-6BT004”:{“ontime”:1213.4358,“avg”:1212.9452,“min”:1212.4012,“max”:1213.5359},“DA-LT-5BT0004”:{“ontime”:1201.6,“avg”:1203.3484,“min”:1201.6,“max”:1204.9},“DA-LT-6BT005”:{“ontime”:405.5151,“avg”:405.8665,“min”:405.5151,“max”:406.0451},“DA-LT-5BT0008”:{“ontime”:187.56,“avg”:185.292,“min”:183.66,“max”:187.56},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:144.925,“avg”:146.3315,“min”:144.9,“max”:149.075},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.0167,“min”:1209.0,“max”:1210.0},“DA-LT-6BT001”:{“ontime”:176681.73,“avg”:177170.773,“min”:176415.9,“max”:178256.67},“DA-NY-LG2ZL-2-003”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0005”:{“ontime”:314.125,“avg”:313.9531,“min”:312.875,“max”:315.875},“DA_DB195_RH_R_0281”:{“ontime”:322.99,“avg”:335.8693,“min”:312.07,“max”:393.37},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:116846.76,“avg”:117260.9993,“min”:116176.56,“max”:118419.29},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 异常检测结果> {“abnormaltype”:3,“paracode”:“EP100010”,“datavalue”:177170.773,“tag”:“DA-LT-6BT001”,“triggertime”:“2025-08-06 09:02”,“statusflag”:1} 报告异常: 类型=3, 状态=异常开始, 标签=DA-LT-6BT001, 编码=EP100010, 时间=2025-08-06 09:02 异常检测结果> {“abnormaltype”:3,“paracode”:“EP000010”,“datavalue”:177170.773,“tag”:“DA-LT-6BT001”,“triggertime”:“2025-08-06 09:02”,“statusflag”:1} 报告异常: 类型=3, 状态=异常开始, 标签=DA-LT-6BT001, 编码=EP000010, 时间=2025-08-06 09:02 异常检测结果> {“abnormaltype”:3,“paracode”:“EP000002”,“datavalue”:117260.9993,“tag”:“DA-LT-4BT0001”,“triggertime”:“2025-08-06 09:02”,“statusflag”:1} 报告异常: 类型=3, 状态=异常开始, 标签=DA-LT-4BT0001, 编码=EP000002, 时间=2025-08-06 09:02 异常检测结果> {“abnormaltype”:4,“paracode”:“EP000001”,“datavalue”:1.0,“tag”:“DA-DB195-RH-B-0201”,“triggertime”:“2025-08-06 09:02”,“statusflag”:1} 报告异常: 类型=4, 状态=异常开始, 标签=DA-DB195-RH-B-0201, 编码=EP000001, 时间=2025-08-06 09:02 分钟数据流> {“times”:“2025-08-06 09:03”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3027.0603,“avg”:3059.1179,“min”:2999.651,“max”:3113.997},“DA-LT-6BT008”:{“ontime”:186.359,“avg”:185.849,“min”:184.1802,“max”:187.0461},“DA-LT-5BT0005”:{“ontime”:399.78,“avg”:400.624,“min”:399.78,“max”:401.4},“DA-LT-6BT004”:{“ontime”:1212.4347,“avg”:1211.9953,“min”:1211.6671,“max”:1212.468},“DA-LT-5BT0004”:{“ontime”:1204.9,“avg”:1206.05,“min”:1204.9,“max”:1207.0},“DA-LT-6BT005”:{“ontime”:405.8684,“avg”:404.3949,“min”:402.8652,“max”:405.8684},“DA-LT-5BT0008”:{“ontime”:183.7,“avg”:183.3153,“min”:182.34,“max”:184.44},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:145.975,“avg”:146.1125,“min”:145.3125,“max”:147.1625},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.15,“min”:1209.0,“max”:1210.0},“DA-LT-6BT001”:{“ontime”:177278.47,“avg”:178191.3243,“min”:177278.47,“max”:179240.23},“DA-LT-4BT0005”:{“ontime”:313.875,“avg”:314.3042,“min”:313.5625,“max”:315.1875},“DA-NY-LG2ZL-2-003”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA_DB195_RH_R_0281”:{“ontime”:380.65,“avg”:344.1003,“min”:320.36,“max”:380.65},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:116501.67,“avg”:116541.2536,“min”:115593.18,“max”:117664.38},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 异常检测结果> {“abnormaltype”:1,“paracode”:“EP000001”,“datavalue”:1.0,“tag”:“DA-DB195-RH-B-0201”,“triggertime”:“2025-08-06 09:03”,“statusflag”:1} 报告异常: 类型=1, 状态=异常开始, 标签=DA-DB195-RH-B-0201, 编码=EP000001, 时间=2025-08-06 09:03 同步检测警告: 关联值未初始化 [主标签=DA-DB195-RH-B-0201(EP000001), 关联标签=DA-LT-4BT0007(EP000022)] 加载配置: 30 个参数 配置加载完成,检查点时间: Wed Aug 06 09:04:31 CST 2025 广播配置更新完成, 配置项: {EP000015=ULEParamConfig(tag=DA-LT-6BT005, encode=EP000015, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000014=ULEParamConfig(tag=DA_DB195_RH_R_0281, encode=EP000014, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000013=ULEParamConfig(tag=DA-LT-6BT008, encode=EP000013, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000012=ULEParamConfig(tag=DA-LT-6BT004, encode=EP000012, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000011=ULEParamConfig(tag=DA-LT-6BT005, encode=EP000011, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000010=ULEParamConfig(tag=DA-LT-6BT001, encode=EP000010, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100013=ULEParamConfig(tag=DA-LT-6BT008, encode=EP100013, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100014=ULEParamConfig(tag=DA_DB195_RH_R_0281, encode=EP100014, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000019=ULEParamConfig(tag=DA-LT-5BT0005, encode=EP000019, datatype=436887248101780357, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000018=ULEParamConfig(tag=DA-LT-4BT0004, encode=EP000018, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100010=ULEParamConfig(tag=DA-LT-6BT001, encode=EP100010, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000017=ULEParamConfig(tag=DA-LT-4BT0005, encode=EP000017, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100011=ULEParamConfig(tag=DA-LT-6BT005, encode=EP100011, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000016=ULEParamConfig(tag=DA-LT-6BT004, encode=EP000016, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100012=ULEParamConfig(tag=DA-LT-6BT004, encode=EP100012, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000004=ULEParamConfig(tag=DA-LT-4BT0004, encode=EP000004, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000003=ULEParamConfig(tag=DA-LT-4BT0008, encode=EP000003, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000002=ULEParamConfig(tag=DA-LT-4BT0001, encode=EP000002, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000001=ULEParamConfig(tag=DA-DB195-RH-B-0201, encode=EP000001, datatype=436887485805570949, constantvalue=1, iszero=1, isonline=1, issync=1, syncparaencode=EP000022, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000022=ULEParamConfig(tag=DA-LT-4BT0007, encode=EP000022, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000021=ULEParamConfig(tag=DA-LT-6BT008, encode=EP000021, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100007=ULEParamConfig(tag=DA-LT-5BT0005, encode=EP100007, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000020=ULEParamConfig(tag=DA-LT-6BT005, encode=EP000020, datatype=436887248101780357, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100008=ULEParamConfig(tag=DA-LT-5BT0005, encode=EP100008, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP100009=ULEParamConfig(tag=DA-LT-5BT0008, encode=EP100009, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000009=ULEParamConfig(tag=DA-LT-5BT0008, encode=EP000009, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000008=ULEParamConfig(tag=DA-LT-5BT0004, encode=EP000008, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000007=ULEParamConfig(tag=DA-LT-5BT0004, encode=EP000007, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000006=ULEParamConfig(tag=DA-LT-5BT0001, encode=EP000006, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3), EP000005=ULEParamConfig(tag=DA-LT-4BT0005, encode=EP000005, datatype=436887289021410181, constantvalue=1, iszero=1, isonline=1, issync=0, syncparaencode=, ishigh=1, highthreshold=10000.0, islow=1, lowthreshold=10.0, duration=3)} 分钟数据流> {“times”:“2025-08-06 09:04”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3100.3306,“avg”:3065.7876,“min”:3011.8132,“max”:3125.8328},“DA-LT-6BT008”:{“ontime”:184.0428,“avg”:183.2953,“min”:181.8443,“max”:184.0821},“DA-LT-5BT0005”:{“ontime”:401.4,“avg”:402.458,“min”:401.4,“max”:403.62},“DA-LT-6BT004”:{“ontime”:1211.7339,“avg”:1211.5092,“min”:1211.3668,“max”:1211.7673},“DA-LT-5BT0004”:{“ontime”:1207.1,“avg”:1208.885,“min”:1207.1,“max”:1210.6},“DA-LT-6BT005”:{“ontime”:402.7474,“avg”:401.5958,“min”:400.9022,“max”:402.7474},“DA-LT-5BT0008”:{“ontime”:184.36,“avg”:184.4267,“min”:183.92,“max”:186.34},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:148.8875,“avg”:145.5819,“min”:144.6125,“max”:148.8875},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.0,“min”:1209.0,“max”:1209.0},“DA-LT-6BT001”:{“ontime”:178735.3,“avg”:178495.8288,“min”:177315.8,“max”:179603.86},“DA-NY-LG2ZL-2-003”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0005”:{“ontime”:318.1875,“avg”:314.7302,“min”:313.9375,“max”:318.1875},“DA_DB195_RH_R_0281”:{“ontime”:345.1,“avg”:344.8548,“min”:305.45,“max”:374.1},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:116909.22,“avg”:116579.9132,“min”:115389.78,“max”:117707.77}}} 同步检测警告: 关联值未初始化 [主标签=DA-DB195-RH-B-0201(EP000001), 关联标签=DA-LT-4BT0007(EP000022)]。需完善内容,1、所有异常发生时间应为实际异常出现的开始时间,不应为加duration后的时间;2、DA-LT-4BT0007离线监测未实现。
最新发布
08-07
G:\jdk\bin\java.exe -Dspring.application.name=ecust-custom-api-li -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:G:\2025.1\IntelliJ IDEA 2025.1\lib\idea_rt.jar=57297" -Dfile.encoding=UTF-8 -classpath C:\Users\Administrator\AppData\Local\Temp\classpath1806507909.jar com.ruoyi.customApi.OuchnCustomApiApplication 19:35:23.819 [background-preinit] INFO o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.3.Final 19:35:24.037 [main] INFO c.u.j.c.EnableEncryptablePropertiesBeanFactoryPostProcessor - [postProcessBeanFactory,40] - Post-processing PropertySource instances 19:35:24.038 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,76] - Skipping PropertySource configurationProperties [class org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource 19:35:24.039 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource bootstrap [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper 19:35:24.039 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper 19:35:24.040 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper 19:35:24.041 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper 19:35:24.042 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource cachedrandom [org.springframework.cloud.util.random.CachedRandomPropertySource] to EncryptablePropertySourceWrapper 19:35:24.042 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource springCloudClientHostInfo [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper 19:35:24.042 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource Config resource 'class path resource [bootstrap.yml]' via location 'optional:classpath:/' [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper 19:35:24.066 [main] INFO c.u.j.f.DefaultLazyPropertyFilter - [lambda$new$2,31] - Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter 19:35:24.072 [main] INFO c.u.j.r.DefaultLazyPropertyResolver - [lambda$new$2,35] - Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver 19:35:24.073 [main] INFO c.u.j.d.DefaultLazyPropertyDetector - [lambda$new$2,35] - Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector Spring Boot Version: 2.6.6 Spring Application Name: ecust-custom-api-li _ _ (_) | | _ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___ | '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ | | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | | |_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_| __/ | __/ | |___/ |___/ 19:35:24.379 [main] INFO c.a.n.c.r.client - [lambda$createClient$0,80] - [RpcClientFactory] create a new rpc client of 5878d075-8e6b-4c44-b13a-dd20288ab154_config-0 19:35:24.403 [main] INFO o.r.Reflections - [scan,232] - Reflections took 16 ms to scan 1 urls, producing 3 keys and 6 values 19:35:24.418 [main] INFO o.r.Reflections - [scan,232] - Reflections took 8 ms to scan 1 urls, producing 4 keys and 9 values 19:35:24.425 [main] INFO o.r.Reflections - [scan,232] - Reflections took 6 ms to scan 1 urls, producing 3 keys and 10 values 19:35:24.434 [main] INFO o.r.Reflections - [scan,232] - Reflections took 7 ms to scan 14 urls, producing 0 keys and 0 values 19:35:24.441 [main] INFO o.r.Reflections - [scan,232] - Reflections took 6 ms to scan 1 urls, producing 1 keys and 5 values 19:35:24.448 [main] INFO o.r.Reflections - [scan,232] - Reflections took 6 ms to scan 1 urls, producing 1 keys and 7 values 19:35:24.456 [main] INFO o.r.Reflections - [scan,232] - Reflections took 6 ms to scan 1 urls, producing 2 keys and 8 values 19:35:24.466 [main] INFO o.r.Reflections - [scan,232] - Reflections took 9 ms to scan 14 urls, producing 0 keys and 0 values 19:35:24.467 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] RpcClient init label, labels = {module=config, Vipserver-Tag=null, source=sdk, Amory-Tag=null, Location-Tag=null, taskId=0, AppName=unknown} 19:35:24.467 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$382/1412656257 19:35:24.468 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$383/358019805 19:35:24.468 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1 19:35:24.468 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2 19:35:24.474 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] Try to connect to server on start up, server: {serverIp = '124.133.23.84', server main port = 18848} 19:35:25.018 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] Success to connect to server [124.133.23.84:18848] on start up, connectionId = 1751283325020_192.168.1.189_57540 19:35:25.018 [com.alibaba.nacos.client.remote.worker] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] Notify connected event to listeners. 19:35:25.019 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler 19:35:25.019 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,60] - [5878d075-8e6b-4c44-b13a-dd20288ab154_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda$391/193625667 19:35:25.045 [main] ERROR c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,101] - get data from Nacos error,dataId:application-dev.yml com.alibaba.nacos.api.exception.NacosException: http error, code=403,msg=authorization failed!,dataId=application-dev.yml,group=DEFAULT_GROUP,tenant=lichao at com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient.queryConfig(ClientWorker.java:979) at com.alibaba.nacos.client.config.impl.ClientWorker.getServerConfig(ClientWorker.java:397) at com.alibaba.nacos.client.config.NacosConfigService.getConfigInner(NacosConfigService.java:166) at com.alibaba.nacos.client.config.NacosConfigService.getConfig(NacosConfigService.java:94) at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.loadNacosData(NacosPropertySourceBuilder.java:85) at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.build(NacosPropertySourceBuilder.java:73) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosPropertySource(NacosPropertySourceLocator.java:199) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosDataIfPresent(NacosPropertySourceLocator.java:186) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosConfiguration(NacosPropertySourceLocator.java:158) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadSharedConfiguration(NacosPropertySourceLocator.java:116) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:101) at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:51) at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47) at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:95) at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:613) at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:381) at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) at com.ruoyi.customApi.OuchnCustomApiApplication.main(OuchnCustomApiApplication.java:33) 19:35:25.049 [main] ERROR c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,101] - get data from Nacos error,dataId:ecust-custom-api com.alibaba.nacos.api.exception.NacosException: http error, code=403,msg=authorization failed!,dataId=ecust-custom-api,group=DEFAULT_GROUP,tenant=lichao at com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient.queryConfig(ClientWorker.java:979) at com.alibaba.nacos.client.config.impl.ClientWorker.getServerConfig(ClientWorker.java:397) at com.alibaba.nacos.client.config.NacosConfigService.getConfigInner(NacosConfigService.java:166) at com.alibaba.nacos.client.config.NacosConfigService.getConfig(NacosConfigService.java:94) at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.loadNacosData(NacosPropertySourceBuilder.java:85) at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.build(NacosPropertySourceBuilder.java:73) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosPropertySource(NacosPropertySourceLocator.java:199) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosDataIfPresent(NacosPropertySourceLocator.java:186) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadApplicationConfiguration(NacosPropertySourceLocator.java:141) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:103) at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:51) at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47) at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:95) at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:613) at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:381) at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) at com.ruoyi.customApi.OuchnCustomApiApplication.main(OuchnCustomApiApplication.java:33) 19:35:25.052 [main] ERROR c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,101] - get data from Nacos error,dataId:ecust-custom-api.yml com.alibaba.nacos.api.exception.NacosException: http error, code=403,msg=authorization failed!,dataId=ecust-custom-api.yml,group=DEFAULT_GROUP,tenant=lichao at com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient.queryConfig(ClientWorker.java:979) at com.alibaba.nacos.client.config.impl.ClientWorker.getServerConfig(ClientWorker.java:397) at com.alibaba.nacos.client.config.NacosConfigService.getConfigInner(NacosConfigService.java:166) at com.alibaba.nacos.client.config.NacosConfigService.getConfig(NacosConfigService.java:94) at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.loadNacosData(NacosPropertySourceBuilder.java:85) at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.build(NacosPropertySourceBuilder.java:73) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosPropertySource(NacosPropertySourceLocator.java:199) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosDataIfPresent(NacosPropertySourceLocator.java:186) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadApplicationConfiguration(NacosPropertySourceLocator.java:144) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:103) at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:51) at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47) at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:95) at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:613) at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:381) at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) at com.ruoyi.customApi.OuchnCustomApiApplication.main(OuchnCustomApiApplication.java:33) 19:35:25.055 [main] ERROR c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,101] - get data from Nacos error,dataId:ecust-custom-api-dev.yml com.alibaba.nacos.api.exception.NacosException: http error, code=403,msg=authorization failed!,dataId=ecust-custom-api-dev.yml,group=DEFAULT_GROUP,tenant=lichao at com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient.queryConfig(ClientWorker.java:979) at com.alibaba.nacos.client.config.impl.ClientWorker.getServerConfig(ClientWorker.java:397) at com.alibaba.nacos.client.config.NacosConfigService.getConfigInner(NacosConfigService.java:166) at com.alibaba.nacos.client.config.NacosConfigService.getConfig(NacosConfigService.java:94) at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.loadNacosData(NacosPropertySourceBuilder.java:85) at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.build(NacosPropertySourceBuilder.java:73) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosPropertySource(NacosPropertySourceLocator.java:199) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosDataIfPresent(NacosPropertySourceLocator.java:186) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadApplicationConfiguration(NacosPropertySourceLocator.java:149) at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:103) at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:51) at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47) at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:95) at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:613) at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:381) at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) at com.ruoyi.customApi.OuchnCustomApiApplication.main(OuchnCustomApiApplication.java:33) 19:35:25.059 [main] INFO c.r.c.OuchnCustomApiApplication - [logStartupProfileInfo,646] - The following 1 profile is active: "dev" 19:35:26.379 [main] INFO c.u.j.c.EnableEncryptablePropertiesBeanFactoryPostProcessor - [postProcessBeanFactory,40] - Post-processing PropertySource instances 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource bootstrapProperties-ecust-custom-api-dev.yml,DEFAULT_GROUP [org.springframework.cloud.bootstrap.config.BootstrapPropertySource] to EncryptableEnumerablePropertySourceWrapper 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource bootstrapProperties-ecust-custom-api.yml,DEFAULT_GROUP [org.springframework.cloud.bootstrap.config.BootstrapPropertySource] to EncryptableEnumerablePropertySourceWrapper 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource bootstrapProperties-ecust-custom-api,DEFAULT_GROUP [org.springframework.cloud.bootstrap.config.BootstrapPropertySource] to EncryptableEnumerablePropertySourceWrapper 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource bootstrapProperties-application-dev.yml,DEFAULT_GROUP [org.springframework.cloud.bootstrap.config.BootstrapPropertySource] to EncryptableEnumerablePropertySourceWrapper 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,76] - Skipping PropertySource configurationProperties [class org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,76] - Skipping PropertySource servletConfigInitParams [class org.springframework.core.env.PropertySource$StubPropertySource 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,76] - Skipping PropertySource servletContextInitParams [class org.springframework.core.env.PropertySource$StubPropertySource 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource cachedrandom [org.springframework.cloud.util.random.CachedRandomPropertySource] to EncryptablePropertySourceWrapper 19:35:26.380 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource springCloudClientHostInfo [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper 19:35:26.381 [main] INFO c.u.j.EncryptablePropertySourceConverter - [makeEncryptable,81] - Converting PropertySource springCloudDefaultProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper 19:35:26.469 [main] INFO i.s.s.b.a.SeataAutoConfiguration - [globalTransactionScanner,65] - Automatically configure Seata 19:35:26.469 [main] INFO c.u.j.f.DefaultLazyPropertyFilter - [lambda$new$2,31] - Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter 19:35:26.474 [main] INFO c.u.j.r.DefaultLazyPropertyResolver - [lambda$new$2,35] - Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver 19:35:26.474 [main] INFO c.u.j.d.DefaultLazyPropertyDetector - [lambda$new$2,35] - Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector 19:35:26.500 [main] INFO i.s.c.ConfigurationFactory - [<clinit>,65] - load Configuration:FileConfiguration$$EnhancerByCGLIB$$862af1eb 19:35:26.507 [main] INFO i.s.c.ConfigurationFactory - [buildConfiguration,123] - load Configuration:FileConfiguration$$EnhancerByCGLIB$$862af1eb 19:35:26.542 [main] INFO i.s.s.a.GlobalTransactionScanner - [initClient,164] - Initializing Global Transaction Clients ... 19:35:26.582 [main] INFO i.s.c.r.n.NettyClientBootstrap - [start,147] - NettyClientBootstrap has started 19:35:26.582 [main] INFO i.s.s.a.GlobalTransactionScanner - [initClient,172] - Transaction Manager Client is initialized. applicationId[ecust-custom-api-li] txServiceGroup[ecust-custom-api-li-seata-service-group] 19:35:26.594 [main] INFO i.s.r.d.AsyncWorker - [init,125] - Async Commit Buffer Limit: 10000 19:35:26.595 [main] INFO i.s.r.d.x.ResourceManagerXA - [init,40] - ResourceManagerXA init ... 19:35:26.599 [main] INFO i.s.c.r.n.NettyClientBootstrap - [start,147] - NettyClientBootstrap has started 19:35:26.599 [main] INFO i.s.s.a.GlobalTransactionScanner - [initClient,177] - Resource Manager is initialized. applicationId[ecust-custom-api-li] txServiceGroup[ecust-custom-api-li-seata-service-group] 19:35:26.599 [main] INFO i.s.s.a.GlobalTransactionScanner - [initClient,181] - Global Transaction Clients are initialized. 19:35:27.150 [main] INFO o.a.c.c.AprLifecycleListener - [log,173] - Loaded Apache Tomcat Native library [1.3.1] using APR version [1.7.4]. 19:35:27.151 [main] INFO o.a.c.c.AprLifecycleListener - [log,173] - APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true]. 19:35:27.151 [main] INFO o.a.c.c.AprLifecycleListener - [log,173] - APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 19:35:27.153 [main] INFO o.a.c.c.AprLifecycleListener - [log,173] - OpenSSL successfully initialized [OpenSSL 3.0.14 4 Jun 2024] 19:35:27.160 [main] INFO o.a.c.h.Http11NioProtocol - [log,173] - Initializing ProtocolHandler ["http-nio-8080"] 19:35:27.160 [main] INFO o.a.c.c.StandardService - [log,173] - Starting service [Tomcat] 19:35:27.160 [main] INFO o.a.c.c.StandardEngine - [log,173] - Starting Servlet engine: [Apache Tomcat/9.0.60] 19:35:27.229 [main] INFO o.a.c.c.C.[.[.[/] - [log,173] - Initializing Spring embedded WebApplicationContext 19:35:27.366 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - [refresh,591] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.redis.host' in value "${spring.redis.host}" 19:35:27.370 [main] INFO o.a.c.c.StandardService - [log,173] - Stopping service [Tomcat] 19:35:27.406 [main] ERROR o.s.b.SpringApplication - [reportFailure,830] - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.redis.host' in value "${spring.redis.host}" at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:405) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) at com.ruoyi.customApi.OuchnCustomApiApplication.main(OuchnCustomApiApplication.java:33) Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.redis.host' in value "${spring.redis.host}" at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:191) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:936) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1330) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ... 17 common frames omitted 19:35:27.408 [Thread-4] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,108] - [HttpClientBeanHolder] Start destroying common HttpClient 19:35:27.408 [Thread-11] WARN c.a.n.c.n.NotifyCenter - [shutdown,136] - [NotifyCenter] Start destroying Publisher 19:35:27.408 [Thread-11] WARN c.a.n.c.n.NotifyCenter - [shutdown,153] - [NotifyCenter] Destruction of the end 19:35:27.408 [Thread-4] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,114] - [HttpClientBeanHolder] Destruction of the end 进程已结束,退出代码为 1
07-01
package com.tongchuang.realtime.mds; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.tongchuang.realtime.bean.ULEParamConfig; import com.tongchuang.realtime.util.KafkaUtils; import org.apache.flink.api.common.eventtime.WatermarkStrategy; import org.apache.flink.api.common.state.; import org.apache.flink.api.common.time.Time; import org.apache.flink.api.common.typeinfo.BasicTypeInfo; import org.apache.flink.api.common.typeinfo.TypeHint; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.configuration.Configuration; import org.apache.flink.connector.kafka.source.KafkaSource; import org.apache.flink.connector.kafka.source.enumerator.initializer.OffsetsInitializer; import org.apache.flink.streaming.api.datastream.; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; import org.apache.flink.streaming.api.functions.co.KeyedBroadcastProcessFunction; import org.apache.flink.streaming.api.functions.source.RichSourceFunction; import org.apache.flink.util.Collector; import org.apache.flink.util.OutputTag; import java.io.Serializable; import java.sql.; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.Duration; import java.util.; import java.util.Date; import java.util.concurrent.TimeUnit; public class ULEDataanomalyanalysis { public static void main(String[] args) throws Exception { final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); env.getConfig().setAutoWatermarkInterval(1000); // Kafka消费者配置 KafkaSource kafkaConsumer = KafkaUtils.getKafkaConsumer( “realdata_minute”, “minutedata_uledataanomalyanalysis”, OffsetsInitializer.latest() ); // 修改Watermark策略 DataStreamSource kafkaDS = env.fromSource( kafkaConsumer, WatermarkStrategy.forBoundedOutOfOrderness(Duration.ofMinutes(1)) .withTimestampAssigner((event, timestamp) -> { try { JSONObject json = JSON.parseObject(event); return new SimpleDateFormat(“yyyy-MM-dd HH:mm”).parse(json.getString(“times”)).getTime(); } catch (ParseException e) { return System.currentTimeMillis(); } }), “realdata_uledataanomalyanalysis” ); kafkaDS.print(“分钟数据流”); // 解析JSON并拆分tag SingleOutputStreamOperator splitStream = kafkaDS .map(JSON::parseObject) .returns(TypeInformation.of(JSONObject.class)) .flatMap((JSONObject value, Collector out) -> { JSONObject data = value.getJSONObject(“datas”); String time = value.getString(“times”); for (String tag : data.keySet()) { JSONObject tagData = data.getJSONObject(tag); JSONObject newObj = new JSONObject(); newObj.put(“time”, time); newObj.put(“tag”, tag); newObj.put(“ontime”, tagData.getDouble(“ontime”)); newObj.put(“avg”, tagData.getDouble(“avg”)); out.collect(newObj); } }) .returns(TypeInformation.of(JSONObject.class)) .name(“Split-By-Tag”); // 配置数据源 DataStream configDataStream = env .addSource(new MysqlConfigSource()) .setParallelism(1) .filter(Objects::nonNull) .name(“Config-Source”); // 标签值数据流 DataStream<Map<String, Object>> tagValueStream = splitStream .map(json -> { Map<String, Object> valueMap = new HashMap<>(); valueMap.put(“tag”, json.getString(“tag”)); valueMap.put(“value”, “436887485805570949”.equals(json.getString(“datatype”)) ? json.getDouble(“ontime”) : json.getDouble(“avg”)); return valueMap; }) .returns(new TypeHint<Map<String, Object>>() {}) .name(“Tag-Value-Stream”); // 合并配置流和标签值流 DataStreambroadcastStream = configDataStream .map(config -> (Object) config) .returns(TypeInformation.of(Object.class)) .union( tagValueStream.map(tagValue -> (Object) tagValue) .returns(TypeInformation.of(Object.class)) ); // 广播流 BroadcastStreamfinalBroadcastStream = broadcastStream .broadcast(Descriptors.configStateDescriptor, Descriptors.tagValuesDescriptor); // 按tag分组 KeyedStream<JSONObject, String> keyedStream = splitStream .keyBy(json -> json.getString(“tag”)); BroadcastConnectedStream<JSONObject, Object> connectedStream = keyedStream.connect(finalBroadcastStream); // 异常检测处理 SingleOutputStreamOperator anomalyStream = connectedStream .process(new OptimizedAnomalyDetectionFunction()) .name(“Anomaly-Detection”); anomalyStream.print(“异常检测结果”); // 离线检测结果侧输出 DataStream offlineCheckStream = anomalyStream.getSideOutput(OptimizedAnomalyDetectionFunction.OFFLINE_CHECK_TAG); offlineCheckStream.print(“离线检测结果”); env.execute(“uledataanomalyanalysis”); } // 配置集合类 public static class ConfigCollection implements Serializable { private static final long serialVersionUID = 1L; public final Map<String, List> tagToConfigs; public final Map<String, ULEParamConfig> encodeToConfig; public final Set allTags; public final long checkpointTime; public ConfigCollection(Map<String, List> tagToConfigs, Map<String, ULEParamConfig> encodeToConfig) { this.tagToConfigs = new HashMap<>(tagToConfigs); this.encodeToConfig = new HashMap<>(encodeToConfig); this.allTags = new HashSet<>(tagToConfigs.keySet()); this.checkpointTime = System.currentTimeMillis(); } } // MySQL配置源 public static class MysqlConfigSource extends RichSourceFunction { private volatile boolean isRunning = true; private final long interval = TimeUnit.MINUTES.toMillis(5); @Override public void run(SourceContext ctx) throws Exception { while (isRunning) { ConfigCollection newConfig = loadParams(); if (newConfig != null) { ctx.collect(newConfig); System.out.println("配置加载完成,检查点时间: " + new Date(newConfig.checkpointTime)); } else { System.out.println(“配置加载失败”); } Thread.sleep(interval); } } private ConfigCollection loadParams() { Map<String, List> tagToConfigs = new HashMap<>(5000); Map<String, ULEParamConfig> encodeToConfig = new HashMap<>(5000); String url = “jdbc:mysql://10.51.37.73:3306/eps?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8”; String user = “root”; String password = “6CKIm5jDVsLrahSw”; String query = "SELECT F_tag AS tag, F_enCode AS encode, F_dataTypes AS datatype, " + "F_isConstantValue AS constantvalue, F_isOnline AS isonline, " + "F_isSync AS issync, F_syncParaEnCode AS syncparaencode, " + "F_isZero AS iszero, F_isHigh AS ishigh, F_highThreshold AS highthreshold, " + "F_isLow AS islow, F_lowThreshold AS lowthreshold, F_duration AS duration " + "FROM t_equipmentparameter " + "WHERE F_enabledmark = ‘1’ AND (F_isConstantValue=‘1’ OR F_isZero=‘1’ " + “OR F_isHigh=‘1’ OR F_isLow=‘1’ OR F_isOnline=‘1’ OR F_isSync=‘1’)”; try (Connection conn = DriverManager.getConnection(url, user, password); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(query)) { while (rs.next()) { ULEParamConfig config = new ULEParamConfig(); config.tag = rs.getString(“tag”); config.encode = rs.getString(“encode”); config.datatype = rs.getString(“datatype”); config.constantvalue = rs.getInt(“constantvalue”); config.iszero = rs.getInt(“iszero”); config.ishigh = rs.getInt(“ishigh”); config.highthreshold = rs.getDouble(“highthreshold”); config.islow = rs.getInt(“islow”); config.lowthreshold = rs.getDouble(“lowthreshold”); config.duration = rs.getLong(“duration”); config.isonline = rs.getInt(“isonline”); config.issync = rs.getInt(“issync”); config.syncparaencode = rs.getString(“syncparaencode”); if (config.encode == null || config.encode.isEmpty()) { System.err.println(“忽略无效配置: 空encode”); continue; } String tag = config.tag; tagToConfigs.computeIfAbsent(tag, k -> new ArrayList<>(10)).add(config); encodeToConfig.put(config.encode, config); } System.out.println(“加载配置: " + encodeToConfig.size() + " 个参数”); return new ConfigCollection(tagToConfigs, encodeToConfig); } catch (SQLException e) { System.err.println(“加载参数配置错误:”); e.printStackTrace(); return null; } } @Override public void cancel() { isRunning = false; } } // 状态描述符 public static class Descriptors { public static final MapStateDescriptor<Void, ConfigCollection> configStateDescriptor = new MapStateDescriptor<>( “configState”, TypeInformation.of(Void.class), TypeInformation.of(ConfigCollection.class) ); public static final MapStateDescriptor<String, Double> tagValuesDescriptor = new MapStateDescriptor<>( “tagValuesBroadcastState”, BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.DOUBLE_TYPE_INFO ); } // 优化后的异常检测函数(已修复离线检测问题) public static class OptimizedAnomalyDetectionFunction extends KeyedBroadcastProcessFunction<String, JSONObject, Object, JSONObject> { public static final OutputTag OFFLINE_CHECK_TAG = new OutputTag(“offline-check”){}; // 状态管理 private transient MapState<String, AnomalyState> stateMap; private transient MapState<String, Double> lastValuesMap; private transient MapState<String, Long> lastDataTimeMap; private transient MapState<String, Long> offlineTimerState; private transient MapState<String, Long> tagInitTimeState; // 标签初始化时间状态 private transient SimpleDateFormat timeFormat; private transient long lastSyncLogTime = 0; @Override public void open(Configuration parameters) { StateTtlConfig ttlConfig = StateTtlConfig.newBuilder(Time.days(30)) .setUpdateType(StateTtlConfig.UpdateType.OnCreateAndWrite) .setStateVisibility(StateTtlConfig.StateVisibility.NeverReturnExpired) .cleanupFullSnapshot() .build(); // 异常状态存储 MapStateDescriptor<String, AnomalyState> stateDesc = new MapStateDescriptor<>( “anomalyState”, BasicTypeInfo.STRING_TYPE_INFO, TypeInformation.of(AnomalyState.class) ); stateDesc.enableTimeToLive(ttlConfig); stateMap = getRuntimeContext().getMapState(stateDesc); // 最新值存储 MapStateDescriptor<String, Double> valuesDesc = new MapStateDescriptor<>( “lastValuesState”, BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.DOUBLE_TYPE_INFO ); valuesDesc.enableTimeToLive(ttlConfig); lastValuesMap = getRuntimeContext().getMapState(valuesDesc); // 最后数据时间存储 MapStateDescriptor<String, Long> timeDesc = new MapStateDescriptor<>( “lastDataTimeState”, BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); timeDesc.enableTimeToLive(ttlConfig); lastDataTimeMap = getRuntimeContext().getMapState(timeDesc); // 离线检测定时器状态 MapStateDescriptor<String, Long> timerDesc = new MapStateDescriptor<>( “offlineTimerState”, BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); timerDesc.enableTimeToLive(ttlConfig); offlineTimerState = getRuntimeContext().getMapState(timerDesc); // 标签初始化时间状态 MapStateDescriptor<String, Long> initTimeDesc = new MapStateDescriptor<>( “tagInitTimeState”, BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); initTimeDesc.enableTimeToLive(ttlConfig); tagInitTimeState = getRuntimeContext().getMapState(initTimeDesc); timeFormat = new SimpleDateFormat(“yyyy-MM-dd HH:mm”); } @Override public void processElement(JSONObject data, ReadOnlyContext ctx, Collector out) throws Exception { String tag = ctx.getCurrentKey(); String timeStr = data.getString(“time”); long eventTime = timeFormat.parse(timeStr).getTime(); // 更新最后数据时间 lastDataTimeMap.put(tag, eventTime); // 获取广播配置 ConfigCollection configCollection = getBroadcastConfig(ctx); if (configCollection == null) return; List configs = configCollection.tagToConfigs.get(tag); if (configs == null || configs.isEmpty()) return; // 清理无效状态 List keysToRemove = new ArrayList<>(); for (String encode : stateMap.keys()) { boolean found = false; for (ULEParamConfig cfg : configs) { if (cfg.encode.equals(encode)) { found = true; break; } } if (!found) { System.out.println("清理过期状态: " + encode); keysToRemove.add(encode); } } for (String encode : keysToRemove) { stateMap.remove(encode); } double value = 0; boolean valueSet = false; // 检查是否需要离线检测 boolean hasOnlineConfig = false; long minDuration = Long.MAX_VALUE; for (ULEParamConfig config : configs) { if (config.isonline == 1) { hasOnlineConfig = true; minDuration = Math.min(minDuration, config.duration); // 初始化标签检测时间(如果尚未初始化) if (!tagInitTimeState.contains(tag)) { tagInitTimeState.put(tag, System.currentTimeMillis()); System.out.println(“初始化在线检测: tag=” + tag + “, 时间=” + timeFormat.format(new Date())); } } } // 管理离线检测定时器 if (hasOnlineConfig) { // 删除现有定时器 Long currentTimer = offlineTimerState.get(tag); if (currentTimer != null) { ctx.timerService().deleteEventTimeTimer(currentTimer); } // 注册新定时器(使用最小duration) long offlineTimeout = eventTime + minDuration * 60 * 1000; ctx.timerService().registerEventTimeTimer(offlineTimeout); offlineTimerState.put(tag, offlineTimeout); // 重置离线状态(数据到达表示恢复) for (ULEParamConfig config : configs) { if (config.isonline == 1) { AnomalyState state = getOrCreateState(config.encode); AnomalyStatus status = state.getStatus(6); if (status.reported) { reportAnomaly(6, 0, 0.0, timeStr, config, out); status.reset(); stateMap.put(config.encode, state); System.out.println(“离线恢复: tag=” + tag + “, encode=” + config.encode); } } } } // 遍历配置项进行异常检测 for (ULEParamConfig config : configs) { if (!valueSet) { value = “436887485805570949”.equals(config.datatype) ? data.getDouble(“ontime”) : data.getDouble(“avg”); lastValuesMap.put(tag, value); valueSet = true; } AnomalyState state = getOrCreateState(config.encode); // 处理异常类型 checkConstantValueAnomaly(config, value, timeStr, state, out); // 1. 恒值检测 checkZeroValueAnomaly(config, value, timeStr, state, out); // 2. 零值检测 checkThresholdAnomaly(config, value, timeStr, state, out); // 3. 上阈值, 4. 下阈值 checkSyncAnomaly(config, value, timeStr, state, configCollection, ctx, out); // 5. 同步检测 stateMap.put(config.encode, state); } } @Override public void onTimer(long timestamp, OnTimerContext ctx, Collector out) throws Exception { String tag = ctx.getCurrentKey(); Long lastEventTime = lastDataTimeMap.get(tag); ConfigCollection configCollection = getBroadcastConfig(ctx); if (configCollection == null) return; List configs = configCollection.tagToConfigs.get(tag); if (configs == null) return; // 检查所有需要离线检测的配置项 boolean hasOnlineConfig = false; for (ULEParamConfig config : configs) { if (config.isonline == 1) { hasOnlineConfig = true; AnomalyState state = getOrCreateState(config.encode); AnomalyStatus status = state.getStatus(6); // 处理从未收到数据的情况 if (lastEventTime == null) { // 获取标签初始化时间 Long initTime = tagInitTimeState.get(tag); if (initTime == null) { // 如果状态中不存在,使用配置加载时间 initTime = configCollection.checkpointTime; tagInitTimeState.put(tag, initTime); } // 检查是否超过配置的duration long elapsed = System.currentTimeMillis() - initTime; long durationMs = config.duration * 60 * 1000; if (elapsed >= durationMs) { if (!status.reported) { String triggerTime = timeFormat.format(new Date()); reportAnomaly(6, 1, 0.0, triggerTime, config, out); status.reported = true; // 输出到侧输出流 ctx.output(OFFLINE_CHECK_TAG, String.format(“离线异常(从未收到数据): tag=%s, encode=%s, 初始化时间=%s, 当前时间=%s, 时间差=%dms (阈值=%dms)”, config.tag, config.encode, timeFormat.format(new Date(initTime)), triggerTime, elapsed, durationMs) ); System.out.println("检测到从未接收数据的离线异常: " + config.tag); } } } // 处理已有数据但超时的情况 else if (timestamp - lastEventTime >= config.duration * 60 * 1000) { if (!status.reported) { String triggerTime = timeFormat.format(new Date(timestamp)); reportAnomaly(6, 1, 0.0, triggerTime, config, out); status.reported = true; ctx.output(OFFLINE_CHECK_TAG, String.format(“离线异常: tag=%s, encode=%s, 最后数据时间=%s, 超时时间=%s, 时间差=%dms (阈值=%dms)”, config.tag, config.encode, timeFormat.format(new Date(lastEventTime)), triggerTime, timestamp - lastEventTime, config.duration * 60 * 1000) ); System.out.println("检测到数据中断的离线异常: " + config.tag); } } else { // 数据已恢复,重置状态 if (status.reported) { reportAnomaly(6, 0, 0.0, timeFormat.format(new Date()), config, out); status.reset(); System.out.println("离线状态恢复: " + config.tag); } } stateMap.put(config.encode, state); } } // 重新注册定时器(每分钟检查一次) if (hasOnlineConfig) { long newTimeout = timestamp + TimeUnit.MINUTES.toMillis(1); ctx.timerService().registerEventTimeTimer(newTimeout); offlineTimerState.put(tag, newTimeout); } else { offlineTimerState.remove(tag); } } // 恒值检测 - 异常类型1 private void checkConstantValueAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector out) { if (config.constantvalue != 1) return; try { AnomalyStatus status = state.getStatus(1); long durationThreshold = config.duration * 60 * 1000; Date timestamp = timeFormat.parse(timeStr); if (status.lastValue == null) { status.lastValue = currentValue; status.lastChangeTime = timestamp; return; } if (Math.abs(currentValue - status.lastValue) > 0.001) { status.lastValue = currentValue; status.lastChangeTime = timestamp; if (status.reported) { reportAnomaly(1, 0, currentValue, timeStr, config, out); } status.reset(); return; } long elapsed = timestamp.getTime() - status.lastChangeTime.getTime(); if (elapsed > durationThreshold) { if (!status.reported) { reportAnomaly(1, 1, currentValue, timeStr, config, out); status.reported = true; } } } catch (Exception e) { System.err.println("恒值检测错误: " + config.encode + " - " + e.getMessage()); } } // 零值检测 - 异常类型2 private void checkZeroValueAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector out) { if (config.iszero != 1) return; try { AnomalyStatus status = state.getStatus(2); Date timestamp = timeFormat.parse(timeStr); boolean isZero = Math.abs(currentValue) < 0.001; if (isZero) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(2, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(2, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (Exception e) { System.err.println("零值检测错误: " + config.encode + " - " + e.getMessage()); } } // 阈值检测 - 异常类型3(上阈值)和4(下阈值) private void checkThresholdAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, Collector out) { try { if (config.ishigh == 1) { AnomalyStatus highStatus = state.getStatus(3); processThresholdAnomaly(highStatus, currentValue, timeStr, currentValue > config.highthreshold, config, 3, out); } if (config.islow == 1) { AnomalyStatus lowStatus = state.getStatus(4); processThresholdAnomaly(lowStatus, currentValue, timeStr, currentValue < config.lowthreshold, config, 4, out); } } catch (Exception e) { System.err.println("阈值检测错误: " + config.encode + " - " + e.getMessage()); } } private void processThresholdAnomaly(AnomalyStatus status, double currentValue, String timeStr, boolean isAnomaly, ULEParamConfig config, int anomalyType, Collector out) { try { Date timestamp = timeFormat.parse(timeStr); if (isAnomaly) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(anomalyType, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(anomalyType, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (Exception e) { System.err.println("阈值处理错误:极速版 " + config.encode + " - " + e.getMessage()); } } // 同步检测 - 异常类型5(优化日志输出) private void checkSyncAnomaly(ULEParamConfig config, double currentValue, String timeStr, AnomalyState state, ConfigCollection configCollection, ReadOnlyContext ctx, Collector out) { if (config.issync != 1 || config.syncparaencode == null || config.syncparaencode.isEmpty()) { return; } try { // 通过encode获取关联配置 ULEParamConfig relatedConfig = configCollection.encodeToConfig.get(config.syncparaencode); if (relatedConfig == null) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.println(“同步检测错误: 未找到关联配置, encode=” + config.syncparaencode); lastSyncLogTime = System.currentTimeMillis(); } return; } // 获取关联配置的tag String relatedTag = relatedConfig.tag; if (relatedTag == null || relatedTag.isEmpty()) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.println(“同步检测错误: 关联配置没有tag, encode=” + config.syncparaencode); lastSyncLogTime = System.currentTimeMillis(); } return; } // 从广播状态获取关联值 ReadOnlyBroadcastState<String, Double> tagValuesState = ctx.getBroadcastState(Descriptors.tagValuesDescriptor); Double relatedValue = tagValuesState.get(relatedTag); if (relatedValue == null) { if (System.currentTimeMillis() - lastSyncLogTime > 60000) { // 优化日志:添加当前标签信息 System.out.printf(“同步检测警告: 关联值未初始化 [主标签=%s(%s), 关联标签=%s(%s)]%n”, config.tag, config.encode, relatedTag, config.syncparaencode); lastSyncLogTime = System.currentTimeMillis(); } return; } // 同步检测逻辑 AnomalyStatus status = state.getStatus(5); Date timestamp = timeFormat.parse(timeStr); // 业务逻辑:当前值接近1且关联值接近0时异常 boolean isAnomaly = (currentValue >= 0.99) && (Math.abs(relatedValue) < 0.01); // 日志记录 if (System.currentTimeMillis() - lastSyncLogTime > 60000) { System.out.printf(“同步检测: %s (%.4f) vs %s (%.4f) -> %b%n”, config.tag, currentValue, relatedTag, relatedValue, isAnomaly); lastSyncLogTime = System.currentTimeMillis(); } // 处理异常状态 if (isAnomaly) { if (status.startTime == null) { status.startTime = timestamp; } else if (!status.reported) { long elapsed = timestamp.getTime() - status.startTime.getTime(); if (elapsed >= config.duration * 60 * 1000) { reportAnomaly(5, 1, currentValue, timeStr, config, out); status.reported = true; } } } else { if (status.reported) { reportAnomaly(5, 0, currentValue, timeStr, config, out); status.reset(); } else if (status.startTime != null) { status.startTime = null; } } } catch (ParseException e) { System.err.println("同步检测时间解析错误: " + config.encode + " - " + e.getMessage()); } catch (Exception e) { System.err.println("同步检测错误: " + config.encode + " - " + e.getMessage()); } } // 报告异常(添加详细日志) private void reportAnomaly(int anomalyType, int statusFlag, double value, String time, ULEParamConfig config, Collector out) { JSONObject event = new JSONObject(); event.put(“tag”, config.tag); event.put(“paracode”, config.encode); event.put(“abnormaltype”, anomalyType); event.put(“statusflag”, statusFlag); event.put(“datavalue”, value); event.put(“triggertime”, time); out.collect(event); // 添加详细日志输出 String statusDesc = statusFlag == 1 ? “异常开始” : “异常结束”; System.out.printf(“报告异常: 类型=%d, 状态=%s, 标签=%s, 编码=%s, 时间=%s%n”, anomalyType, statusDesc, config.tag, config.encode, time); } @Override public void processBroadcastElement(Object broadcastElement, Context ctx, Collector out) throws Exception { // 处理配置更新 if (broadcastElement instanceof ConfigCollection) { ConfigCollection newConfig = (ConfigCollection) broadcastElement; BroadcastState<Void, ConfigCollection> configState = ctx.getBroadcastState(Descriptors.configStateDescriptor); // 获取旧配置 ConfigCollection oldConfig = configState.get(null); // 处理配置变更:清理不再启用的报警 if (oldConfig != null) { for (Map.Entry<String, ULEParamConfig> entry : oldConfig.encodeToConfig.entrySet()) { String encode = entry.getKey(); ULEParamConfig oldCfg = entry.getValue(); ULEParamConfig newCfg = newConfig.encodeToConfig.get(encode); if (newCfg == null || !isAlarmEnabled(newCfg, oldCfg)) { // 发送恢复事件 sendRecoveryEvents(encode, oldCfg, ctx, out); } } } // 更新广播状态 configState.put(null, newConfig); System.out.println("广播配置更新完成, 配置项: " + newConfig.encodeToConfig.size()); } // 处理标签值更新 else if (broadcastElement instanceof Map) { @SuppressWarnings(“unchecked”) Map<String, Object> tagValue = (Map<String, Object>) broadcastElement; String tag = (String) tagValue.get(“tag”); Double value = (Double) tagValue.get(“value”); if (tag != null && value != null) { BroadcastState<String, Double> tagValuesState = ctx.getBroadcastState(Descriptors.tagValuesDescriptor); tagValuesState.put(tag, value); } } } // 检查报警是否启用 private boolean isAlarmEnabled(ULEParamConfig newCfg, ULEParamConfig oldCfg) { return (oldCfg.constantvalue == 1 && newCfg.constantvalue == 1) || (oldCfg.iszero == 1 && newCfg.iszero == 1) || (oldCfg.ishigh == 1 && newCfg.ishigh == 1) || (oldCfg.islow == 1 && newCfg.islow == 1) || (oldCfg.isonline == 1 && newCfg.isonline == 1) || (oldCfg.issync == 1 && newCfg.issync == 1); } // 发送恢复事件 private void sendRecoveryEvents(String encode, ULEParamConfig config, Context ctx, Collector out) { try { AnomalyState state = stateMap.get(encode); if (state == null) return; // 遍历所有可能的报警类型 for (int type = 1; type <= 6; type++) { AnomalyStatus status = state.getStatus(type); if (status.reported) { JSONObject recoveryEvent = new JSONObject(); recoveryEvent.put(“tag”, config.tag); recoveryEvent.put(“paracode”, config.encode); recoveryEvent.put(“abnormaltype”, type); recoveryEvent.put(“statusflag”, 0); // 恢复事件 recoveryEvent.put(“datavalue”, 0.0); recoveryEvent.put(“triggertime”, timeFormat.format(new Date())); out.collect(recoveryEvent); System.out.println(“发送恢复事件: 类型=” + type + “, 标签=” + config.tag); status.reset(); } } // 更新状态 stateMap.put(encode, state); } catch (Exception e) { System.err.println("发送恢复事件失败: " + e.getMessage()); } } // 辅助方法 private ConfigCollection getBroadcastConfig(ReadOnlyContext ctx) throws Exception { return ctx.getBroadcastState(Descriptors.configStateDescriptor).get(null); } private AnomalyState getOrCreateState(String encode) throws Exception { AnomalyState state = stateMap.get(encode); if (state == null) { state = new AnomalyState(); } return state; } } // 异常状态类 public static class AnomalyState implements Serializable { private static final long serialVersionUID = 1L; private final Map<Integer, AnomalyStatus> statusMap = new HashMap<>(); public AnomalyStatus getStatus(int type) { return statusMap.computeIfAbsent(type, k -> new AnomalyStatus()); } } // 异常状态详情 public static class AnomalyStatus implements Serializable { private static final long serialVersionUID = 1L; public Date startTime; // 异常开始时间 public Double lastValue; // 用于恒值检测 public Date lastChangeTime; // 值最后变化时间 public boolean reported; // 是否已报告 public void reset() { startTime = null; lastValue = null; lastChangeTime = null; reported = false; } } } 运行日志为:“C:\Program Files (x86)\Java\jdk1.8.0_102\bin\java.exe” -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:21889,suspend=y,server=n -javaagent:C:\Users\Administrator\AppData\Local\JetBrains\IntelliJIdea2021.2\captureAgent\debugger-agent.jar=file:/C:/Users/Administrator/AppData/Local/Temp/capture.props -Dfile.encoding=UTF-8 -classpath C:\Users\Administrator\AppData\Local\Temp\classpath739647490.jar com.tongchuang.realtime.mds.ULEDataanomalyanalysis 已连接到目标 VM, 地址: ‘‘127.0.0.1:21889’,传输: ‘套接字’’ SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/F:/flink/flinkmaven/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.10.0/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/F:/flink/flinkmaven/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] 加载配置: 30 个参数 配置加载完成,检查点时间: Wed Aug 06 08:06:53 CST 2025 广播配置更新完成, 配置项: 30 分钟数据流> {“times”:“2025-08-06 08:06”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3028.0762,“avg”:3002.0539,“min”:2943.5588,“max”:3055.423},“DA-LT-6BT008”:{“ontime”:182.708,“avg”:184.5047,“min”:182.708,“max”:186.0057},“DA-LT-5BT0005”:{“ontime”:408.72,“avg”:409.09,“min”:408.72,“max”:409.5},“DA-LT-6BT004”:{“ontime”:1211.9675,“avg”:1211.8802,“min”:1211.6671,“max”:1212.0676},“DA-LT-5BT0004”:{“ontime”:1196.8,“avg”:1197.8467,“min”:1196.8,“max”:1198.9},“DA-LT-6BT005”:{“ontime”:401.0593,“avg”:401.0972,“min”:400.8238,“max”:401.4126},“DA-LT-5BT0008”:{“ontime”:191.24,“avg”:191.4387,“min”:190.88,“max”:193.04},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:134.125,“avg”:133.6627,“min”:133.0,“max”:134.6625},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1210.0,“avg”:1209.2167,“min”:1209.0,“max”:1210.0},“DA-LT-6BT001”:{“ontime”:178782.56,“avg”:178583.6142,“min”:177692.36,“max”:179265.8},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0005”:{“ontime”:302.125,“avg”:302.4458,“min”:301.25,“max”:303.5625},“DA_DB195_RH_R_0281”:{“ontime”:407.41,“avg”:407.1857,“min”:363.58,“max”:465.25},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:128130.79,“avg”:125782.1916,“min”:122764.53,“max”:129377.766}}} 初始化在线检测: tag=DA-LT-5BT0001, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-6BT008, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-5BT0005, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-6BT004, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-5BT0004, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-6BT005, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-5BT0008, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-4BT0008, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-4BT0004, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-6BT001, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-LT-4BT0005, 时间=2025-08-06 08:07 初始化在线检测: tag=DA_DB195_RH_R_0281, 时间=2025-08-06 08:07 初始化在线检测: tag=DA-DB195-RH-B-0201, 时间=2025-08-06 08:07 同步检测警告: 关联值未初始化 [主标签=DA-DB195-RH-B-0201(EP000001), 关联标签=DA-LT-4BT0007(EP000022)] 初始化在线检测: tag=DA-LT-4BT0001, 时间=2025-08-06 08:07 分钟数据流> {“times”:“2025-08-06 08:07”,“datas”:{“DA-LT-5BT0001”:{“ontime”:2983.723,“avg”:2998.5335,“min”:2933.6702,“max”:3050.6917},“DA-LT-6BT008”:{“ontime”:183.4736,“avg”:182.5906,“min”:182.0799,“max”:183.4736},“DA-LT-5BT0005”:{“ontime”:409.5,“avg”:411.009,“min”:409.5,“max”:412.02},“DA-LT-5BT0004”:{“ontime”:1198.8,“avg”:1200.8084,“min”:1198.8,“max”:1202.6},“DA-LT-6BT004”:{“ontime”:1211.6671,“avg”:1211.3646,“min”:1211.1666,“max”:1211.7673},“DA-LT-6BT005”:{“ontime”:401.5108,“avg”:402.1448,“min”:401.5108,“max”:402.7081},“DA-LT-5BT0008”:{“ontime”:191.18,“avg”:192.5137,“min”:190.98,“max”:193.82},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:133.75,“avg”:133.5158,“min”:128.8375,“max”:138.0625},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1208.5333,“min”:1208.0,“max”:1209.0},“DA-LT-6BT001”:{“ontime”:178991.39,“avg”:178253.286,“min”:177076.5,“max”:179702.92},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0005”:{“ontime”:302.25,“avg”:302.6656,“min”:298.4375,“max”:307.75},“DA_DB195_RH_R_0281”:{“ontime”:418.74,“avg”:386.4635,“min”:318.91,“max”:493.5399},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:123272.95,“avg”:126419.8397,“min”:120245.72,“max”:130466.016},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 异常检测结果> {“abnormaltype”:3,“paracode”:“EP100010”,“datavalue”:178253.286,“tag”:“DA-LT-6BT001”,“triggertime”:“2025-08-06 08:07”,“statusflag”:1} 报告异常: 类型=3, 状态=异常开始, 标签=DA-LT-6BT001, 编码=EP100010, 时间=2025-08-06 08:07 异常检测结果> {“abnormaltype”:3,“paracode”:“EP000010”,“datavalue”:178253.286,“tag”:“DA-LT-6BT001”,“triggertime”:“2025-08-06 08:07”,“statusflag”:1} 报告异常: 类型=3, 状态=异常开始, 标签=DA-LT-6BT001, 编码=EP000010, 时间=2025-08-06 08:07 异常检测结果> {“abnormaltype”:3,“paracode”:“EP000002”,“datavalue”:126419.8397,“tag”:“DA-LT-4BT0001”,“triggertime”:“2025-08-06 08:07”,“statusflag”:1} 报告异常: 类型=3, 状态=异常开始, 标签=DA-LT-4BT0001, 编码=EP000002, 时间=2025-08-06 08:07 异常检测结果> {“abnormaltype”:4,“paracode”:“EP000001”,“datavalue”:1.0,“tag”:“DA-DB195-RH-B-0201”,“triggertime”:“2025-08-06 08:07”,“statusflag”:1} 报告异常: 类型=4, 状态=异常开始, 标签=DA-DB195-RH-B-0201, 编码=EP000001, 时间=2025-08-06 08:07 分钟数据流> {“times”:“2025-08-06 08:08”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3042.6296,“avg”:3003.8981,“min”:2967.8362,“max”:3055.9065},“DA-LT-6BT008”:{“ontime”:182.3939,“avg”:183.4896,“min”:182.3939,“max”:185.3776},“DA-LT-5BT0005”:{“ontime”:411.96,“avg”:412.596,“min”:411.84,“max”:413.04},“DA-LT-5BT0004”:{“ontime”:1202.8,“avg”:1203.81,“min”:1202.8,“max”:1204.6},“DA-LT-6BT004”:{“ontime”:1211.2,“avg”:1211.1372,“min”:1211.0332,“max”:1211.2667},“DA-LT-6BT005”:{“ontime”:402.3745,“avg”:402.7078,“min”:402.3548,“max”:402.9437},“DA-LT-5BT0008”:{“ontime”:193.76,“avg”:195.1453,“min”:193.72,“max”:197.06},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.9333,“min”:0.0,“max”:1.0},“DA-LT-4BT0008”:{“ontime”:137.3625,“avg”:139.1331,“min”:137.225,“max”:140.85},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.8,“min”:1209.0,“max”:1211.0},“DA-LT-6BT001”:{“ontime”:178882.36,“avg”:178488.8015,“min”:177432.6,“max”:179877.9},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.75,“min”:0.0,“max”:1.0},“DA-LT-4BT0005”:{“ontime”:307.5625,“avg”:309.2396,“min”:307.5625,“max”:310.75},“DA_DB195_RH_R_0281”:{“ontime”:396.59,“avg”:401.5442,“min”:346.05,“max”:450.32},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:121446.11,“avg”:119290.5578,“min”:117657.12,“max”:122175.7},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 异常检测结果> {“abnormaltype”:1,“paracode”:“EP000001”,“datavalue”:1.0,“tag”:“DA-DB195-RH-B-0201”,“triggertime”:“2025-08-06 08:08”,“statusflag”:1} 报告异常: 类型=1, 状态=异常开始, 标签=DA-DB195-RH-B-0201, 编码=EP000001, 时间=2025-08-06 08:08 同步检测警告: 关联值未初始化 [主标签=DA-DB195-RH-B-0201(EP000001), 关联标签=DA-LT-4BT0007(EP000022)] 分钟数据流> {“times”:“2025-08-06 08:09”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3033.7747,“avg”:3002.4513,“min”:2962.6672,“max”:3055.1338},“DA-LT-6BT008”:{“ontime”:185.3776,“avg”:184.3745,“min”:183.5324,“max”:185.672},“DA-LT-5BT0005”:{“ontime”:412.86,“avg”:412.575,“min”:412.14,“max”:412.86},“DA-LT-6BT004”:{“ontime”:1211.0665,“avg”:1210.6939,“min”:1210.2991,“max”:1211.0999},“DA-LT-5BT0004”:{“ontime”:1204.6,“avg”:1205.0734,“min”:1204.6,“max”:1205.7001},“DA-LT-6BT005”:{“ontime”:402.3352,“avg”:402.9368,“min”:402.2763,“max”:403.6503},“DA-LT-5BT0008”:{“ontime”:196.7,“avg”:195.9777,“min”:195.26,“max”:196.7},“DA-NY-LG1ZL-2-001”:{“ontime”:1.0,“avg”:0.9333,“min”:0.0,“max”:1.0},“DA-LT-4BT0008”:{“ontime”:139.5875,“avg”:140.9713,“min”:139.5875,“max”:142.825},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1211.0,“avg”:1211.75,“min”:1211.0,“max”:1212.0},“DA-LT-6BT001”:{“ontime”:178391.67,“avg”:178443.7467,“min”:177628.52,“max”:179565.55},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0005”:{“ontime”:309.6875,“avg”:310.8229,“min”:309.5,“max”:312.625},“DA_DB195_RH_R_0281”:{“ontime”:450.32,“avg”:408.5857,“min”:379.12,“max”:450.32},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:118694.516,“avg”:118275.7408,“min”:117089.89,“max”:120421.92},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 同步检测警告: 关联值未初始化 [主标签=DA-DB195-RH-B-0201(EP000001), 关联标签=DA-LT-4BT0007(EP000022)] 分钟数据流> {“times”:“2025-08-06 08:10”,“datas”:{“DA-LT-5BT0001”:{“ontime”:2973.0352,“avg”:3002.7071,“min”:2957.5095,“max”:3051.2454},“DA-LT-6BT008”:{“ontime”:185.6328,“avg”:184.5608,“min”:183.4343,“max”:186.0842},“DA-LT-5BT0005”:{“ontime”:412.2,“avg”:411.9946,“min”:411.54,“max”:412.2},“DA-LT-6BT004”:{“ontime”:1210.2991,“avg”:1210.0581,“min”:1209.7651,“max”:1210.3992},“DA-LT-5BT0004”:{“ontime”:1205.7001,“avg”:1207.1034,“min”:1205.6,“max”:1208.6},“DA-LT-6BT005”:{“ontime”:403.1989,“avg”:403.2295,“min”:402.9437,“max”:403.5129},“DA-LT-5BT0008”:{“ontime”:195.32,“avg”:193.6475,“min”:192.74,“max”:195.32},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:141.7875,“avg”:144.065,“min”:141.325,“max”:145.6125},“DA-LT-4BT0007”:{“ontime”:170.7,“avg”:170.3056,“min”:169.9,“max”:170.7},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1212.0,“avg”:1211.9831,“min”:1211.0,“max”:1212.0},“DA-LT-6BT001”:{“ontime”:178867.8,“avg”:178457.1483,“min”:177291.66,“max”:179163.56},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0005”:{“ontime”:312.1875,“avg”:313.2235,“min”:311.625,“max”:314.3125},“DA_DB195_RH_R_0281”:{“ontime”:384.85,“avg”:413.9697,“min”:360.35,“max”:446.67},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:117148.07,“avg”:117013.164,“min”:115852.336,“max”:118035.484}}} 初始化在线检测: tag=DA-LT-4BT0007, 时间=2025-08-06 08:11 加载配置: 30 个参数 配置加载完成,检查点时间: Wed Aug 06 08:11:54 CST 2025 广播配置更新完成, 配置项: 30 分钟数据流> {“times”:“2025-08-06 08:11”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3015.391,“avg”:3009.9417,“min”:2954.6865,“max”:3061.303},“DA-LT-6BT008”:{“ontime”:184.141,“avg”:184.0843,“min”:183.7876,“max”:184.3176},“DA-LT-5BT0005”:{“ontime”:411.48,“avg”:409.439,“min”:407.16,“max”:411.48},“DA-LT-6BT004”:{“ontime”:1209.8318,“avg”:1209.5916,“min”:1209.1644,“max”:1209.8986},“DA-LT-5BT0004”:{“ontime”:1208.6,“avg”:1209.5684,“min”:1208.6,“max”:1210.4},“DA-LT-6BT005”:{“ontime”:403.3755,“avg”:403.1174,“min”:402.9241,“max”:403.3755},“DA-LT-5BT0008”:{“ontime”:192.68,“avg”:191.2343,“min”:190.24,“max”:192.68},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:144.4375,“avg”:144.1377,“min”:142.95,“max”:146.5375},“DA-LT-4BT0007”:{“ontime”:170.6,“avg”:170.6117,“min”:170.3,“max”:171.4},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1212.0,“avg”:1211.15,“min”:1211.0,“max”:1212.0},“DA-LT-6BT001”:{“ontime”:177777.17,“avg”:178292.1055,“min”:177513.31,“max”:179294.77},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0005”:{“ontime”:313.4375,“avg”:313.074,“min”:312.25,“max”:315.4375},“DA_DB195_RH_R_0281”:{“ontime”:416.57,“avg”:420.0408,“min”:398.11,“max”:440.25},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:116889.69,“avg”:117360.7005,“min”:116638.09,“max”:118252.67}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-LT-4BT0007 (170.3056) -> false 分钟数据流> {“times”:“2025-08-06 08:12”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3024.455,“avg”:3003.0229,“min”:2952.1091,“max”:3051.3713},“DA-LT-6BT008”:{“ontime”:184.1213,“avg”:183.9952,“min”:183.611,“max”:185.829},“DA-LT-5BT0005”:{“ontime”:407.1,“avg”:405.0824,“min”:403.5,“max”:407.1},“DA-LT-6BT004”:{“ontime”:1209.2645,“avg”:1209.0078,“min”:1208.7306,“max”:1209.2979},“DA-LT-5BT0004”:{“ontime”:1210.3,“avg”:1210.6475,“min”:1210.3,“max”:1210.9},“DA-LT-6BT005”:{“ontime”:402.9633,“avg”:402.4523,“min”:402.0407,“max”:403.0026},“DA-LT-5BT0008”:{“ontime”:191.1,“avg”:190.6654,“min”:188.58,“max”:192.0},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:143.45,“avg”:142.3155,“min”:140.975,“max”:143.45},“DA-LT-4BT0007”:{“ontime”:171.4,“avg”:171.3667,“min”:171.3,“max”:171.5},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1211.0,“avg”:1210.9322,“min”:1210.0,“max”:1211.0},“DA-LT-6BT001”:{“ontime”:177789.66,“avg”:178372.5054,“min”:177478.8,“max”:179600.3},“DA-LT-4BT0005”:{“ontime”:313.25,“avg”:311.9121,“min”:310.375,“max”:313.25},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA_DB195_RH_R_0281”:{“ontime”:424.16,“avg”:413.6031,“min”:359.99,“max”:447.09},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:117766.25,“avg”:118432.5507,“min”:117581.59,“max”:119435.39},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-LT-4BT0007 (171.3667) -> false 分钟数据流> {“times”:“2025-08-06 08:13”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3034.6885,“avg”:3021.2272,“min”:2973.6846,“max”:3070.9446},“DA-LT-6BT008”:{“ontime”:185.829,“avg”:185.7005,“min”:184.0231,“max”:186.7712},“DA-LT-5BT0005”:{“ontime”:403.5,“avg”:404.826,“min”:403.26,“max”:407.16},“DA-LT-6BT004”:{“ontime”:1208.7974,“avg”:1208.477,“min”:1208.13,“max”:1208.7974},“DA-LT-5BT0004”:{“ontime”:1210.8,“avg”:1210.895,“min”:1210.7001,“max”:1211.1},“DA-LT-6BT005”:{“ontime”:402.0407,“avg”:402.2606,“min”:401.7463,“max”:403.2774},“DA-LT-5BT0008”:{“ontime”:189.26,“avg”:188.3993,“min”:187.28,“max”:189.62},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:142.225,“avg”:140.6388,“min”:139.025,“max”:143.575},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1211.0,“avg”:1210.4,“min”:1210.0,“max”:1211.0},“DA-LT-6BT001”:{“ontime”:178168.95,“avg”:178193.5373,“min”:177064.11,“max”:179223.0},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0005”:{“ontime”:311.625,“avg”:309.7354,“min”:308.125,“max”:312.875},“DA_DB195_RH_R_0281”:{“ontime”:405.55,“avg”:420.8507,“min”:394.22,“max”:446.28},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:119361.805,“avg”:119400.946,“min”:118796.96,“max”:120133.164},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-LT-4BT0007 (171.3667) -> false 分钟数据流> {“times”:“2025-08-06 08:14”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3029.965,“avg”:3031.526,“min”:2987.0623,“max”:3073.6565},“DA-LT-6BT008”:{“ontime”:185.3579,“avg”:184.7612,“min”:183.8858,“max”:185.3579},“DA-LT-5BT0005”:{“ontime”:407.16,“avg”:408.448,“min”:407.16,“max”:409.2},“DA-LT-6BT004”:{“ontime”:1208.1968,“avg”:1207.8436,“min”:1207.5293,“max”:1208.2301},“DA-LT-5BT0004”:{“ontime”:1211.0,“avg”:1210.8483,“min”:1210.5,“max”:1211.1},“DA-LT-6BT005”:{“ontime”:402.7278,“avg”:403.5316,“min”:402.5511,“max”:404.6122},“DA-LT-5BT0008”:{“ontime”:189.36,“avg”:191.098,“min”:189.36,“max”:191.72},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:140.4125,“avg”:140.0025,“min”:139.15,“max”:141.5625},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1210.0,“avg”:1210.0,“min”:1210.0,“max”:1210.0},“DA-LT-6BT001”:{“ontime”:178750.7,“avg”:178188.4007,“min”:177176.88,“max”:179348.72},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0005”:{“ontime”:309.3125,“avg”:308.1458,“min”:307.3125,“max”:309.3125},“DA_DB195_RH_R_0281”:{“ontime”:424.4,“avg”:411.3922,“min”:369.9,“max”:448.17},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:120119.95,“avg”:120058.3205,“min”:119094.73,“max”:121310.28},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 分钟数据流> {“times”:“2025-08-06 08:15”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3023.7253,“avg”:3028.9999,“min”:2966.9814,“max”:3080.395},“DA-LT-6BT008”:{“ontime”:184.5335,“avg”:185.1561,“min”:184.4746,“max”:185.7505},“DA-LT-5BT0005”:{“ontime”:409.2,“avg”:410.104,“min”:409.2,“max”:410.7},“DA-LT-6BT004”:{“ontime”:1207.5293,“avg”:1207.1667,“min”:1206.7952,“max”:1207.5293},“DA-LT-5BT0004”:{“ontime”:1210.6,“avg”:1210.5767,“min”:1210.3,“max”:1210.8},“DA-LT-6BT005”:{“ontime”:404.4944,“avg”:404.7401,“min”:404.4551,“max”:404.887},“DA-LT-5BT0008”:{“ontime”:191.0,“avg”:192.0173,“min”:191.0,“max”:193.7},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:142.4875,“avg”:140.1067,“min”:139.3,“max”:142.4875},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1210.0,“avg”:1209.9833,“min”:1209.0,“max”:1210.0},“DA-LT-6BT001”:{“ontime”:178105.47,“avg”:178441.7792,“min”:176945.67,“max”:179479.31},“DA-LT-4BT0005”:{“ontime”:308.6875,“avg”:307.0417,“min”:306.375,“max”:308.6875},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA_DB195_RH_R_0281”:{“ontime”:427.36,“avg”:418.5213,“min”:394.84,“max”:459.6199},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:119546.92,“avg”:120351.8229,“min”:119268.62,“max”:121035.23},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-LT-4BT0007 (171.3667) -> false 加载配置: 30 个参数 配置加载完成,检查点时间: Wed Aug 06 08:16:54 CST 2025 广播配置更新完成, 配置项: 30 分钟数据流> {“times”:“2025-08-06 08:16”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3025.5146,“avg”:3039.6875,“min”:2985.3137,“max”:3098.7444},“DA-LT-6BT008”:{“ontime”:185.7505,“avg”:185.0521,“min”:183.0417,“max”:187.0461},“DA-LT-5BT0005”:{“ontime”:410.76,“avg”:410.988,“min”:410.64,“max”:411.24},“DA-LT-6BT004”:{“ontime”:1206.7952,“avg”:1206.4737,“min”:1205.8943,“max”:1206.8286},“DA-LT-5BT0004”:{“ontime”:1210.4,“avg”:1210.1584,“min”:1209.8,“max”:1210.5},“DA-LT-6BT005”:{“ontime”:404.6907,“avg”:403.4472,“min”:402.1782,“max”:404.7103},“DA-LT-5BT0008”:{“ontime”:191.96,“avg”:192.4993,“min”:191.9,“max”:193.56},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:139.325,“avg”:139.0523,“min”:137.3125,“max”:142.2375},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.3667,“min”:1209.0,“max”:1210.0},“DA-LT-6BT001”:{“ontime”:178384.45,“avg”:178832.4795,“min”:177665.1,“max”:180298.0},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0005”:{“ontime”:307.125,“avg”:307.7823,“min”:306.375,“max”:311.4375},“DA_DB195_RH_R_0281”:{“ontime”:399.44,“avg”:418.7185,“min”:379.25,“max”:471.42},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:120173.64,“avg”:119901.6293,“min”:118565.47,“max”:121078.25}}} 分钟数据流> {“times”:“2025-08-06 08:17”,“datas”:{“DA-LT-5BT0001”:{“ontime”:3088.785,“avg”:3038.1858,“min”:2982.0671,“max”:3088.785},“DA-LT-6BT008”:{“ontime”:183.2576,“avg”:185.1267,“min”:183.2576,“max”:186.1431},“DA-LT-5BT0005”:{“ontime”:410.58,“avg”:410.86,“min”:410.52,“max”:411.24},“DA-LT-6BT004”:{“ontime”:1206.0945,“avg”:1205.5561,“min”:1205.0934,“max”:1206.0945},“DA-LT-5BT0004”:{“ontime”:1209.8,“avg”:1209.4934,“min”:1209.2001,“max”:1209.9},“DA-LT-6BT005”:{“ontime”:402.2763,“avg”:403.2048,“min”:402.0996,“max”:404.3177},“DA-LT-5BT0008”:{“ontime”:193.58,“avg”:194.234,“min”:193.58,“max”:194.58},“DA-NY-LG1ZL-2-001”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA-LT-4BT0008”:{“ontime”:139.6,“avg”:138.4794,“min”:137.55,“max”:139.6},“DB5701P250A00_101”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0004”:{“ontime”:1209.0,“avg”:1209.0,“min”:1209.0,“max”:1209.0},“DA-LT-6BT001”:{“ontime”:178429.75,“avg”:178591.9377,“min”:177682.62,“max”:179453.27},“DA-LT-4BT0005”:{“ontime”:308.0,“avg”:307.6677,“min”:307.0625,“max”:308.375},“DA-NY-LG2ZL-2-003”:{“ontime”:0.0,“avg”:0.0,“min”:0.0,“max”:0.0},“DA_DB195_RH_R_0281”:{“ontime”:434.05,“avg”:416.3023,“min”:387.8,“max”:444.66},“DA-DB195-RH-B-0200”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-DB195-RH-B-0201”:{“ontime”:1.0,“avg”:1.0,“min”:1.0,“max”:1.0},“DA-LT-4BT0001”:{“ontime”:119510.79,“avg”:120487.2018,“min”:119177.92,“max”:121636.37}}} 同步检测: DA-DB195-RH-B-0201 (1.0000) vs DA-LT-4BT0007 (171.3667) -> false 其中DA-LT-4BT0007配置了isonline=1,duration=1,DA-LT-4BT0007在分钟数据流中,初始没有数据,然后有几分钟有数据,而后有没有数据.但未生成DA-LT-4BT0007的离线异常报告。请改变实现思路。生成完整代码。
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值