Network public opinion represents public social opinion to a certain extent and has an important impact on formulating national policies and judgment. Therefore, China and other countries attach great importance to the study of online public opinion. However, the current researches lack the combination of theory and practical cases and lack the intersection of social and natural sciences. This work aims to overcome the technical defects of traditional management systems, break through the difficulties and pain points of existing network public opinion risk management, and improve the efficiency of network public opinion risk management. Firstly, a network public opinion isolation strategy based on the infectious disease propagation model is proposed, and the optimal control theory is used to realize a functional control model to maximize social utility. Secondly, blockchain technology is used to build a network public opinion risk management system. The system is used to conduct a detailed study on identifying and perceiving online public opinion risk. Finally, a Chinese word segmentation scheme based on Long Short-Term Memory (LSTM) network model and a text emotion recognition scheme based on a convolutional neural network are proposed. Both schemes are validated on a typical corpus. The results show that when the system has a control strategy, the number of susceptible drops significantly. Two days after the public opinion is generated, the number of susceptible people decreased from 1,000 to 250; 3 days after the public opinion is generated, the number of susceptible people stabilized. 2 days after the public opinion is generated, the number of lurkers increased from 100 to 620; 3 days after the public opinion is generated, the number of lurkers stabilized. The data demonstrate that the designed isolation control strategy is effective. Changes in public opinion among infected people show that quarantine control strategies played a significant role in the early days of Corona Virus Disease 2019. The rate of change in the number of infections is more affected when quarantine controls are increased, especially in the days leading up to the outbreak. When the system adopts the optimal control strategy, the influence scope of public opinion becomes smaller, and the control becomes easier. When the dimension of the word vector of emergent events is 200, its accuracy may be higher. This method provides certain ideas for blockchain and deep learning technology in network public opinion control.