code: def binary2pb(b, proto_id, proto_fmt_type):
      
      rsp = pb_map[proto_id]
      if rsp is None:
          return None
      if proto_fmt_type == ProtoFMT.Json:
          return json2pb(type(rsp), b.decode('utf-8'))
      elif proto_fmt_type == ProtoFMT.Protobuf:
          rsp = type(rsp)()
          # logger.debug((proto_id))
          if IS_PY2:
              rsp.ParseFromString(str(b))
          else:
              rsp.ParseFromString(b)
          return rsp
      else:
          raise Exception("binary2str: unknown proto format.")
docs: Transfer binary to pb message
      :param b: binary content to be transformed to pb message
      :return: pb message