Artificial intelligence-driven stock price prediction system and method thereof

Through the stock price prediction system driven by artificial intelligence, multi-dimensional data is integrated, market turning points are identified and market snapshots are generated, which solves the problem of insufficient predictions in the face of market complexity and improves the accuracy and robustness of predictions.

CN119090641AInactive Publication Date: 2024-12-06HEBEI FINANCE UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411201083.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing stock price prediction system is difficult to effectively integrate multi-dimensional data, ignoring market sentiment and external events, resulting in poor prediction performance in the face of market complexity and variability.

Method used

The stock price prediction system driven by artificial intelligence is adopted, including data collection module, data processing module, kernel function optimization module, inflection point judgment module, market snapshot generation module, multi-head attention mechanism module and theme fusion module, and obtain multi-source data in real time. Extract news emotional characteristics and technical indicator characteristics, optimize kernel function parameters, judge market turning points, and generate historical and future market snapshots.

Benefits of technology

It has achieved effective identification of key turning points in market trends, generated accurate market snapshots, captured multiple semantic levels in financial news, improved the accuracy and robustness of predictions, helped users understand market trends and timely adjusted their investment strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090641A_ABST
    Figure CN119090641A_ABST
Patent Text Reader

Abstract

The invention discloses a stock price prediction system driven by artificial intelligence and a method thereof, an inflection point judgment module can effectively identify a key inflection point of a market trend based on an optimized feature combination, and provides a basis for a dynamic market information snapshot generation module; generating a historical and future predicted market information snapshot sequence set of the target stock; and through parallel processing of the multi-head attention mechanism module on the text vectors in different semantic spaces, multiple semantic hierarchies in financial news can be captured, so that the potential influence of the news on the stock price can be analyzed more accurately, a user is helped to comprehensively understand the past trend and future expectation of the market, the investment strategy is adjusted in time, and the risk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of stock price prediction, and in particular, relates to an artificial intelligence driven stock price prediction system and method thereof. Background Art

[0002] In the modern stock market, the amount and complexity of information faced by investors is increasing day by day, and market trends are affected by many factors, including not only traditional technical indicators and fundamental analysis, but also multi-dimensional factors such as market sentiment, news events, and social media opinions. Although traditional stock prediction methods, such as technical analysis based on technical indicators and fundamental analysis based on company financial conditions, can help predict stock price trends to a certain extent, they usually ignore the immediate impact of market sentiment and external events, and thus appear insufficient in responding to sudden changes in the market.

[0003] To address these challenges, existing technologies have gradually introduced artificial intelligence (AI) and machine learning (ML) methods. These methods are able to process and analyze large amounts of data, including text data such as financial news and social media posts, to capture market sentiment and hot events, and integrate this information into prediction models. However, despite the significant improvement in prediction accuracy of AI and ML methods, how to effectively integrate multi-dimensional data and make accurate market turning point judgments based on this remains a complex technical problem. In addition, existing market prediction systems usually focus on a single aspect of data processing or analysis, such as focusing only on historical price data or based only on news sentiment analysis, but lack comprehensive processing and systematic analysis of multi-source data. This approach may result in less than ideal performance of the prediction model in dealing with market complexity and variability.

[0004] In view of this, the present invention is proposed. Summary of the invention

[0005] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide an artificial intelligence driven stock price prediction system and method thereof, which solves the problems raised in the above-mentioned background technology.

[0006] In order to solve the above technical problems, the basic concept of the technical solution adopted by the present invention is:

[0007] An artificial intelligence driven stock price prediction system and method thereof, comprising: a data collection module, the data collection module is used to obtain real-time and historical stock market data and financial news text corpus from multiple data sources, that is, to obtain a data set;

[0008] A data processing module, which is used to extract news sentiment feature time series and pre-acquire technical indicator feature time series of target stocks based on the financial news text corpus of the target stocks;

[0009] Kernel function optimization module: The kernel function optimization module uses the kernel function to train the data of the data set, obtains the optimal parameters of the kernel function, and generates the final feature combination;

[0010] The inflection point judgment module is used to judge whether the current stock market is at a stock price inflection point based on the final feature combination;

[0011] A market snapshot generation module is used to generate a set of historical and future forecast market snapshot sequences of target stocks based on the inflection point judgment results;

[0012] The multi-head attention mechanism module is used to process text vectors in parallel using multiple attention heads according to different semantic spaces, and map the processed vectors to different topic spaces;

[0013] The topic fusion module is used to generate fused text representation by applying different attention weights to different topic information;

[0014] The result display module is used to display the stock price prediction results.

[0015] Optionally, the data collection module obtains real-time and historical stock market data and financial news text corpus from multiple data sources, that is, obtains the data set in the following specific steps:

[0016] Identify and select multiple data sources, including but not limited to stock exchange databases, financial news websites, and social media platforms;

[0017] Use APIs to obtain real-time stock market data from stock exchanges and related websites and regularly call APIs from news websites and social media to obtain the latest news reports and market comments in real time;

[0018] Access the stock exchange's historical database to batch download historical trading data of target stocks;

[0019] Obtain past news reports related to the target stock from the historical news database, archive and classify them after obtaining them, and ensure timely synchronization of real-time data and historical data through a caching mechanism and refresh the cache regularly.

[0020] Optionally, the steps of extracting the news sentiment feature time series and pre-acquiring the technical indicator feature time series of the target stock based on the financial news text corpus of the target stock are:

