考虑唯一字符串,取出17位当前时间戳 + 3位随机数字
//获取当前时间戳 public static String getTimeStr(){ StringBuffer sb = new StringBuffer(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); sb.append(sdf.format(new Date())).append((int) (Math.random() * 900) + 100); return sb.toString();//20190319222821840453 }