Relying on features such as high-speed, low latency, support for cutting-edge technology, internet of things, and multimodality, 5G networks will greatly contribute to the transformation of Web 3.0. In order to realize low-latency and high-speed information exchange in 5G communication networks, a method based on the allocation of network computing resource in view of edge computing model is proposed. The method first considers three computing modes: local device computing, local mobile edge computing (MEC) server computing, and adjacent MEC server computing. Then, a multi-scenario edge computing model is further constructed for optimizing energy consumption and delay. At the same time, the encoding-decoding mode is used to optimize PSO algorithm and combined with the improvement of fitness function, which can effectively support the communication network to achieve reasonable allocation of resources, ensuring efficiency of information exchange in the network. In the end, the results show that when the number of users is 500, the method can complete the task assignment within 44s.