The invention provides an early warning method and system based on a holiday and festival flow prediction algorithm, and the method comprises the steps: firstly obtaining a traffic data set of a whole year and a whole time period, carrying out the preprocessing, fusing the surrounding environment data and weather data of a highway section with the preprocessed traffic data set, and forming a complete traffic data set; the method comprises the following steps: selecting actual traffic data, establishing an ST-GCN model for training by selecting a preset data granularity and adopting a holiday flow prediction algorithm to obtain an optimal ST-GCN model to predict a plurality of target results, establishing an evaluation index according to the actual traffic data and the plurality of predicted target results, evaluating the ST-GCN model by adopting a comparison model, verifying the ST-GCN model as the optimal model, and determining the actual traffic data according to the evaluation index. According to a plurality of target results predicted by the ST-GCN model which is verified to be the optimal model, in combination with the grade division standard of the expressway operation state, the road condition information is marked with different color information, and a picture is generated for display, so that the passing efficiency of the expressway is effectively improved, and the traffic flow trend during holidays and festivals is efficiently and accurately predicted.