In order to explore the current income gap, a method based on the PSO algorithm in the edge computing environment is proposed. PSO calculates and simulates bird flock foraging activities, the Frank Heppner biological group model, and the three rules in bird activities. After studying the activities of these natural creatures, abstract problems are quantified and similar models established. The Gini coefficient is calculated by using grouped data, and the grouping basis is also innovative. The quantile grouping method is adopted, which can effectively solve the difference between the concentration index and the Gini coefficient, and the Gini coefficients of each year can be added up to finally get the Gini coefficient of the stock income. Experimental results show that the Gini coefficient of traffic income in 2017 and 2018 had dropped significantly, but the variation of the Gini coefficient of stock income (Delta CG) was still greater than 0. Obviously, the adjustment speed of the Gini coefficient of stock income was lagging behind, as was the Gini coefficient of traffic income. We found that after 1986, the facilitation effect was greater than the dilution effect, and the facilitation effect continued to push up the stock income gap, which indicated more income flow to the high-income group, with the income flow gap showing an upward trend and the upward trend becoming more and more obvious. It has been proved that the PSO algorithm can effectively identify the income gap in the edge computing environment, and the corresponding policy suggestions are given.