[0021] Perform text cleaning, word segmentation and vectorization processing on financial news text corpus and apply sentiment analysis models or dictionaries to extract news sentiment feature time series;

[0022] Extract the historical trading data of the target stock from the database and use the formula Calculate the technical indicators of the target stock and generate the characteristic time series of the technical indicators; where MDWSM(t) is the characteristic time series of the technical indicators, N is the smoothing cycle length, which indicates the cycle length of the historical data considered in the calculation, and α i is the price momentum weighting coefficient, which measures the weight of the price in period i. β is the price momentum attenuation factor, which controls the attenuation speed of price momentum. When β>0, the early price change has little impact on the current momentum. t is the stock price at the current time point t, P t-i is the stock price at time point ti, γ i is the volume momentum weighting coefficient, which measures the weight of the volume in period i. δ is the volume momentum decay factor, which controls the decay speed of the volume momentum. When δ>0, the earlier volume changes have less impact on the current momentum. V t is the transaction volume at the current time point t, V t-i is the trading volume at time point ti, λ i ATR is the weighted coefficient of the average true range, which measures the weight of the average true range in period i. i is the average true range of period i, RSI i The relative strength index of period i indicates the overbought or oversold state of the market. RSI i The value range is 0-100, MACD t It is the exponential moving average convergence / divergence at the current time point t, measuring the difference between short-term and long-term market trends. To perform nonlinear transformation of RSI using sine function;

[0023] The news sentiment feature time series is synchronized and aligned with the technical indicator feature time series to form comprehensive feature data for model training.

[0024] Optionally, the steps of using a kernel function to train the data of the data set, obtaining the optimal parameters of the kernel function, and generating the final feature combination are:

[0025] Select the type of kernel function suitable for the training data set according to the distribution characteristics and complexity of the features of the data and calculate the similarity between the data points in the training set through the selected kernel function;

[0026] Convert the news sentiment feature time series and technical indicator feature time series obtained by the data processing module into high-dimensional feature vectors;

[0027] The data set is divided into a training set and a validation set. The selected kernel function is applied to each pair of data points in the training set, and the kernel function matrix is ​​calculated. Then, the kernel function matrix is ​​used to train the prediction model and optimize the prediction model parameters. Finally, the kernel function parameters and regularization parameters are optimized through cross-validation and grid search methods. Finally, the optimized kernel function parameters are used to map the obtained original data features to a high-dimensional space to generate a new feature combination, and all the mapped high-dimensional features are integrated to form the final feature combination.

[0028] Optionally, the steps of judging whether the current stock market is at a stock price turning point according to the final feature combination are:

[0029] The final feature combination generated from the kernel function optimization module is input into the inflection point judgment module and the inflection point data in the training set is used to establish and train the inflection point recognition model;

[0030] The input feature combination is operated with the weight vector of the inflection point recognition model to calculate the probability that the current time point is at the inflection point and preset the inflection point threshold;

[0031] The output value of the inflection point identification model is compared with the set threshold. If it reaches or exceeds the threshold, it is judged that the current stock market is at a stock price inflection point, triggering relevant market operation recommendations.

[0032] Optionally, the step of the market snapshot generation module generating a set of historical and future predicted market snapshot sequences of the target stock according to the inflection point judgment result is:

[0033] The inflection point judgment result output by the inflection point judgment module is used as input to guide the market snapshot generation module to generate the corresponding market snapshot, and to conduct a historical review and future trend forecast when the market is at an inflection point. Then, the historical transaction data of the target stock is extracted from the stock price prediction system database and a historical market snapshot reflecting market changes is generated based on the extracted historical data;

[0034] When predicting future trends, simulate the stock market trend over a period of time in the future and generate snapshots of future market conditions at multiple time points;

[0035] The generated historical market snapshots and future forecast snapshots are integrated, arranged in chronological order to form a complete market snapshot sequence set, and the integrated market snapshot sequence set is output and displayed to the user.

[0036] Optionally, the multi-head attention mechanism module is used to process text vectors in parallel using multiple attention heads according to different semantic spaces, and the steps of mapping the processed vectors to different topic spaces are:

[0037] Input the preprocessed text vector into the multi-head attention mechanism module;

[0038] According to different semantic spaces, h attention heads are used to input the query vector Q i , key vector K i Sum value vector V i Perform parallel processing, and each attention head calculates the corresponding attention matrix And generate the output vector O i =A i V i , where i represents the i-th attention head,

[0039] Next, for each attention head, the attention weight associated with the input text vector is calculated to generate a weighted output vector.

[0040] The output vector Z after each attention head is processed i Mapped to the corresponding subject space, through the projection matrix P i Generate topic vector T i =tanh(Z i P i ), and finally integrate all topic vectors to form the final text representation Among them, P i is the projection matrix of the i-th topic space, which is used to map the weighted output vector to the topic space, T i is the topic vector corresponding to the i-th attention head, generated by the tanh activation function, and T is the final text representation, which is generated by integrating the topic vectors of all attention heads.

[0041] Optionally, the steps to generate a fused text representation by applying different attention weights to different topic information are:

[0042] The topic vectors generated from different attention heads are taken as input, and for each topic vector, the weight matrix Calculate the attention score S i =T i W i +b i ,in, Indicates the topic score corresponding to each word, b i is the bias term;

