In order to address the dissipation of energy efficiency in 5G edge computing, and the problem of network delay, better improve the quality of user service, considering the data aggregation delay while improving the network energy efficiency. The author proposes a 5G edge computing access node selection algorithm based on energy efficiency and delay; through the energy efficiency and delay balanced data collection mechanism (EEDBDG), a new dynamic tree is used to organize the network topology, eliminating the hot zone problem; nodes dynamically choose routes and take turns acting as the root of the tree, which collects data and communicates directly with the base station. At the same time, three data collection strategies are proposed for different latency and energy efficiency requirements: delay optimal algorithm (EEDBDG-D), energy efficiency optimal algorithm (EEDBDG-E), and energy efficiency delay balance algorithm (EEDBDG-M). Experimental results show that, when the communication radius of nodes is limited, EEDBDG balances the energy consumption of nodes, prolongs the network life time, and shows outstanding performance in energy saving and time saving. Compared with GSEN, in the best case, the network lifetime of EEDBDG-E is increased by 72%, and the convergence delay of EEDBDG-D is reduced by 74%. Conclusion. The algorithm can effectively reduce the energy dissipation and delay of edge computing.