| | |
| | | "nanomsg.org/go-mangos/protocol/req" |
| | | "nanomsg.org/go-mangos/transport/ipc" |
| | | "nanomsg.org/go-mangos/transport/tcp" |
| | | "strconv" |
| | | "sync" |
| | | "webserver/extend/config" |
| | | "webserver/extend/logger" |
| | | "basic.com/valib/logger.git" |
| | | ) |
| | | |
| | | type FaceCompareService struct { |
| | |
| | | func (sv *FaceCompareService) CompareVideoPersons() *CompareList{ |
| | | sv.CompareArgs.TableIds = []string { CaptureTable } |
| | | b, err := proto.Marshal(&sv.CompareArgs) |
| | | esCompServerList := config.EsCompServerInfo.Url |
| | | esCompServerList := config.EsCompServerInfo.Ips |
| | | logger.Debug("compServerList:", esCompServerList) |
| | | //1.向各个Es compare进程发起请求拿到比对结果 |
| | | var resultList CompareList |
| | | |
| | | for _,str :=range esCompServerList{ |
| | | reqUrl := "tcp://"+str |
| | | reqUrl := "tcp://"+str + ":"+strconv.Itoa(config.EsCompServerInfo.Port) |
| | | resultB := doCompareRequest(reqUrl,b) |
| | | if resultB == nil || len(*resultB) ==0 { |
| | | continue |
| | |
| | | //比对底库 |
| | | func (sv *FaceCompareService) CompareDbPersons() *CompareList{ |
| | | b, err := proto.Marshal(&sv.CompareArgs) |
| | | dbPersonCompServerUrl := config.DbPersonCompInfo.Url |
| | | dbPersonCompServerUrl := config.DbPersonCompInfo.Ip |
| | | logger.Debug("comp Server url:", dbPersonCompServerUrl) |
| | | |
| | | var resultList CompareList |
| | | |
| | | reqUrl := "tcp://"+dbPersonCompServerUrl |
| | | reqUrl := "tcp://"+dbPersonCompServerUrl+":"+strconv.Itoa(config.DbPersonCompInfo.Port) |
| | | resultB := doCompareRequest(reqUrl,b) |
| | | if resultB == nil || len(*resultB) ==0 { |
| | | return nil |