The effect of resonant magnetic perturbations (RMPs) on particle confinement is studied in J-TEXT tokamak by using externally applied rotating RMPs. It is found that RMPs cause improved (degraded) particle confinement when its frequency is higher (lower) than the natural m/n = 2/1 tearing mode frequency, and the amount of change in electron density is proportional to the difference between these two frequencies, where m and n are the poloidal and toroidal mode number, respectively. These results reveal the important role of the relative rotation between RMPs and the electron fluid in affecting the particle confinement. The experimental results are compared to numerical ones based on nonlinear two-fluid equations, and quantitative agreement is found. Resonant magnetic perturbations (RMPs) often exist, e.g., in solar flares, magnetotail and fusion devices, due to intrinsic plasma instabilities and have attracted much research efforts, since they are associated with magnetic reconnection. In fusion devices RMPs can also be generated by external coil current, which have important applications in fusion plasmas. Static RMPs are able to suppress or mitigate edge localized modes (ELMs) [1-5] and to affect other instabilities [6-12]. In addition, rotating RMPs were used to study the field penetration [13], their effect on plasma rotation [14] and plasma response on TEXTOR [15]. On DIII-D, rotating RMPs are utilized to control NTMs rotation [16] and detect the intrinsic error field [17].