As a significant carbon dioxide-emitting country globally, China has set a concrete short-term target of carbon dioxideemissions peak in 2030 and an ambitious long-term plan to reach carbon neutrality by 2060. One essential policy is toset up a carbon trading market to reduce high-pollution enterprises’ carbon emissions by rationally allocating carbonquotas among different firms and regions and setting carbon quotas trading market.In reality, firms obtain carbon quotas in three ways, initial allocation from the government, carbon market trading, andpurification. By using carbon quotas, firms are required to meet the limitation of carbon emissions by regulations. Tohelp firms make the cost-optimal decision in both short-term and long-term management, this paper focuses on theimpact and trading of carbon quota for emission-depending firms.The short-term optimal production model suits firms less than a year from meeting emission limitation requirements. Itis considered that during this time, firms cannot upgrade production equipment with less carbon emission but can onlysell or buy carbon quotas in the carbon trading market. Furthermore, this paper builds a carbon quota price predictingmodel based on the long-short-term memory neural networks(LSTM) method to help firms develop a better tradingstrategy. In the long term, firms can update their technique to less carbon-emitting production technology. Therefore,a long-term optimal production model is established, and variable purifying levels are discussed. Finally, this papercalculates the optimal production strategy under different restraints of carbon emission.