Economic forecasting provides support for governments to formulate rules in advance and ensure the smooth operation of the social economy. At the same time, it is also very important to identify possible network threats in the process of economic forecasting in a timely manner to ensure the security of economic data. In this paper, research is carried out from two aspects of economic forecasting and cyber threat detection. The prediction model MIDAS is constructed to predict the quarterly GDP growth rate with monthly economic data, and the prediction error is reduced by determining the weight function and parameter constraints. Design a behavioral pattern graph that contains normal and abnormal user behaviors. Combine the behavior pattern graph embedding algorithm (GraphSAGE) to achieve graph embedding and graph dimensionality reduction, and introduce Gaussian noise to enhance the effect of cyber threat retrieval.The success rate of GraphSAGE’s behavior pattern graph dimensionality reduction reaches up to 97.12%, and 12 cyber threat paths hidden in user behaviors are successfully identified in an average time of 1.82ms-9.18ms