As patients infected with SARS-CoV-2 are more likely to have trouble breathing, a great demand for ventilators has been generated since the COVID-19 is continuing to spread around the world. However, the research and development of ventilator control suffer from high cost, slow efficiency, and lack of automation, especially regarding the estimation of ventilator pressure. In this paper, to address this challenge and help control the mechanical ventilators better, we develop a Transformer-based deep learning method for the prediction of ventilator pressure. Based on the dataset provided by Google Brain in a Kaggle competition, we connect the Transformer encoders by residual connections to extract features from the time-series ventilator data, and successfully achieve the goal to predict the ventilator pressure with excellent performance. After applying the K-Fold cross validation technique, our Transformer-based model reaches a mean absolute error 0.1311 on the private test set. This result ranks 67/2605 (top 2.6%) in the leaderboard of Google Brain - Ventilator Pressure Prediction competition, and can get a silver medal in this Kaggle competition. This work could accelerate the development of new methods to overcome the cost barrier of ventilator control.