The invention provides a V2G service-oriented multi-
granularity data on-demand sharing security aggregation method, and relates to the technical field of
data security. The method comprises the following steps: acquiring multi-dimensional and multi-
granularity power utilization data interacted between an
electric vehicle and a
power grid, and obtaining compressed data of each dimension based on super-incremental sequence compression; summing and aggregating the compressed data in the jurisdiction of the
charging station, and obtaining an encrypted aggregation result by adopting Paillier
homomorphic encryption; when a user accesses, a request is verified through an access
authorization judgment function constructed by an RBAC model, and
ciphertext aggregation (homomorphic addition is executed on global data, and differential
ciphertext operation is executed on single-
pile data to construct single-
pile encrypted data) is executed as required after
verification is passed; a complete decryption result is obtained through collaborative decryption by adopting a threshold decryption mechanism, and then target
power consumption data is obtained through super-incremental sequence decoding. According to the method, on-demand access of multi-
granularity data is realized, transmission overhead is reduced, data leakage and unauthorized access are completely eradicated through double guarantee of permission and
encryption, and V2G multi-scene requirements are met.