The regional energy internet is a distributed complex system with deep integration of energy and information. If different energy systems are planned and operated independently and lack of coordination with each other, problems such as low energy utilization rate, weak self-healing ability, and low system security and reliability will be caused. Therefore, scientific and reasonable planning methods and operation strategies are crucial to the overall efficiency and economy of distributed multi-energy systems. The main purpose of this paper is to study the optimization of distributed systems based on K-Means clustering. In this paper, a multi-energy unified clustering model based on the K-means algorithm is established to analyze the data characteristics in the cluster, and at the same time, the energy-side data is clustered to evaluate the available value of various types of energy. Experiments show that according to the 2/5/10 principle, when the system response time is within 2s, the user experience is very good. When the response time is between 2s and 5s, the user experience is better. Because the number of concurrent users of the system exceeds 500, the response time of the system is within the normal response time range acceptable to users and meets the needs of enterprises.