The handling of unbalanced funds has been a core issue in the spot electricity market, how to balance the economic interest relationship between market entities through compensation or apportionment is one of the key points to the success of the power spot reform, and cost compensation and deviation assessment costs are important components of unbalanced funds. Based on this, this paper systematically describes the generation mechanism and allocation method of cost compensation and deviation assessment costs, proposes a joint settlement method of cost compensation and deviation assessment costs based on the relationship of physical economy rights and responsibilities, and puts forward an optimization calculation method of cost allocation, which can provide reference for the design of settlement mechanism in power spot market.