[0043] Score the attention to each topic i Perform normalization to obtain normalized attention weights Among them, A iis the normalized attention weight matrix. The softmax function is used to normalize the attention scores. h is the total number of topics, i.e., the number of attention heads. exp(·) is an exponential function used to convert the scores into non-negative values.

[0044] Each topic vector T i And the corresponding normalized attention weight A i Multiply them together to generate the weighted topic vector M i =A i ⊙T i ,in And add all weighted topic vectors to get the final fused text representation M i is the weighted topic vector, and the attention weight is applied to the topic vector through element-wise multiplication ⊙, ⊙ is the element-wise multiplication symbol, and R is the final text representation after fusion.

[0045] An artificial intelligence driven stock price prediction method comprises the following steps:

[0046] The dataset is obtained by acquiring real-time and historical stock market data and financial news text corpus from multiple data sources;

[0047] Based on the financial news text corpus of the target stock, extract the news sentiment feature time series and pre-acquire the technical indicator feature time series of the target stock;

[0048] Use the kernel function to train the data of the data set, obtain the optimal parameters of the kernel function, and generate the final feature combination;

[0049] Determine whether the current stock market is at a turning point in stock prices based on the final feature combination;

[0050] A market snapshot generation module is used to generate a set of historical and future forecast market snapshot sequences of target stocks based on the inflection point judgment results;

[0051] It is used to process text vectors in parallel using multiple attention heads according to different semantic spaces and map the processed vectors to different topic spaces;

[0052] By applying different attention weights to different topic information, a fused text representation is generated;

[0053] Display the above stock price prediction results.

[0054] After adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art. Of course, any product implementing the present invention does not necessarily need to achieve all the advantages described below at the same time:

[0055] The turning point judgment module of the present invention can effectively identify the key turning points of market trends based on the optimized feature combination, and provide a basis for the dynamic market snapshot generation module to generate a set of market snapshot sequences of historical and future forecasts of target stocks; and through the parallel processing of text vectors in different semantic spaces by the multi-head attention mechanism module, it can capture multiple semantic levels in financial news, thereby more accurately analyzing the potential impact of news on stock prices, helping users to fully understand the past trends and future expectations of the market, and timely adjust investment strategies to reduce risks.

[0056] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The drawings described below are only some embodiments. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0058] In the figure:

[0059] Figure 1 Block diagram of the AI-driven stock price prediction system.

[0060] It should be noted that these drawings and textual descriptions are not intended to limit the conceptual scope of the present invention in any way, but are intended to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0061] The present invention will now be described in further detail with reference to the accompanying drawings.

[0062] See also Figure 1 As shown, in this embodiment, an artificial intelligence-driven stock price prediction system and method are provided, including a data collection module, which is used to obtain real-time and historical stock market data and financial news text corpus from multiple data sources, that is, to obtain a data set; through automated data collection, the stock price prediction system can update data in real time, so that the prediction model is always in the latest state and can reflect market changes in a timely manner.

[0063] Data processing module: The data processing module is used to extract the news sentiment feature time series and pre-acquire the technical indicator feature time series of the target stock based on the financial news text corpus of the target stock; the sentiment features extracted by the data processing module can reflect the emotions and attitudes of market participants, providing the prediction model with richer input information than relying solely on technical indicators. In addition, the data processing module also pre-acquires the technical indicator feature time series, which can effectively capture the fluctuations and trends of market prices. By combining the technical indicator feature time series with the sentiment feature, the model can be analyzed in multiple dimensions, thereby improving the accuracy and robustness of the prediction.

[0064] Kernel function optimization module: The kernel function optimization module uses kernel function to train the data of the data set, obtains the optimal parameters of the kernel function, and generates the final feature combination; kernel functions include but are not limited to linear kernel function, polynomial kernel function, Gaussian radial basis function and Sigmoid kernel function. The selection of kernel function depends on the distribution characteristics of the data and the complexity of the features. For example, for nonlinear data distribution, RBF kernel function is usually preferred.

[0065] By selecting the corresponding kernel function and optimizing its parameters, the stock price prediction system can effectively capture the nonlinear relationship in the data, thereby generating a more accurate feature combination. This optimization process can reveal the complex interactions between data in high-dimensional space, so that the model not only performs well on the training data, but also can be well generalized to new data sets. In addition, through the optimization of the kernel function, the stock price prediction system can retain the important patterns and trends in the data while reducing noise and redundant information, thereby improving the generalization ability of the model.

[0066] Inflection point judgment module, the inflection point judgment module is used to judge whether the current stock market is at a stock price inflection point based on the final feature combination; the inflection point judgment module uses the feature combination of technical indicators and emotional features to analyze market dynamics from multiple angles, thereby improving the accuracy of inflection point identification. In addition, this module can analyze market changes in real time to ensure that when a turning point occurs in the market, the stock price prediction system can respond quickly and issue warnings or suggestions to users in a timely manner. This ability to predict market inflection points in advance enables users to better grasp market opportunities and avoid potential risks, thereby gaining greater advantages in a dynamic and uncertain market.

[0067] The market snapshot generation module is used to generate a set of historical and future forecast market snapshot sequences of target stocks based on the inflection point judgment results; by displaying the historical market snapshots of stocks, it helps users review and understand the market changes before and after the inflection point occurs, allowing users to comprehensively analyze market behavior. In addition, by generating future market snapshots, the stock price prediction system provides users with an expectation of possible future market trends, allowing users to adjust their investment strategies based on the predictions. By combining the historical and future market snapshot display method, the interpretability and decision support capabilities of the stock price prediction system are greatly improved, allowing users to not only see the review of historical data, but also obtain the foresight of future market changes.

