1) LEARNING MODULE The learning module, as the kernel of energy controller, is implemented by using the neural network algorithm for learningandcalculatingasmartsockets’operationtime.The action trigger sends trigger signals to the learning module at 12:30 and 00:30. On receiving the first trigger signal (i.e.at12:30),thelearningmodulerequestsenergyconsumption histories of all smart sockets, and the peak-time periods set by users for the sockets as its input to calculate the time periods in which a smart socket will be turned on or off for the time duration from 00:00 to 12:00 (i.e., AM) of the next day. The time periods as the output of this module are stored in the Memory for easily being accessed by other modules. When the second trigger signal arrives, of course, at 00:30, theinputsandoutputsaresimilartothosewhenreceivingthe firsttriggersignal.Butthistime,thecalculationisforthetime duration from 12:00 PM to 00:00 of current day.