Browse Source

抽取优化

zhangjinkun 6 years ago
parent
commit
52f4e32e33

+ 3 - 4
src/config.json

@@ -3,20 +3,19 @@
     "mgodb": "192.168.3.207:27082",
     "dbsize": 2,
     "dbname": "extract_kf",
-    "redis": "buyer=192.168.3.18:6379,winner=192.168.3.18:6379",
+    "redis": "buyer=192.168.3.207:1377,winner=192.168.3.207:1378,agency=192.168.3.207:1379",
     "elasticsearch": "http://192.168.3.18:9800",
     "elasticPoolSize": 30,
     "mergetable": "projectset",
     "mergetablealias": "projectset_v1",
     "saveresult": false,
     "fieldscore": true,
-    "qualityaudit": true,
+    "qualityaudit": false,
     "saveblock": false,
     "filelength": 100000,
     "iscltlog": false,
-    "brandgoods": true,
+    "brandgoods": false,
     "udptaskid": "5be107e600746bf92debf080",
-    "udpip": "127.0.0.1",
     "udpport": "1484",
     "nextNode": [
         {

+ 171 - 225
src/jy/extract/extract.go

@@ -22,7 +22,8 @@ import (
 )
 
 var (
-	lock          sync.RWMutex
+	lock, lockrule, lockclear, locksave sync.RWMutex
+
 	cut           = ju.NewCut()                          //获取正文并清理
 	ExtLogs       map[*TaskInfo][]map[string]interface{} //抽取日志
 	TaskList      map[string]*ExtractTask                //任务列表
@@ -243,7 +244,10 @@ func (e *ExtractTask) PreInfo(doc map[string]interface{}) (j, jf *ju.Job) {
 		toptype = "结果"
 	}
 	if toptype == "" {
-		toptype = "*"
+		toptype = "all"
+	}
+	if subtype == "" {
+		subtype = "all"
 	}
 	j = &ju.Job{
 		SourceMid:      qu.BsonIdToSId(doc["_id"]),
@@ -340,106 +344,64 @@ func (e *ExtractTask) ExtractDetail(j *ju.Job) {
 		//for _, v := range e.RulePres {
 		//	doc = ExtRegPre(doc, j, v, e.TaskInfo)
 		//}
-		if j.CategorySecond == "" {
-			//抽取规则
-			tmprules := map[string][]*RuleCore{}
-			lock.Lock()
-			if e.RuleCores[j.Category] == nil {
-				j.Category = "*_其他"
+		tmprules := map[string][]*RuleCore{}
+		lockrule.Lock()
+		if j.Category == "all" || j.CategorySecond == "all" {
+			for k, vc1 := range e.RuleCores["all_all"] {
+				tmprules[k] = vc1
 			}
-			for k, vc1 := range e.RuleCores[j.Category] {
+		} else {
+			for k, vc1 := range e.RuleCores[j.Category+"_"+j.CategorySecond] {
 				tmprules[k] = vc1
 			}
-			lock.Unlock()
-			for _, vc1 := range tmprules {
-				for _, vc := range vc1 {
-					tmp := ju.DeepCopy(doc).(map[string]interface{})
-					//是否进入逻辑
-					if !ju.Logic(vc.LuaLogic, tmp) {
-						continue
-					}
-					////抽取-前置规则
-					//for _, v := range vc.RulePres {
-					//	tmp = ExtRegPre(tmp, j, v, e.TaskInfo)
-					//}
-					// log.Debug("抽取-前置规则", tmp)
-
-					//抽取-规则
-					for _, v := range vc.RuleCores {
-						ExtRegCore(vc.ExtFrom, tmp, j, v, e)
-					}
-					// log.Debug("抽取-规则", tmp)
-
-					//项目名称未能抽取到,标题来凑
-					if vc.Field == "projectname" {
-						if len(j.Result[vc.Field]) < 1 {
-							items := make([]*ju.ScoreItem, 1)
-							items[0] = &ju.ScoreItem{Des: "项目名称未能抽取到,标题来凑初始化", ExtFrom: "title", Value: j.Title, Score: 4}
-							field := &ju.ExtField{Field: vc.Field, Code: "title", RuleText: "title", Type: "regexp", MatchType: "title", ExtFrom: vc.ExtFrom, SourceValue: j.Title, Value: j.Title, Score: 4, ScoreItem: items}
-							if tmp["blocktag"] != nil {
-								field.BlockTag = tmp["blocktag"].(map[string]bool)
-							}
-							j.Result[vc.Field] = append(j.Result[vc.Field], field)
-							//j.Result[vc.Field] = append(j.Result[vc.Field], &ju.ExtField{tmp["blocktag"].(map[string]bool), vc.Field, "title", "title", "regexp", "title", vc.ExtFrom, j.Title, 0})
-						}
-					}
+		}
+		if len(tmprules) < 1 { //分类未覆盖部分
+			for k, vc1 := range e.RuleCores["all_all"] {
+				tmprules[k] = vc1
+			}
+		}
+		lockrule.Unlock()
 
-					//抽取-后置规则
-					for _, v := range vc.RuleBacks {
-						ExtRegBack(j, v, e.TaskInfo)
-					}
-					// log.Debug("抽取-后置规则", tmp)
+		//抽取规则
+		for _, vc1 := range tmprules {
+			for _, vc := range vc1 {
+				tmp := ju.DeepCopy(doc).(map[string]interface{})
+				//是否进入逻辑
+				if !ju.Logic(vc.LuaLogic, tmp) {
+					continue
 				}
-			}
-		} else {
-			var cores map[string][]*RuleCore
-			if e.RuleCores[j.Category+"_"+j.CategorySecond] == nil {
-				cores = e.RuleCores["*_其他"]
-			} else {
-				cores = e.RuleCores[j.Category+"_"+j.CategorySecond]
-			}
-			for _, vc1 := range cores {
-				for _, vc := range vc1 {
-					tmp := ju.DeepCopy(doc).(map[string]interface{})
-					//是否进入逻辑
-					if !ju.Logic(vc.LuaLogic, tmp) {
-						continue
-					}
-					//抽取-前置规则
-					for _, v := range vc.RulePres {
-						tmp = ExtRegPre(tmp, j, v, e.TaskInfo)
-					}
-					// log.Debug("抽取-前置规则", tmp)
+				////抽取-前置规则
+				//for _, v := range vc.RulePres {
+				//	tmp = ExtRegPre(tmp, j, v, e.TaskInfo)
+				//}
+				// log.Debug("抽取-前置规则", tmp)
 
-					//抽取-规则
-					for _, v := range vc.RuleCores {
-						ExtRegCore(vc.ExtFrom, tmp, j, v, e)
-					}
-					// log.Debug("抽取-规则", tmp)
+				//抽取-规则
+				for _, v := range vc.RuleCores {
+					ExtRegCore(vc.ExtFrom, tmp, j, v, e)
+				}
+				// log.Debug("抽取-规则", tmp)
 
-					//项目名称未能抽取到,标题来凑
-					if vc.Field == "projectname" {
-						items := make([]*ju.ScoreItem, 1)
-						items[0] = &ju.ScoreItem{Des: "项目名称未能抽取到,标题来凑初始化", ExtFrom: "title", Value: j.Title, Score: 4}
-						field := &ju.ExtField{Field: vc.Field, Code: "title", RuleText: "title", Type: "regexp", MatchType: "title", ExtFrom: vc.ExtFrom, SourceValue: j.Title, Value: j.Title, Score: 4, ScoreItem: items}
-						if len(j.Result[vc.Field]) < 1 {
-							if tmp["blocktag"] != nil {
-								field.BlockTag = tmp["blocktag"].(map[string]bool)
-							}
-							j.Result[vc.Field] = append(j.Result[vc.Field], field)
-							//j.Result[vc.Field] = append(j.Result[vc.Field], &ju.ExtField{tmp["blocktag"].(map[string]bool), vc.Field, "title", "title", "regexp", "title", vc.ExtFrom, j.Title, 0})
-						}
+				//项目名称未能抽取到,标题来凑
+				if vc.Field == "projectname" {
+					//if len(j.Result[vc.Field]) < 1 {//如果抽取有结果,不走标题。待验证,暂时标题加入选举逻辑
+					items := make([]*ju.ScoreItem, 1)
+					items[0] = &ju.ScoreItem{Des: "项目名称未能抽取到,标题来凑初始化", ExtFrom: "title", Value: j.Title, Score: 4}
+					field := &ju.ExtField{Field: vc.Field, Code: "title", RuleText: "title", Type: "title", MatchType: "title", ExtFrom: vc.ExtFrom, SourceValue: j.Title, Value: j.Title, Score: 4, ScoreItem: items}
+					if tmp["blocktag"] != nil {
+						field.BlockTag = tmp["blocktag"].(map[string]bool)
 					}
+					j.Result[vc.Field] = append(j.Result[vc.Field], field)
+					//}
+				}
 
-					//抽取-后置规则
-					for _, v := range vc.RuleBacks {
-						ExtRegBack(j, v, e.TaskInfo)
-					}
-					// log.Debug("抽取-后置规则", tmp)
+				//抽取-后置规则
+				for _, v := range vc.RuleBacks {
+					ExtRegBack(j, v, e.TaskInfo)
 				}
+				// log.Debug("抽取-后置规则", tmp)
 			}
 		}
-
 		//全局后置规则
 		for _, v := range e.RuleBacks {
 			ExtRegBack(j, v, e.TaskInfo)
@@ -471,13 +433,13 @@ func (e *ExtractTask) ExtractDetail(j *ju.Job) {
 		//函数清理
 		for key, val := range j.Result {
 			for _, v := range val {
-				lock.Lock()
+				lockclear.Lock()
 				cfn := e.ClearFn[key]
-				lock.Unlock()
+				lockclear.Unlock()
 				data := clear.DoClearFn(cfn, []interface{}{v.Value, j.Content})
 				v.Value = data[0]
 				//清理特殊符号
-				lock.Lock()
+				lockclear.Lock()
 				if clear.AsyField[key] != nil || clear.SymField[key] != nil ||
 					clear.MesField[key] != nil {
 					text := qu.ObjToString(v.Value)
@@ -486,7 +448,7 @@ func (e *ExtractTask) ExtractDetail(j *ju.Job) {
 						v.Value = text
 					}
 				}
-				lock.Unlock()
+				lockclear.Unlock()
 			}
 		}
 		PackageDetail(j, e) //处理分包信息
@@ -500,77 +462,54 @@ func (e *ExtractTask) ExtractFile(j *ju.Job) {
 	qu.Try(func() {
 		doc := *j.Data
 		//全局前置规则,结果覆盖doc属性
-		for _, v := range e.RulePres {
-			if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
-				doc = ExtRegPre(doc, j, v, e.TaskInfo)
-			}
-		}
+		//		for _, v := range e.RulePres {
+		//			if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
+		//				doc = ExtRegPre(doc, j, v, e.TaskInfo)
+		//			}
+		//		}
 		//抽取规则
-		if j.CategorySecond == "" {
-			for _, vc1 := range e.RuleCores[j.Category] {
-				for _, vc := range vc1 {
-					tmp := ju.DeepCopy(doc).(map[string]interface{})
-					//是否进入逻辑
-					if !ju.Logic(vc.LuaLogic, tmp) {
-						continue
-					}
-					//抽取-前置规则
-					for _, v := range vc.RulePres {
-						if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
-							tmp = ExtRegPre(tmp, j, v, e.TaskInfo)
-						}
-					}
-					// log.Debug("抽取-前置规则", tmp)
-
-					//抽取-规则
-					for _, v := range vc.RuleCores {
-						if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
-							ExtRegCore(vc.ExtFrom, tmp, j, v, e)
-						}
-					}
-					// log.Debug("抽取-规则", tmp)
-
-					//抽取-后置规则
-					for _, v := range vc.RuleBacks {
-						if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
-							ExtRegBack(j, v, e.TaskInfo)
-						}
-					}
-					// log.Debug("抽取-后置规则", tmp)
-				}
+		tmprules := map[string][]*RuleCore{}
+		lockrule.Lock()
+		if j.Category == "all" || j.CategorySecond == "all" {
+			for k, vc1 := range e.RuleCores["all_all"] {
+				tmprules[k] = vc1
 			}
 		} else {
-			for _, vc1 := range e.RuleCores[j.Category+"_"+j.CategorySecond] {
-				for _, vc := range vc1 {
-					tmp := ju.DeepCopy(doc).(map[string]interface{})
-					//是否进入逻辑
-					if !ju.Logic(vc.LuaLogic, tmp) {
-						continue
-					}
-					//抽取-前置规则
-					for _, v := range vc.RulePres {
-						if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
-							tmp = ExtRegPre(tmp, j, v, e.TaskInfo)
-						}
-					}
-					// log.Debug("抽取-前置规则", tmp)
+			for k, vc1 := range e.RuleCores[j.Category+"_"+j.CategorySecond] {
+				tmprules[k] = vc1
+			}
+		}
+		lockrule.Unlock()
+		for _, vc1 := range tmprules {
+			for _, vc := range vc1 {
+				tmp := ju.DeepCopy(doc).(map[string]interface{})
+				//是否进入逻辑
+				if !ju.Logic(vc.LuaLogic, tmp) {
+					continue
+				}
+				//抽取-前置规则
+				//				for _, v := range vc.RulePres {
+				//					if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
+				//						tmp = ExtRegPre(tmp, j, v, e.TaskInfo)
+				//					}
+				//				}
+				// log.Debug("抽取-前置规则", tmp)
 
-					//抽取-规则
-					for _, v := range vc.RuleCores {
-						if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
-							ExtRegCore(vc.ExtFrom, tmp, j, v, e)
-						}
+				//抽取-规则
+				for _, v := range vc.RuleCores {
+					if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
+						ExtRegCore(vc.ExtFrom, tmp, j, v, e)
 					}
-					// log.Debug("抽取-规则", tmp)
+				}
+				// log.Debug("抽取-规则", tmp)
 
-					//抽取-后置规则
-					for _, v := range vc.RuleBacks {
-						if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
-							ExtRegBack(j, v, e.TaskInfo)
-						}
+				//抽取-后置规则
+				for _, v := range vc.RuleBacks {
+					if value, ok := e.FileFields.Load(v.Field); ok && qu.IntAllDef(value, 1) > 0 {
+						ExtRegBack(j, v, e.TaskInfo)
 					}
-					// log.Debug("抽取-后置规则", tmp)
 				}
+				// log.Debug("抽取-后置规则", tmp)
 			}
 		}
 
@@ -607,20 +546,20 @@ func (e *ExtractTask) ExtractFile(j *ju.Job) {
 		//函数清理
 		for key, val := range j.Result {
 			for _, v := range val {
-				lock.Lock()
+				lockclear.Lock()
 				cfn := e.ClearFn[key]
-				lock.Unlock()
+				lockclear.Unlock()
 				data := clear.DoClearFn(cfn, []interface{}{v.Value, j.Content})
 				v.Value = data[0]
 				//清理特殊符号
-				lock.Lock()
+				lockclear.Lock()
 				if clear.AsyField[key] != nil || clear.SymField[key] != nil ||
 					clear.MesField[key] != nil {
 					text := qu.ObjToString(v.Value)
 					text = clear.OtherClean(key, text)
 					v.Value = text
 				}
-				lock.Unlock()
+				lockclear.Unlock()
 			}
 		}
 
@@ -682,7 +621,7 @@ func ExtRegCore(extfrom string, doc map[string]interface{}, j *ju.Job, in *RegLu
 				}
 				if tmps, ok := v.([]map[string]interface{}); ok {
 					for _, tmp := range tmps {
-						field := &ju.ExtField{Field: k, Code: qu.ObjToString(tmp["code"]), RuleText: qu.ObjToString(tmp["ruletext"]), Type: qu.ObjToString(tmp["type"]), MatchType: qu.ObjToString(tmp["matchtype"]), ExtFrom: extfrom, Value: tmp["value"]}
+						field := &ju.ExtField{Field: k, Code: qu.ObjToString(tmp["code"]), RuleText: qu.ObjToString(tmp["ruletext"]), Type: qu.ObjToString(tmp["type"]), MatchType: qu.ObjToString(tmp["matchtype"]), ExtFrom: extfrom, SourceValue: tmp["sourcevalue"], Value: tmp["value"]}
 						if extfrom == "title" {
 							field.Score = 4
 						}
@@ -761,14 +700,15 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 								text := ju.TrimLRSpace(kv.Value, "")
 								if text != "" {
 									kvmap[field] = append(kvmap[field], map[string]interface{}{
-										"field":     field,
-										"code":      in.Code,
-										"ruletext":  tag.Key,
-										"extfrom":   extfrom,
-										"value":     text,
-										"type":      "colon1",
-										"matchtype": "tag_string",
-										"blocktag":  bl.Tag,
+										"field":       field,
+										"code":        in.Code,
+										"ruletext":    tag.Key,
+										"extfrom":     extfrom,
+										"sourcevalue": text,
+										"value":       text,
+										"type":        "colon1",
+										"matchtype":   "tag_string",
+										"blocktag":    bl.Tag,
 									})
 								}
 								break
@@ -778,14 +718,15 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 								text := ju.TrimLRSpace(kv.Value, "")
 								if text != "" {
 									kvmap[field] = append(kvmap[field], map[string]interface{}{
-										"field":     field,
-										"code":      in.Code,
-										"ruletext":  tag.Key,
-										"extfrom":   extfrom,
-										"value":     text,
-										"type":      "colon1",
-										"matchtype": "tag_regexp",
-										"blocktag":  bl.Tag,
+										"field":       field,
+										"code":        in.Code,
+										"ruletext":    tag.Key,
+										"extfrom":     extfrom,
+										"sourcevalue": text,
+										"value":       text,
+										"type":        "colon1",
+										"matchtype":   "tag_regexp",
+										"blocktag":    bl.Tag,
 									})
 								}
 								break
@@ -798,14 +739,15 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 								text := ju.TrimLRSpace(kv.Value, "")
 								if text != "" {
 									kvmap[field] = append(kvmap[field], map[string]interface{}{
-										"field":     field,
-										"code":      in.Code,
-										"ruletext":  tag.Key,
-										"extfrom":   extfrom,
-										"value":     text,
-										"type":      "colon2",
-										"matchtype": "tag_string",
-										"blocktag":  bl.Tag,
+										"field":       field,
+										"code":        in.Code,
+										"ruletext":    tag.Key,
+										"extfrom":     extfrom,
+										"sourcevalue": text,
+										"value":       text,
+										"type":        "colon2",
+										"matchtype":   "tag_string",
+										"blocktag":    bl.Tag,
 									})
 								}
 								break
@@ -815,14 +757,15 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 								text := ju.TrimLRSpace(kv.Value, "")
 								if text != "" {
 									kvmap[field] = append(kvmap[field], map[string]interface{}{
-										"field":     field,
-										"code":      in.Code,
-										"ruletext":  tag.Key,
-										"extfrom":   extfrom,
-										"value":     text,
-										"type":      "colon2",
-										"matchtype": "tag_regexp",
-										"blocktag":  bl.Tag,
+										"field":       field,
+										"code":        in.Code,
+										"ruletext":    tag.Key,
+										"extfrom":     extfrom,
+										"sourcevalue": text,
+										"value":       text,
+										"type":        "colon2",
+										"matchtype":   "tag_regexp",
+										"blocktag":    bl.Tag,
 									})
 								}
 								break
@@ -832,7 +775,7 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 				}
 			}
 			//空格kv
-			if bl.SpaceKV != nil  {
+			if bl.SpaceKV != nil {
 				kvs := bl.SpaceKV.Kvs
 				// log.Debug("SpaceKV", kvs)
 				for _, tag := range tags {
@@ -842,14 +785,15 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 								text := ju.TrimLRSpace(kv.Value, "")
 								if text != "" {
 									kvmap[field] = append(kvmap[field], map[string]interface{}{
-										"field":     field,
-										"code":      in.Code,
-										"ruletext":  tag.Key,
-										"extfrom":   extfrom,
-										"value":     text,
-										"type":      "space",
-										"matchtype": "tag_string",
-										"blocktag":  bl.Tag,
+										"field":       field,
+										"code":        in.Code,
+										"ruletext":    tag.Key,
+										"extfrom":     extfrom,
+										"sourcevalue": text,
+										"value":       text,
+										"type":        "space",
+										"matchtype":   "tag_string",
+										"blocktag":    bl.Tag,
 									})
 								}
 								break
@@ -859,14 +803,15 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 								text := ju.TrimLRSpace(kv.Value, "")
 								if text != "" {
 									kvmap[field] = append(kvmap[field], map[string]interface{}{
-										"field":     field,
-										"code":      in.Code,
-										"ruletext":  tag.Key,
-										"extfrom":   extfrom,
-										"value":     text,
-										"type":      "space",
-										"matchtype": "tag_regexp",
-										"blocktag":  bl.Tag,
+										"field":       field,
+										"code":        in.Code,
+										"ruletext":    tag.Key,
+										"extfrom":     extfrom,
+										"sourcevalue": text,
+										"value":       text,
+										"type":        "space",
+										"matchtype":   "tag_regexp",
+										"blocktag":    bl.Tag,
 									})
 								}
 								break
@@ -876,7 +821,7 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 				}
 			}
 			//表格kv
-			if bl.TableKV != nil  {
+			if bl.TableKV != nil {
 				tkv := bl.TableKV
 				// log.Debug("tkv", tkv)
 				for k, v := range tkv.Kv {
@@ -889,14 +834,15 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 								ruletext = tags[-tkv.KvIndex[fieldname]].Key
 							}
 							kvmap[field] = append(kvmap[field], map[string]interface{}{
-								"field":     field,
-								"code":      in.Code,
-								"ruletext":  ruletext,
-								"extfrom":   "table",
-								"value":     v,
-								"type":      "table",
-								"matchtype": "tag_string",
-								"blocktag":  bl.Tag,
+								"field":       field,
+								"code":        in.Code,
+								"ruletext":    ruletext,
+								"extfrom":     "table",
+								"sourcevalue": v,
+								"value":       v,
+								"type":        "table",
+								"matchtype":   "tag_string",
+								"blocktag":    bl.Tag,
 							})
 						} else { //涉及其他待处理
 							// log.Debug(tags)
@@ -946,7 +892,7 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]bool, j *ju.Job, v
 						if v.RegCore.NumSign == -1 { //正负值修正
 							val = "-" + val
 						}
-						exfield := ju.ExtField{BlockTag: *tag, Field: k, Code: v.Code, RuleText: v.RuleText, Type: "regexp", MatchType: "regcontent", ExtFrom: extfrom, Value: val}
+						exfield := ju.ExtField{BlockTag: *tag, Field: k, Code: v.Code, RuleText: v.RuleText, Type: "regexp", MatchType: "regcontent", ExtFrom: extfrom, SourceValue: val, Value: val}
 						if extfrom == "title" {
 							exfield.Score = 4
 						}
@@ -957,9 +903,9 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]bool, j *ju.Job, v
 						if extfrom == "title" {
 							item.Score = 4
 						}
-						if strings.Contains(val,"\n") {
-							item.Score -=1
-							exfield.Score-=1
+						if strings.Contains(val, "\n") {
+							item.Score -= 1
+							exfield.Score -= 1
 						}
 						if tmp["scoreitem"] == nil {
 							sitems := make([]*ju.ScoreItem, 0)
@@ -1002,7 +948,7 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]bool, j *ju.Job, v
 			if j.Result[v.Field] == nil {
 				j.Result[v.Field] = [](*ju.ExtField){}
 			}
-			field := &ju.ExtField{BlockTag: *tag, Field: v.Field, Code: v.Code, RuleText: v.RuleText, Type: "regexp", MatchType: "regcontent", ExtFrom: extfrom, Value: val}
+			field := &ju.ExtField{BlockTag: *tag, Field: v.Field, Code: v.Code, RuleText: v.RuleText, Type: "regexp", MatchType: "regcontent", ExtFrom: extfrom, SourceValue: val, Value: val}
 			if extfrom == "title" {
 				field.Score = 4
 			}

+ 7 - 6
src/jy/extract/extractInit.go

@@ -1152,32 +1152,32 @@ func (e *ExtractTask) ResultSave(init bool) {
 			for {
 				if len(e.ResultArr) > 500 {
 					arr := e.ResultArr[:500]
+					e.ResultArr = e.ResultArr[500:]
 					qu.Try(func() {
 						db.Mgo.UpSertBulk("extract_result", arr...)
 					}, func(err interface{}) {
 						log.Debug(err)
 					})
-					e.ResultArr = e.ResultArr[500:]
 				} else {
 					arr := e.ResultArr
+					e.ResultArr = [][]map[string]interface{}{}
 					qu.Try(func() {
 						db.Mgo.UpSertBulk("extract_result", arr...)
 					}, func(err interface{}) {
 						log.Debug(err)
 					})
-					e.ResultArr = [][]map[string]interface{}{}
 				}
 				time.Sleep(10 * time.Second)
 			}
 		}()
 	} else {
 		arr := e.ResultArr
+		e.ResultArr = [][]map[string]interface{}{}
 		qu.Try(func() {
 			e.TaskInfo.TDB.UpSertBulk(e.TaskInfo.ToColl, arr...)
 		}, func(err interface{}) {
 			log.Debug(err)
 		})
-		e.ResultArr = [][]map[string]interface{}{}
 	}
 }
 
@@ -1192,32 +1192,33 @@ func (e *ExtractTask) BidSave(init bool) {
 			for {
 				if len(e.BidArr) > 500 {
 					arr := e.BidArr[:500]
+					e.BidArr = e.BidArr[500:]
 					qu.Try(func() {
 						e.TaskInfo.TDB.UpSertBulk(e.TaskInfo.ToColl, arr...)
 					}, func(err interface{}) {
 						log.Debug(err)
 					})
-					e.BidArr = e.BidArr[500:]
 				} else {
 					arr := e.BidArr
+					e.BidArr = [][]map[string]interface{}{}
 					qu.Try(func() {
 						e.TaskInfo.TDB.UpSertBulk(e.TaskInfo.ToColl, arr...)
 					}, func(err interface{}) {
 						log.Debug(err)
 					})
-					e.BidArr = [][]map[string]interface{}{}
+
 				}
 				time.Sleep(10 * time.Second)
 			}
 		}()
 	} else {
 		arr := e.BidArr
+		e.BidArr = [][]map[string]interface{}{}
 		qu.Try(func() {
 			e.TaskInfo.TDB.UpSertBulk(e.TaskInfo.ToColl, arr...)
 		}, func(err interface{}) {
 			log.Debug(err)
 		})
-		e.BidArr = [][]map[string]interface{}{}
 		time.Sleep(1 * time.Second)
 	}
 }

+ 9 - 6
src/jy/extract/extractudp.go

@@ -37,11 +37,11 @@ func processUdpMsg(act byte, data []byte, ra *net.UDPAddr) {
 			eid, _ := rep["lteid"].(string)
 			stype, _ := rep["stype"].(string)
 			if sid == "" || eid == "" {
-				log.Debug("err", "sid=", sid, "eid=", eid)
+				log.Debug("err", "sid=", sid, ",eid=", eid)
 			} else {
 				go Udpclient.WriteUdp([]byte("udpok"), mu.OP_NOOP, ra)
 				if stype == "distributed" { //分布式抽取分支
-					log.Debug("分布式抽取id段", sid, eid)
+					log.Debug("分布式抽取id段", sid, " ", eid)
 					InstanceId := qu.ObjToString(rep["InstanceId"])
 					db.Mgo.Update("ecs", `{"InstanceId":"`+InstanceId+`"}`,
 						map[string]interface{}{
@@ -56,9 +56,9 @@ func processUdpMsg(act byte, data []byte, ra *net.UDPAddr) {
 								"extstatus": "ok",
 							},
 						}, true, false)
-					log.Debug("分布式抽取完成", sid, eid, "释放esc实例", qu.ObjToString(rep["ip"]))
+					log.Debug("分布式抽取完成", sid, " ", eid, "释放esc实例", qu.ObjToString(rep["ip"]))
 				} else {
-					log.Debug("udp通知抽取id段", sid, eid)
+					log.Debug("udp通知抽取id段", sid, " ", eid)
 					ExtractByUdp(sid, eid)
 					log.Debug("udp通知抽取完成,eid=", eid)
 					for _, m := range nextNodes {
@@ -240,13 +240,16 @@ func ExtractByUdp(sid, eid string, instanceId ...string) {
 				}()
 				index++
 				if index%1000 == 0 {
-					log.Debug("index:", index, "页码:", i+1, "_id:", _id)
+					log.Debug("index:", index, ",页码:", i+1, ",_id:", _id)
 				}
 				sid = _id
+				if sid >= eid {
+					break
+				}
 			}
 		}
 		wg.Wait()
 		ext.BidSave(false)
-		log.Debug("抽取完成", "count:", count, "index:", index, "bidtotal:", ext.BidTotal, "sid:", eid)
+		log.Debug("抽取完成,", "count:", count, ",index:", index, ",bidtotal:", ext.BidTotal, ",eid:", eid)
 	}
 }

+ 15 - 15
src/jy/extract/score.go

@@ -102,7 +102,7 @@ func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 					}
 				}
 				tmps[tmpsindex].Score += 2 * qz //乘以权重系数
-				tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "匹配段标签权重", Code: "权重系数乘以2", RuleText: "BlockTag", Type: tgk+field,  ExtFrom: "tagscore.json", Value: tmpsvalue.Value, Score: 2 * qz})
+				tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "匹配段标签权重", Code: "权重系数乘以2", RuleText: "BlockTag", Type: tgk + field, ExtFrom: "tagscore.json", Value: tmpsvalue.Value, Score: 2 * qz})
 			} else {
 				//没有段标签,走其他
 				//qz := TagConfig["其他"][field]
@@ -124,12 +124,12 @@ func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 			if tmpsvalue.ExtFrom != "title" { //非标题抽取
 				if strings.Contains(tmpsvalue.Type, "regexp") {
 					tmps[tmpsindex].Score += qu.Float64All(SoreConfig["extractype"]["regexp"])
-					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "regexp", Code: "fieldscore.regexp", RuleText:  qu.ObjToString(SoreConfig["extractype"]["describe"]), Type: "regexp",  ExtFrom: "fieldscore.json", Value: tmpsvalue.Value, Score: qu.Float64All(SoreConfig["extractype"]["regexp"])})
+					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "regexp", Code: "fieldscore.regexp", RuleText: qu.ObjToString(SoreConfig["extractype"]["describe"]), Type: "regexp", ExtFrom: "fieldscore.json", Value: tmpsvalue.Value, Score: qu.Float64All(SoreConfig["extractype"]["regexp"])})
 				}
 			} else {
 				if strings.Contains(tmpsvalue.Type, "regexp") {
-					tmps[tmpsindex].Score += qu.Float64All(SoreConfig["extractype"]["regexp"])+ 1
-					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "regexp", Code: "fieldscore.regexp", RuleText:  qu.ObjToString(SoreConfig["extractype"]["describe"]), Type: "regexp", ExtFrom:"fieldscore.json", Value: tmpsvalue.Value, Score: qu.Float64All(SoreConfig["extractype"]["regexp"])+ 1 })
+					tmps[tmpsindex].Score += qu.Float64All(SoreConfig["extractype"]["regexp"]) + 1
+					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "regexp", Code: "fieldscore.regexp", RuleText: qu.ObjToString(SoreConfig["extractype"]["describe"]), Type: "regexp", ExtFrom: "fieldscore.json", Value: tmpsvalue.Value, Score: qu.Float64All(SoreConfig["extractype"]["regexp"]) + 1})
 				}
 			}
 			scoreRule := SoreConfig[field]
