The penetration of electric vehicles (EVs) in vehicle-to-grid (V2G) interaction can effectively assist the grid in achieving frequency regulation and peak load balancing. However, the customer perceives that participating in V2G services would result in the additional cycling of the battery and the accelerated aging of the EVs’ power battery, which has become a major obstacle to the widespread adoption of V2G services. Most existing methods require long-term cycling data and battery parameters to quantify battery aging, which is not suitable for the V2G scenario with large-scale and short-time intervals. Consequently, the real-time and accurate quantification of battery aging for optimization remains a challenge. This study proposes a charging scheduling method for EVs that can accurately and online quantify battery aging. Firstly, V2G scheduling is formulated as an optimization problem by defining an online sliding window to collect real-time vehicle information on the grid, enabling online optimization. Secondly, battery aging is more accurately quantified by proposing a novel amplitude-based rain-flow cycle counting (MRCC) method, which utilizes the charging information of the battery within a shorter time period. Lastly, an intelligent optimization algorithm is employed to optimize the charging and discharging power of EVs, aiming to minimize grid fluctuations and battery aging. The proposed method is validated using a V2G scenario with 50 EVs with randomly generated behaviors, and the results demonstrate that the proposed online scheduling method not only reduces the EFCC of the battery by 8.4%, but also achieves results close to global optimization.