Stock prediction system of multi-graph neural network based on implicit relationship mining environment

By introducing market fusion MIGRU module and implicit relationship building module in the stock prediction system, combined with the multi-graph GNN method of attention mechanism, the problem of ignoring market indicators and unobservable information in the existing technology is solved, and the accuracy of stock trend prediction is achieved.

CN119693139APending Publication Date: 2025-03-25HAINAN INTERNATIONAL MEDIA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411768685.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing stock prediction method based on graph neural network ignores the interaction between market indicators and stocks when exploring explicit relationships, and ignores the stock interaction relationship in unobservable information when exploring implicit relationships, resulting in limited prediction accuracy.

Method used

A stock prediction system based on the implicit relationship mining environment is proposed, including the market fusion MIGRU module, the implicit relationship construction module, the relational aggregation module and the prediction module. The system explores the potential relationship between stocks by integrating market information and unobservable information, and aggregates different types of relationship characteristics through attention mechanisms to generate more comprehensive stock relationship characteristics, and ultimately conducts stock trend prediction.

Benefits of technology

By capturing the displayed and implicit timing dependencies between stocks and extracting advanced fusion features, the model shows higher accuracy in stock trend prediction, surpassing existing GNN-based methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693139A_ABST
    Figure CN119693139A_ABST
Patent Text Reader

Abstract

The invention provides a stock prediction system of a multi-graph neural network based on an implicit relationship mining environment, and relates to the technical field of artificial intelligence, and the system comprises the steps: firstly, providing a market fusion MIGRU module, and integrating a past market index into a historical stock price index; therefore, time sequence features fused with external market features are generated. And the time sequence features obtained by the market fusion MIGRU module are input into the implicit relation construction module to obtain a relation matrix based on price data and a relation matrix based on stock unobservable data. And inputting the unobservable relation matrix and the market information relation matrix generated by the implicit relation construction module into a relation aggregation module based on a graph neural network to obtain relation characteristics of the stock. And finally, for a specific stock, combining a time sequence feature fused by an initial feature and an external market feature of the specific stock with a relation feature between the stocks, and designing a stock prediction problem into a one-node three-classification task through a prediction module, thereby predicting a future price trend of the stock.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a stock prediction system based on a multi-graph neural network in an implicit relationship mining environment. Background Art

[0002] With the rapid development of computer hardware and artificial intelligence, quantitative trading is ushering in a new wave of research, among which stock trading has become one of the focuses of attention in the financial market. Stock trading relies on precise mathematical models, predicts future price trends through a large amount of historical data, and screens stocks through artificial intelligence methods. This method significantly reduces the impact of investor sentiment on the market and effectively avoids the risk of making irrational investment decisions when the market is enthusiastic or pessimistic. In the field of quantitative trading, stock analysis plays an indispensable role in scientifically evaluating the value and price trend of stocks. Quantitative trading adopts a systematic and regularized approach, combining stock analysis with computer technology to make investment decisions in a more scientific and objective way.

[0003] Stock trend prediction has always been a core issue of concern to investors and financial institutions. However, in the face of the ever-changing stock market environment and complex stock data, improving the accuracy of stock predictions remains a challenging task. Currently, stock predictions mainly use a variety of methods such as statistics, traditional machine learning, and deep learning. Deep learning has become one of the most popular methods due to its high accuracy and powerful feature extraction capabilities. Deep learning originates from the imitation of the way the human brain processes information, and simulates the operation mode of the human brain through a multi-level and complex neural network model. It has achieved remarkable results in the fields of speech recognition and image recognition, and has attracted much attention for its efficient processing of complex data. Popular deep learning frameworks include TensorFlow, MXNet, PyTorch, etc.

[0004] Although deep learning has achieved good results in stock prediction, traditional recurrent neural networks (such as LSTM) have certain limitations in dealing with complex stock market situations because they mainly consider historical time series data. To solve this problem, graph neural networks (GNNs) have attracted much attention as an emerging graph data processing technology. Unlike traditional neural networks, the input of GNNs is a graph structure, which can better capture the complex relationships between nodes. As a popular GNN architecture, graph convolutional neural networks (GCNs) obtain graph representations through convolutional layers and effectively extract relationship information in graph structures. In addition, there are other GNN architectures, such as graph attention networks (GATs), graph generative networks (GGNs), and graph spatial-temporal networks (GSTNs). The introduction of these advanced technologies makes stock predictions more accurate and adaptable, providing stronger support for investment decisions. In the financial field, these advanced technologies are not only investment tools, but also promote the innovation and upgrading of investment strategies and decision-making methods.

