public static byte[] generateID() {
        byte[] ret = new byte[MESSAGE_ID_LEN];

        //产生一个时间值
        long time = System.currentTimeMillis();
        //产生一个序列数
        int s = serialize.getAndIncrement();
        //产生一个short的随机值
        short ran = (short) (Math.random() * Short.MAX_VALUE);

        //将时间值拷贝到结果的最高8字节
        for (int i = 1; i <= 8; i++) {
            ret[MESSAGE_ID_LEN - i] = (byte) ((time >>> (64 - 8 * i)) & 0xFF);
        }
        //将序列数拷贝到接下来的4字节
        for (int i = 1; i <= 4; i++) {
            ret[MESSAGE_ID_LEN - i - 8] = (byte) ((s >>> (32 - 8 * i)) & 0xFF);
        }
        //将随机值拷贝到接下来的2字节
        for (int i = 1; i <= 2; i++) {
            ret[MESSAGE_ID_LEN - i - 12] = (byte) ((ran >>> (16 - 8 * i)) & 0xFF);
        }
        return ret;
    }