code: def binary2str(b, proto_id, proto_fmt_type):
      
      if proto_fmt_type == ProtoFMT.Json:
          return b.decode('utf-8')
      elif proto_fmt_type == ProtoFMT.Protobuf:
          rsp = pb_map[proto_id]
          if IS_PY2:
              rsp.ParseFromString(str(b))
          else:
              rsp.ParseFromString(b)
          return MessageToJson(rsp)
      else:
          raise Exception("binary2str: unknown proto format.")
docs: Transfer binary to string
      :param b: binary content to be transformed to string
      :return: string