---
panlei
2019-08-08 5a9ed312168e352e348474405163de7054070836
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,13 @@
// 给目标填充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 {
@@ -301,7 +301,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
@@ -357,6 +357,6 @@
      logger.Error("接收响应失败: %s", err.Error())
      os.Exit(1)
   }
   logger.Debug("数据推送成功!收到响应",string(msg))
   logger.Debug("数据推送成功!收到响应,数据长度为:",len(msg))
   return msg
}