In order to accurately estimate the disparity of ill-posed regions, such as weak texture and occlusion regions, we propose DSPANet, a stereo matching network that incorporates a dual-stream pyramid module and a channel and spatial attention module. The dual-stream pyramid module captures numerous complementary features from different layers by utilizing multi-resolution inputs and feature extraction blocks. This approach enables the learning of local detailed features at various scales. These features at various scales are then combined to calculate the stereo matching cost. By incorporating channel and spatial attention module into the feature extraction process to obtain richer and more concise contextual information, the matching cost can be constructed more accurately, which provides powerful conditions for subsequent cost aggregation. In the cost aggregation stage, we utilize the stacked hourglass module for both encoding and decoding. Additionally, we incorporate 3D global attention upsampling during the decoding stage, which enables high-level features to provide guidance information to low-level features in a simple way. We evaluate our proposed method on the Scene Flow dataset, as well as the KITTI2012 and KITTI2015 datasets. The experimental results demonstrate that our DSPANet achieves superior performance and effectively enhances the matching results in ill-posed regions. Our code has been implemented using PyTorch and will be released after paper publication at https://github.com/Shi-LiQing/DSPANet.