Energy supply is an important system that affects the overall efficiency of urban transportation. To improve the system operational efficiency and reduce costs, we formulate and solve a collaborative multidepot petrol station replenishment problem with multicompartments and time window assignment by establishing a mixed-integer linear programming model. The hybrid heuristic algorithm composed of genetic algorithm and particle swarm optimization is used as a solution, and then the Shapley value method is applied to analyze the profit allocation of each petrol depot under different coalitions. The optimal membership sequence of the cooperation is determined according to the strict monotone path. To analyze and verify the effectiveness of the proposed method, a regional petrol supply network in Chongqing city in China is investigated. Through cooperation between petrol depots in the supply network, the utilization of customer clustering, time window coordination, and distribution truck sharing can significantly reduce the total operation costs and improve the efficiency of urban transportation energy supply. This approach can provide theoretical support for relevant government departments and enterprises to make optimal decisions. The implementation of the joint distribution of energy can promote the sustainable development of urban transportation.