[0005] GNN has a wide range of application potential in stock prediction, because the stock market can be viewed as a huge stock relationship graph. However, there are two problems with existing GNN-based stock prediction methods: First, when exploring explicit relationships, explicit relationships are determined based on financial knowledge, such as industry relationships and shareholder relationships. However, when exploring explicit relationships, the impact of the interaction between market indicators and stocks is ignored; second, implicit relationships are explored based on observable price indicators. Implicit relationships are extracted and analyzed from data using various strategies, such as Pearson coefficients or cosine similarity to explore stock price correlations, or using deep learning-based graph representation methods to gain insight into the relationship between stocks. However, previous implicit relationships often ignore the exploration of stock interaction relationships from unobservable information. These two problems may affect the prediction accuracy of the model. Summary of the invention

[0006] In view of the deficiencies of the prior art, the present invention provides a stock prediction system based on a multi-graph neural network in an implicit relationship mining environment;

[0007] The technical solution of the present invention is as follows:

[0008] On the one hand, the stock prediction system based on multi-graph neural network in implicit relationship mining environment includes: market fusion MIGRU module, implicit relationship building module, relationship aggregation module and prediction module;

[0009] The market fusion MIGRU module integrates external market information into stock price features; the market fusion MIGRU module takes the stock's historical daily and weekly opening price, closing price, highest price, lowest price and trading volume and external market information as input, introduces a fusion gate based on GRU, integrates past market indexes into historical stock indexes, extracts features after the price index data is fused with the market index, and is used to generate time series features affected by external market information;

[0010] The implicit relationship building module analyzes the relationship between price data and unobservable information of stocks and explores the potential relationship between stocks based on price data and unobservable information;

[0011] The relationship aggregation module inputs the relationship constructed based on price data and unobservable information and the time series features of each stock into the GCN to mine the mutual influence between stocks and generate the relationship features of the stocks;

[0012] The prediction module performs prediction by fusing the time series features generated by the market fusion MIGRU module, the stock relationship features generated by the relationship aggregation module, and the initial features of the stock historical price index.

[0013] On the other hand, the stock prediction method of the multi-graph neural network based on the implicit relationship mining environment is implemented based on the aforementioned stock prediction system of the multi-graph neural network based on the implicit relationship mining environment, and includes the following steps:

[0014] Step 1: Obtain historical time series data and explicit relationship data of stocks;

[0015] Step 2: Preprocess the historical time series data;

[0016] For historical time series data, the characteristic dimensions of each stock include five historical attributes: opening price, closing price, highest price, lowest price and trading volume. Based on these price indicators, daily and weekly lines are generated, and filtering conditions are set to filter the historical time series data obtained in step 1. The set filtering formula is as follows:

[0017]

[0018] in, Indicates stock v i In the closing price data of the tth trading day, Min(p i ) indicates stock v i The minimum closing price in the time series data, Max(p i ) indicates stock v iThe maximum closing price in the time series data, other price indicators, opening price, highest price, lowest price and trading volume are all filtered using this screening formula to normalize the stock data and scale the data to the [0,1] interval;

[0019] Step 3: Use the daily and weekly lines as historical stock price index data and input them into the market fusion MIGRU module together with the market index data. The MIGRU module generates an output after the fusion of stock historical features and market index features. The output obtained by the market fusion MIGRU module is input into the relationship aggregation module and the prediction module to achieve feature aggregation;

[0020] The extraction of fusion features of historical time series features and market indicators through the market fusion module MIGRU includes the following steps:

[0021] Step S1: The price index of each company and Input market fusion MIGRU module to capture timing dependencies:

[0022]

[0023] get in, represents the time series price index of the i-th company, represents the market index of the i-th company, T represents the time step, and D p represents the price attribute feature dimension, D m represents the characteristic dimension of the market index, D s For the newly extracted feature dimension, MIGRU i (·) represents the GRU-based market fusion module, which is used to extract the fusion features of stock historical features and market indicators;

[0024] Step S2: Extract feature dimensions using the market fusion module MIGRU;

[0025] Step S2.1: Convert stock historical features and market index characteristics The vectors are concatenated into a new vector and input into the fusion gate in the market fusion MIGRU module. The redundant features are filtered through a sigmoid function, and the non-redundant features are combined with the price index. Fusion generates new features:

[0026]

[0027] in, represents the fusion gate, express and The fusion characteristics of and represents the weight of the neural network, and is the bias in the neural network, σ represents the sigmoid function, Represents element-wise multiplication;

[0028] Step S2.2: Add The fusion vector of the historical time series features extracted at the previous moment and the market indicators Splice into a new vector and calculate the update gate vector and reset gate vector The formula is as follows:

[0029]

[0030] in are the weights of the update gate and the reset gate respectively, are the biases of the update gate and reset gate respectively;

[0031] Step S2.3: Add the vector that has passed the update gate to the vector at the previous moment. Corresponding element multiplication and fusion features Splicing is performed and the candidate state is calculated through a tanh activation function Multiply it element-wise with the reset gate vector, plus With the previous moment The vectors multiplied element by element get the final time series features The specific formula is as follows:

[0032]

