Smart meters are deployed in the smart grid to achieve bidirectional communication, the control center can monitor, predict energy consumption data in real-time, and adjust energy supply dynamically. Unfortunately, real-time data may divulge users private information. To protect the privacy of real-time data, data aggregation schemes have been proposed to assist the control center in adjusting the supply to meet users electricity demands without sacrificing data privacy. However, extreme weather events and potential attacks may damage the meters and change the structure of the smart grid dynamically, it is important to improve the reliability of the data aggregation scheme. Even if some schemes have improved reliability, but the scalability is poor, they are not suitable for the dynamically changing smart grid network structure. To meet this end, a resilient data aggregation scheme for the smart grid is proposed, which (1) offers better reliability by defending against malicious attacks, group management techniques are proposed, and meters can update their keys when the smart grid network structure changes; (2) affords higher scalability; (3) enables the control center to make fine-grained adjustments. A prototype implementation shows that the proposed scheme is efficient enough for smart meters.