To obtain lithium-ion concentration in the electrolyte is one of primitive tasks to solve the electrochemical models of lithium-ion batteries. In order to balance the computational efficiency and electrolyte dynamic, it is assumed that reactions only occur at interfaces between the collectors and the electrolyte. Based on the analytical solution to the liquid diffusion equations, which is in the form of infinite series, a new method is proposed to solve it. Under galvanostatic profiles, the analytic solution is an infinite time series transformed into a converged sum function by using the monotone convergence theorem. Under dynamic profiles, the infinite series solution is simplified to an infinite discrete convolution of both the input and the sum function. The sum function is truncated by its characteristic of monotonic decay approaching zero over time, thus to obtain a finite discrete convolution algorithm. Reference to the results from a professional finite element analysis software, the proposed algorithm can produce high accuracy with less computation time under both galvanostatic profiles and dynamic profiles. Also, there is only one parameter to be configured. Therefore, our algorithm will reduce computation burden of the electrochemical models applied to a real-time battery management system.