[0033] in, is the weight, is bias;

[0034] Step 4: Input the time series features obtained by the market fusion MIGRU module into the implicit relationship building module to explore the potential relationship between stocks through the relationship based on price data and the relationship based on unobservable information;

[0035] Step 4.1: Use the Hawkes process to simulate the decay of the relationship between stocks over time. The specific implementation steps of the Hawkes process are as follows:

[0036] Step 4.1.1: Use the market fusion MIGRU module to obtain stock v i and stock v i The timing characteristics of and Generate a scalar through a relational mapping function R Indicates stock v j For stocks i The specific formula is as follows:

[0037]

[0038] The relational mapping function R(·) represents a two-layer fully connected neural network;

[0039] Step 4.1.2: Consider the weighted sum of the scalars generated by the mappings over the previous T days to represent the stock v j For stocks i The specific formula is as follows:

[0040]

[0041] The relational mapping function R(·) is a two-layer fully connected neural network;

[0042] Step 4.1.3: The weighted sum of the scalar generated by the mapping function R and the intensity value at time tT is obtained to obtain a value representing the stock v j For stocks i The strength value of the correlation strength between them is as follows:

[0043]

[0044] Where ∈ is the excitation coefficient, γ is the decay rate, λ t-T is the intensity value at time tT, K is the index of the time step;

[0045] Specifically, the potential relationship between stocks is explored based on unobservable information:

[0046] Step 4.2: Randomly initialize the features D of the two unobservable relationships i ,D j ∈R K×C , construct the stock relationship strength value e based on unobservable information through graph learning method i,j ;

[0047] Step 4.2.1: and The scalar obtained by doing the inner product infers the stock v i and stock v j The kth unobservable relationship between , the specific formula is as follows:

[0048]

[0049] in Is stock v i and stock vj The characteristics of the kth unobservable relationship;

[0050] Step 4.2.2: Fusion the stock v output by the MIGRU module i and stock v j The time series features are concatenated and the concatenated vector is combined with the weight W u Perform a dot product and add the bias b u Generate a scalar Indicates stock v i and stock v j The correlation formula is as follows:

[0051]

[0052] where s i Indicates stock v i The time series characteristics, s j Indicates stock v j The timing characteristics of

[0053] Step 4.2.3: Convert the scalar generated in step 4.2.2 Input into the Softmax function for normalization to generate a scalar Indicates stock v i and stock v j The probability of the Kth unobservable relationship between , the specific formula is as follows:

[0054]

[0055] Among them, λ is a positive parameter that controls the output distribution, ∈ k and ∈ p is the bias term, and p represents the index of traversing all K unobservable relationship patterns;

[0056] Step 4.2.4: For the stock v obtained in step 4.2.1 i and stock v j The Kth unobservable relationship between The stock v generated in step 4.2.3 i and stock v j The probability of the Kth unobservable relationship between Perform weighted summation to obtain a scalar Used to represent stock v i and stock v j The strength of the unobservable relationship between , the specific formula is as follows:

[0057]

[0058] Step 5: Use the multi-graph GNN method based on the attention mechanism to assign different weights according to the importance of different types of relationship features, thereby obtaining stock relationship features;

[0059] Step 5.1: Preprocess the explicit relationship data to obtain the predefined relationship between stocks;

[0060] The explicit relationship data include: industry relationship and regional relationship, all of which are taken from Tushare. First, mathematical modeling of industry relationship is performed to construct the industry relationship matrix A, which is a symmetric undirected graph. If company i and company j belong to the same industry, then

[0061] A i,j =A j,i =1

[0062] otherwise

[0063] A i,j =A j,i =0

[0064] Among them A i,j and A j,i Represents the weight of the line between company i and company j in an undirected graph;

[0065] Similarly, the regional relationship between companies is modeled and the regional relationship matrix is ​​constructed. The construction method is that if company i and company j are headquartered in the same region, then the regional relationship adjacency matrix

[0066] A i,j =A j,i =1

[0067] If the headquarters of company i and company j are not in the same region, then the regional relationship matrix

[0068] A i,j =A j,i =0

[0069] Among them A i,j and A j,i The meaning of is the same as above, indicating the weight of the line connecting company i and company j;

[0070] Step 5.2: For stock v i , its relationship characteristics The relationship feature is determined by the weighted sum of the features of adjacent stocks and is calculated using the linear aggregator in GCN. The specific formula is as follows:

[0071]

[0072] Among them, a i,j For stock v i and stock v jThe predefined relationship between them is standardized, W is the weight, b is the bias, and N represents the total number of stocks.

[0073] Construct the relationship strength value e under the influence of multiple factors i,j , indicating stock v i and stock v j The strength of the relationship between them; through the relationship aggregation module, different types of relationship features Assign different weights to stocks j For stocks i The strength value of the relationship in the first category and timing characteristics Perform a linear transformation, add a bias, and then and Input into the Softmax function for normalization to obtain the potential representation weights of all stocks and different types of relationships to obtain more comprehensive relationship features The specific formula is as follows:

[0074]

[0075] in For stock v i With stock v j The attention score of the l-th type of relation, For stock v i With stock v j The attention score of the k-th relation, For stock v j For stocks i The strength value of the lth type of relationship, is the time series feature, is the weight, is bias;

[0076] Step 6: Add price indicator features Timing characteristics And the relationship features output by the relationship aggregation module The vectors are concatenated into a new vector and input into the fully connected layer of the prediction module to predict the probability of future stock trends. The formula is as follows:

[0077]

[0078] Where Softmax(·) is the Softmax function, is the weight, b p ∈R C is the bias, C is the number of neurons in the output layer, corresponding to the number of categories, and D p Price indicator characteristics The characteristic dimension, D sFor the time series characteristics The characteristic dimension, D r Relationship Features The feature dimension of the output is a vector of length 3, representing the company's stock trend. Specifically, the three categories of nodes are as follows:

[0079]

[0080] in, is the stock v on day t i After the adjustment of the closing price, output 1 represents a future stock price increase, output -1 represents a future stock price decrease, and output 0 represents a future stock price that remains the same.

[0081] The beneficial effects of adopting the above technical solution are:

[0082] The present invention provides a stock prediction system based on a multi-graph neural network in an implicit relationship mining environment. In order to capture the explicit and implicit temporal dependencies between stocks, the present invention proposes a new GRU-based MIGRU module to extract advanced fusion features and eliminate redundant data in two stock data. The present invention considers the stock relationship matrix based on price data relationship and unobservable information in stock data. In order to obtain the price data-based relationship, the present invention uses the Hawkes process to simulate the decay of the relationship and considers the impact of historical relationships on stocks. At the same time, a new GNN method based on the attention mechanism is proposed to aggregate features from related stocks to obtain the relationship features of stocks. This method can model historical price data and different types of relationship types through the attention mechanism, thereby predicting stock price changes. Through comparative experiments, compared with the existing GNN-based methods, our accuracy in stock trend prediction is higher than that of other models. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] Figure 1 It is the overall framework diagram of the system of the present invention;

[0084] Figure 2 This is the structural diagram of the MIGRU module of the market fusion of the present invention. DETAILED DESCRIPTION

[0085] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0086] On the one hand, stock prediction systems based on multi-graph neural networks in implicit relationship mining environments, such as Figure 1 As shown, it includes: market fusion MIGRU module, implicit relationship building module, relationship aggregation module and prediction module;

[0087] The market fusion MIGRU module is as follows Figure 2 As shown in the figure, external market information is fused into stock price features. Among them, external market information refers to information that has a global impact on all stocks and stock relationships in the stock market, such as relevant policies and events. The market fusion MIGRU module takes the historical daily and weekly opening prices, closing prices, highest prices, lowest prices and trading volumes of stocks and external market information as inputs, and introduces an additional gating mechanism, the fusion gate, on the basis of GRU to integrate past market indexes into historical stock indicators; existing methods often ignore the impact of the interaction between market indicators and stocks when exploring explicit relationships. In order to make up for this deficiency, a market fusion MIGRU module is proposed to extract the features of the fusion of price index data and market index, which are used to generate time series features affected by external market information;

[0088] The implicit relationship building module analyzes the potential relationship between price data and stocks, which is difficult to obtain directly from observable data. Unobservable information refers to information that cannot be directly obtained from public data, usually including implicit or difficult to quantify factors, which have an impact on stock prices but cannot be obtained through conventional financial statements, price data and other public channels. When using observable price indicators to explore implicit relationships, existing methods mainly focus on the correlation of stock prices and ignore the exploration of the interaction relationship between stocks from unobservable information. In order to solve this problem, the present invention proposes the implicit relationship building module. Explore the potential relationship between stocks based on price data and unobservable information;

[0089] The relationship aggregation module inputs the relationship constructed based on price data and unobservable information and the time series features of each stock into the GCN to mine the mutual influence between stocks and generate the relationship features of the stocks;

[0090] The prediction module performs prediction by fusing the time series features generated by the market fusion MIGRU module, the stock relationship features generated by the relationship aggregation module, and the initial features of the stock historical price index.

[0091] On the other hand, the stock prediction method of the multi-graph neural network based on the implicit relationship mining environment is implemented based on the aforementioned stock prediction system of the multi-graph neural network based on the implicit relationship mining environment, and includes the following steps:

[0092] Step 1: Obtain historical time series data and explicit relationship data of stocks;

[0093] In this embodiment, the historical time series data and explicit relationship data are from the open source financial database Cashare;

[0094] Step 2: Preprocess the historical time series data;