[0068] Multi-head attention mechanism module, the multi-head attention mechanism module is used to process text vectors in parallel using multiple attention heads according to different semantic spaces, and map the processed vectors to different topic spaces; through this multi-head attention mechanism, the stock price prediction system can focus on different parts of the text at the same time and extract information from multiple semantic dimensions, which makes the final text representation more comprehensive and accurate. In addition, each attention head can focus on different semantic spaces, capturing subtle features and relationships that are difficult to detect in a single semantic space, thereby enhancing the expressive power of text representation. This mechanism can effectively identify key information and emotional changes in complex financial news texts, allowing the stock price prediction system to more accurately reflect the dynamic changes in market sentiment. In addition, through parallel processing and multi-dimensional analysis, the multi-head attention mechanism module significantly improves the stock price prediction system's ability to understand text information, making market predictions and sentiment analysis more accurate and comprehensive.

[0069] The topic fusion module is used to generate a fused text representation by applying different attention weights to different topic information; it can dynamically adjust the attention weights according to the importance of each topic, so that the stock price prediction system can focus on analyzing and highlighting the core information in the text. Through the flexible adjustment of attention weights, different topic information is properly integrated in the final representation, avoiding excessive concentration of information or ignoring important details. The topic fusion module can process financial news texts containing multiple topics, so that the final text representation can more accurately reflect the multi-dimensional emotions and opinions of the market. In addition, through the effective integration of different topics, the topic fusion module improves the text analysis accuracy of the stock price prediction system, enabling the prediction model to better capture the complex changes in market sentiment and provide stronger support for market predictions.

[0070] The result display module is used to display the stock price prediction results.

[0071] In this embodiment, the data collection module obtains real-time and historical stock market data and financial news text corpus from multiple data sources, that is, obtains the data set in the following specific steps:

[0072] Identify and select multiple data sources, including but not limited to stock exchange databases, financial news websites, and social media platforms; by obtaining data from multiple sources, the stock price prediction system is able to capture market dynamics from different angles, ranging from official trading data to market sentiment on social media.

[0073] The multi-source data selection strategy not only enhances the diversity of data, but also improves the integrity and coverage of data, ensuring that the stock price prediction system can analyze and predict based on the most comprehensive information. In addition, the diverse data sources help reduce data bias and avoid the inaccuracy or one-sidedness that may be caused by a single data source, making the prediction results of the stock price prediction system more reliable and accurate.

[0074] Use the API interface to obtain real-time stock market data from stock exchanges and related websites, and regularly call the APIs of news websites and social media to obtain the latest news reports and market comments in real time; through the API interface's automated data acquisition mechanism, the stock price prediction system can update key market information such as stock prices and trading volumes in real time, while obtaining the latest financial news and social media comments to reflect market sentiment and changes in public opinion.

[0075] This method of acquiring real-time data greatly improves the response speed of the stock price prediction system, allowing the prediction model to be quickly adjusted to respond to market changes, thereby improving the timeliness and accuracy of the prediction.

[0076] Access the historical database of the stock exchange to batch download the historical trading data of the target stocks, and obtain past news reports related to the target stocks from the historical news database. After obtaining the past news reports related to the target stocks, they will be archived and classified; by collecting detailed historical trading data, the stock price prediction system can identify long-term market trends, cyclical patterns and historical turning points, which is crucial for building a robust prediction model.

[0077] At the same time, by obtaining relevant financial reports from the historical news database, the stock price prediction system can analyze the correlation between historical market events and news sentiment, helping to understand past market reactions and sentiment changes.

[0078] The cache mechanism ensures timely synchronization of real-time data and historical data and refreshes the cache regularly. The cache mechanism enables the stock price prediction system to quickly access recently acquired data, reducing frequent calls to external data sources, thereby reducing network latency and data acquisition costs. The cache mechanism enables the stock price prediction system to respond quickly at critical moments without waiting for data to be transmitted from remote servers.

[0079] In this embodiment, the steps of extracting the news sentiment feature time series and pre-acquiring the technical indicator feature time series of the target stock based on the financial news text corpus of the target stock are as follows:

[0080] Perform text cleaning, word segmentation and vectorization processing on financial news text corpus and apply sentiment analysis models or dictionaries to extract news sentiment feature time series;

[0081] Extract the historical trading data of the target stock from the database and use the formula Calculate the technical indicators of the target stock and generate the characteristic time series of the technical indicators;

[0082] Among them, MDWSM(t) is the characteristic time series of technical indicators, N is the length of the smoothing period, which means the period length of the historical data considered in the calculation, α i is the price momentum weighting coefficient, which measures the weight of the price in period i. β is the price momentum attenuation factor, which controls the attenuation speed of price momentum. When β>0, the early price change has little impact on the current momentum. t is the stock price at the current time point t, P t-i is the stock price at time point ti, γ i is the volume momentum weighting coefficient, which measures the weight of the volume in period i. δ is the volume momentum decay factor, which controls the decay speed of the volume momentum. When δ>0, the earlier volume changes have less impact on the current momentum. V t is the transaction volume at the current time point t, V t-i is the trading volume at time point ti, λ i ATR is the weighted coefficient of the average true range, which measures the weight of the average true range in period i. i is the average true range of period i, RSI i The relative strength index of period i indicates the overbought or oversold state of the market. RSI i The value range is 0-100, MACD t It is the exponential moving average convergence / divergence at the current time point t, measuring the difference between short-term and long-term market trends. To use the sine function to perform nonlinear transformation on RSI, making the impact of RSI more dynamic and sensitive under different market conditions;

