Electronic music can help people alleviate the pressure in life and work. It is a way to express people’s emotional needs. With the increase of the types and quantity of electronic music, the traditional electronic music classification and emotional analysis cannot meet people’s more and more detailed emotional needs. Therefore, this study proposes the emotion analysis of electronic music based on the PSO-BP neural network and data analysis, optimizes the BP neural network through the PSO algorithm, and extracts and analyzes the emotional characteristics of electronic music combined with data analysis. The experimental results show that compared with BP neural network, PSO-BP neural network has a faster convergence speed and better optimal individual fitness value and can provide more stable operating conditions for later training and testing. The electronic music emotion analysis model based on PSO-BP neural network can reduce the error rate of electronic music lyrics text emotion classification and identify and analyze electronic music emotion with high accuracy, which is closer to the actual results and meets the expected requirements.