Diffusion plays a crucial role in the mass transfer and migration of coalbed methane within coal-rocks. The diffusion coefficient is a key parameter that influences the diffusion of CH4 in porous media, including coal-rock. Conventional experimental approaches, reliant on theoretical solutions for diffusion coefficient determination, exhibit inherent limitations including theoretical constraints, protracted experimental procedures, and susceptibility to errors. Addressing these shortcomings, this study introduces a numerical method based on inverse problem calculation, the core of this method lies in an optimization process that adjusts model parameters by minimizing the error between observed data and model predictions, ensuring that the model output closely matches the actual observed values. Building on the traditional isothermal adsorption experiment for CH4, we use isothermal adsorption pressure fluctuation data as a penalty factor, inverse problem numerical optimization techniques are employed to determine the coal particle diffusion coefficient. The results indicate that during the initial adsorption stage, CH4 molecules rapidly penetrate into coal particles, followed by a diffusion and adsorption process. The flow sequence of CH4 over different time periods adheres to a sequential transport mode of "free flow, permeation, diffusion, adsorption." Using this model, we determined the diffusion coefficient of coal particles to be 1.295 x 10(-13) m(2)/s through reverse optimization. The fitting accuracy (R-2) with experimental data was 0.973, which indicates the reliability of the results. This new method effectively determines the diffusion coefficient of gases in coal samples and offers valuable guidance for the development and utilization of unconventional natural gas.