[0083] The news sentiment feature time series and the technical indicator feature time series are synchronized and aligned to form comprehensive feature data for model training. Through the synchronization and alignment process, the stock price prediction system ensures that data from different sources can be compared and integrated on the same timeline. The sentiment feature time series reflects the emotional fluctuations of market participants, while the technical indicator feature time series provides quantitative analysis of the market. The combination of the two enables the prediction model to consider both the psychological factors and technical factors of the market. The generation of this comprehensive feature data greatly improves the prediction ability of the model.

[0084] In this embodiment, the steps of using a kernel function to train the data of a data set, obtaining the optimal parameters of the kernel function, and generating the final feature combination are as follows:

[0085] The similarity between the training set data points is calculated through the selected kernel function, and the news sentiment feature time series and technical indicator feature time series obtained by the data processing module are converted into high-dimensional feature vectors; by analyzing the distribution and feature complexity of the data, the stock price prediction system can specifically select the most suitable kernel function type, such as the linear kernel function is suitable for simple linear data, while the Gaussian radial basis kernel function is suitable for processing nonlinear data.

[0086] The data set is divided into a training set and a validation set. The selected kernel function is applied to each pair of data points in the training set. The kernel function matrix is ​​calculated by calculating the similarity and generating the kernel function matrix. The kernel function matrix records the similarity between each pair of data points in the training set. This similarity reflects the relative position of the data points in the feature space. The similarity between the data points in the training set is calculated by the selected kernel function, and the kernel function matrix is ​​generated. It can effectively capture the complex relationship between data points, so that the model can perform more accurate classification and prediction in high-dimensional space.

[0087] The kernel function matrix is ​​used to train the model and optimize the model parameters, and the kernel function parameters and regularization parameters are optimized through cross-validation and grid search methods. Through cross-validation, the stock price prediction system can effectively evaluate the performance of the model on different data partitions to avoid overfitting or underfitting problems.

[0088] Grid search systematically searches for the best parameter combination through stock price prediction to ensure that the kernel function parameters and regularization parameters are optimally configured. This process not only improves the prediction accuracy of the model, but also enhances the robustness of the model under different market conditions.

[0089] The acquired raw data features are mapped to a high-dimensional space to generate new feature combinations. Through this mapping, the nonlinear relationships hidden in the original features are discovered, and these complex patterns are captured in new feature combinations.

[0090] By operating in a high-dimensional space, the model can better distinguish and classify data points, thereby improving the accuracy and reliability of predictions. Moreover, the newly generated feature combination not only retains the key information in the original data, but also reveals deeper structures and associations through mapping.

[0091] All mapped high-dimensional features are integrated to form the final feature combination, which includes the original technical indicators and sentiment features, as well as the nonlinear features mapped by the kernel function. By integrating features from multiple sources, the stock price prediction system can better understand market behavior, identify potential patterns and trends, and thus improve the accuracy and robustness of predictions. This comprehensive feature combination makes the model more adaptable and flexible when processing complex market data, providing users with more reliable market prediction services.

[0092] In this embodiment, the steps of judging whether the current stock market is at a stock price turning point according to the final feature combination are:

[0093] The final feature combination generated from the kernel function optimization module is input into the inflection point judgment module; by inputting these features into the inflection point judgment module, the stock price prediction system can identify inflection points with high accuracy, avoiding the judgment errors that may be caused by a single feature. This makes the judgment process of the stock price prediction system not only more scientific and accurate, but also able to discover potential turning points in the market earlier.

[0094] The system is trained by identifying inflection point patterns in historical data and using a pre-trained inflection point recognition model for analysis. This training based on historical data patterns enables the model to identify possible turning points in the market under certain conditions and apply this knowledge to current market analysis. Using a pre-trained inflection point recognition model for analysis, the stock price prediction system can quickly and accurately judge the input feature combination, reducing analysis time and improving response speed.

[0095] The input feature combination is operated with the weight vector of the inflection point recognition model to calculate the probability of the current time point being at an inflection point and preset the inflection point threshold; through the operation of the weight vector, the stock price prediction system can simplify complex market data into an understandable probability value, indicating the possibility that the current market is at an inflection point. This probabilistic result helps users intuitively understand the market situation and make corresponding investment decisions.

[0096] The output value of the inflection point identification model is compared with the set threshold. If it reaches or exceeds the threshold, it is judged that the current stock market may be at a stock price inflection point, triggering relevant market operation suggestions or early warning mechanisms. By setting the threshold, the stock price prediction system can transform complex analysis results into simple and clear operation signals, helping users to quickly understand the current market situation and take corresponding measures. The triggered market operation suggestions or early warning mechanisms can help users adjust their investment portfolios or take preventive measures in a timely manner when important changes are about to occur in the market, thereby effectively reducing potential risks;

[0097] The final judgment result is output in the form of "inflection point" or "non-inflection point". Through clear "inflection point" or "non-inflection point" judgment, it can be seamlessly integrated with the automated trading system or early warning system to provide a basis for further investment strategy execution.

