The cooperative, reliable and responsive characteristics make smart grid more popular than traditional power grid. However, with the extensive employment of smart grid concepts, the traditional centralized control methods expose a lot of shortcomings, such as communication congestion, computing complexity in central management systems, and so on. The distributed control method with flexible characteristics can meet the timeliness and effectiveness of information management in smart grid and ensure the information collection timely and the power dispatch economically. This article presents a decentralized approach based on multi agent system (MAS) for solving data collection and economic dispatch problem of smart grid. First, considering the generators and loads are distributed on many nodes in the space, a flooding-based consensus algorithm is proposed to achieve generator and load information for each agent. Then, a suitable distributed algorithm called λ-consensus is used for solving the economic dispatch problem, eventually, all generators can automatically minimize the total cost in a collective sense. Simulation results in standard test cases are presented to demonstrate the effectiveness of the proposed control strategy.