Abstract Objective: Electroencephalographic (EEG) microstates, as a non-invasive and high-temporal-resolution tool for analyzing time-space features of brain activity, have been validated and applied in various research domains. However, current methods for EEG microstate analysis rely on clustering algorithms, which require large-scale offline computations to obtain microstate labels and cluster centers. This offline approach is no longer sufficient for applications in cross-subject, cross-dataset, and multi-task scenarios. Approach: To address these limitations, we propose, for the first time, a novel sequence-to-sequence-based framework for microstate identification and prediction, enabling end-to-end online recognition and prediction from EEG signals to microstate labels. Specifically, we introduce a method for constructing training datasets for online identification and prediction, which includes microstate label calibration, EEG electrode mapping, and sequence data partitioning. We validate this approach using four different neural network models with varying computational mechanisms on two public datasets. Main Results: Our results demonstrate that EEG microstates can be identified and predicted by trainable models. In cross-subject microstate recognition tasks, the recognition accuracy for four typical microstates reached up to 74.26%, outperforming K-Nearest Neighbor (KNN) by 21.91%. For seven typical microstates, the recognition accuracy peaked at 66.76%, surpassing KNN by 26.6%. In prediction tasks, the accuracy for four and seven typical microstates reached 70.49% and 62.71%, respectively. Significance: Our work advances EEG microstate analysis from an offline clustering-based paradigm to an online model-data hybrid computation paradigm, providing new insights and references for cross-subject and cross-dataset applications of EEG microstates.