[0098] In this embodiment, the steps of the market snapshot generation module generating a set of historical and future predicted market snapshot sequences of the target stock according to the inflection point judgment result are as follows:

[0099] The inflection point judgment result output by the inflection point judgment module is used as input to guide the market snapshot generation module to generate the corresponding market snapshot, and to conduct a detailed historical review and future trend forecast when the market is at an inflection point; through the inflection point judgment result, the system can identify the key moments when the market is about to undergo major changes, and generate detailed market snapshots at these moments. This process enables users to gain an in-depth understanding of the market's performance before and after the inflection point, and obtain a more comprehensive historical review and future trend forecast.

[0100] First, the historical transaction data of the target stock is extracted from the stock price prediction system database and the extracted historical data is used to generate a series of historical market snapshots reflecting market changes; users can identify similar market patterns through these snapshots, so as to make more rational and accurate decisions when facing future market changes.

[0101] The ARIMA model is used to simulate the stock market trend in the future and generate snapshots of future market conditions at multiple time points. The ARIMA model combines historical data and statistical characteristics of the market, and can effectively capture trends and seasonal changes in time series, thereby generating accurate future market scenarios. These future market snapshots provide users with a variety of possible market development paths, helping users to foresee potential market turning points and trend changes, and adjust strategies when necessary.

[0102] Since the calculation process combines the model's weight vector, this calculation makes full use of the key features extracted during model training and their corresponding importance. By combining the model's weight vector in the calculation process, the system can identify the features that have the greatest impact on turning point judgment and give them a higher weight in the calculation, which ensures the reliability of the final judgment. The application of weight vectors not only improves the model's performance in turning point judgment, but also enhances the model's adaptability and sensitivity to different market conditions. Users can therefore rely on more accurate market turning point signals to make decisions and reduce the risk of misjudgment.

[0103] The generated historical market snapshots and future forecast snapshots are integrated, arranged in chronological order to form a complete market snapshot sequence set, and the integrated market snapshot sequence set is output and displayed to the user.

[0104] In this embodiment, the multi-head attention mechanism module is used to process text vectors in parallel using multiple attention heads according to different semantic spaces, and the steps of mapping the processed vectors to different topic spaces are as follows:

[0105] The preprocessed text vector is input into the multi-head attention mechanism module; through the multi-head attention mechanism, the stock price prediction system can process multiple query, key and value vectors in parallel to capture different semantic features in the text. This multi-dimensional processing method avoids the information loss problem that may be caused by a single attention mechanism, allowing the stock price prediction system to more comprehensively understand the complex structure and internal relationship of the text.

[0106] According to different semantic spaces, h attention heads are used to input the query vector Q i , key vector K i Sum value vector V i Perform parallel processing, and each attention head calculates the corresponding attention matrix And generate the output vector O i =A i V i , where i represents the i-th attention head; each attention head focuses on a specific semantic space, which enables the stock price prediction system to identify complex relationships and patterns hidden in the text. In addition, parallel processing not only improves computational efficiency, but also ensures the complete capture of different semantic information, thereby forming a more comprehensive text representation. Finally, by generating output vectors, the stock price prediction system lays a solid foundation for subsequent topic mapping and weighted processing, ensuring that the final text representation can accurately reflect the multi-level semantic structure of the text.

[0107] For each attention head, the attention weight associated with the input text vector is calculated to generate a weighted output vector; by calculating the attention weights, the stock price prediction system can identify the most critical information in the text and assign it a higher weight, thereby ensuring that the information is fully reflected in the final representation. The process of generating weighted output vectors enhances the hierarchy of text representation, allowing the stock price prediction system to not only capture the global semantics of the text, but also pay attention to important local details.

[0108] The output vector Z after each attention head is processed i Mapped to the corresponding subject space, through the projection matrix P i Generate topic vector T i =tanh(Z i P i ), and finally integrate all topic vectors to form the final text representation Among them, P i is the projection matrix of the i-th topic space, which is used to map the weighted output vector to the topic space, T i is the topic vector corresponding to the i-th attention head, generated by the tanh activation function, and T is the final text representation, generated by integrating the topic vectors of all attention heads. Through the projection matrix, the stock price prediction system maps the weighted output vector to different topic spaces, which enables the stock price prediction system to identify the main topics in the text and integrate these topic information into a unified representation. The final text representation not only retains the detailed information of each attention head, but also forms a more comprehensive and accurate semantic representation by integrating the vectors of different topics. This process enables the stock price prediction system to identify and reflect the multiple semantic levels of the text when processing complex text, providing richer and more valuable semantic information.

[0109] The steps to generate the fused text representation by applying different attention weights to different topic information are:

[0110] The topic vectors generated from different attention heads are taken as input, and for each topic vector, the weight matrix Calculate the attention score S i =T i W i +b i ,in, Indicates the topic score corresponding to each word, b i is the bias term;

[0111] Score the attention to each topic i Perform normalization to obtain normalized attention weights Among them, A iis the normalized attention weight matrix. The softmax function is used to normalize the attention scores. h is the total number of topics, i.e., the number of attention heads. exp(·) is an exponential function used to convert the scores into non-negative values.

[0112] Each topic vector T i And the corresponding normalized attention weight A i Multiply them together to generate the weighted topic vector M i =A i ⊙T i ,in And add all weighted topic vectors to get the final fused text representation M i is the weighted topic vector, the attention weight is applied to the topic vector through element-wise multiplication ⊙, ⊙ is the element-wise multiplication symbol, R is the final text representation after fusion, and the weighted representations of all topics are added together.

