zhangjinkun 6 年 前
コミット
e1c72241e9

+ 14 - 12
src/jy/cluster/distributed.go

@@ -35,6 +35,7 @@ func IdsRange(table, sdate, edate string) int {
 					ids[fmt.Sprint(k)][1],
 					ids[fmt.Sprint(k)][2],
 					qu.ObjToString(v["InstanceId"]),
+					ids[fmt.Sprint(k)][3],
 				},
 			},
 		})
@@ -82,44 +83,45 @@ func RangeIdsByDate(escnum int, start, end time.Time) map[string][]string {
 	total_back := DB.Count("bidding_back", bson.M{"_id": bson.M{"$gte": bson.NewObjectIdWithTime(start), "$lt": bson.NewObjectIdWithTime(end)}})
 	total += total_back
 	pagesize := (total + escnum - 1) / escnum
-	log.Printf("total:%d total_back:%d pagesize:%d escnum:%d", total, total_back, pagesize, escnum)
+	log.Printf("total:%d pagesize:%d escnum:%d", total, pagesize, escnum)
 	nums := 0
+	table := "bidding_back"
 	for i := 0; i < escnum; i++ {
 		log.Println("escnum", i)
 		sid := bson.NewObjectIdWithTime(start)
 		var eid bson.ObjectId
 		var idsnum = 0
-		table := "bidding_back"
 		for {
 			tmpsid := bson.NewObjectIdWithTime(start)
-			end := start.Add(4 * time.Hour)
-			if end.Unix() > end.Unix() {
+			endi := start.Add(4 * time.Hour)
+			if endi.Unix() > end.Unix() {
 				eid = bson.NewObjectIdWithTime(end)
 			} else {
-				eid = bson.NewObjectIdWithTime(end)
+				eid = bson.NewObjectIdWithTime(endi)
 			}
-			start = end
+			start = endi
 			query := bson.M{"_id": bson.M{"$gte": tmpsid, "$lt": eid}}
 			count := DB.Count(table, query)
-			log.Println(count, table, query)
+			//log.Println(count, table, query)
 			if count < 1 { //校验是否切换table
-				tmpnum := DB.Count(table, bson.M{"_id": bson.M{"$gte": tmpsid, "$lt": bson.NewObjectIdWithTime(end.Add(24 * 10 * time.Hour) /*连续10天无数据*/)}})
-				if tmpnum < 1 && table != "bidding" {
+				tmpnum := DB.Count(table, bson.M{"_id": bson.M{"$gte": tmpsid, "$lt": bson.NewObjectIdWithTime(endi.Add(30 * 24 * time.Hour))}})
+				if tmpnum < 1 && table == "bidding_back" {
 					table = "bidding"
 					start = start.Add(-4 * time.Hour)
+					log.Println("切换table,bidding", start)
 					continue
 				}
 			} else {
 				idsnum += count
 			}
-			log.Printf("i:%d count:%d,date:%s", i, idsnum, end.Format(qu.Date_Full_Layout))
+			//log.Printf("i:%d count:%d,date:%s", i, idsnum, end.Format(qu.Date_Full_Layout))
 			if idsnum >= pagesize || start.Unix() > time.Now().Unix() || count > 5000000 { //测试数据count > 5000000
 				break
 			}
 		}
 		nums += idsnum
-		ids[fmt.Sprint(i)] = []string{qu.BsonIdToSId(sid), qu.BsonIdToSId(eid), fmt.Sprint(idsnum)}
-		log.Println("nums", nums)
+		ids[fmt.Sprint(i)] = []string{qu.BsonIdToSId(sid), qu.BsonIdToSId(eid), fmt.Sprint(idsnum), table}
+		log.Println("nums", nums, table)
 	}
 	return ids
 }

+ 111 - 105
src/jy/extract/extpackage.go

@@ -4,138 +4,144 @@ package extract
 import (
 	"jy/clear"
 	ju "jy/util"
+	"log"
 	qu "qfw/util"
 	"reflect"
 )
 
 //处理分包信息
 func PackageDetail(j *ju.Job, e *ExtractTask) {
-	if len(j.BlockPackage) > 0 {
-		packageResult := map[string]map[string]interface{}{}
-		packagenum := len(j.BlockPackage)
-		for pkName, pkg := range j.BlockPackage {
-			//是否清理标记
-			clearmap := map[string]bool{}
-			sonJobResult := map[string]interface{}{}
-			sonJobResult["text"] = pkg.Text
-			sonJobResult["origin"] = pkg.Origin
-			sonJobResult["type"] = pkg.Type
-			sonJobResult["winnerorder"] = pkg.WinnerOrder
-			for k, tags := range e.Tag {
-			L:
-				for _, tag := range tags {
-					if pkg.TableKV != nil {
-						for key, val := range pkg.TableKV.Kv {
-							if tag.Key == key {
-								clearmap[k] = false
-								var tmpval interface{}
-								if len(e.ClearFn[k]) > 0 {
-									data := clear.DoClearFn(e.ClearFn[k], []interface{}{val, j.Content})
-									tmpval = data[0]
-								} else {
-									tmpval = val
-								}
-								sonJobResult[k] = tmpval
-								if packagenum == 1 {
-									field := &ju.ExtField{
-										Field:     k,
-										Code:      "package",
-										RuleText:  "package",
-										Type:      "table",
-										MatchType: "tag_string",
-										ExtFrom:   "package",
-										Value:     tmpval,
-										Score:     0,
+	qu.Try(func() {
+		if len(j.BlockPackage) > 0 {
+			packageResult := map[string]map[string]interface{}{}
+			packagenum := len(j.BlockPackage)
+			for pkName, pkg := range j.BlockPackage {
+				//是否清理标记
+				clearmap := map[string]bool{}
+				sonJobResult := map[string]interface{}{}
+				sonJobResult["text"] = pkg.Text
+				sonJobResult["origin"] = pkg.Origin
+				sonJobResult["type"] = pkg.Type
+				sonJobResult["winnerorder"] = pkg.WinnerOrder
+				for k, tags := range e.Tag {
+				L:
+					for _, tag := range tags {
+						if pkg.TableKV != nil {
+							for key, val := range pkg.TableKV.Kv {
+								if tag.Key == key {
+									clearmap[k] = false
+									var tmpval interface{}
+									if len(e.ClearFn[k]) > 0 {
+										data := clear.DoClearFn(e.ClearFn[k], []interface{}{val, j.Content})
+										tmpval = data[0]
+									} else {
+										tmpval = val
+									}
+									sonJobResult[k] = tmpval
+									if packagenum == 1 {
+										field := &ju.ExtField{
+											Field:     k,
+											Code:      "package",
+											RuleText:  "package",
+											Type:      "table",
+											MatchType: "tag_string",
+											ExtFrom:   "package",
+											Value:     tmpval,
+											Score:     0,
+										}
+										j.Result[k] = append(j.Result[k], field)
 									}
-									j.Result[k] = append(j.Result[k], field)
+									break L
 								}
-								break L
 							}
 						}
-					}
-					if pkg.ColonKV != nil {
-						for key, val := range pkg.ColonKV.Kv {
-							if tag.Key == key {
-								clearmap[k] = true
-								var tmpval interface{}
-								if len(e.ClearFn[k]) > 0 {
-									data := clear.DoClearFn(e.ClearFn[k], []interface{}{val, j.Content})
-									tmpval = data[0]
-								} else {
-									tmpval = val
-								}
-								sonJobResult[k] = tmpval
-								if packagenum == 1 {
-									field := &ju.ExtField{
-										Field:     k,
-										Code:      "package",
-										RuleText:  "package",
-										Type:      "colon",
-										MatchType: "tag_string",
-										ExtFrom:   "package",
-										Value:     tmpval,
-										Score:     0,
+						if pkg.ColonKV != nil {
+							for key, val := range pkg.ColonKV.Kv {
+								if tag.Key == key {
+									clearmap[k] = true
+									var tmpval interface{}
+									if len(e.ClearFn[k]) > 0 {
+										data := clear.DoClearFn(e.ClearFn[k], []interface{}{val, j.Content})
+										tmpval = data[0]
+									} else {
+										tmpval = val
 									}
-									j.Result[k] = append(j.Result[k], field)
+									sonJobResult[k] = tmpval
+									if packagenum == 1 {
+										field := &ju.ExtField{
+											Field:     k,
+											Code:      "package",
+											RuleText:  "package",
+											Type:      "colon",
+											MatchType: "tag_string",
+											ExtFrom:   "package",
+											Value:     tmpval,
+											Score:     0,
+										}
+										j.Result[k] = append(j.Result[k], field)
+									}
+									break L
 								}
-								break L
 							}
 						}
-					}
-					if pkg.SpaceKV != nil {
-						for key, val := range pkg.SpaceKV.Kv {
-							if tag.Key == key {
-								clearmap[k] = true
-								var tmpval interface{}
-								if len(e.ClearFn[k]) > 0 {
-									data := clear.DoClearFn(e.ClearFn[k], []interface{}{val, j.Content})
-									tmpval = data[0]
-								} else {
-									tmpval = val
-								}
-								sonJobResult[k] = tmpval
-								if packagenum == 1 {
-									field := &ju.ExtField{
-										Field:     k,
-										Code:      "package",
-										RuleText:  "package",
-										Type:      "space",
-										MatchType: "tag_string",
-										ExtFrom:   "package",
-										Value:     tmpval,
-										Score:     0,
+						if pkg.SpaceKV != nil {
+							for key, val := range pkg.SpaceKV.Kv {
+								if tag.Key == key {
+									clearmap[k] = true
+									var tmpval interface{}
+									if len(e.ClearFn[k]) > 0 {
+										data := clear.DoClearFn(e.ClearFn[k], []interface{}{val, j.Content})
+										tmpval = data[0]
+									} else {
+										tmpval = val
+									}
+									sonJobResult[k] = tmpval
+									if packagenum == 1 {
+										field := &ju.ExtField{
+											Field:     k,
+											Code:      "package",
+											RuleText:  "package",
+											Type:      "space",
+											MatchType: "tag_string",
+											ExtFrom:   "package",
+											Value:     tmpval,
+											Score:     0,
+										}
+										j.Result[k] = append(j.Result[k], field)
 									}
-									j.Result[k] = append(j.Result[k], field)
+									break L
 								}
-								break L
 							}
 						}
 					}
 				}
-			}
-			//如果有中标候选人排序,优先用第一中标候选人的中标单位和中标金额覆盖该包里面相应的字段的值
-			if pkg.WinnerOrder != nil && len(pkg.WinnerOrder) > 0 {
-				firstWinnerOrder := pkg.WinnerOrder[0]
-				if qu.ObjToString(sonJobResult["winner"]) == "" || (!pkg.Accuracy && qu.ObjToString(firstWinnerOrder["entname"]) != "" && qu.Int64All(firstWinnerOrder["sort"]) == 1) {
-					sonJobResult["winner"] = firstWinnerOrder["entname"]
-				}
-				if qu.Float64All(sonJobResult["bidamount"]) == 0 || (!pkg.Accuracy && qu.Float64All(firstWinnerOrder["price"]) > 0 && qu.Int64All(firstWinnerOrder["sort"]) == 1) {
-					sonJobResult["bidamount"] = firstWinnerOrder["price"]
+				//如果有中标候选人排序,优先用第一中标候选人的中标单位和中标金额覆盖该包里面相应的字段的值
+				if pkg.WinnerOrder != nil && len(pkg.WinnerOrder) > 0 {
+					firstWinnerOrder := pkg.WinnerOrder[0]
+					if qu.ObjToString(sonJobResult["winner"]) == "" || (!pkg.Accuracy && qu.ObjToString(firstWinnerOrder["entname"]) != "" && qu.Int64All(firstWinnerOrder["sort"]) == 1) {
+						sonJobResult["winner"] = firstWinnerOrder["entname"]
+					}
+					if qu.Float64All(sonJobResult["bidamount"]) == 0 || (!pkg.Accuracy && qu.Float64All(firstWinnerOrder["price"]) > 0 && qu.Int64All(firstWinnerOrder["sort"]) == 1) {
+						sonJobResult["bidamount"] = firstWinnerOrder["price"]
+					}
 				}
+				//log.Println(pkName, sonJobResult)
+				sonJobResult["clear"] = clearmap
+				packageResult[pkName] = sonJobResult
+			}
+			if len(packageResult) > 0 {
+				j.PackageInfo = packageResult
 			}
-			//log.Println(pkName, sonJobResult)
-			sonJobResult["clear"] = clearmap
-			packageResult[pkName] = sonJobResult
-		}
-		if len(packageResult) > 0 {
-			j.PackageInfo = packageResult
 		}
-	}
-	extRegBackPack(j, e)
+		extRegBackPack(j, e)
+	}, func(err interface{}) {
+		log.Println("PackageDetail err", err)
+	})
 }
 
 //清理分包信息
 func extRegBackPack(j *ju.Job, e *ExtractTask) {
+	defer qu.Catch()
 	//正则清理
 	for _, rc := range e.RuleCores {
 		for pk, pack := range j.PackageInfo {

+ 78 - 62
src/jy/extract/extract.go

@@ -89,6 +89,7 @@ func RunExtractTestTask(ext *ExtractTask, startId, num string) bool {
 
 //启动抽取
 func StartExtractTaskId(taskId string) bool {
+	defer qu.Catch()
 	isgo := false
 	ext := TaskList[taskId]
 	if ext == nil {
@@ -133,6 +134,7 @@ func StartExtractTaskId(taskId string) bool {
 
 //停止抽取
 func StopExtractTaskId(taskId string) bool {
+	defer qu.Catch()
 	ext := TaskList[taskId]
 	if ext != nil {
 		ext.IsRun = false
@@ -145,6 +147,7 @@ func StopExtractTaskId(taskId string) bool {
 
 //开始抽取
 func RunExtractTask(taskId string) {
+	defer qu.Catch()
 	ext := TaskList[taskId]
 	query := bson.M{"_id": bson.M{"$gte": bson.ObjectIdHex(ext.TaskInfo.LastExtId)}}
 	count := ext.TaskInfo.FDB.Count(ext.TaskInfo.FromColl, query)
@@ -182,6 +185,7 @@ func RunExtractTask(taskId string) {
 
 //信息预处理
 func PreInfo(doc map[string]interface{}) *ju.Job {
+	defer qu.Catch()
 	detail := ""
 	d1, _ := doc["detail"].(string)
 	d2, _ := doc["contenthtml"].(string)
@@ -312,15 +316,16 @@ func (e *ExtractTask) ExtractProcess(j *ju.Job) {
 		//		log.Println("抽取结果", j.Title, j.SourceMid, string(bs))
 		//分析抽取结果并保存 todo
 		AnalysisSaveResult(j, e)
+		<-e.TaskInfo.ProcessPool
 	}, func(err interface{}) {
-		log.Println((*j.Data)["_id"], err)
+		log.Println("ExtractProcess err", err, (*j.Data)["_id"])
 		<-e.TaskInfo.ProcessPool
 	})
-	<-e.TaskInfo.ProcessPool
 }
 
 //前置过滤
 func ExtRegPre(doc map[string]interface{}, j *ju.Job, in *RegLuaInfo, t *TaskInfo) map[string]interface{} {
+	defer qu.Catch()
 	before := ju.DeepCopy(doc).(map[string]interface{})
 	extinfo := map[string]interface{}{}
 	if in.IsLua {
@@ -345,6 +350,7 @@ func ExtRegPre(doc map[string]interface{}, j *ju.Job, in *RegLuaInfo, t *TaskInf
 
 //抽取-规则
 func ExtRegCore(extfrom string, doc map[string]interface{}, j *ju.Job, in *RegLuaInfo, et *ExtractTask) {
+	defer qu.Catch()
 	//废标、流标、ppp等跳过
 	b := IsExtract(in.Field, j.Title, j.Content)
 	if !b {
@@ -385,6 +391,7 @@ func ExtRegCore(extfrom string, doc map[string]interface{}, j *ju.Job, in *RegLu
 
 //lua脚本根据属性设置提取kv值
 func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]*Tag) map[string][]map[string]interface{} {
+	defer qu.Catch()
 	kvmap := map[string][]map[string]interface{}{}
 	for fieldname, field := range in.LFields {
 		lock.Lock()
@@ -547,6 +554,7 @@ func getKvByLuaFields(extfrom string, j *ju.Job, in *RegLuaInfo, t map[string][]
 
 //正则提取结果
 func extRegCoreToResult(extfrom, text string, j *ju.Job, v *RegLuaInfo) map[string][]map[string]interface{} {
+	defer qu.Catch()
 	extinfo := map[string][]map[string]interface{}{}
 	if v.RegCore.Bextract { //正则是两部分的,可以直接抽取的(含下划线)
 		apos := v.RegCore.Reg.FindAllStringSubmatchIndex(text, -1)
@@ -614,6 +622,7 @@ func extRegCoreToResult(extfrom, text string, j *ju.Job, v *RegLuaInfo) map[stri
 
 //后置过滤
 func ExtRegBack(j *ju.Job, in *RegLuaInfo, t *TaskInfo) {
+	defer qu.Catch()
 	if in.IsLua {
 		result := GetResultMapForLua(j)
 		lua := ju.LuaScript{Code: in.Code, Name: in.Name, Result: result, Script: in.RuleText}
@@ -695,6 +704,7 @@ func ExtRegBack(j *ju.Job, in *RegLuaInfo, t *TaskInfo) {
 
 //获取抽取结果map[string][]interface{},lua脚本使用
 func GetResultMapForLua(j *ju.Job) map[string][]map[string]interface{} {
+	defer qu.Catch()
 	result := map[string][]map[string]interface{}{}
 	for key, val := range j.Result {
 		if result[key] == nil {
@@ -718,6 +728,7 @@ func GetResultMapForLua(j *ju.Job) map[string][]map[string]interface{} {
 
 //抽取日志
 func AddExtLog(ftype, sid string, before interface{}, extinfo interface{}, v *RegLuaInfo, t *TaskInfo) {
+	defer qu.Catch()
 	if !t.IsEtxLog {
 		return
 	}
@@ -742,6 +753,7 @@ func AddExtLog(ftype, sid string, before interface{}, extinfo interface{}, v *Re
 
 //保存抽取日志
 func SaveExtLog() {
+	defer qu.Catch()
 	tmpLogs := map[*TaskInfo][]map[string]interface{}{}
 	lock.Lock()
 	tmpLogs = ExtLogs
@@ -773,77 +785,78 @@ type FieldValue struct {
 
 //分析抽取结果并保存
 func AnalysisSaveResult(j *ju.Job, e *ExtractTask) {
-	doc := j.Data
-	result := j.Result
-	_id := qu.BsonIdToSId((*doc)["_id"])
-	iscore, _ := ju.Config["fieldscore"].(bool)
-	if iscore { //打分
-		result = ScoreFields(j)
-	}
-	//结果排序
-	values := map[string][]*ju.SortObject{}
-	for key, val := range result {
-		fieldValue := map[string][]interface{}{}
-		if iscore { //走打分
-			for _, v := range val {
-				if len(fmt.Sprint(v.Value)) < 1 {
-					continue //去除空串
+	qu.Try(func() {
+		doc := j.Data
+		result := j.Result
+		_id := qu.BsonIdToSId((*doc)["_id"])
+		iscore, _ := ju.Config["fieldscore"].(bool)
+		if iscore { //打分
+			result = ScoreFields(j)
+		}
+		//结果排序
+		values := map[string][]*ju.SortObject{}
+		for key, val := range result {
+			fieldValue := map[string][]interface{}{}
+			if iscore { //走打分
+				for _, v := range val {
+					if len(fmt.Sprint(v.Value)) < 1 {
+						continue //去除空串
+					}
+					fieldValue[fmt.Sprint(v.Value)+v.Type] = []interface{}{v.Score, v.Value}
+				}
+			} else { //不走打分,按出现频次
+				for _, v := range val {
+					if len(fmt.Sprint(v.Value)) < 1 {
+						continue //去除空串
+					}
+					if fieldValue[fmt.Sprint(v.Value)] == nil {
+						fieldValue[fmt.Sprint(v.Value)] = []interface{}{0, v.Value}
+					} else {
+						fieldValue[fmt.Sprint(v.Value)][0] = qu.IntAll(fieldValue[fmt.Sprint(v.Value)][0]) + 1
+					}
 				}
-				fieldValue[fmt.Sprint(v.Value)+v.Type] = []interface{}{v.Score, v.Value}
 			}
-		} else { //不走打分,按出现频次
-			for _, v := range val {
-				if len(fmt.Sprint(v.Value)) < 1 {
-					continue //去除空串
+			objects := []*ju.SortObject{}
+			for k, v := range fieldValue {
+				ValueStr := "" //第二排序
+				if reflect.TypeOf(v[1]).String() == "string" {
+					ValueStr = qu.ObjToString(v[1])
 				}
-				if fieldValue[fmt.Sprint(v.Value)] == nil {
-					fieldValue[fmt.Sprint(v.Value)] = []interface{}{0, v.Value}
-				} else {
-					fieldValue[fmt.Sprint(v.Value)][0] = qu.IntAll(fieldValue[fmt.Sprint(v.Value)][0]) + 1
+				tmp := &ju.SortObject{
+					Key:      k,
+					Value:    qu.IntAll(v[0]),
+					Object:   v[1],
+					ValueStr: ValueStr,
 				}
+				objects = append(objects, tmp)
 			}
+			values[key] = ju.ExtSort(objects)
 		}
-		objects := []*ju.SortObject{}
-		for k, v := range fieldValue {
-			ValueStr := "" //第二排序
-			if reflect.TypeOf(v[1]).String() == "string" {
-				ValueStr = qu.ObjToString(v[1])
-			}
-			tmp := &ju.SortObject{
-				Key:      k,
-				Value:    qu.IntAll(v[0]),
-				Object:   v[1],
-				ValueStr: ValueStr,
+		//从排序结果中取值
+		tmp := map[string]interface{}{} //抽取值
+		for key, val := range values {
+			for _, v := range val { //取第一个非负数
+				if v.Key != "" && v.Value > -1 {
+					tmp[key] = v.Object
+					break
+				}
 			}
-			objects = append(objects, tmp)
 		}
-		values[key] = ju.ExtSort(objects)
-	}
-	//从排序结果中取值
-	tmp := map[string]interface{}{} //抽取值
-	for key, val := range values {
-		for _, v := range val { //取第一个非负数
-			if v.Key != "" && v.Value > -1 {
-				tmp[key] = v.Object
-				break
-			}
+		if len(j.PackageInfo) > 0 { //分包信息
+			tmp["package"] = j.PackageInfo
 		}
-	}
-	if len(j.PackageInfo) > 0 { //分包信息
-		tmp["package"] = j.PackageInfo
-	}
-	if len(j.Winnerorder) > 0 { //候选人信息
-		tmp["winnerorder"] = j.Winnerorder
-	}
-	for k, v := range *doc {
-		//去重冗余字段
-		if k == "detail" || k == "contenthtml" || k == "site" || k == "spidercode" {
-			continue
+		if len(j.Winnerorder) > 0 { //候选人信息
+			tmp["winnerorder"] = j.Winnerorder
 		}
-		if tmp[k] == nil {
-			tmp[k] = v
+		for k, v := range *doc {
+			//去重冗余字段
+			if k == "detail" || k == "contenthtml" || k == "site" || k == "spidercode" {
+				continue
+			}
+			if tmp[k] == nil {
+				tmp[k] = v
+			}
 		}
-	}
 
 	//质量审核
 	if ju.Config["qualityaudit"].(bool) {
@@ -905,6 +918,9 @@ func AnalysisSaveResult(j *ju.Job, e *ExtractTask) {
 			log.Println(e.TaskInfo.TestColl, _id)
 		}
 	}
+	}, func(err interface{}) {
+		log.Println("AnalysisSaveResult err", err)
+	})
 }
 
 func (e *ExtractTask) QualityAudit(resulttmp map[string]interface{}) {

+ 1 - 0
src/jy/extract/extractudp.go

@@ -84,6 +84,7 @@ func processUdpMsg(act byte, data []byte, ra *net.UDPAddr) {
 
 //根据id区间抽取
 func ExtractByUdp(sid, eid string, instanceId ...string) {
+	defer qu.Catch()
 	ext := &ExtractTask{}
 	ext.Id = qu.ObjToString(ju.Config["udptaskid"])
 	ext.InitTaskInfo()

+ 1 - 0
src/jy/extract/isextract.go

@@ -22,6 +22,7 @@ func init() {
 }
 
 func IsExtract(filed, title, content string) bool {
+	defer qu.Catch()
 	b := true
 	if N_extract[filed] != nil {
 		nregs := N_extract[filed]

+ 97 - 93
src/jy/extract/score.go

@@ -35,113 +35,117 @@ func init() {
 //结果打分
 func ScoreFields(j *ju.Job) map[string][]*ju.ExtField {
 	result := j.Result
-	//打分
-	for field, tmps := range result {
-		scoreRule := SoreConfig[field]
-		if scoreRule == nil {
-			continue
-		}
-		extractype := SoreConfig["extractype"]
-		fieldtype := scoreRule["type"]
-		for _, v := range tmps {
-			if len(fmt.Sprint(v.Value)) < 1 {
-				continue //空串跳过
+	qu.Try(func() {
+		//打分
+		for field, tmps := range result {
+			scoreRule := SoreConfig[field]
+			if scoreRule == nil {
+				continue
 			}
-			//长度超过100个字,直接负分
-			vlen := len([]rune(qu.ObjToString(v.Value)))
-			if vlen > 100 && field != "projectscope" {
-				v.Score = -1
-			} else {
-				//类型打分
-				if v.ExtFrom == "title" {
-					v.Score += qu.IntAll(extractype["title"])
+			extractype := SoreConfig["extractype"]
+			fieldtype := scoreRule["type"]
+			for _, v := range tmps {
+				if len(fmt.Sprint(v.Value)) < 1 {
+					continue //空串跳过
+				}
+				//长度超过100个字,直接负分
+				vlen := len([]rune(qu.ObjToString(v.Value)))
+				if vlen > 100 && field != "projectscope" {
+					v.Score = -1
 				} else {
-					if strings.Contains(v.Type, "table") {
-						v.Score += qu.IntAll(extractype["table"])
-					} else if strings.Contains(v.Type, "colon") {
-						v.Score += qu.IntAll(extractype["colon"])
-					} else if strings.Contains(v.Type, "space") {
-						v.Score += qu.IntAll(extractype["space"])
-					} else if strings.Contains(v.Type, "regexp") {
-						v.Score += qu.IntAll(extractype["regexp"])
-					} else if strings.Contains(v.Type, "winnerorder") {
-						v.Score += qu.IntAll(extractype["winnerorder"])
+					//类型打分
+					if v.ExtFrom == "title" {
+						v.Score += qu.IntAll(extractype["title"])
+					} else {
+						if strings.Contains(v.Type, "table") {
+							v.Score += qu.IntAll(extractype["table"])
+						} else if strings.Contains(v.Type, "colon") {
+							v.Score += qu.IntAll(extractype["colon"])
+						} else if strings.Contains(v.Type, "space") {
+							v.Score += qu.IntAll(extractype["space"])
+						} else if strings.Contains(v.Type, "regexp") {
+							v.Score += qu.IntAll(extractype["regexp"])
+						} else if strings.Contains(v.Type, "winnerorder") {
+							v.Score += qu.IntAll(extractype["winnerorder"])
+						}
 					}
-				}
-				//字符型打分
-				if fieldtype == "string" {
-					//位置打分
-					if positions, ok := scoreRule["position"].([]interface{}); ok {
-						for _, position := range positions {
-							if p, ok := position.(map[string]interface{}); ok {
-								qu.Try(func() {
-									if p["regexp"] != nil {
-										reg := p["regexp"].(*regexp.Regexp)
-										if reg.MatchString(qu.ObjToString(v.Value)) {
-											v.Score += qu.IntAll(p["score"])
+					//字符型打分
+					if fieldtype == "string" {
+						//位置打分
+						if positions, ok := scoreRule["position"].([]interface{}); ok {
+							for _, position := range positions {
+								if p, ok := position.(map[string]interface{}); ok {
+									qu.Try(func() {
+										if p["regexp"] != nil {
+											reg := p["regexp"].(*regexp.Regexp)
+											if reg.MatchString(qu.ObjToString(v.Value)) {
+												v.Score += qu.IntAll(p["score"])
+											}
 										}
-									}
-								}, func(err interface{}) {
-									log.Println(err)
-								})
+									}, func(err interface{}) {
+										log.Println(err)
+									})
+								}
 							}
 						}
-					}
-					//长度打分
-					if lengths, ok := scoreRule["length"].([]interface{}); ok {
-						for _, tmp := range lengths {
-							if length, ok := tmp.(map[string]interface{}); ok {
-								min := qu.IntAll(length["min"])
-								max := qu.IntAll(length["max"])
-								scores, _ := length["score"].([]interface{})
-								if len(scores) < 3 {
-									continue
-								}
-								if vlen < min {
-									v.Score += qu.IntAll(scores[0])
-								} else if vlen > max {
-									v.Score += qu.IntAll(scores[2])
-								} else {
-									v.Score += qu.IntAll(scores[1])
+						//长度打分
+						if lengths, ok := scoreRule["length"].([]interface{}); ok {
+							for _, tmp := range lengths {
+								if length, ok := tmp.(map[string]interface{}); ok {
+									min := qu.IntAll(length["min"])
+									max := qu.IntAll(length["max"])
+									scores, _ := length["score"].([]interface{})
+									if len(scores) < 3 {
+										continue
+									}
+									if vlen < min {
+										v.Score += qu.IntAll(scores[0])
+									} else if vlen > max {
+										v.Score += qu.IntAll(scores[2])
+									} else {
+										v.Score += qu.IntAll(scores[1])
+									}
 								}
 							}
 						}
 					}
-				}
-				//float类型打分
-				if fieldtype == "float" {
-					min := qu.IntAll(scoreRule["min"])
-					max := qu.IntAll(scoreRule["max"])
-					val := qu.IntAll(v.Value)
-					scores, _ := scoreRule["score"].([]interface{})
-					if len(scores) < 3 {
-						continue
-					}
-					if val < min && 0 < val {
-						v.Score += qu.IntAll(scores[0])
-					} else if val > max {
-						v.Score += qu.IntAll(scores[2])
-					} else if val <= max && val >= min {
-						v.Score += qu.IntAll(scores[1])
-					}
-				}
-				//decimal
-				if fieldtype == "decimal" {
-					min := qu.IntAll(scoreRule["min"])
-					max := qu.IntAll(scoreRule["max"])
-					val := qu.IntAll(v.Value)
-					scores, _ := scoreRule["score"].([]interface{})
-					if len(scores) < 3 {
-						continue
+					//float类型打分
+					if fieldtype == "float" {
+						min := qu.IntAll(scoreRule["min"])
+						max := qu.IntAll(scoreRule["max"])
+						val := qu.IntAll(v.Value)
+						scores, _ := scoreRule["score"].([]interface{})
+						if len(scores) < 3 {
+							continue
+						}
+						if val < min && 0 < val {
+							v.Score += qu.IntAll(scores[0])
+						} else if val > max {
+							v.Score += qu.IntAll(scores[2])
+						} else if val <= max && val >= min {
+							v.Score += qu.IntAll(scores[1])
+						}
 					}
-					if val > max {
-						v.Score += qu.IntAll(scores[2])
-					} else if val <= max && val > min {
-						v.Score += qu.IntAll(scores[1])
+					//decimal
+					if fieldtype == "decimal" {
+						min := qu.IntAll(scoreRule["min"])
+						max := qu.IntAll(scoreRule["max"])
+						val := qu.IntAll(v.Value)
+						scores, _ := scoreRule["score"].([]interface{})
+						if len(scores) < 3 {
+							continue
+						}
+						if val > max {
+							v.Score += qu.IntAll(scores[2])
+						} else if val <= max && val > min {
+							v.Score += qu.IntAll(scores[1])
+						}
 					}
 				}
 			}
 		}
-	}
+	}, func(err interface{}) {
+		log.Println("ScoreFields err", err)
+	})
 	return result
 }