LingxinMeng преди 10 месеца
родител
ревизия
438c9acd6e
променени са 1 файла, в които са добавени 140 реда и са изтрити 243 реда
  1. 140 243
      aarch64/pjisuv/master/service/produce_window.go

+ 140 - 243
aarch64/pjisuv/master/service/produce_window.go

@@ -22,9 +22,8 @@ import (
 
 // 所有共享变量
 var (
-	lastGlobalTriggerTime = time.Now()
-	thisGlobalTriggerTime = time.Now()
-	pjisuvParam           = pjisuv_param.PjisuvParam{
+	latestTimeWindowEnd = util.GetTimeString(time.Now())
+	pjisuvParam         = pjisuv_param.PjisuvParam{
 		ObjDicOfTpperception:      make(map[uint32][]float32),
 		ObjTypeDicOfTpperception:  make(map[uint32]uint8),
 		ObjSpeedDicOfTpperception: make(map[uint32]float64),
@@ -61,9 +60,7 @@ func PrepareTimeWindowProducerQueue() {
 						label := f(pjisuvParam)
 						if label != "" {
 							saveTimeWindow(label, util.GetNowTimeCustom(), commonEntity.GetLastTimeWindow())
-							lastGlobalTriggerTime = thisGlobalTriggerTime
-							thisGlobalTriggerTime = time.Now()
-							subscribersTimes[i] = thisGlobalTriggerTime
+							subscribersTimes[i] = time.Now()
 							break
 						}
 					}
@@ -91,9 +88,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -104,9 +99,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -137,9 +130,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -150,9 +141,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -183,9 +172,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -196,9 +183,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -229,9 +214,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -242,9 +225,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -275,9 +256,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -288,9 +267,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -321,9 +298,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -334,9 +309,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -367,9 +340,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -380,9 +351,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -413,9 +382,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -426,9 +393,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -459,9 +424,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -472,9 +435,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -505,9 +466,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -518,9 +477,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -552,9 +509,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -565,9 +520,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -622,9 +575,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -635,9 +586,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -668,9 +617,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -681,9 +629,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -714,9 +661,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -727,9 +672,7 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -760,9 +703,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -773,9 +715,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -806,9 +747,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -819,9 +759,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -852,9 +791,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -865,9 +803,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -898,9 +835,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -911,9 +847,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -944,9 +879,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -957,9 +891,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -990,9 +923,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1003,9 +935,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1036,9 +967,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1049,9 +979,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1093,9 +1022,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1106,9 +1034,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1139,9 +1066,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1152,9 +1078,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1185,9 +1110,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1198,9 +1122,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1231,9 +1154,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1244,9 +1166,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1277,9 +1198,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1290,9 +1210,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1323,9 +1242,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1336,9 +1254,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1369,9 +1286,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1382,9 +1298,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1415,9 +1330,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1428,9 +1342,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1479,9 +1392,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1492,9 +1404,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1534,9 +1445,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1547,9 +1457,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1580,9 +1489,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1593,9 +1501,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1626,9 +1533,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1639,9 +1545,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1672,9 +1577,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1685,9 +1589,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1718,9 +1621,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1731,9 +1633,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1775,9 +1676,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1788,9 +1688,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1820,9 +1719,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1833,9 +1731,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1866,9 +1763,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1879,9 +1775,8 @@ func PrepareTimeWindowProducerQueue() {
 								faultLabel = f(data, &pjisuvParam)
 								if faultLabel != "" {
 									saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
-									lastGlobalTriggerTime = thisGlobalTriggerTime
-									thisGlobalTriggerTime = time.Now()
-									subscribersTimes[i] = thisGlobalTriggerTime
+
+									subscribersTimes[i] = time.Now()
 									goto TriggerSuccess
 								}
 							}
@@ -1915,18 +1810,18 @@ func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *c
 	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
+		if util.TimeCustom1LessEqualThanTimeCustom2(exceptBegin, latestTimeWindowEnd) { // 窗口最早时间不能早于上一个窗口结束时间
+			finalTimeWindowBegin = latestTimeWindowEnd
 		} else {
 			finalTimeWindowBegin = exceptBegin
 		}
+		latestTimeWindowEnd = util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime)
 		newTimeWindow := commonEntity.TimeWindow{
 			FaultTime:       faultHappenTime,
 			TimeWindowBegin: finalTimeWindowBegin,
-			TimeWindowEnd:   util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime),
-			Length:          commonConfig.PlatformConfig.TaskBeforeTime + commonConfig.PlatformConfig.TaskAfterTime + 1,
+			TimeWindowEnd:   latestTimeWindowEnd,
+			Length:          util.CalculateDifferenceOfTimeCustom(finalTimeWindowBegin, latestTimeWindowEnd),
 			Labels:          []string{faultLabel},
 			MasterTopics:    masterTopics,
 			SlaveTopics:     slaveTopics,
@@ -1941,12 +1836,14 @@ func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *c
 		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
+			latestTimeWindowEnd = latestEnd
+			lastTimeWindow.TimeWindowEnd = latestTimeWindowEnd
+			lastTimeWindow.Length = util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, lastTimeWindow.TimeWindowEnd)
 		} else {
 			if util.TimeCustom1GreaterTimeCustom2(expectEnd, lastTimeWindow.TimeWindowEnd) {
-				lastTimeWindow.TimeWindowEnd = expectEnd
-				lastTimeWindow.Length = util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, expectEnd)
+				latestTimeWindowEnd = expectEnd
+				lastTimeWindow.TimeWindowEnd = latestTimeWindowEnd
+				lastTimeWindow.Length = util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, lastTimeWindow.TimeWindowEnd)
 			}
 		}
 		// 更新label