[0113] It should be noted that the stock price prediction system can effectively integrate information from different topics by generating fused texts with different attention weights to form a more accurate and unified text representation. This fusion mechanism based on attention weights allows the stock price prediction system to dynamically adjust the importance of different topics, and decide which topics should occupy a larger proportion in the final representation based on the content and context of the specific text. Through weighting and fusion, the stock price prediction system can avoid excessive concentration or dispersion of information, ensure that the semantic features of each topic are fully reflected, and make the final generated text representation reflect both global semantics and details, thereby making the stock price prediction system more explanatory and adaptable in complex text analysis.

[0114] An artificial intelligence driven stock price prediction method comprises the following steps:

[0115] The dataset is obtained by acquiring real-time and historical stock market data and financial news text corpus from multiple data sources;

[0116] Based on the financial news text corpus of the target stock, extract the news sentiment feature time series and pre-acquire the technical indicator feature time series of the target stock;

[0117] Use the kernel function to train the data of the data set, obtain the optimal parameters of the kernel function, and generate the final feature combination;

[0118] Determine whether the current stock market is at a turning point in stock prices based on the final feature combination;

[0119] A market snapshot generation module is used to generate a set of historical and future forecast market snapshot sequences of target stocks based on the inflection point judgment results;

[0120] It is used to process text vectors in parallel using multiple attention heads according to different semantic spaces and map the processed vectors to different topic spaces;

[0121] By applying different attention weights to different topic information, a fused text representation is generated;

[0122] Display the above stock price prediction results.

[0123] The present invention is not limited to the above-mentioned embodiments. Anyone should be aware that any structural changes made under the enlightenment of the present invention, and any technical solutions that are the same or similar to the present invention, fall within the protection scope of the present invention. The technology, shape, and structural parts not described in detail in the present invention are all well-known technologies.

Claims

1. An artificial intelligence driven stock price prediction system, characterized in that: include: A data collection module is used to obtain real-time and historical stock market data and financial news text corpus from multiple data sources, that is, to obtain a data set; A data processing module, which is used to extract news sentiment feature time series and pre-acquire technical indicator feature time series of target stocks based on the financial news text corpus of the target stocks; Kernel function optimization module: The kernel function optimization module uses the kernel function to train the data of the data set, obtains the optimal parameters of the kernel function, and generates the final feature combination; The inflection point judgment module is used to judge whether the current stock market is at a stock price inflection point based on the final feature combination; A market snapshot generation module is used to generate a set of historical and future forecast market snapshot sequences of target stocks based on the inflection point judgment results; The multi-head attention mechanism module is used to process text vectors in parallel using multiple attention heads according to different semantic spaces, and map the processed vectors to different topic spaces; The topic fusion module is used to generate fused text representation by applying different attention weights to different topic information; The result display module is used to display the stock price prediction results.

2. The artificial intelligence driven stock price prediction system according to claim 1, characterized in that: The data collection module obtains real-time and historical stock market data and financial news text corpus from multiple data sources, that is, the specific steps of obtaining the data set are as follows: Identify and select multiple data sources, including but not limited to stock exchange databases, financial news websites, and social media platforms; Use APIs to obtain real-time stock market data from stock exchanges and related websites and regularly call APIs from news websites and social media to obtain the latest news reports and market comments in real time; Access the stock exchange's historical database to batch download historical trading data of target stocks; Obtain past news reports related to the target stock from the historical news database, archive and classify them after obtaining them, and ensure timely synchronization of real-time data and historical data through a caching mechanism and refresh the cache regularly.

3. The artificial intelligence driven stock price prediction system according to claim 1, characterized in that: Based on the financial news text corpus of the target stock, the steps of extracting the news sentiment feature time series and pre-acquiring the technical indicator feature time series of the target stock are as follows: Perform text cleaning, word segmentation and vectorization processing on financial news text corpus and apply sentiment analysis models or dictionaries to extract news sentiment feature time series; Extract the historical trading data of the target stock from the database and use the formula Calculate the technical indicators of the target stock and generate the characteristic time series of the technical indicators; where MDWSM(t) is the characteristic time series of the technical indicators, N is the smoothing cycle length, which indicates the cycle length of the historical data considered in the calculation, and α i is the price momentum weighting coefficient, which measures the weight of the price in period i. β is the price momentum attenuation factor, which controls the attenuation speed of price momentum. When β>0, the early price change has little impact on the current momentum. t is the stock price at the current time point t, P t-i is the stock price at time point ti, γ i is the volume momentum weighting coefficient, which measures the weight of the volume in period i. δ is the volume momentum decay factor, which controls the decay speed of the volume momentum. When δ>0, the earlier volume changes have less impact on the current momentum. V t is the transaction volume at the current time point t, V t-i is the trading volume at time point ti, λ i ATR is the weighted coefficient of the average true range, which measures the weight of the average true range in period i. i is the average true range of period i, RSI i The relative strength index of period i indicates the overbought or oversold state of the market. RSI i The value range is 0-100, MACD t is the exponential moving average convergence / divergence at the current time point t, measuring the difference between short-term and long-term market trends. To perform nonlinear transformation of RSI using sine function; The news sentiment feature time series is synchronized and aligned with the technical indicator feature time series to form comprehensive feature data for model training.

