LingxinMeng 10 mēneši atpakaļ
vecāks
revīzija
87f8bd7fda

+ 1 - 0
aarch64/pjisuv/master/service/move_bag_and_send_window.go

@@ -57,6 +57,7 @@ func RunTimeWindowProducerQueue() {
 		if !move && bigger {
 			currentTimeWindow.CanUpload = "yes"
 			// 如果第一个已经大于了timeWindowEnd,则触发上传并删除
+			// todo 校验补齐机制,可能损耗性能,暂时搁置
 			//domain.SupplyCopyBags(commonConfig.CloudConfig.BagDataDir, commonConfig.CloudConfig.BagCopyDir, currentTimeWindow)
 			entity.RefreshTcpSendTime()
 			go sendTimeWindowByTcp(currentTimeWindow)

+ 247 - 83
aarch64/pjisuv/master/service/produce_window.go

@@ -22,7 +22,9 @@ import (
 
 // 所有共享变量
 var (
-	pjisuvParam = pjisuv_param.PjisuvParam{
+	lastGlobalTriggerTime = time.Now()
+	thisGlobalTriggerTime = time.Now()
+	pjisuvParam           = pjisuv_param.PjisuvParam{
 		ObjDicOfTpperception:      make(map[uint32][]float32),
 		ObjTypeDicOfTpperception:  make(map[uint32]uint8),
 		ObjSpeedDicOfTpperception: make(map[uint32]float64),
@@ -59,7 +61,9 @@ func PrepareTimeWindowProducerQueue() {
 						label := f(pjisuvParam)
 						if label != "" {
 							saveTimeWindow(label, util.GetNowTimeCustom(), commonEntity.GetLastTimeWindow())
-							subscribersTimes[i] = time.Now()
+							lastGlobalTriggerTime = thisGlobalTriggerTime
+							thisGlobalTriggerTime = time.Now()
+							subscribersTimes[i] = thisGlobalTriggerTime
 							break
 						}
 					}
@@ -87,7 +91,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -98,7 +104,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -129,7 +137,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -140,7 +150,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -171,7 +183,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -182,7 +196,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -213,7 +229,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -224,7 +242,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -255,7 +275,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -266,7 +288,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -297,7 +321,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -308,7 +334,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -339,7 +367,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -350,7 +380,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -381,7 +413,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -392,7 +426,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -423,7 +459,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -434,7 +472,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -465,7 +505,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -476,7 +518,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -508,7 +552,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -519,7 +565,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -574,7 +622,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -585,7 +635,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -616,7 +668,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -627,7 +681,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -658,7 +714,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -669,7 +727,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -700,7 +760,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -711,7 +773,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -742,7 +806,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -753,7 +819,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -784,7 +852,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -795,7 +865,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -826,7 +898,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -837,7 +911,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -868,7 +944,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -879,7 +957,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -910,7 +990,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -921,7 +1003,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -952,7 +1036,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -963,7 +1049,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1005,7 +1093,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1016,7 +1106,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1047,7 +1139,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1058,7 +1152,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1089,7 +1185,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1100,7 +1198,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1131,7 +1231,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1142,7 +1244,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1173,7 +1277,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1184,7 +1290,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1215,7 +1323,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1226,7 +1336,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1257,7 +1369,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1268,7 +1382,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1299,7 +1415,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1310,7 +1428,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1359,7 +1479,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1370,7 +1492,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1410,7 +1534,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1421,7 +1547,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1452,7 +1580,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1463,7 +1593,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1494,7 +1626,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1505,7 +1639,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1536,7 +1672,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1547,7 +1685,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1578,7 +1718,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1589,7 +1731,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1631,7 +1775,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1642,7 +1788,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1672,7 +1820,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1683,7 +1833,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1714,7 +1866,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1725,7 +1879,9 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									subscribersTimes[i] = time.Now()
+									lastGlobalTriggerTime = thisGlobalTriggerTime
+									thisGlobalTriggerTime = time.Now()
+									subscribersTimes[i] = thisGlobalTriggerTime
 									goto TriggerSuccess
 								}
 							}
@@ -1758,9 +1914,17 @@ func PrepareTimeWindowProducerQueue() {
 func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *commonEntity.TimeWindow) {
 	masterTopics, slaveTopics := getTopicsOfNode(faultLabel)
 	if lastTimeWindow == nil || util.TimeCustom1GreaterTimeCustom2(faultHappenTime, lastTimeWindow.TimeWindowEnd) { // 如果是不在旧故障窗口内,添加一个新窗口
+		exceptBegin := util.TimeCustomChange(faultHappenTime, -commonConfig.PlatformConfig.TaskBeforeTime)
+		earliestBegin := util.GetTimeString(lastGlobalTriggerTime) // 窗口最早时间不能早于上一次触发时间
+		finalTimeWindowBegin := ""
+		if util.TimeCustom1LessEqualThanTimeCustom2(exceptBegin, earliestBegin) {
+			finalTimeWindowBegin = earliestBegin
+		} else {
+			finalTimeWindowBegin = exceptBegin
+		}
 		newTimeWindow := commonEntity.TimeWindow{
 			FaultTime:       faultHappenTime,
-			TimeWindowBegin: util.TimeCustomChange(faultHappenTime, -commonConfig.PlatformConfig.TaskBeforeTime),
+			TimeWindowBegin: finalTimeWindowBegin,
 			TimeWindowEnd:   util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime),
 			Length:          commonConfig.PlatformConfig.TaskBeforeTime + commonConfig.PlatformConfig.TaskAfterTime + 1,
 			Labels:          []string{faultLabel},
@@ -1774,10 +1938,10 @@ func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *c
 		commonEntity.TimeWindowProducerQueueMutex.RLock()
 		defer commonEntity.TimeWindowProducerQueueMutex.RUnlock()
 		// 更新故障窗口end时间
-		maxEnd := util.TimeCustomChange(lastTimeWindow.TimeWindowBegin, commonConfig.PlatformConfig.TaskMaxTime)
-		expectEnd := util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime)
-		if util.TimeCustom1GreaterTimeCustom2(expectEnd, maxEnd) {
-			lastTimeWindow.TimeWindowEnd = maxEnd
+		latestEnd := util.TimeCustomChange(lastTimeWindow.TimeWindowBegin, commonConfig.PlatformConfig.TaskMaxTime) // 窗口最晚关闭时间是窗口开启时间加上最大任务时间
+		expectEnd := util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime)              // 窗口期望关闭时间是触发时间加上后置时间
+		if util.TimeCustom1GreaterTimeCustom2(expectEnd, latestEnd) {
+			lastTimeWindow.TimeWindowEnd = latestEnd
 			lastTimeWindow.Length = commonConfig.PlatformConfig.TaskMaxTime
 		} else {
 			if util.TimeCustom1GreaterTimeCustom2(expectEnd, lastTimeWindow.TimeWindowEnd) {