The era of big data produces massive data, and carrying out data mining can effectively obtain effective information in huge data, which provides support for efficient decision-making and intelligent optimization. The purpose of this paper is to establish a digital twin system, preprocess massive data using random matrix theory, and design the knowledge graph construction process based on digital twin technology. The BERT model, attention mechanism, BiLSTM model, and conditional random field of the joint deep learning technology are used to identify the knowledge entities in the digital twin system, extract the knowledge relations through the Transformer model, and utilize the TransE model for the knowledge representation in order to construct the knowledge graph. Then, the constructed knowledge graph is combined with the multi-feature attention mechanism to build an anomaly data prediction model in the digital twin system. Finally, the effectiveness of the methods in this paper is validated through corresponding experiments. The TransE model is used for knowledge representation. The accuracy of ternary classification is higher than 80% in all cases, and the MR value decreases by up to 64 compared to the TransR model. The F1 composite score of the anomaly data prediction model is 0.911, and the AUC value of the validation of knowledge graph effectiveness is 0.702. Combining deep learning with the knowledge graph, the knowledge information can be realized in the digital twin system’s accurate representation and enhance the data mining ability of the digital twin system.