Active flow control (AFC) through deep reinforcement learning (DRL) is computationally demanding. To address this, a masked deep neural network (MDNN), aiming to replace the computational fluid dynamics (CFD) environment, is developed to predict unsteady flow fields under the influence of arbitrary object motion. Then, a novel DRL-MDNN framework that combines the MDNN-based environment with the DRL algorithm is proposed. To validate the reliability of the framework, a blind test in a pulsating baffle system is designed. Vibration damping is considered to be the objective, and a traditional DRL-CFD framework is constructed for comparison. After training, a spatiotemporal evolution of 200 time steps under the influence of arbitrary object motion is predicted by the MDNN. The details of the flow field are compared with the CFD results, and a relative error within 5% is achieved, which satisfies the accuracy of serving as an interactive environment for DRL algorithms. The DRL-MDNN and traditional DRL-CFD frameworks are then applied to the pulsating baffle system to find the optimal control strategy. The results indicate that both frameworks achieve similar control performance, reducing vibration by 90%. Considering the resources expended in establishing the database, the computational resource consumption of the DRL-MDNN framework is reduced by 95%, and the interactive response time during each episode is decreased by 98.84% compared to the traditional DRL-CFD framework.