Battery energy storage system (BESS) operation management, including charging/discharging scheduling, is generally a complicated, non-linear optimization problem with constrains. To solve the high-dimension optimization problems, this paper proposes a novel electron drifting algorithm (EDA) to avoid the common disadvantages that most existing optimization algorithms have, such as easy to trap in a local optimal point and sensitive to given initial solutions. All the proposed EDA mainly mimics the features of electron drifting. The solutions having been searched in the past iterations are stored in a database to constitute an electric field. The electrons, which represent solutions, are generated at random location and drift according to the electric field. Benchmark functions are adopted to verify the effectiveness of the proposed EDA before its application to the BESS scheduling problem of a home energy management system (HEMS). The numerical results obtained from the proposed EDA are compared with the existing optimization algorithms to verify the enhanced searching efficiency and capability of the proposed EDA.