Social network hotspot data prediction method and system based on artificial intelligence
By encoding and evaluating social network hotspot data using an AI-based approach, this method addresses the uncertainties and environmental impacts that are not considered in existing prediction methods, achieving higher accuracy and lower cost in hotspot prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2026-04-14
AI Technical Summary
Existing methods for predicting social network hot topics suffer from problems such as high uncertainty, failure to consider the impact of distributed network environments, and inability to accurately assess the influence of hot topics, leading to inaccurate predictions.
An AI-based approach is employed to encode and extract temporal information from social network hotspot data through data temporal information encoding, a Transformer encoder, and a decoder. The importance of the data is then assessed using a self-attention matrix, simplifying the calculation process and improving prediction accuracy.
It significantly improves the accuracy and efficiency of predicting trending data on social networks, reduces time costs, and is applicable to the prediction of various trending events.
Smart Images

Figure CN121858799A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence network data prediction technology, specifically relating to an artificial intelligence-based method and system for predicting social network hotspot data over long time series. Background Technology
[0002] With the rise of social media and the widespread use of the internet, people increasingly enjoy sharing various types of information on social media, such as videos, text, and music. This information often forms so-called social media hotspots, which are topics or events that attract widespread attention and discussion. For advertisers, communication platforms, and other businesses, predicting the popularity of social media hotspots is crucial, as they can leverage these hotspots to promote their products or services. However, existing methods for predicting social media hotspots have some shortcomings. First, many methods tend to use viral propagation models, which still have significant uncertainties, making accurate predictions difficult. Second, the generation, spread, replication, and outbreak of social media hotspots occur in a typical distributed network environment, and current methods rarely consider the impact of this environment. Third, existing methods do not quantitatively analyze the popularity of social media hotspots, thus failing to accurately assess their influence. To better predict the popularity of social media hotspots, we need to adopt more precise and comprehensive methods. One possible approach is to use machine learning techniques to predict the popularity of social media hotspots. This method can learn the patterns of hotspot generation, spread, and outbreak by analyzing large amounts of historical data and predict future hotspot trends. Another possible approach is to use graph theory and network science techniques to build a model of hotspot propagation, taking into account the influence of distributed network environments, thereby more accurately predicting the popularity trends of social network hotspots.
[0003] Regardless of the method used, we need to consider the popularity of trending topics on social networks, as this directly impacts their influence and commercial value. Therefore, we need to quantitatively analyze the popularity of trending topics to better assess their influence and commercial value. In short, predicting the popularity trends of social network trends is crucial and has significant marketing value for advertisers, communication platforms, and other businesses. We need to adopt more precise and comprehensive methods to achieve accurate predictions. Summary of the Invention
[0004] The purpose of this invention is to provide a more accurate and comprehensive method and system for predicting social network hotspot data based on artificial intelligence.
[0005] The objective of this invention is achieved as follows:
[0006] An artificial intelligence-based method for predicting trending data on social networks includes the following steps:
[0007] (1) Encode the time-series information of social network hotspot data;
[0008] (2) Extract time-series information from the encoded new data;
[0009] (3) The prediction module outputs predicted social network hotspot data.
[0010] Step (1) includes:
[0011] (1.1) Segment the input social network hotspot data into data to be encoded;
[0012] (1.2) Perform location and global timestamp encoding;
[0013] (1.3) Obtain the new encoded data.
[0014] Step (1.1) includes:
[0015] (1.1.1) The data time series information encoder receives input social network hotspot data K:G×S, where G is the total time series length and S is the feature dimension of the data;
[0016] (1.1.2) Select the batch size O and the time window size Y to divide the input social network hotspot data into V data to be encoded, K. v :O×Y×S;
[0017] Step (1.2) includes:
[0018] (1.2.1) Collect the v-th segment of data to be encoded, K v Determine K v Position (poc) and K within the timing window v Mapped feature dimension q model ;
[0019] (1.2.2) For K v Perform relative position encoding:
[0020]
[0021] (1.2.3) For K v Perform global timestamp encoding:
[0022] Collect K v Time features are embedded into corresponding words by month using monr(K) v ), embedding corresponding words according to day (dayr(K)). v), embedding corresponding words by hour (hour(K)). v ) and the corresponding word embedding minr(K) by minute v ), through Embedding layer word embedding to K v To expand;
[0023] (1.2.4) The extended global time codes are accumulated to obtain the global timestamp code:
[0024] TR(K v ) = monr(K v )+dayr(K v )+hour(K v )+minr(K v );
[0025] Step (1.3) includes adding the encoded results to obtain the new encoded data:
[0026] K v =TR(K v )+CR(K v );
[0027] K v Simplified to O×Y×A; A is the new dimension obtained by expanding the feature dimension S after encoding.
[0028] Step (2) includes:
[0029] (2.1) Initialize the number of layers of the Transformer encoder w = 1, and the total number of layers of the encoder is wn;
[0030] (2.2) will Input to the self-attention layer of the w-th layer of the Transformer encoder:
[0031]
[0032] S indicates that the encoder module contains repeated operations of several encoder layers, Norm(·) is the normalization layer, and SparseAttention(·) is the bidirectional sparse self-attention layer;
[0033] (2.3) Obtain the query weight matrix J through random initialization D O×A×A, Key weight matrix J X O×A×A, Value Weight Matrix J I :O×A×A;
[0034] (2.4) Calculate the query matrix Key matrix Value matrix
[0035] (2.5) Evaluate the importance of different elements d in the query matrix D v :
[0036]
[0037] Mean is the operation of taking the mean by row, q = A;
[0038] (2.6) Evaluate the importance of different elements x in the key matrix X v :
[0039]
[0040] Obtain the score vectors F v of Y d v and x d in D and X: 1×Y, F x : 1×Y;
[0041] (2.7) Retain the top h largest d d and F x in the score vectors F v and x v , and replace the remaining elements of D and X, obtaining to replace D and X,
[0042] h = p1lnY;
[0043] p1 is a constant;
[0044] (2.8) Calculate the self-attention matrix N v :
[0045]
[0046] Softmax is the normalization exponential function;
[0047] (2.9) Input the self-attention matrix into the normalization layer, one-dimensional convolutional layer, and normalization layer in sequence to obtain the output:
[0048]
[0049] The time series window size Y of Y′ L = Y;
[0050] (2.10) If w < wn, let w = w + 1 and re-execute (2.2); otherwise, execute the next step;
[0051] (2.11) The output K of the Transformer encoder Enc :
[0052] Step (3) includes:
[0053] (3.1) K Enc Input to Transformer decoder, output K Dec : Give it to the prediction module;
[0054] (3.2) The prediction module outputs the prediction result C: Y C ×S;Y C To predict the time series length.
[0055] An AI-based social network hotspot data prediction system includes a data time-series information encoder, a Transformer encoder, a Transformer decoder, and a prediction module. The specific data processing flow includes:
[0056] (1) The temporal information encoder encodes the temporal information of social network hotspot data;
[0057] The data time series information encoder receives input social network hotspot data K:G×S, where G is the total time series length and S is the feature dimension of the data;
[0058] Choose the batch size O and the time window size Y to divide the input social network hotspot data into V data sets to be encoded. v :O×Y×S;
[0059] Collect the v-th segment of data to be encoded, K v Determine K v Position (poc) and K within the timing window v Mapped feature dimension q model ;
[0060] For K v Perform relative position encoding:
[0061]
[0062] For K v Perform global timestamp encoding:
[0063] Collect K v Time features are embedded into corresponding words by month using monr(K) v ), embedding corresponding words according to day (dayr(K)). v ), embedding corresponding words by hour (hour(K)). v ) and the corresponding word embedding minr(K) by minute v), through Embedding layer word embedding to K v To expand;
[0064] The expanded global time codes are accumulated to obtain the global timestamp code:
[0065] TR(K v ) = monr(K v )+dayr(K v )+hour(K v )+minr(K v );
[0066] The encoded results are added together to obtain the new encoded data:
[0067] K v =TR(K v )+CR(K v );
[0068] K v Simplified to O×Y×A; A is the new dimension obtained by expanding the feature dimension S after encoding;
[0069] (2) The Transformer encoder extracts the timing information of the encoded new data;
[0070] Initialize the number of layers of the Transformer encoder w = 1, and the total number of layers of the encoder is wn;
[0071] Will Input to the self-attention layer of the w-th layer of the Transformer encoder:
[0072]
[0073] S indicates that the encoder module contains repeated operations of several encoder layers, Norm(·) is the normalization layer, and SparseAttention(·) is the bidirectional sparse self-attention layer;
[0074] The query weight matrix J is obtained through random initialization. D O×A×A, Key weight matrix J X O×A×A, Value Weight Matrix J I :O×A×A;
[0075] Calculate the query matrix Key matrix Value matrix
[0076] For querying distinct elements d in matrix D v Assess the importance of:
[0077]
[0078] Mean is the operation of taking the mean value row by row, and q = A;
[0079] Evaluate the importance of different elements x in the key matrix X v :
[0080]
[0081] Obtain Y d's and x's in D and X and the score vector F v and x v : 1×Y, F d : 1×Y; x
[0082] Retain the top h largest d's and x's in the score vectors F d and F x v and x v and x v , replace the remaining elements of D and X, and obtain Replace D and X,
[0083] h = p1lnY;
[0084] p1 is a constant;
[0085] Calculate the self-attention matrix N v :
[0086]
[0087] Softmax is the normalized exponential function;
[0088] Input the self-attention matrix into the normalization layer, one-dimensional convolutional layer, and normalization layer in sequence to obtain the output:
[0089]
[0090] The time series window size Y of Y' L = Y;
[0091] If w < wn, let w = w + 1 and re-execute the process of inputting the self-attention layer of the w-th layer of the Transformer encoder and the following processes; otherwise, the output K of the Transformer encoder : Enc :
[0092] (3) The prediction module outputs the predicted social network hot data.
[0093] Input K EncInput to Transformer decoder, output K Dec : Give it to the prediction module;
[0094] The prediction module outputs the prediction result C:Y C ×S;Y C To predict the time series length.
[0095] The beneficial effects of this invention are as follows: Compared with the prior art, this invention adds time-series information to social network hotspot data, which is more conducive to the Transformer model capturing the time-series correlation between data information, thus resulting in higher prediction accuracy. By calculating self-attention, the query matrix and key matrix are greatly simplified, thereby significantly reducing the time cost in the prediction process. Attached Figure Description
[0096] Figure 1 This is a flowchart of the method steps of the present invention;
[0097] Figure 2 This is a comparison of the errors of this invention with other technologies;
[0098] Figure 3 The time consumption of this invention is similar to that of the Transformer model Informer. Detailed Implementation
[0099] The present invention will now be further described with reference to the accompanying drawings.
[0100] like Figure 1 As shown, this invention provides an artificial intelligence-based method for predicting social network hotspot data. This method can efficiently capture the temporal characteristics of data and extract deep correlation information through self-attention computation, significantly improving the efficiency and accuracy of data prediction. Specifically, it includes the following steps:
[0101] (1) Encode the time-series information of social network hotspot data;
[0102] (1.1) Segment the input social network hotspot data into data to be encoded;
[0103] (1.1.1) The data time series information encoder receives input social network hotspot data K:G×S, where G is the total time series length and S is the feature dimension of the data;
[0104] (1.1.2) Select the batch size O and the time window size Y to divide the input social network hotspot data into V data to be encoded, K. v :O×Y×S;
[0105] (1.2) Perform location and global timestamp encoding;
[0106] (1.2.1) Collect the v-th segment of data to be encoded, K v Determine K v Position (poc) and K within the timing window v Mapped feature dimension q model ;
[0107] (1.2.2) For K v Perform relative position encoding:
[0108]
[0109] (1.2.3) For K v Perform global timestamp encoding:
[0110] Collect K v Time features are embedded into corresponding words by month using monr(K) v ), embedding corresponding words according to day (dayr(K)). v ), embedding corresponding words by hour (hour(K)). v ) and the corresponding word embedding minr(K) by minute v ), through Embedding layer word embedding to K v To expand;
[0111] (1.2.4) The extended global time codes are accumulated to obtain the global timestamp code:
[0112] TR(K v ) = monr(K v )+dayr(K v )+hour(K v )+minr(K v );
[0113] Step (1.3) includes adding the encoded results to obtain the new encoded data:
[0114] K v =TR(K v )+CR(K v );
[0115] K v Simplified to O×Y×A; A is the new dimension obtained by expanding the feature dimension S after encoding.
[0116] (1.3) Obtain the new encoded data.
[0117] (2) Extract time-series information from the encoded new data;
[0118] (2.1) Initialize the number of layers of the Transformer encoder w = 1, and the total number of layers of the encoder is wn;
[0119] (2.2) will Input to the self-attention layer of the w-th layer of the Transformer encoder:
[0120]
[0121] S indicates that the encoder module contains repeated operations of several encoder layers, Norm(·) is the normalization layer, and SparseAttention(·) is the bidirectional sparse self-attention layer;
[0122] (2.3) Obtain the query weight matrix J through random initialization D O×A×A, Key weight matrix J X O×A×A, Value Weight Matrix J I :O×A×A;
[0123] (2.4) Calculate the query matrix Key matrix Value matrix
[0124] (2.5) For different elements d in the query matrix D v Assess the importance of:
[0125]
[0126] Mean is the average value calculated by rows, q = A;
[0127] (2.6) For different elements x in the key matrix X v Assess the importance of:
[0128]
[0129] Get Y d within D and X v and x v The score vector F d :1×Y,F x :1×Y;
[0130] (2.7) Retain the score vector F d F x The largest of the first h d v and x v Given the remaining elements of D and X, we obtain... Replacing D,X
[0131] h = p1lnY;
[0132] p1 is a constant;
[0133] (2.8) Calculate the self-attention matrix N v :
[0134]
[0135] Softmax is a normalization exponential function;
[0136] (2.9) Input the self-attention matrix into the normalization layer, one-dimensional convolutional layer, and normalization layer in sequence to obtain the output:
[0137]
[0138] The time series window size Y of Y' L = Y;
[0139] (2.10) If w < wn, let w = w + 1 and re-execute (2.2); otherwise, execute the next step;
[0140] In actual work, the calculation of self-attention consumes a great deal of computing power and storage, and the self-attention score matrix is sparse. Therefore, it is not necessary to calculate all the elements in the key matrix. The present invention creatively ignores the elements without prediction value through importance evaluation, can weaken the calculation amount according to different hot parameters, and this concept is quite unique in the field of prediction of hot data. In addition, the present invention solves the asymmetry problem of the importance evaluation kernel function, making the evaluation system universal and applicable to most hot events, such as entertainment, political news, etc.
[0141] (2.11) The output K of the Transformer encoder Enc :
[0142] (3) The prediction module outputs the predicted social network hot data.
[0143] (3.1) Input K Enc into the Transformer decoder, and the Transformer decoder outputs K Dec : to the prediction module;
[0144] (3.2) The prediction module outputs the prediction result C: Y C × S; Y C is the prediction time series length.
[0145] This invention proposes an artificial intelligence-based social network hotspot data prediction system, comprising a data time-series information encoder, a Transformer encoder, a Transformer decoder, and a prediction module. The specific data processing flow includes:
[0146] (1) The temporal information encoder encodes the temporal information of social network hotspot data;
[0147] The data time series information encoder receives input social network hotspot data K:G×S, where G is the total time series length and S is the feature dimension of the data;
[0148] Choose the batch size O and the time window size Y to divide the input social network hotspot data into V data sets to be encoded. v :O×Y×S;
[0149] Collect the v-th segment of data to be encoded, K v Determine K v Position (poc) and K within the timing window v Mapped feature dimension q model ;
[0150] For K v Perform relative position encoding:
[0151]
[0152] For K v Perform global timestamp encoding:
[0153] Collect K v Time features are embedded into corresponding words by month using monr(K) v ), embedding corresponding words according to day (dayr(K)). v ), embedding corresponding words by hour (hour(K)). v ) and the corresponding word embedding minr(K) by minute v ), through Embedding layer word embedding to K v To expand;
[0154] The expanded global time codes are accumulated to obtain the global timestamp code:
[0155] TR(K v ) = monr(K v )+dayr(K v )+hour(K v )+minr(K v );
[0156] The encoded results are added together to obtain the new encoded data:
[0157] K v =TR(K v )+CR(K v );
[0158] K v Simplified to O×Y×A; A is the new dimension obtained by expanding the feature dimension S after encoding;
[0159] (2) The Transformer encoder extracts the timing information of the encoded new data;
[0160] Initialize the number of layers of the Transformer encoder w = 1, and the total number of layers of the encoder is wn;
[0161] Will Input to the self-attention layer of the w-th layer of the Transformer encoder:
[0162]
[0163] S indicates that the encoder module contains repeated operations of several encoder layers, Norm(·) is the normalization layer, and SparseAttention(·) is the bidirectional sparse self-attention layer;
[0164] The query weight matrix J is obtained through random initialization. D O×A×A, Key weight matrix J X O×A×A, Value Weight Matrix J I :O×A×A;
[0165] Calculate the query matrix Key matrix Value matrix
[0166] For querying distinct elements d in matrix D v Assess the importance of:
[0167]
[0168] Mean is the average value calculated by rows, q = A;
[0169] For different elements x in the key matrix X v Assess the importance of:
[0170]
[0171] Get Y d within D and X v and x v The score vector Fd : 1×Y, F x : 1×Y;
[0172] Retain the score vector F d , F x The top h largest d in v and x v , for the remaining elements of D and X, obtain Replace D and X with
[0173] h = p1lnY;
[0174] p1 is a constant;
[0175] Calculate the self-attention matrix N v :
[0176]
[0177] Softmax is a normalization exponential function;
[0178] Input the self-attention matrix into the normalization layer, one-dimensional convolutional layer, and normalization layer in sequence to obtain the output:
[0179]
[0180] The time series window size Y of Y' L = Y;
[0181] If w < wn, set w = w + 1 and re-execute the process of inputting the self-attention layer of the w-th layer of the Transformer encoder and the following processes; otherwise, the output K of the Transformer encoder Input the self-attention layer of the w-th layer of the Transformer encoder and the following processes; otherwise, the output K of the Transformer encoder Enc :
[0182] (3) The prediction module outputs the predicted social network hot data.
[0183] Input K Enc Input K into the Transformer decoder, and the Transformer decoder outputs K Dec : To the prediction module; (66)
[0184] The prediction module outputs the prediction result C: Y C ×S; Y C is the prediction time series length.
[0185] To demonstrate the advantages of this invention, we conducted experimental verification. Experimental data sampling focused on the development trend of an entertainment event, collecting data from two online social media platforms. The main features consisted of indicators such as event attention and duration. The dataset was collected hourly, with each data sample comprising 8 features. The dataset included 620 simulated customer information entries, resulting in 52,608 samples with high feature dimensionality. The Adam function was used to iteratively update the model parameters, and the cross-entropy function was chosen as the loss function for network training. The training epochs were 3, O=64, and both MSE and MAE standards were used. Figure 2 The errors of this invention were compared with those of other technologies; Figure 3 The time consumption of this invention was compared with that of the Informer model, which is also a Transformer model. Analysis Figure 2 and Figure 3 It can be seen that, compared with existing methods, the present invention reduces errors, effectively improves prediction accuracy, and also effectively reduces prediction time.
Claims
1. A method for predicting social network hotspot data based on artificial intelligence, characterized in that, The steps are as follows: (1) Encoding the time series information of the social network hot data; (2) Extracting the time series information from the encoded new data; (3) The prediction module outputs the predicted social network hot data.
2. The method for predicting social network hotspot data based on artificial intelligence according to claim 1, characterized in that, The steps are as follows: The step (1) includes: (1.1) Splitting the input social network hot data into data to be encoded; (1.2) Performing position and global timestamp encoding; (1.3) Obtaining the encoded new data.
3. According to the method for predicting social network hot data based on artificial intelligence described in claim 2, the step (1.1) includes: (1.1.1) The data time series information encoder receives the input social network hot data K: G×S, where G is the total time series length and S is the feature dimension of the data; (1.1.2) Select the batch size O and the time window size Y to divide the input social network hotspot data into V data to be encoded, K. v :O×Y×S.
4. According to the method for predicting social network hot data based on artificial intelligence described in claim 2, the step (1.2) includes: (1.2.1) Collect the v-th segment of data to be encoded, K v Determine K v Position (poc) and K within the timing window v Mapped feature dimension q model ; (1.2.2) For K v Perform relative position encoding: (1.2.3) For K v Perform global timestamp encoding: Collect K v Time features are embedded into corresponding words by month using monr(K) v ), embedding corresponding words according to day (dayr(K)). v ), embedding corresponding words by hour (hour(K)). v ) and the corresponding word embedding minr(K) by minute v ), through Embedding layer word embedding to K v To expand; (1.2.4) Accumulating the extended global time encoding to obtain the global timestamp encoding: TR(K v )=monr(K v )+dayr(K v )+hour(K v )+minr(K v )。 5. According to the method for predicting social network hot data based on artificial intelligence described in claim 2, the step (1.3) includes adding the encoding results to obtain the encoded new data: K v =TR(K v )+CR(K v ); K v Simplified to O×Y×A; A is the new dimension obtained by expanding the feature dimension S after encoding.
6. According to the method for predicting social network hot data based on artificial intelligence described in claim 1, the step (2) includes: (2.1) Initializing the number of layers w = 1 of the Transformer encoder, and the total number of layers of the encoder is wn; (2.2) will Input to the self-attention layer of the w-th layer of the Transformer encoder: S represents the repeated operation of several encoder layers included in the encoder module, Norm(·) is the normalization layer, and SparseAttention(·) is the bidirectional sparse self-attention layer; (2.3) Obtain the query weight matrix J through random initialization D O×A×A, Key weight matrix J X O×A×A, Value Weight Matrix J I :O×A×A; (2.4) Calculate the query matrix Key matrix Value matrix (2.5) For different elements d in the query matrix D v Assess the importance of: Mean is the operation of taking the mean by row, and q = A; (2.6) For different elements x in the key matrix X v Assess the importance of: Get Y d within D and X v and x v The score vector F d :1×Y,F x :1×Y; (2.7) Retain the score vector F d F x The largest of the first h d v and x v Given the remaining elements of D and X, we obtain... Replacing D,X h = p1lnY; p1 is a constant; (2.8) Calculate the self-attention matrix N v : Softmax is the normalization exponential function; (2.9) Sequentially inputting the self-attention matrix into the normalization layer, the one-dimensional convolutional layer, and the normalization layer to obtain the output: The timing window size Y′ L =Y; (2.10) If w < wn, set w = w + 1 and re-execute (2.2); otherwise, execute the next step; (2.11) Output K of the Transformer encoder Enc :
7. According to the method for predicting social network hot data based on artificial intelligence described in claim 1, the step (3) includes: (3.1) K Enc Input to Transformer decoder, output K Dec : Give it to the prediction module; (3.2) The prediction module outputs the prediction result C: Y C ×S;Y C To predict the time series length.
8. An artificial intelligence-based social network hotspot data prediction system, comprising a data time-series information encoder, a Transformer encoder, a Transformer decoder, and a prediction module, characterized in that, The processing flow of specific data includes: (1) The time series information encoder encodes the time series information of the social network hot data; The data time series information encoder receives the input social network hot data K: G×S, where G is the total time series length and S is the feature dimension of the data; Choose the batch size O and the time window size Y to divide the input social network hotspot data into V data sets to be encoded. v :O×Y×S; Collect the v-th segment of data to be encoded, K v Determine K v Position (poc) and K within the timing window v Mapped feature dimension q model ; For K v Perform relative position encoding: For K v Perform global timestamp encoding: Collect K v Time features are embedded into corresponding words by month using monr(K) v ), embedding corresponding words according to day (dayr(K)). v ), embedding corresponding words by hour (hour(K)). v ) and the corresponding word embedding minr(K) by minute v ), through Embedding layer word embedding to K v To expand; Accumulating the extended global time encoding to obtain the global timestamp encoding: TR(K v )=monr(K v )+dayr(K v )+hour(K v )+minr(K v ); Adding the encoding results to obtain the encoded new data: K v =TR(K v )+CR(K v ); K v Simplified to O×Y×A; A is the new dimension obtained by expanding the feature dimension S after encoding; (2) The Transformer encoder extracts the time series information from the encoded new data; Initializing the number of layers w = 1 of the Transformer encoder, and the total number of layers of the encoder is wn; Will Input to the self-attention layer of the w-th layer of the Transformer encoder: S represents the repeated operation of several encoder layers included in the encoder module, Norm(·) is the normalization layer, and SparseAttention(·) is the bidirectional sparse self-attention layer; The query weight matrix J is obtained through random initialization. D O×A×A, Key weight matrix J X O×A×A, Value Weight Matrix J I :O×A×A; Calculate the query matrix Key matrix Value matrix For querying distinct elements d in matrix D v Assess the importance of: Mean is the operation of taking the mean by row, and q = A; For different elements x in the key matrix X v Assess the importance of: Get Y d within D and X v and x v The score vector F d :1×Y,F x :1×Y; Preserve the score vector F d F x The largest of the first h d v and x v Given the remaining elements of D and X, we obtain... Replacing D and X, h = p1lnY; p1 is a constant; Calculate the self-attention matrix N v : Softmax is a normalized exponential function; The self-attention matrix is sequentially input into a normalization layer, a one-dimensional convolutional layer, and another normalization layer to obtain the output: Y′: The timing window size Y′ L =Y; If w < wn, set w = w + 1 and re - execute the following process of the self - attention layer of the w - th layer of the input Transformer encoder; otherwise, the output K of the Transformer encoder : Enc : (3) The prediction module outputs predicted social network hotspot data; K Enc Input to Transformer decoder, output K Dec : Give it to the prediction module; The prediction module outputs the prediction result C:Y C ×S;Y C To predict the time series length.