[0095] For historical time series data, the characteristic dimensions of each stock include five historical attributes: opening price, closing price, highest price, lowest price and trading volume. Based on these price indicators, daily and weekly charts are generated. The filtering conditions are set to filter the historical time series data obtained in step 1 to ensure the quality and relevance of the data. i Taking the closing price of as an example, the screening formula is set as follows:

[0096]

[0097] in, Indicates stock v i In the closing price data of the tth trading day, Min(p i ) indicates stock v i The minimum closing price in the time series data, Max(p i ) indicates stock v i The maximum closing price in the time series data, other price indicators, opening price, highest price, lowest price and trading volume are all filtered using this screening formula to normalize the stock data and scale the data to the [0,1] interval;

[0098] Step 3: Use the daily and weekly lines as historical stock price index data and input them into the market fusion MIGRU module together with the market index data. This module aims to integrate external market information and stock price features. Through the MIGRU module, the relationship between the market and stock prices is modeled and learned, and then the output of the fusion of stock historical features and market index features is generated. The output of the market fusion MIGRU module is input into the relationship aggregation module and the prediction module to achieve feature aggregation;

[0099] The market fusion module MIGRU is used to extract the fusion features of historical time series features and market indicators:

[0100] Step S1: The price index of each company and The input market is fused with a MIGRU module to capture both short-term and long-term temporal dependencies:

[0101]

[0102] get in, represents the time series price index of the i-th company, represents the market index of the i-th company, T represents the time step, and D prepresents the price attribute feature dimension, D m represents the characteristic dimension of the market index, D s For the newly extracted feature dimension, MIGRU i (·) represents the GRU-based market fusion module, which is used to extract the fusion features of stock historical features and market indicators;

[0103] Step S2: Taking the i-th company at time t as an example, the market fusion module MIGRU is used to extract feature dimensions;

[0104] Step S2.1: Convert stock historical features and market index characteristics The vectors are concatenated into a new vector and input into the fusion gate in the market fusion MIGRU module. The redundant features are filtered through a sigmoid function, and the non-redundant features are combined with the price index. Fusion generates new features:

[0105]

[0106] in, represents the fusion gate, express and The fusion characteristics of and represents the weight of the neural network, and is the bias in the neural network, σ represents the sigmoid function, Represents element-wise multiplication;

[0107] Step S2.2: Add The fusion vector of the historical time series features extracted at the previous moment and the market indicators Splice into a new vector and calculate the update gate vector and reset gate vector The formula is as follows:

[0108]

[0109] in are the weights of the update gate and the reset gate respectively, are the biases of the update gate and reset gate respectively;

[0110] Step S2.3: Add the vector that has passed the update gate to the vector at the previous moment. Corresponding element multiplication and fusion features Splicing is performed and the candidate state is calculated through a tanh activation function Multiply it element-wise with the reset gate vector, plus With the previous moment The vectors multiplied element by element get the final time series features The specific formula is as follows:

[0111]

[0112] in, is the weight, is bias;

[0113] Step 4: Input the time series features obtained by the market fusion MIGRU module into the implicit relationship building module affected by the market to explore the potential relationship between stocks through the relationship based on price data and the relationship based on unobservable information;

[0114] The specific method of exploring potential correlations between stocks based on price data is as follows:

[0115] Step 4.1: Use the Hawkes process to simulate the decay of the relationship between stocks over time. The specific implementation steps of the Hawkes process are as follows:

[0116] Step 4.1.1: Use the market fusion MIGRU module to obtain stock v i and stock v i The timing characteristics of and Generate a scalar through a relational mapping function R Indicates stock v j For stocks i The specific formula is as follows:

[0117]

[0118] The relational mapping function R(·) represents a two-layer fully connected neural network;

[0119] Step 4.1.2: Consider historical relationships to mitigate the impact of temporary noise in the modeled relationship and minimize the impact of transient fluctuations. Consider representing the stock v with the weighted sum of the scalars generated by the mapping of the previous T days. j For stocks i The specific formula is as follows:

[0120]

[0121] The relational mapping function R(·) is a two-layer fully connected neural network;

[0122] Step 4.1.3: The weighted sum of the scalar generated by the mapping function R and the intensity value at time tT is obtained to obtain a value representing the stock v j For stocks iThe strength value of the correlation strength between them is used to indicate the degree of correlation and relevance between stocks. The formula is as follows:

[0123]

[0124] Where ∈ is the excitation coefficient, γ is the decay rate, λ t-T is the intensity value at time tT, K is the index of the time step;

[0125] Specifically, the potential relationship between stocks is explored based on unobservable information:

[0126] Step 4.2: For any stock, take stock v i and stock v j For example, randomly initialize the features D of two unobservable relationships i ,D j ∈R K×C , construct the stock relationship strength value e based on unobservable information through graph learning method i,j ;

[0127] Step 4.2.1: and The scalar obtained by doing the inner product infers the stock v i and stock v j The kth unobservable relationship between , the specific formula is as follows:

