Large scale bilateral transactions may lead to extreme power grid operation mode. The trading results adjustion by post security check may affect the generation plans and increase the production and operation risks of market members. It is of great significance for the orderly development of power market in the medium and long-term to provide the security analysis service before the transaction process and guide the market members to revise the medium and long-term physical transactions. A new mode of medium and long-term electricity security analysis based on market members' transaction willingness is proposed. In the mode, a two-step security check process including centralized electricity security analysis and electric energy limitation calculation is established, and an optimization analysis model based on security-constrained unit commitment (SCUC) is developed. Through coordinating the multi-period optimal dispatching of power balance and power grid security, it is available to acquire the executable conclusion of electricity contract as well as the subsequent power tradable space. The case analysis based on actual data of provincial power grid shows the effectiveness of the mechanism.