privateString CompareData(String before, String latest){
// 如果两个字符串相同,那么就不需要进行对比了if (before.equals(latest)) {return "";}
// 执行分割
String[] s1= before.split("@");
String[] s2= latest.split("@");
// 定义返回比对信息
StringBuilder contrastData= newStringBuilder();
// 将信息保存到哈希表中
Map pack_before = new HashMap();
Map pack_latest = new HashMap();
// 保存上一次信息过程for(String temp: s1) {if (temp.length() == 0) { continue; }
pack_before.put(temp.split("#")[0], temp.split("#")[1]);
}
// 保存当前信息过程for(String temp: s2) {if (temp.length() == 0) { continue; }
pack_latest.put(temp.split("#")[0], temp.split("#")[1]);
}
// 遍历前一次信息,与当前信息做以对比for(Map.Entry e: pack_before.entrySet()) {
// 如果存在信息,进行下一步操作&