[0128]

[0129] in Is stock v i and stock v j The characteristics of the kth unobservable relationship;

[0130] Step 4.2.2: Fusion the stock v output by the MIGRU module i and stock v j The time series features are concatenated and the concatenated vector is combined with the weight W u Perform a dot product and add the bias b u Generate a scalar Indicates stock v i and stock v j The correlation formula is as follows:

[0131]

[0132] where s i Indicates stock v i The time series characteristics, s j Indicates stock v j The timing characteristics of

[0133] Step 4.2.3: Convert the scalar generated in step 4.2.2 Input into the Softmax function for normalization to generate a scalar Indicates stock v i and stock v j The probability of the Kth unobservable relationship between , the specific formula is as follows:

[0134]

[0135] Among them, λ is a positive parameter that controls the output distribution, ∈ k and ∈ p is the bias term, and p represents the index of traversing all K unobservable relationship patterns;

[0136] Step 4.2.4: For the stock v obtained in step 4.2.1 i and stock v j The Kth unobservable relationship between The stock v generated in step 4.2.3 i and stock v j The probability of the Kth unobservable relationship between Perform weighted summation to obtain a scalar Used to represent stock v i and stock v j The strength of the unobservable relationship between them is as follows:

[0137]

[0138] Step 5: Use the multi-graph GNN method based on the attention mechanism to assign different weights according to the importance of different types of relationship features, so as to obtain more accurate stock relationship features;

[0139] Step F1: preprocessing the explicit relationship data to obtain the predefined relationship between stocks;

[0140] The explicit relationship data include: industry relationship and regional relationship, all of which are taken from Tushare. First, mathematical modeling of industry relationship is performed to construct the industry relationship matrix A, which is a symmetric undirected graph. If company i and company j belong to the same industry, then

[0141] A i,j =A j,i =1

[0142] otherwise

[0143] A i,j =A j,i =0

[0144] Among them A i,j and A j,i Represents the weight of the line between company i and company j in an undirected graph;

[0145] Similarly, we model the regional relationships between companies and construct a regional relationship matrix. The construction method is as follows: if company i and company j are headquartered in the same region, then the regional relationship adjacency matrix

[0146] A i,j =A j,i =1

[0147] If the headquarters of company i and company j are not in the same region, then the regional relationship matrix

[0148] A i,j =A j,i =0

[0149] Among them A i,j and A j,i The meaning of is the same as above, indicating the weight of the line connecting company i and company j;

[0150] Step F2: Existing methods use GCN to aggregate features from stocks. i , its relationship characteristics The relationship feature is determined by the weighted sum of the features of adjacent stocks and is calculated using the linear aggregator in GCN. The specific formula is as follows:

[0151]

[0152] Among them, a i,j For stock v i and stock v j The predefined relationship between them is standardized, W is the weight, b is the bias, and N represents the total number of stocks.

[0153] However, for the relationship characteristics of stocks, the price of a stock is affected by multiple factors related to another stock, such as industry-related, holding-related, and market-related factors. Therefore, it is necessary to model these factors according to the importance of the influence and construct the relationship strength value e under the influence of multiple factors. i,j , indicating stock v i and stock v j The strength of the relationship between them; through the relationship aggregation module, different types of relationship features Assign different weights to stocks v i and stock v j As an example, let stock v j For stocks i The strength value of the relationship in the first category and timing characteristics Perform a linear transformation, add a bias, and then and Input into the Softmax function for normalization to obtain the potential representation weights of all stocks and different types of relationships to obtain more comprehensive relationship features The specific formula is as follows:

[0154]

[0155] in For stock v i With stock v j The attention score of the l-th relation, For stock v i With stock v j The attention score of the k-th relation, For stock v j For stocks i The strength value of the lth type of relationship, is the time series feature, is the weight, is bias;

[0156] Step 6: Add price indicator features Timing characteristics And the relationship features output by the relationship aggregation module The vectors are concatenated into a new vector and input into the fully connected layer of the prediction module to predict the probability of future stock trends. The formula is as follows:

[0157]

[0158] Where Softmax(·) is the Softmax function, is the weight, b p ∈R C is the bias, C is the number of neurons in the output layer, corresponding to the number of categories, and D p Price indicator characteristics The characteristic dimension, D s For the time series characteristics The characteristic dimension, D r Relationship Features The feature dimension of the stock trend prediction is a three-classification problem of the node, so the output is a vector of length 3, representing the company's stock trend. Specifically, the three categories of nodes are as follows:

[0159]

[0160] in, is the stock v on day t iAfter the adjustment of the closing price, output 1 represents a future stock price increase, output -1 represents a future stock price decrease, and output 0 represents a future stock price remain unchanged.

[0161] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.

Claims

