private static long calculateCronOffset(ScheduleInfo scheduleInfo) {
        if (scheduleInfo.getCrontabExpression() == null) {
            LOGGER.error("Crontab expression cannot be null for schedule type crontab");
            throw new DolphinScheduleException("Crontab expression cannot be null for schedule type crontab");
        }

        try {
            CronExpression cronExpression = new CronExpression(scheduleInfo.getCrontabExpression());
            Date firstExecution = cronExpression.getNextValidTimeAfter(new Date());
            Date secondExecution = cronExpression.getNextValidTimeAfter(firstExecution);

            if (secondExecution != null) {
                return secondExecution.getTime() - firstExecution.getTime();
            } else {
                LOGGER.error("Unable to calculate the next execution times for the cron expression");
                throw new DolphinScheduleException(
                        "Unable to calculate the next execution times for the cron expression");
            }
        } catch (Exception e) {
            LOGGER.error("Invalid cron expression: ", e);
            throw new DolphinScheduleException(String.format("Invalid cron expression: %s", e.getMessage()));
        }
    }
Calculate the offset according to schedule info

@param scheduleInfo The schedule info
@return timestamp between two schedule task
inlong-manager/manager-schedule/src/main/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleUtils.java