In accordance with the problem of difficult measurement real‐time collision avoidance and untimely early warning, the real‐time AIS data collection is used to preprocess, fill and so on, which to improve the accuracy and availability of AIS data, and provide a reliable data source for the real‐time collision risk assessment value of ships. By establishing DCPA model and TCPA model between ships, the ship collision risk degree in the space domain and the time domain are calculated, and then the real‐time collision risk index (CRI) is obtained, so as to realize the safety warning of different risk levels. Taking Nanjing Banqiao ferry as a case, the DCPA model and TCPA model are applied to the ferry safety management system, and many real‐time warnings are carried out, and the warning accuracy is up to 96.15%, which obtains good reputation from the management department. Finally, the factors that need to be considered in the subsequent optimization of the CRI model are pointed out.