1. A stock prediction system based on multi-graph neural network in implicit relationship mining environment, characterized in that: include: The market integrates the MIGRU module, implicit relationship building module, relationship aggregation module, and prediction module; The market fusion MIGRU module integrates external market information into stock price features; The market fusion MIGRU module takes the stock's daily and weekly opening price, closing price, highest price, lowest price and trading volume as well as external market information as input, introduces a fusion gate based on GRU, integrates the past market index into the historical stock index, extracts the features of the fusion of price index data and market index, and uses them to generate time series features affected by external market information; The implicit relationship building module analyzes the relationship between price data and unobservable information of stocks and explores the potential relationship between stocks based on price data and unobservable information; The relationship aggregation module inputs the relationship constructed based on price data and unobservable information and the time series features of each stock into the GCN to mine the mutual influence between stocks and generate the relationship features of the stocks; The prediction module performs prediction by fusing the time series features generated by the market fusion MIGRU module, the stock relationship features generated by the relationship aggregation module, and the initial features of the stock historical price index.

2. The stock prediction system based on multi-graph neural network in implicit relationship mining environment according to claim 1 is characterized in that: A method for implementing a stock prediction method based on a multi-graph neural network in an implicit relationship mining environment includes the following steps: Step 1: Obtain historical time series data and explicit relationship data of stocks; Step 2: Preprocess the historical time series data; For historical time series data, the characteristic dimensions of each stock include five historical attributes: opening price, closing price, highest price, lowest price and trading volume. Based on these price indicators, daily and weekly lines are generated, and filtering conditions are set to filter the historical time series data obtained in step 1. The set filtering formula is as follows: in, Indicates stock v i In the closing price data of the tth trading day, Min(p i ) indicates stock v i The minimum closing price in the time series data, Max(p i ) indicates stock v i The maximum closing price in the time series data, other price indicators, opening price, highest price, lowest price and trading volume are all filtered using this screening formula to normalize the stock data and scale the data to the [0,1] interval; Step 3: Use the daily and weekly lines as stock historical price index data and input them into the market fusion MIGRU module together with the market index data. The market fusion MIGRU generates an output after the fusion of stock historical features and market index features. The output of the market fusion MIGRU module is input into the relationship aggregation module and the prediction module to achieve feature aggregation. Step 4: Input the time series features obtained by the market fusion MIGRU module into the implicit relationship building module to explore the potential relationship between stocks through the relationship based on price data and the relationship based on unobservable information; Step 5: Use the multi-graph GNN method based on the attention mechanism to assign different weights according to the importance of different types of relationship features, thereby obtaining stock relationship features; Step 6: Add price indicator features Timing characteristics And the relationship features output by the relationship aggregation module The vectors are concatenated into a new vector and input into the fully connected layer of the prediction module to predict the probability of future stock trends. The formula is as follows: Where Softmax(·) is the Softmax function, is the weight, b p ∈R C is the bias, C is the number of neurons in the output layer, corresponding to the number of categories, and D p Price indicator characteristics The characteristic dimension, D s For the time series characteristics The characteristic dimension, D r Relationship Features The feature dimension of the output is a vector of length 3, representing the company's stock trend. Specifically, the three categories of nodes are as follows: in, is the stock v on day t i After the adjustment of the closing price, output 1 represents a future stock price increase, output -1 represents a future stock price decrease, and output 0 represents a future stock price that remains the same.

3. The stock prediction system based on multi-graph neural network in implicit relationship mining environment according to claim 2 is characterized in that: The extraction of the fusion features of historical time series features and market indicators through the market fusion MIGRU module in step 3 includes the following steps: Step S1: The price index of each company and The input market is fused into a MIGRU module to capture temporal dependencies: get in, represents the time series price index of the i-th company, represents the market index of the i-th company, T represents the time step, and D p represents the price attribute feature dimension, D m represents the characteristic dimension of the market index, D s For the newly extracted feature dimension, MIGRU i (·) represents the GRU-based market fusion module, which is used to extract the fusion features of stock historical features and market indicators; Step S2: Extract feature dimensions using the market fusion module MIGRU; Step S2.1: Convert stock historical features and market index characteristics The vectors are concatenated into a new vector and input into the fusion gate in the market fusion MIGRU module. The redundant features are filtered through a sigmoid function, and the non-redundant features are combined with the price index. Fusion generates new features: in, represents the fusion gate, express and The fusion characteristics of and represents the weight of the neural network, and is the bias in the neural network, σ represents the sigmoid function, Represents element-wise multiplication; Step S2.2: Add The fusion vector of the historical time series features extracted at the previous moment and the market indicators Splice into a new vector and calculate the update gate vector and reset gate vector The formula is as follows: in are the weights of the update gate and the reset gate respectively, are the biases of the update gate and reset gate respectively; Step S2.3: Add the vector that has passed the update gate to the vector at the previous moment. Corresponding element multiplication and fusion features Splicing is performed and the candidate state is calculated through a tanh activation function Multiply it element-wise with the reset gate vector, plus With the previous moment The vectors multiplied element by element get the final time series features The specific formula is as follows: in, is the weight, For bias.

