public static String[] deviceIdToStringArray(IDeviceID deviceID) {
    String[] ret = new String[deviceID.segmentNum()];
    for (int i = 0; i < ret.length; i++) {
      ret[i] = deviceID.segment(i) != null ? deviceID.segment(i).toString() : null;
    }
    return ret;
  }
Converts a string into a byte array based on the encoding format (hex or escape).

@param input The input string.
@return The encoded byte array.
@throws IllegalArgumentException if input is invalid.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/CommonUtils.java