@@ -157,13 +157,13 @@ func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 							}
 							if valueLen < min {
 								tmps[tmpsindex].Score += qu.Float64All(scores[0])
-								tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "长度打分", Code: fmt.Sprint(valueLen,"<",min), Type: field,  ExtFrom: "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[0])})
+								tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "长度打分", Code: fmt.Sprint(valueLen, "<", min), Type: field, ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[0])})
 							} else if valueLen > max {
 								tmps[tmpsindex].Score += qu.Float64All(scores[2])
-								tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "长度打分", Code: fmt.Sprint(valueLen,">",max), Type: field, ExtFrom: "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[2])})
+								tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "长度打分", Code: fmt.Sprint(valueLen, ">", max), Type: field, ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[2])})
 							} else {
 								tmps[tmpsindex].Score += qu.Float64All(scores[1])
-								tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "长度打分", Code: fmt.Sprint(valueLen,">",min,"&&",valueLen,"<",max), Type: field,  ExtFrom: "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[1])})
+								tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "长度打分", Code: fmt.Sprint(valueLen, ">", min, "&&", valueLen, "<", max), Type: field, ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[1])})
 							}
 						}
 					}
@@ -177,7 +177,7 @@ func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 									reg := p["regexp"].(*regexp.Regexp)
 									if reg.MatchString(qu.ObjToString(tmpsvalue.Value)) {
 										tmps[tmpsindex].Score += qu.Float64All(p["score"])
-										tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "负面词打分"+fmt.Sprint(p["describe"]), Code:field+".negativewords" , RuleText: reg.String(), Type: "regexp",  ExtFrom: "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(p["score"])})
+										tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "负面词打分" + fmt.Sprint(p["describe"]), Code: field + ".negativewords", RuleText: reg.String(), Type: "regexp", ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(p["score"])})
 									}
 								}
 							}, func(err interface{}) {
@@ -195,7 +195,7 @@ func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 									reg := p["regexp"].(*regexp.Regexp)
 									if reg.MatchString(qu.ObjToString(tmpsvalue.Value)) {
 										tmps[tmpsindex].Score += qu.Float64All(p["score"])
-										tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "正面词打分"+fmt.Sprint(p["describe"]), Code: field+".positivewords", RuleText: reg.String(), Type: "regexp",  ExtFrom:  "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(p["score"])})
+										tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "正面词打分" + fmt.Sprint(p["describe"]), Code: field + ".positivewords", RuleText: reg.String(), Type: "regexp", ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(p["score"])})
 									}
 								}
 							}, func(err interface{}) {
@@ -213,7 +213,7 @@ func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 									reg := p["regexp"].(*regexp.Regexp)
 									if reg.MatchString(qu.ObjToString(tmpsvalue.Value)) {
 										tmps[tmpsindex].Score += qu.Float64All(p["score"])
-										tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "位置打分winnerorder"+fmt.Sprint(p["describe"]), Code:  field+".winnerorder", RuleText:reg.String(), Type:  "regexp", ExtFrom:"fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(p["score"])})
+										tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "位置打分winnerorder" + fmt.Sprint(p["describe"]), Code: field + ".winnerorder", RuleText: reg.String(), Type: "regexp", ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(p["score"])})
 									}
 								}
 							}, func(err interface{}) {
@@ -234,13 +234,13 @@ func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 				}
 				if val < min && 0 < val {
 					tmps[tmpsindex].Score += qu.Float64All(scores[0])
-					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "数据范围打分", Code:field+".float", RuleText: fmt.Sprint(val ,"<",min,"&&",0,"<",val),  ExtFrom: "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[0])})
+					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "数据范围打分", Code: field + ".float", RuleText: fmt.Sprint(val, "<", min, "&&", 0, "<", val), ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[0])})
 				} else if val > max {
 					tmps[tmpsindex].Score += qu.Float64All(scores[2])
-					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "数据范围打分", Code: field+".float", RuleText: fmt.Sprint(val,">",max),  ExtFrom: "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[2])})
+					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "数据范围打分", Code: field + ".float", RuleText: fmt.Sprint(val, ">", max), ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[2])})
 				} else if val <= max && val >= min {
 					tmps[tmpsindex].Score += qu.Float64All(scores[1])
-					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "数据范围打分", Code:field+".float", RuleText: fmt.Sprintln(val,"<=", max,"&&", val,">=", min ), ExtFrom: "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[1])})
+					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "数据范围打分", Code: field + ".float", RuleText: fmt.Sprintln(val, "<=", max, "&&", val, ">=", min), ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[1])})
 				}
 			}
 			//其他打分配置
