From a6a28e08a0031ca046947d67727f0e133c19e4ab Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期五, 09 八月 2019 11:49:25 +0800
Subject: [PATCH] cpu火力全开
---
ruleserver/readyDataForRule.go | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/ruleserver/readyDataForRule.go b/ruleserver/readyDataForRule.go
index 0989721..e9be6db 100644
--- a/ruleserver/readyDataForRule.go
+++ b/ruleserver/readyDataForRule.go
@@ -167,22 +167,25 @@
// 缁欑洰鏍囧~鍏卨iker
func (arg *Arg) fillLiker(tableId []string, compareThreshold float32) {
- // bytes := bigCache.GetComparePersonBaseInfo(tableId, arg.Feature, compareThreshold)
+ //bytes := bigCache.GetComparePersonBaseInfo(tableId, arg.Feature, compareThreshold)
comArg := &protomsg.CompareArgs{
TableIds:tableId,
FaceFeature:arg.Feature,
CompareThreshold:compareThreshold,
+ Source:false,
}
bytes := Push("tcp://192.168.1.182:40010",comArg,sock)
- var m map[string]float32
- err1 := json.Unmarshal(bytes, &m)
+ var scResult protomsg.SdkCompareResult
+ err1 := proto.Unmarshal(bytes, &scResult)
if err1 != nil {
logger.Error("getBaseInfo瑙e帇閿欒", err1)
}
//logger.Info("----------------------------------------map鏄�", m)
ids := []string{}
- for key, _ := range m {
- ids = append(ids, key)
+ m := make(map[string]*protomsg.SdkCompareEach)
+ for _,key := range scResult.CompareResult {
+ ids = append(ids, key.Id)
+ m[key.Id] = key
}
logger.Info("------------------------------------------------------------------------------------------------------------------------")
//logger.Info("=====================浜哄憳id鐨勯泦鍚堜负锛�",ids)
@@ -200,8 +203,8 @@
if err != nil || len(table) == 0 {
logger.Error("鏍规嵁id鏌ヨ搴曞簱淇℃伅鍑洪敊锛�", err, "--杩斿洖鍊奸暱搴︿负锛�", len(table))
}
- logger.Debug("鐪嬬湅杩欎釜base鐨勫姣斿�兼槸澶氬皯锛�", Decimal(m[baseinfo.Id] * 100))
- base := BaseInfo{TableId: baseinfo.TableId, TableName: table[0].TableName, BwType: table[0].BwType, CompareScore: Decimal(m[baseinfo.Id] * 100), PersonId: baseinfo.Id, PersonName: baseinfo.PersonName, PersonPicUrl: baseinfo.PersonPicUrl, PhoneNum: baseinfo.PhoneNum, Sex: baseinfo.Sex, IdCard: baseinfo.IdCard, MonitorLevel: baseinfo.MonitorLevel, Content: baseinfo.Reserved}
+ logger.Debug("鐪嬬湅杩欎釜base鐨勫姣斿�兼槸澶氬皯锛�", Decimal(m[baseinfo.Id].CompareScore))
+ base := BaseInfo{TableId: baseinfo.TableId, TableName: table[0].TableName, BwType: table[0].BwType, CompareScore: Decimal(m[baseinfo.Id].CompareScore), PersonId: baseinfo.Id, PersonName: baseinfo.PersonName, PersonPicUrl: baseinfo.PersonPicUrl, PhoneNum: baseinfo.PhoneNum, Sex: baseinfo.Sex, IdCard: baseinfo.IdCard, MonitorLevel: baseinfo.MonitorLevel, Content: baseinfo.Reserved}
//os.Exit(1)
arg.Liker = append(arg.Liker, &base)
}
@@ -213,7 +216,7 @@
func Compare(args *SdkDatas, groupRule *protomsg.GroupRule) {
compareFlag := 0
var tableIds []string
- var threshold float32 = 0.5 // 榛樿闃堝�间负0.5
+ var threshold float32 = 50 // 榛樿闃堝�间负50
// 鐪嬬湅鏄惁鏈夊彧閰嶄汉鑴告瘮瀵圭畻娉曚絾娌℃湁閰嶅姣斿簱鐨勮鍒欙紝濡傛灉鏈夛紝鍒欐瘮瀵瑰璞′负鍏ㄩ儴搴曞簱
for j := 0; j < len(groupRule.Rules); j++ {
if groupRule.Rules[j].SdkId == "812b674b-2375-4589-919a-5c1c3278a972" { // 閰嶄簡浜鸿劯姣斿
@@ -301,7 +304,7 @@
a.filterData = append(a.filterData, &arg1)
}
}
- logger.Info("鍖哄煙鏄細",areaPoints,"鍖哄煙鍐呯洰鏍囨暟閲忎负锛�",a.targetNum,"---",len(a.filterData))
+ //logger.Info("鍖哄煙鏄細",areaPoints,"鍖哄煙鍐呯洰鏍囨暟閲忎负锛�",a.targetNum,"---",len(a.filterData))
a.time = time.Unix(time.Now().Unix(), 0).String()[11:16]
a.keepRight = arg.KeepRight
a.isStatic = arg.IsStatic
--
Gitblit v1.8.0