4. The artificial intelligence driven stock price prediction system according to claim 1, characterized in that: The steps of using the kernel function to train the data set, obtain the optimal parameters of the kernel function, and generate the final feature combination are as follows: Select the type of kernel function suitable for the training data set according to the distribution characteristics and complexity of the features of the data and calculate the similarity between the data points in the training set through the selected kernel function; Convert the news sentiment feature time series and technical indicator feature time series obtained by the data processing module into high-dimensional feature vectors; The data set is divided into a training set and a validation set. The selected kernel function is applied to each pair of data points in the training set, and the kernel function matrix is ​​calculated. Then, the kernel function matrix is ​​used to train the prediction model and optimize the prediction model parameters. Finally, the kernel function parameters and regularization parameters are optimized through cross-validation and grid search methods. Finally, the optimized kernel function parameters are used to map the obtained original data features to a high-dimensional space to generate a new feature combination, and all the mapped high-dimensional features are integrated to form the final feature combination.

5. The artificial intelligence driven stock price prediction system according to claim 1, characterized in that: The steps to determine whether the current stock market is at a stock price turning point based on the final feature combination are: The final feature combination generated from the kernel function optimization module is input into the inflection point judgment module and the inflection point data in the training set is used to establish and train the inflection point recognition model; The input feature combination is operated with the weight vector of the inflection point recognition model to calculate the probability that the current time point is at the inflection point and preset the inflection point threshold; The output value of the inflection point identification model is compared with the set threshold. If it reaches or exceeds the threshold, it is judged that the current stock market is at a stock price inflection point, triggering relevant market operation recommendations.

6. The artificial intelligence driven stock price prediction system according to claim 1, characterized in that: The steps of the market snapshot generation module generating a set of historical and future predicted market snapshot sequences of target stocks according to the inflection point judgment result are as follows: The inflection point judgment result output by the inflection point judgment module is used as input to guide the market snapshot generation module to generate the corresponding market snapshot, and to conduct a historical review and future trend forecast when the market is at an inflection point. Then, the historical transaction data of the target stock is extracted from the stock price prediction system database and a historical market snapshot reflecting market changes is generated based on the extracted historical data; When predicting future trends, simulate the stock market trend over a period of time in the future and generate snapshots of future market conditions at multiple time points; The generated historical market snapshots and future forecast snapshots are integrated, arranged in chronological order to form a complete market snapshot sequence set, and the integrated market snapshot sequence set is output and displayed to the user.

7. The artificial intelligence driven stock price prediction system according to claim 1, characterized in that: The multi-head attention mechanism module is used to process text vectors in parallel using multiple attention heads according to different semantic spaces, and the steps of mapping the processed vectors to different topic spaces are as follows: Input the preprocessed text vector into the multi-head attention mechanism module; According to different semantic spaces, h attention heads are used to input the query vector Q i , key vector K i Sum value vector V i Perform parallel processing, and each attention head calculates the corresponding attention matrix And generate the output vector O i =A i V i , where i represents the i-th attention head. Then, for each attention head, the attention weight associated with the input text vector is calculated to generate a weighted output vector. The output vector Z after each attention head is processed i Mapped to the corresponding subject space, through the projection matrix P i Generate topic vector T i =tanh(Z i P i ), and finally integrate all topic vectors to form the final text representation Among them, P i is the projection matrix of the i-th topic space, which is used to map the weighted output vector to the topic space, T i is the topic vector corresponding to the i-th attention head, generated by the tanh activation function, and T is the final text representation, which is generated by integrating the topic vectors of all attention heads.

8. The artificial intelligence driven stock price prediction system according to claim 1, characterized in that: The steps to generate the fused text representation by applying different attention weights to different topic information are: The topic vectors generated from different attention heads are taken as input, and for each topic vector, the weight matrix Calculate the attention score S i =T i W i +b i ,in, Indicates the topic score corresponding to each word, b i is the bias term; Score the attention to each topic i Perform normalization to obtain normalized attention weights Among them, A i is the normalized attention weight matrix. The softmax function is used to normalize the attention scores. h is the total number of topics, i.e., the number of attention heads. exp(·) is an exponential function used to convert the scores into non-negative values. Each topic vector T i And the corresponding normalized attention weight A i Multiply them together to generate the weighted topic vector M i =A i ⊙T i ,in And add all weighted topic vectors to get the final fused text representation M i is the weighted topic vector, and the attention weight is applied to the topic vector through element-wise multiplication ⊙, ⊙ is the element-wise multiplication symbol, and R is the final text representation after fusion.

9. An artificial intelligence driven stock price prediction method, characterized in that: The following steps are involved: The dataset is obtained by acquiring real-time and historical stock market data and financial news text corpus from multiple data sources; Based on the financial news text corpus of the target stock, extract the news sentiment feature time series and pre-acquire the technical indicator feature time series of the target stock; Use the kernel function to train the data of the data set, obtain the optimal parameters of the kernel function, and generate the final feature combination; Determine whether the current stock market is at a turning point in stock prices based on the final feature combination; A market snapshot generation module is used to generate a set of historical and future forecast market snapshot sequences of target stocks based on the inflection point judgment results; It is used to process text vectors in parallel using multiple attention heads according to different semantic spaces and map the processed vectors to different topic spaces; By applying different attention weights to different topic information, a fused text representation is generated; Display the above stock price prediction results.