4. The stock prediction system based on multi-graph neural network in implicit relationship mining environment according to claim 2 is characterized in that: The step 4 is specifically as follows: The exploration of potential relationships between stocks is specifically as follows: Step 4.1: Use the Hawkes process to simulate the decay of the relationship between stocks over time. The specific implementation steps of the Hawkes process are as follows: Step 4.1.1: Use the market fusion MIGRU module to obtain stock v i and stock v i The timing characteristics of and Generate a scalar through a relational mapping function R Indicates stock v j For stocks i The specific formula is as follows: The relational mapping function R(·) represents a two-layer fully connected neural network; Step 4.1.2: Consider the weighted sum of the scalars generated by the mappings over the previous T days to represent the stock v j For stocks i The specific formula is as follows: The relational mapping function R(·) is a two-layer fully connected neural network; Step 4.1.3: The weighted sum of the scalar generated by the mapping function R and the intensity value at time tT is obtained to obtain a value representing the stock v j For stocks i The strength value of the correlation strength between them is as follows: Where ∈ is the excitation coefficient, γ is the decay rate, λ t-T is the intensity value at time tT, K is the index of the time step; Specifically, the potential relationship between stocks is explored based on unobservable information: Step 4.2: Randomly initialize the features D of the two unobservable relationships i ,D j ∈R K×C , construct the stock relationship strength value e based on unobservable information through graph learning method i,j ; Step 4.2.1: and The scalar obtained by doing the inner product infers the stock v i and stock v j The kth unobservable relationship between , the specific formula is as follows: in Is stock v i and stock v j The characteristics of the kth unobservable relationship; Step 4.2.2: Fusion the stock v output by the MIGRU module i and stock v j The time series features are concatenated and the concatenated vector is combined with the weight W u Perform a dot product and add the bias b u Generate a scalar Indicates stock v i and stock v j The correlation formula is as follows: where s i Indicates stock v i The time series characteristics, s j Indicates stock v j The timing characteristics of Step 4.2.3: Convert the scalar generated in step 4.2.2 Input into the Softmax function for normalization to generate a scalar Indicates stock v i and stock v j The probability of the Kth unobservable relationship between , the specific formula is as follows: Among them, λ is a positive parameter that controls the output distribution, ∈ k and ∈ p is the bias term, and p represents the index of traversing all K unobservable relationship patterns; Step 4.2.4: For the stock v obtained in step 4.2.1 i and stock v j The Kth unobservable relationship between The stock v generated in step 4.2.3 i and stock v j The probability of the Kth unobservable relationship between Perform weighted summation to obtain a scalar Used to represent stock v i and stock v j The strength of the unobservable relationship between , the specific formula is as follows:

5. The stock prediction system based on multi-graph neural network in implicit relationship mining environment according to claim 2, characterized in that: The step 5 is specifically as follows: Step 5.1: Preprocess the explicit relationship data to obtain the predefined relationship between stocks; The explicit relationship data include industry relationship and regional relationship, all of which are taken from Tushare. First, the industry relationship is mathematically modeled and the industry relationship matrix A is constructed. A is a symmetric undirected graph. If company i and company j belong to the same industry, then A i,j =A j,i =1 otherwise A i,j =A j,i =0 Among them A i,j and A j,i Represents the weight of the line between company i and company j in an undirected graph; Similarly, the regional relationship between companies is modeled and the regional relationship matrix is ​​constructed. The construction method is that if company i and company j are headquartered in the same region, then the regional relationship adjacency matrix A i,j =A j,i =1 If the headquarters of company i and company j are not in the same region, then the regional relationship matrix A i,j =A j,i =0 Among them A i,j and A j,i The meaning of is the same as above, indicating the weight of the line connecting company i and company j; Step 5.2: For stock v i , its relationship characteristics The relationship feature is determined by the weighted sum of the features of adjacent stocks and is calculated using the linear aggregator in GCN. The specific formula is as follows: Among them, a i,j For stock v i and stock v j The predefined relationship between them is standardized, W is the weight, b is the bias, and N is the total number of stocks; Construct the relationship strength value e under the influence of multiple factors i,j , indicating stock v i and stock v j The strength of the relationship between them; through the relationship aggregation module, different types of relationship features Assign different weights to stocks j For stocks i The strength value of the relationship in the first category and timing characteristics Perform a linear transformation, add a bias, and then and Input into the Softmax function for normalization to obtain the potential representation weights of all stocks and different types of relationships to obtain more comprehensive relationship features The specific formula is as follows: in For stock v i With stock v j The attention score of the l-th relation, For stock v i With stock v j The attention score of the k-th relation, For stock v j For stocks i The strength value of the lth type of relationship, is the time series feature, is the weight, For bias.