| | |
| | | "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" |
| | |
| | | } |
| | | 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 { |
| | |
| | | |
| | | // 给目标填充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, |
| | | //} |
| | | //bytes := Push("tcp://192.168.1.182:40010",comArg,sock) |
| | | var m map[string]float32 |
| | | err1 := json.Unmarshal(bytes, &m) |
| | | if err1 != nil { |
| | |
| | | logger.Error("接收响应失败: %s", err.Error()) |
| | | os.Exit(1) |
| | | } |
| | | logger.Debug("数据推送成功!收到响应",string(msg)) |
| | | logger.Debug("数据推送成功!收到响应,数据长度为:",len(msg)) |
| | | return msg |
| | | } |