@@ -255,10 +255,10 @@ func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 				}
 				if val > max {
 					tmps[tmpsindex].Score += qu.Float64All(scores[2])
-					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "其他打分配置decimal", Code: field+".decimal", RuleText: fmt.Sprint(val ,">", max),  ExtFrom: "fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[2])})
+					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "其他打分配置decimal", Code: field + ".decimal", RuleText: fmt.Sprint(val, ">", max), ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[2])})
 				} else if val <= max && val > min {
 					tmps[tmpsindex].Score += qu.Float64All(scores[1])
-					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "其他打分配置decimal", Code: field+".decimal", RuleText:fmt.Sprint(val ,"<=", max ,"&&", val,">", min), ExtFrom:"fieldscore.json."+field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[1])})
+					tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{Des: "其他打分配置decimal", Code: field + ".decimal", RuleText: fmt.Sprint(val, "<=", max, "&&", val, ">", min), ExtFrom: "fieldscore.json." + field, Value: tmpsvalue.Value, Score: qu.Float64All(scores[1])})
 				}
 			}
 		}

+ 21 - 18
src/res/fieldscore.json

@@ -19,9 +19,14 @@
         ],
         "negativewords": [
             {
-            "describe": "以*开头",
-            "regstr": "关于|\\[|【",
-            "score": -10
+                "describe": "以*开头",
+                "regstr": "^(关于|\\[|【)",
+                "score": -10
+            },
+            {
+                "describe": "以*结尾",
+                "regstr": ".{2,100}(的|招标|公示|公告|谈判|公开|通知|采购文件)$",
+                "score": -2
             }
         ],
         "length": [
@@ -30,7 +35,7 @@
                 "min": 4,
                 "max": 35,
                 "score": [
-                    -5,
+                    -10,
                     3,
                     -1
                 ]
@@ -48,18 +53,18 @@
         ],
         "negativewords": [
             {
-            "describe": "包含负分",
-            "regstr": "(附件|招标失败|交易中心|不足|公告|变更|采购|招标|废标|废止|流标|中标|投标|评标|开标|供应商|金额|万元|元整|预算|报价|单价|第(\\d|一|二|三|四|五)(名|包)|排名|候选|确定|标段|(标|一|二|三|四|五)包|中选|成交|包号|(A|B|C|D|E|F|G)包|地址|详情|要求|推荐|名称|评审|得分|合同|平方米|公示期|结果|备注|说明|单位|代表|委托|工作日|营业(执|期)|通过|代码|电话|联系|条件|合理|费率|以上|以下|拟定|为|注:|\\d[\\s]{0,10}(\\.|元|包|米|平米|平方米|吨|辆|千克|克|毫克|毫升|公升|套|件|瓶|箱|只|台|年|月|日|天|号)|(:|:|;|;|?|¥|\\*|%)|^[a-zA-Z0-9-]{5,100}|^[a-zA-Z0-9-]{1,100}$|[a-zA-Z0-9-]{10,100})",
-            "score": -10
+                "describe": "包含负分",
+                "regstr": "(附件|招标失败|交易中心|不足|公告|变更|采购|招标|废标|废止|流标|中标|投标|评标|开标|供应商|金额|万元|元整|预算|报价|单价|第(\\d|一|二|三|四|五)(名|包)|排名|候选|确定|标段|(标|一|二|三|四|五)包|中选|成交|包号|(A|B|C|D|E|F|G)包|地址|详情|要求|推荐|名称|评审|得分|合同|平方米|公示期|结果|备注|说明|单位|代表|委托|工作日|营业(执|期)|通过|代码|电话|联系|条件|合理|费率|以上|以下|拟定|为|注:|\\d[\\s]{0,10}(\\.|元|包|米|平米|平方米|吨|辆|千克|克|毫克|毫升|公升|套|件|瓶|箱|只|台|年|月|日|天|号)|(:|:|;|;|?|¥|\\*|%)|^[a-zA-Z0-9-]{5,100}|^[a-zA-Z0-9-]{1,100}$|[a-zA-Z0-9-]{10,100})",
+                "score": -10
             }
         ],
         "length": [
             {
                 "describe": "长度打分min>val:-6,min<=val<=max:1,max<val:-1",
-                "min": 5,
+                "min": 4,
                 "max": 20,
                 "score": [
-                    -5,
+                    -10,
                     3,
                     -1
                 ]
@@ -85,16 +90,16 @@
         "length": [
             {
                 "describe": "长度打分min>val:-6,min<=val<=max:1,max<val:-1",
-                "min": 5,
+                "min": 4,
                 "max": 20,
                 "score": [
-                    -5,
+                    -10,
                     3,
                     -1
                 ]
             }
         ],
-        "winnerorder":[
+        "winnerorder": [
             {
                 "describe": "非结尾",
                 "regstr": ".*[^集团|公司|学校|中心|家具城|门诊|\\[大中小\\]学|部|院|局|厂|店|所|队|社|室|厅|段|会|场|行]$",
@@ -123,7 +128,7 @@
                 "min": 4,
                 "max": 30,
                 "score": [
-                    -5,
+                    -10,
                     3,
                     -1
                 ]
@@ -155,8 +160,7 @@
     },
     "buyertel": {
         "type": "string",
-        "positivewords": [
-        ],
+        "positivewords": [],
         "negativewords": [
             {
                 "describe": "出现中文汉字",
@@ -179,8 +183,7 @@
     },
     "projectcode": {
         "type": "string",
-        "positivewords": [
-        ],
+        "positivewords": [],
         "negativewords": [
             {
                 "describe": "全为中文汉字或符号",
@@ -257,7 +260,7 @@
                 "min": 2,
                 "max": 500,
                 "score": [
-                    -5,
+                    -10,
                     3,
                     -1
                 ]

+ 1 - 1
udps/main.go

@@ -40,7 +40,7 @@ func main() {
 		startid = bson.NewObjectIdWithTime(start)
 		endid = bson.NewObjectIdWithTime(end)
 	}
-	log.Println(startid, startid, ip, port, stype)
+	log.Println(startid, endid, ip, port, stype)
 	udpclient = mu.UdpClient{Local: ":1470", BufSize: 1024}
 	udpclient.Listen(processUdpMsg)
 	by, _ := json.Marshal(map[string]interface{}{

+ 2 - 2
versioncomparison/main.go

@@ -124,7 +124,7 @@ func getVersionData() {
 			FieldData[key] = rd
 		}
 	}
-	log.Println("pre version 加载完成", len(*list1))
+	log.Println("pre version 加载完成")
 
 	list2, _ := Newmgo.Find(qu.ObjToString(SysConfig["newc"]), query, nil, `{}`, false, -1, -1)
 	for _, v := range *list2 {
@@ -146,7 +146,7 @@ func getVersionData() {
 			FieldData[field] = rd
 		}
 	}
-	log.Println("new version 加载完成", len(*list2))
+	log.Println("new version 加载完成")
 	for k, v := range FieldData {
 		cp := &Compare{Field: k}
 		for _, d := range v {