panlei
2019-08-08 68f1b499619d789333e9a3596fe322af52afedd6
测试比对进程
1个文件已修改
25 ■■■■ 已修改文件
ruleserver/readyDataForRule.go 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruleserver/readyDataForRule.go
@@ -10,7 +10,7 @@
    "io/ioutil"
    "math"
    "nanomsg.org/go-mangos"
    //"nanomsg.org/go-mangos/protocol/req"
    "nanomsg.org/go-mangos/protocol/req"
    "nanomsg.org/go-mangos/transport/tcp"
    "os"
    "ruleprocess/cache"
@@ -50,10 +50,10 @@
    }
    logger.Debug("本机信息和server信息:", localConfig, serverIp, serverPort)
    bigCache.Init(dbTablePersons, serverIp, serverPort, localConfig.ServerId)
    //sock, err = req.NewSocket();
    //if err != nil {
    //    logger.Error("创建请求socket失败: %s", err.Error())
    //}
    sock, err = req.NewSocket();
    if err != nil {
        logger.Error("创建请求socket失败: %s", err.Error())
    }
}
type BaseInfo struct {
@@ -167,13 +167,14 @@
// 给目标填充liker
func (arg *Arg) fillLiker(tableId []string, compareThreshold float32) {
    bytes := bigCache.GetComparePersonBaseInfo(tableId, arg.Feature, compareThreshold)
    //comArg := &protomsg.CompareArgs{
    //    TableIds:tableId,
    //    FaceFeature:arg.Feature,
    //    CompareThreshold:compareThreshold,
    //}
    //bytes := Push("tcp://192.168.1.182:40010",comArg,sock)
    //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)
    if err1 != nil {