This paper presents an Adaptive Spatial-Temporal Convolutional Neural Network (ASTCN) model for traffic state prediction, which learns the complex spatial-temporal information of traffic data through trainable temporal embedding and graph adjacency matrix. The gate control mechanism is used to control the proportion of different temporal embedding to improve prediction accuracy. In the visualization of the temporal embedding, it is found that the influence of the weekly temporal embedding on prediction accuracy is the greatest, followed by the daily temporal embedding, and the monthly temporal embedding is the smallest. Meanwhile, a new method for constructing graph adjacency matrices is proposed, and the experimental results show that the two types of graph adjacency matrices have different effects on improving the prediction accuracy of traffic speed and traffic flow. Therefore, this paper fuses the two graph adjacency matrices to make the ASTCN model achieve better prediction accuracy on both traffic speed and traffic flow datasets than when the two are present separately. The final prediction results of the ASTCN model in the comparative experiment show excellent performance.