In order to improve the efficiency of the automatic demand response of the energy storage resource system, a user authentication and key agreement scheme for wireless sensor networks based on blockchain is proposed. The user does not need to register with the gateway node. As the light node of the blockchain network, the two can directly authenticate each other. The user obtains the public information of the sensor node from the blockchain through the client and verifies its legitimacy. It solves the problem that the traditional wireless sensor network user authentication scheme cannot be applied to the distributed Internet of things environment and the authentication process is low in security and efficiency. Mode 1 is the disordered charging mode. The charging facility provides continuous constant power charging service for the connected response subject until the user leaves. If the response subject is full before this, the charging will stop. Mode 2 is the BADR operation mode under charging optimization only, that is, the V2G function of PEV is not considered. In this case,
0
≤
P
l
,
k
≤
P
l
max
c
. Mode 3 is the BADR operating mode with V2G functionality in mind. The ELN load characteristics under the above three operating modes are discussed, respectively. Calculate and compare with economy on both sides of supply and demand. The experimental results show that the discharge compensation coefficient will not affect mode 2. In mode 3, as the compensation coefficient increases (from 0.4 to 1.2 at intervals of 0.2), the average total cost of the PEV cluster continues to decrease and the average total cost of the energy local network (ELN) system increases monotonically. Comparing the curves of the economic impact of the compensation coefficient on both sides of mode 2 and mode 3, it can be seen that the reasonable setting of the compensation coefficient is one of the key parameters for controlling the distribution of benefits. It proves that the proposed blockchain-based automated demand response (BADR) method can not only meet the satisfaction of energy demand but also coordinate the available energy storage resources in the system, so that the load level curve can track the output of new energy to the greatest extent and improve the balance between supply and demand of the system, which is suitable for a large-scale decentralized energy storage system.