With the development of society and the advancement of urbanization, the development of intelligent transportation system has attracted much attention. Efficient and accurate traffic flow prediction is one of the core tasks in the research of intelligent transportation system. Most of the existing spatiotemporal traffic flow prediction models do not make full use of various periodic spatiotemporal dynamic characteristics of traffic flow, and it is difficult to effectively capture the complex spatiotemporal changes of traffic flow. To accurately predict the traffic flow of complex urban network, this paper proposes a traffic prediction model (STBGRN) based on spatiotemporal bidirectional gated cycle unit (ST-BiGRU) and graph convolution residual network (GCN-ResNet). The spatiotemporal information in traffic data is learned using the spatiotemporal bidirectional GRU coupled with the forward and backward information of the current time step, and the topology structure of the traffic network is captured by the graph convolution residual network, which is combined to complete the prediction task of the urban traffic network. In this paper, STBGRN was tested on two real data sets, SZ-taxi and Los-loop, and compared with other baseline methods, the RMSE index reached 3.857 and 5.461, and the MAE index reached 2.702 and 3.781, respectively. Accuracy index is 72.66% and 91.35%, $${R}^{2}$$
R
2
index is 0.858 and 0.845, var index is 0.858 and 0.849. The experimental results show that STBGRN model can obtain spatiotemporal dependence from complex traffic data, and can be used in spatiotemporal traffic data processing.