Market dynamic prediction method and system, electronic equipment and storage medium
By performing multi-scale decomposition and feature extraction on trading market data, and comprehensive prediction combined with time series information, the problem of low market dynamic prediction accuracy in the existing technology is solved, and higher prediction accuracy and adaptability are achieved.
Patent Information
- Application Number
- CN202510248992.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-07-18
AI Technical Summary
The existing technology fails to effectively consider multi-scale analysis in the dynamic forecast of trading markets, resulting in low prediction accuracy.
By performing multi-scale decomposition of market data, using trained prediction models and neural network models for state prediction and feature extraction, combining time series information for comprehensive prediction, and adjusting model parameters to improve accuracy.
It improves the accuracy of market dynamic prediction, adapts to the dynamic changes and complexity of the trading market, and enhances the applicability of the prediction model.
Smart Images

Figure CN120338859A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular, to a method, a system, an electronic device, and a storage medium for predicting market dynamics. Background Art
[0002] The dynamic changes in the trading market are affected by factors such as market participants, commodity price fluctuations, and changes in technical indicators, showing different change trends in different periods. For example, the short-term trend of a certain commodity is positive, but the medium- and long-term trend is downward. By predicting the dynamic changes in the trading market, effective coping strategies can be formulated. However, the existing technologies analyze the trading market limited to single-scale analysis, without considering the dynamic real-time changes and complexity of the trading market, resulting in low prediction accuracy of market dynamics. Summary of the Invention
[0003] The main purpose of the embodiments of the present invention is to provide a method, a system, an electronic device, and a storage medium for predicting market dynamics, which can improve the prediction accuracy.
[0004] To achieve the above object, on the one hand, an embodiment of the present invention provides a method for predicting market dynamics, the method including:
[0005] Performing multi-scale decomposition on the collected original market data to obtain a multi-scale data set, and performing state prediction on the multi-scale data set according to a trained prediction model to obtain a state information set; wherein, the original market data includes time series data of the trading market;
[0006] Performing feature extraction on the multi-scale data set to obtain a multi-scale feature set, and performing convolution processing on the multi-scale feature set according to a trained neural network model to obtain a time series information set;
[0007] Determining a target prediction result according to the state information set and the time series information set; wherein, the target prediction result includes dynamic trend information of the trading market.
[0008] In some embodiments, the performing multi-scale decomposition on the collected original market data to obtain a multi-scale data set specifically includes:
[0009] Segmenting the original market data according to a preset period to obtain a time scale data set; wherein, the time scale data set includes several different time scale data subsets;
[0010] Performing correlation calculation on the time scale data set respectively according to a preset cell definition to obtain several groups of correlation values; wherein, the preset cell definition includes attributes of different cell states in the prediction model;
[0011] Segment the time-scale data set according to a preset spatial scale and several groups of the correlation values to obtain the multi-scale data set; wherein, the preset spatial scale includes the correlation degree of the attributes of the different cell states.
[0012] In some embodiments, the state prediction of the multi-scale data set according to the trained prediction model to obtain a state information set specifically includes:
[0013] Determine a number of model cells according to the multi-scale data set and the grid size in the prediction model;
[0014] For each of the model cells, calculate according to the transformation rule of the prediction model and the states of several neighboring cells to determine the state of the model cell at the next moment; count the number of current state updates, and compare the number of current state updates with a preset number of updates;
[0015] If the number of current state updates is less than the preset number of updates, return to execute the calculation according to the transformation rule of the prediction model and the states of several neighboring cells to determine the state of the model cell at the next moment; until the number of current state updates is greater than or equal to the preset number of updates;
[0016] If the number of current state updates is greater than or equal to the preset number of updates, determine the state information set according to the current cell state.
[0017] In some embodiments, the method further includes:
[0018] Determine corresponding time information according to the target prediction result, and collect corresponding market data according to the time information;
[0019] Perform error calculation according to the target prediction result and the market data to determine a prediction accuracy value, and compare the prediction accuracy value with a preset accuracy threshold;
[0020] If the prediction accuracy value is less than the preset accuracy threshold, adjust the parameters of the prediction model according to the prediction error, and train the prediction model with the adjusted parameters according to the multi-scale data until the prediction accuracy value is greater than or equal to the preset accuracy threshold; wherein, the parameter adjustment includes weight adjustment and / or transformation rule modification, and the prediction error is determined according to the target prediction result and the market data.
[0021] In some embodiments, the prediction model is trained by the following method:
[0022] Perform multi-scale decomposition on the sample data to obtain a multi-scale sample data set;
[0023] Construct a cellular automaton model according to preset parameters, and train the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result; wherein, the preset parameters include the cell grid size, the initial state, and the initial transition rule;
[0024] Determine the prediction model according to the first prediction result, the multi-scale sample data set, and a preset threshold.
[0025] In some embodiments, the determining the prediction model according to the first prediction result, the multi-scale sample data set, and a preset threshold specifically includes:
[0026] Calculate an error according to the first prediction result and the multi-scale sample data set to obtain a prediction error, and compare the prediction error with the preset threshold;
[0027] If the prediction error is greater than the preset threshold, adjust the parameters of the cellular automaton model according to the prediction error, and return to execute the training of the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result; until the prediction error is less than or equal to the preset threshold;
[0028] If the prediction error is less than or equal to the preset threshold, use the cellular automaton model as the prediction model.
[0029] In some embodiments, the method further includes:
[0030] Obtain the historical prediction error at the previous moment, and compare the prediction error with the historical prediction error;
[0031] If the prediction error is greater than or equal to the historical prediction error, adjust the parameters of the cellular automaton model according to the prediction error, and return to execute the training of the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result; until the prediction error is less than or equal to the preset threshold;
[0032] If the prediction error is less than the historical prediction error, calculate according to the historical prediction error and the prediction error to determine an error change value, and compare the error change value with a preset change threshold;
[0033] If the error change value is greater than the preset change threshold, keep the parameters of the cellular automaton model unchanged;
[0034] If the error change value is less than or equal to the preset change threshold, adjust the parameters of the cellular automaton model according to the prediction error, and return to execute the training of the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result until the error change value is greater than the preset change threshold.
[0035] To achieve the above object, another aspect of the embodiments of the present invention provides a market dynamics prediction system, including:
[0036] A first module, configured to perform multi-scale decomposition on the collected original market data to obtain a multi-scale data set, and perform state prediction on the multi-scale data set according to the trained prediction model to obtain a state information set; wherein, the original market data includes time series data of the trading market;
[0037] A second module, configured to extract features from the multi-scale data set to obtain a multi-scale feature set, and perform convolution processing on the multi-scale feature set according to the trained neural network model to obtain a time series information set;
[0038] A third module, configured to determine a target prediction result according to the state information set and the time series information set; wherein, the target prediction result includes dynamic trend information of the trading market.
[0039] To achieve the above object, another aspect of the embodiments of the present application proposes an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the foregoing method when executing the computer program.
[0040] To achieve the above object, another aspect of the embodiments of the present application proposes a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program implements the foregoing method when executed by a processor.
[0041] Implementing the embodiments of the present invention includes the following beneficial effects: This embodiment provides a method, system, electronic device, and storage medium for predicting market dynamics. This solution performs multi-scale decomposition on the collected market data to obtain multi-scale data at different time scales and spatial scales; uses a trained prediction model to predict the state of the multi-scale data to obtain a set of state information; at the same time, extracts features from the obtained multi-scale data to obtain a multi-scale feature set of market data; uses a trained neural network model to perform convolution processing on the multi-scale feature set to extract a set of time series information in the market data; combines the predicted set of state information and the set of time series information to obtain a target prediction result; by performing multi-scale analysis on market data, extracting the time series information therein, and combining the results of the multi-scale analysis and the extracted time series information for prediction, the prediction accuracy is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 FIG. is a schematic flowchart of the steps of a method for predicting market dynamics provided by an embodiment of the present invention;
[0043] Figure 2 FIG. is a schematic flowchart of the steps of obtaining a multi-scale data set in a method for predicting market dynamics provided by an embodiment of the present invention;
[0044] Figure 3 FIG. is a schematic flowchart of the steps of obtaining a set of state information in a method for predicting market dynamics provided by an embodiment of the present invention;
[0045] Figure 4 FIG. is a schematic flowchart of the steps of adjusting model parameters in a method for predicting market dynamics provided by an embodiment of the present invention;
[0046] Figure 5 FIG. is a schematic flowchart of the steps of training a prediction model in a method for predicting market dynamics provided by an embodiment of the present invention;
[0047] Figure 6 FIG. is a schematic flowchart of the steps of determining a prediction model in a method for predicting market dynamics provided by an embodiment of the present invention;
[0048] Figure 7 FIG. is a schematic flowchart of the steps of adjusting a prediction model in a method for predicting market dynamics provided by an embodiment of the present invention;
[0049] Figure 8 FIG. is a schematic flowchart of the steps of a specific embodiment provided by an embodiment of the present invention;
[0050] Figure 9 FIG. is a structural block diagram of a system for predicting market dynamics provided by an embodiment of the present invention;
[0051] Figure 10It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0052] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. For the step numbers in the following embodiments, they are only set for the convenience of explanation and illustration, and no limitation is imposed on the order between steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0053] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0054] In the following description, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when allowed, so that the embodiments of the present invention described here can be implemented in an order other than that illustrated or described here.
[0055] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs. The terms used in the embodiments of the present invention are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0056] Figure 1 It is an alternative flowchart of a method for predicting market dynamics provided by an embodiment of the present invention. Figure 1 The method in may include but is not limited to steps S101 to S103.
[0057] Step S101: Perform multi-scale decomposition on the collected original market data to obtain a multi-scale data set, and perform state prediction on the multi-scale data set according to the trained prediction model to obtain a state information set; wherein, the original market data includes time series data of the trading market.
[0058] Step S102: Extract features from the multi-scale data set to obtain a multi-scale feature set, and perform convolution processing on the multi-scale feature set according to the trained neural network model to obtain a time series information set.
[0059] Step S103: Determine the target prediction result according to the state information set and the time series information set; wherein, the target prediction result includes dynamic trend information of the trading market.
[0060] Steps S101 to S106 illustrated in the embodiments of the present application collect data of the trading market to be predicted, such as information of several participants in the trading market, price information of commodities in the trading market, trading volume, etc.; divide the collected trading market data according to predefined information to obtain a dataset of the trading market with different scales; where the predefined information is used to focus on market information at different levels, such as price fluctuations of commodities in the short-term trading market, market change trends in the medium-term trading market, etc.; input the divided multi-scale dataset into a trained prediction model, and perform simulation prediction through the prediction model to obtain a prediction result of market dynamics; at the same time, use the trained deep learning model to extract multi-scale features from the obtained multi-scale data to obtain multi-scale features in the market data; then, use the deep learning model to extract the relationship between feature data of different scales changing over time, capture the sequential dependence relationship in the time series to obtain time series information; finally, combine the prediction result of market dynamics and time series information, consider the multi-scale features and time series dynamics of the trading market, and comprehensively predict to obtain the final prediction result.
[0061] In step S101 of some embodiments, data can be collected according to the frequency of data status update by the prediction model, or data can be collected according to the focused scale of prediction, and the like.
[0062] Please refer to Figure 2 , in some embodiments, step S101 may include but is not limited to steps S201 to S203:
[0063] Step S201, divide the original market data according to a preset period to obtain a time-scale dataset; where the time-scale dataset includes several data subsets with different time scales;
[0064] Step S202, perform correlation calculation on the time-scale dataset respectively according to a preset cell definition to obtain several groups of correlation values; where the preset cell definition includes attributes of different cell states in the prediction model;
[0065] Step S203, divide the time-scale dataset according to a preset spatial scale and several groups of correlation values to obtain a multi-scale dataset; where the preset spatial scale includes the degree of correlation of attributes of different cell states.
[0066] In step S201 of some embodiments, the collected market data is divided according to different levels of the trading market. In this embodiment, first, the collected data is divided according to the time scale of the trading market to obtain market data with different time scales, such as short-term market data within one hour, medium-term market data within one week, and long-term market data within one month.
[0067] In step S202 of some embodiments, relevance calculations are performed on data of different time scales respectively according to the cell definitions in the model parameters of the prediction model to determine the degree of influence between different market data; for example, the relevance of changes in commodity prices in the short-term trading market to the dynamic changes in the medium-term trading market; wherein, the cell definition is the attribute of different cell states in the prediction model, and processing market data of different time scales according to the cell definition facilitates the prediction model to process input data.
[0068] In step S203 of some embodiments, the time-scale data is divided according to the degree of influence between different market data obtained from the calculation in the previous step and the spatial-scale parameters set in the prediction model to obtain multi-scale data that can be used for subsequent market dynamic simulation and prediction. The multi-scale data includes market data of different time scales and different spatial scales; in this embodiment, the spatial scale includes micro, meso, and macro, expanding from local market data to all market data.
[0069] Please refer to Figure 3 , in some embodiments, step S101 may include but is not limited to steps S301 to S304:
[0070] Step S301, determining a number of model cells according to the multi-scale data set and the grid size in the prediction model;
[0071] Step S302, for each model cell, calculating according to the conversion rules of the prediction model and the states of several neighbor cells to determine the state of the model cell at the next moment; counting the number of times the current state is updated, and comparing the number of times the current state is updated with the preset number of updates;
[0072] Step S303, if the number of times the current state is updated is less than the preset number of updates, return to execute the calculation according to the conversion rules of the prediction model and the states of several neighbor cells to determine the state of the model cell at the next moment; until the number of times the current state is updated is greater than or equal to the preset number of updates;
[0073] Step S304, if the number of times the current state is updated is greater than or equal to the preset number of updates, determining the state information set according to the current cell state.
[0074] In step S301 of some embodiments, the obtained multi-scale data is input into the trained prediction model for simulation and prediction. In this embodiment, a cellular automaton model is used to simulate and predict the multi-scale data. The cellular automaton processes the input multi-scale data set according to the set grid size and cell definition to determine cells with different cell definitions. By iteratively simulating cells with different cell definitions, prediction results of the trading market at different scales can be obtained.
[0075] In step S302 of some embodiments, in the cellular automaton, each cell updates its own state according to the states of its neighboring cells and the corresponding transition rules to complete the simulation prediction of the cells for one time step. After all cells have completed the simulation prediction for one time step, it can be determined whether the number of cell updates in the cellular automaton meets a preset number of updates to determine whether to stop the simulation prediction of the cellular automaton. Among them, the preset number of updates can be set according to actual needs. Optionally, it can also be determined the degree of difference between the state of the most recently updated cell and the state of the cell at the previous update. If the difference between the states of the cells at the two updates is less than a certain threshold, it can be considered that the simulation prediction of the cellular automaton tends to be stable, and the simulation prediction of the cellular automaton can be stopped.
[0076] In step S303 of some embodiments, if the number of cell updates in the cellular automaton is less than the set number of updates, continue to update the cell state according to the transition rules of the cellular automaton and the states of the neighboring cells, and continue the simulation prediction until the number of cell updates in the cellular automaton is greater than or equal to the set number of updates, and the cellular automaton stops the iterative update of the cell state and enters the next operation.
[0077] In step S304 of some embodiments, if the number of cell updates in the cellular automaton is greater than or equal to the set number of updates, the cellular automaton stops the simulation prediction, and takes the cell state obtained last time as the result of the market simulation prediction and outputs it as a state information set.
[0078] Please refer to Figure 4 , in some embodiments, a method for predicting market dynamics provided by the embodiments of the present invention may include but is not limited to steps S401 to S403:
[0079] Step S401, determine the corresponding time information according to the target prediction result, and collect the corresponding market data according to the time information;
[0080] Step S402, calculate the error according to the target prediction result and the market data, determine the prediction accuracy value, and compare the prediction accuracy value with a preset accuracy threshold;
[0081] Step S403, if the prediction accuracy value is less than the preset accuracy threshold, adjust the parameters of the prediction model according to the prediction error, and train the prediction model with the adjusted parameters according to the multi-scale data until the prediction accuracy value is greater than or equal to the preset accuracy threshold. Among them, the parameter adjustment includes weight adjustment and / or modification of the transition rules, and the prediction error is determined according to the target prediction result and the market data.
[0082] In step S401 of some embodiments, the performance of the prediction model can be detected in real time or regularly. When the prediction accuracy of the prediction model decreases, adjustments are made in a timely manner to maintain the prediction accuracy. In this embodiment, according to the time information corresponding to the prediction result output by the cellular automaton serving as the prediction model, the actual market data at the corresponding time point is collected. The prediction accuracy of the cellular automaton is detected based on the actual market data and the prediction result output by the cellular automaton, and then it is determined whether the cellular automaton needs to be adjusted. Optionally, historical trading market data can also be input into the cellular automaton for processing to predict the market dynamics after a period of time, and the market data at the corresponding time is used for performance detection, and the like is not limited thereto.
[0083] In step S402 of some embodiments, the prediction error is calculated based on the actual trading market data and the prediction result of the cellular automaton, the prediction accuracy of the cellular automaton is determined, and this prediction accuracy is compared with the set prediction accuracy threshold to determine the current performance of the cellular automaton.
[0084] In step S403 of some embodiments, if the prediction accuracy of the cellular automaton is less than the set accuracy threshold, the model parameters of the cellular automaton need to be adjusted accordingly. For example, the weights of market data at certain scales are modified to change the influence degree of this market data on the prediction result; certain transition rules can also be modified to change the state update logic of a certain market data. By training the cellular automaton after parameter adjustment, it is determined whether the prediction error of the model is improved or reduced to an acceptable level, whether the prediction accuracy is improved, and then it is determined whether it is necessary to continue to adjust the parameters of the cellular automaton and then put it into actual application.
[0085] Please refer to Figure 5 , in some embodiments, a method for predicting market dynamics provided by an embodiment of the present invention further includes pre-training a prediction model, and this prediction model is used for state prediction of a multi-scale data set. This prediction model can be obtained through training from step S501 to step S503:
[0086] Step S501, perform multi-scale decomposition on the sample data to obtain a multi-scale sample data set;
[0087] Step S502, construct a cellular automaton model according to preset parameters, and train the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result. Among them, the preset parameters include the cell grid size, the initial state, and the initial transition rule;
[0088] Step S503, determine the prediction model according to the first prediction result, the multi-scale sample data set, and the preset threshold.
[0089] In step S501 of some embodiments, historical market data of the trading market can be used as sample data for training the prediction model; the sample data is subjected to multi-scale decomposition to obtain multi-scale sample data sets at different levels of the trading market; exemplarily, in this embodiment, the sample data is subjected to multi-scale decomposition from the time scale and the space scale.
[0090] In step S502 of some embodiments, model parameters are set according to actual requirements, a cellular automaton model is constructed according to the set model parameters, and then the constructed cellular automaton model is trained according to the obtained multi-scale sample data sets; in this embodiment, the grid size, the initial cell state, and the initial transition rules of the cellular automaton model are set to construct an initial cellular automaton model; the multi-scale sample data sets are input into the constructed initial cellular automaton model for training, and corresponding prediction results are output; according to the prediction results, it is judged whether the performance of the trained cellular automaton model meets the requirements.
[0091] In step S503 of some embodiments, the error between the prediction result output by the cellular automaton model and the input multi-scale sample data sets is compared with a preset threshold; according to the comparison result, it is determined whether to adjust the trained cellular automaton model to obtain a prediction model with a certain prediction accuracy.
[0092] Please refer to Figure 6 , in some embodiments, step S503 may include but is not limited to steps S601 to S603:
[0093] Step S601, error calculation is performed according to the first prediction result and the multi-scale sample data sets to obtain a prediction error, and the prediction error is compared with a preset threshold;
[0094] Step S602, if the prediction error is greater than the preset threshold, the parameters of the cellular automaton model are adjusted according to the prediction error, and the training of the cellular automaton model is returned to be performed according to the multi-scale sample data sets to obtain the first prediction result; until the prediction error is less than or equal to the preset threshold;
[0095] Step S603, if the prediction error is less than or equal to the preset threshold, the cellular automaton model is used as the prediction model.
[0096] In step S601 of some embodiments, after the constructed cellular automaton model is trained, error calculation is performed according to the prediction result output by the trained cellular automaton model and the multi-scale sample data sets to determine the prediction error of the cellular automaton model, the obtained prediction error is compared with a preset error threshold, and the prediction performance of the cellular automaton model is evaluated according to the comparison result of the two.
[0097] In step S602 of some embodiments, if the prediction error of the cellular automaton model is greater than a preset error threshold, the prediction performance of the cellular automaton model is low. Determine the relevant parameters affecting the prediction performance of the cellular automaton model based on the prediction error of the cellular automaton model, and adjust these parameters; then input the multi-scale sample data into the cellular automaton model with adjusted parameters for training again; repeat the above process until the prediction error of the cellular automaton model is less than or equal to the preset error threshold, and determine that the prediction performance of the cellular automaton model meets the requirements of the application.
[0098] In step S603 of some embodiments, if the prediction error of the cellular automaton model is less than or equal to the set error threshold, it indicates that the prediction performance of the current cellular automaton model meets the application requirements. Take the finally trained cellular automaton model as the prediction model and apply it to the market simulation prediction.
[0099] Please refer to Figure 7 , in some embodiments, the training of the prediction model in a market dynamics prediction method provided by an embodiment of the present invention may further include, but is not limited to, steps S701 to S705:
[0100] Step S701, obtain the historical prediction error at the previous moment, and compare the prediction error with the historical prediction error;
[0101] Step S702, if the prediction error is greater than or equal to the historical prediction error, adjust the parameters of the cellular automaton model according to the prediction error, and return to execute the training of the cellular automaton model based on the multi-scale sample data set to obtain the first prediction result; until the prediction error is less than or equal to the preset threshold;
[0102] Step S703, if the prediction error is less than the historical prediction error, calculate according to the historical prediction error and the prediction error to determine the error change value, and compare the error change value with the preset change threshold;
[0103] Step S704, if the error change value is greater than the preset change threshold, keep the parameters of the cellular automaton model unchanged;
[0104] Step S705, if the error change value is less than or equal to the preset change threshold, adjust the parameters of the cellular automaton model according to the prediction error, and return to execute the training of the cellular automaton model based on the multi-scale sample data set to obtain the first prediction result until the error change value is greater than the preset change threshold.
[0105] In step S701 of some embodiments, in addition to evaluating the prediction performance of the cellular automaton model after parameter adjustment according to the prediction error of the cellular automaton model and a preset error threshold, it can also be determined according to the prediction errors corresponding to consecutive adjacent training batches of the cellular automaton model; in this embodiment, after the cellular automaton model of the current training batch is trained, a prediction result is output, the prediction error of the cellular automaton model of the current training batch is calculated according to the prediction result and the input data, and the historical prediction error of the cellular automaton model of the previous training batch is obtained; the prediction error of the current batch is compared with the historical training error of the previous batch to evaluate the prediction performance of the cellular automaton model of the current training batch.
[0106] In step S702 of some embodiments, if the prediction error of the current batch is greater than or equal to the historical prediction error of the previous batch, it indicates that through the training of the current batch, the prediction performance of the cellular automaton model is poor and it cannot yet be applied to the simulation prediction of market data; the model parameters of the cellular automaton model are adjusted according to the prediction error of the cellular automaton model of the current batch, and then the parameter-adjusted cellular automaton model is trained using multi-scale sample data, and the above comparison process is repeated until the prediction error of the prediction model of the trained cellular automaton model is less than the set error threshold.
[0107] In step S703 of some embodiments, if the prediction error of the cellular automaton model of the current batch is less than the historical prediction error of the previous batch, it indicates that the prediction performance of the trained cellular automaton model has been improved to a certain extent; at this time, it is necessary to further determine whether the prediction performance of the cellular automaton model tends to be stable and determine whether to further train the cellular automaton model; the error change value is calculated according to the prediction error of the cellular automaton model of the current batch and the historical prediction error of the previous batch, and the error change value is compared with the set change threshold.
[0108] In step S704 of some embodiments, if the calculated error change value is greater than the set change threshold, it indicates that after the parameter adjustment of the cellular automaton model of the current batch, the prediction performance has been significantly improved, and the adjusted parameters are retained, such as the adjusted weights or the modified rule logic, etc.; then, it can be determined whether the prediction error of the current cellular automaton model has been reduced to an acceptable level and determine whether to apply it to the simulation prediction of market data.
[0109] In step S705 of some embodiments, if the calculated error change value is less than or equal to the set change threshold, it indicates that after the parameters of the current batch of cellular automaton models are adjusted, the prediction performance does not change significantly. It is necessary to continue to adjust the parameters of the cellular automaton models and retrain the cellular automaton models with adjusted parameters using multi-scale sample data until the prediction error of the trained cellular automaton models is reduced to an acceptable level. Exemplarily, using the trained cellular automaton model to predict the price trend of a certain stock in the trading market, if the cellular automaton model predicts that the stock price will rise in the short term, but the actual price of the stock in the actual trading market falls and the calculated prediction error of the cellular automaton model exceeds the threshold, then it is necessary to adjust the parameters of the cellular automaton model, reduce the weight of the trading volume parameter, and introduce the market sentiment index as a new conversion condition, such as news sentiment analysis. Retrain the cellular automaton model with adjusted parameters until the prediction error of the model tends to be stable or is reduced to an acceptable level.
[0110] Next, combined with specific application examples, the solutions of the embodiments of the present invention will be introduced and described in detail:
[0111] Please refer to Figure 8, an embodiment of the present invention provides a specific embodiment of a method for predicting market dynamics, which is applied to predicting the dynamics of the stock trading market. Market data is collected from the stock trading market. According to the predefined cellular automaton model, the collected market data is divided into different scales to obtain multi-scale data, including short-term, medium-term, and long-term time scales, as well as micro, meso, and macro spatial scale data. The stock trading market is analyzed at different levels using market data at different scales; the cellular automaton model is initialized by setting the grid size and initial cell state of the cellular automaton model, and taking the transformation rule of the cellular automaton model as the initial transformation rule. The obtained multi-scale data is input into the cellular automaton model for model prediction. Each cell in the cellular automaton model represents attributes such as the price and trading volume of each stock in the stock trading market; the cellular automaton model updates the cell state according to the set initial transformation rule to obtain the dynamic prediction of stocks at different time points. The actual market data corresponding to the corresponding time points is collected according to the time points of each stock dynamic prediction. The prediction error is calculated based on the collected actual market data and the stock dynamic prediction at the corresponding time point. The prediction error of each cell is quantified according to the prediction error, and the high-error cells are selected. The transformation rule corresponding to the high-error cell is modified, and the cell is predicted again; through iterative adjustment and prediction, the prediction result of the stock trading market is obtained; a convolutional neural network model is used to extract features from the multi-scale data to obtain the multi-scale features of the stock trading market; then the obtained multi-scale features are input into a long short-term memory network model for processing. The long short-term memory network model captures the temporal dependence relationship between the feature data at different scales in the multi-scale features to obtain temporal information; a comprehensive prediction is made based on the temporal information and the dynamic prediction result output by the cellular automaton model to obtain the changes in attributes such as the price and trading volume of different stocks in the stock trading market within a certain period of time; the dynamic changes of different stocks to the dynamic change trend of the entire stock market, etc.
[0112] Implementing the embodiments of the present invention includes the following beneficial effects: This embodiment provides a method, system, electronic device, and storage medium for predicting market dynamics. This solution performs multi-scale decomposition on the collected market data to obtain multi-scale data at different time scales and spatial scales; uses a trained prediction model to perform state prediction on the multi-scale data to obtain a set of state information; at the same time, extracts features from the obtained multi-scale data to obtain a multi-scale feature set of market data; uses a trained neural network model to perform convolutional processing on the multi-scale feature set to extract a time series information set from the market data; combines the predicted state information set and the time series information set to obtain a target prediction result; by performing multi-scale analysis on the market data, extracting the time series information therein, and combining the results of the multi-scale analysis and the extracted time series information for prediction, the prediction accuracy is improved; based on an adaptive learning mechanism, during the process of model training and model application, the weights or transformation rules of the prediction model are adjusted according to the prediction error of the model to improve the prediction accuracy and adapt to the dynamic changes and complexity of the trading market, thereby improving the applicability of the prediction model.
[0113] Please refer to Figure 9 , the embodiments of the present invention also provide a system for predicting market dynamics, which can implement the above-mentioned method for predicting market dynamics. The system includes:
[0114] A first module for performing multi-scale decomposition on the collected original market data to obtain a multi-scale data set, and performing state prediction on the multi-scale data set according to a trained prediction model to obtain a set of state information; wherein, the original market data includes time series data of the trading market;
[0115] A second module for extracting features from the multi-scale data set to obtain a multi-scale feature set, and performing convolutional processing on the multi-scale feature set according to a trained neural network model to obtain a time series information set;
[0116] A third module for determining a target prediction result according to the set of state information and the time series information set; wherein, the target prediction result includes dynamic trend information of the trading market.
[0117] It can be seen that the content in the above method embodiments is applicable to the system embodiments of the present invention. The functions specifically implemented by the system embodiments of the present invention are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0118] The embodiments of the present application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the above-mentioned method for predicting market dynamics. The electronic device can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.
[0119] It can be understood that the content in the above method embodiments is applicable to the device embodiments of the present application. The functions specifically implemented by the device embodiments of the present application are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0120] Please refer to Figure 10 , Figure 10 , which shows the hardware structure of an electronic device in another embodiment. The electronic device includes:
[0121] A processor 1001, which can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present application;
[0122] A memory 1002, which can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 1002 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of the present specification through software or firmware, the relevant program codes are stored in the memory 1002 and are called by the processor 1001 to execute a method for predicting a market trend in the embodiments of the present application;
[0123] An input / output interface 1003, which is used to implement information input and output;
[0124] A communication interface 1004, which is used to implement communication interaction between the present device and other devices, and can communicate through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);
[0125] A bus 1005, which transmits information between the various components of the device (such as the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004);
[0126] Among them, the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004 are communicatively connected to each other inside the device through the bus 1005.
[0127] Among them, the memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. The memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a remote memory remotely disposed relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0128] In addition, an embodiment of the present application also discloses a computer program product or a computer program. The computer program product or the computer program is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above method. Similarly, the content in the above method embodiments is applicable to this storage medium embodiment. The functions specifically implemented by this storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0129] An embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the above method for predicting a market trend.
[0130] It can be understood that the content in the above method embodiments is applicable to this storage medium embodiment. The functions specifically implemented by this storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0131] It will be understood that all or some of the steps and systems disclosed in the above methods may be implemented as software, firmware, hardware and appropriate combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes but is not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0132] The above is a specific description of the preferred embodiment of the present invention, but the present invention is not limited to the described embodiment. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A method for predicting market dynamics, characterized in that, The method includes: Performing multi-scale decomposition on the collected original market data to obtain a multi-scale data set, and performing state prediction on the multi-scale data set according to a trained prediction model to obtain a state information set; wherein, the original market data includes time series data of a trading market. Performing feature extraction on the multi-scale data set to obtain a multi-scale feature set, and performing convolution processing on the multi-scale feature set according to a trained neural network model to obtain a time series information set. Determining a target prediction result according to the state information set and the time series information set; wherein, the target prediction result includes dynamic trend information of the trading market.
2. The method according to claim 1, wherein The performing multi-scale decomposition on the collected original market data to obtain a multi-scale data set specifically includes: Segmenting the original market data according to a preset period to obtain a time scale data set; wherein, the time scale data set includes several data subsets with different time scales. Performing correlation calculation on the time scale data set respectively according to a preset cell definition to obtain several groups of correlation values; wherein, the preset cell definition includes attributes of different cell states in the prediction model. Segmenting the time scale data set according to a preset space scale and several groups of the correlation values to obtain the multi-scale data set; wherein, the preset space scale includes the correlation degree of the attributes of the different cell states.
3. The method according to claim 1, wherein The performing state prediction on the multi-scale data set according to a trained prediction model to obtain a state information set specifically includes: Determining several model cells according to the multi-scale data set and the grid size in the prediction model. For each of the model cells, calculating according to the conversion rule of the prediction model and the states of several neighbor cells to determine the state of the model cell at the next moment; counting the number of current state updates, and comparing the number of current state updates with a preset number of updates. If the number of current state updates is less than the preset number of updates, return to execute the calculating according to the conversion rule of the prediction model and the states of several neighbor cells to determine the state of the model cell at the next moment; until the number of current state updates is greater than or equal to the preset number of updates. If the number of current state updates is greater than or equal to the preset number of updates, determining the state information set according to the current cell state.
4. The method according to claim 1, wherein The method further includes: Determining corresponding time information according to the target prediction result, and collecting corresponding market data according to the time information. Performing error calculation according to the target prediction result and the market data to determine a prediction accuracy value, and comparing the prediction accuracy value with a preset accuracy threshold. If the prediction accuracy value is less than the preset accuracy threshold, adjusting the parameters of the prediction model according to the prediction error, and training the prediction model with the parameter adjustment according to the multi-scale data until the prediction accuracy value is greater than or equal to the preset accuracy threshold; wherein, the parameter adjustment includes weight adjustment and / or modification of the conversion rule, and the prediction error is determined according to the target prediction result and the market data.
5. The method according to claim 1, wherein The prediction model is trained through the following method: Perform multi-scale decomposition on the sample data to obtain a multi-scale sample data set; Construct a cellular automaton model according to preset parameters, and train the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result; wherein, the preset parameters include the cell grid size, the initial state, and the initial transition rule; Determine the prediction model according to the first prediction result, the multi-scale sample data set, and a preset threshold.
6. The method according to claim 5, characterized in that, The determining the prediction model according to the first prediction result, the multi-scale sample data set, and a preset threshold specifically includes: Perform error calculation according to the first prediction result and the multi-scale sample data set to obtain a prediction error, and compare the prediction error with the preset threshold; If the prediction error is greater than the preset threshold, adjust the parameters of the cellular automaton model according to the prediction error, and return to execute the training of the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result; until the prediction error is less than or equal to the preset threshold; If the prediction error is less than or equal to the preset threshold, use the cellular automaton model as the prediction model.
7. The method according to claim 6, wherein The method further includes: Obtain the historical prediction error at the previous moment, and compare the prediction error with the historical prediction error; If the prediction error is greater than or equal to the historical prediction error, adjust the parameters of the cellular automaton model according to the prediction error, and return to execute the training of the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result; until the prediction error is less than or equal to the preset threshold; If the prediction error is less than the historical prediction error, calculate according to the historical prediction error and the prediction error to determine an error change value, and compare the error change value with a preset change threshold; If the error change value is greater than the preset change threshold, keep the parameters of the cellular automaton model unchanged; If the error change value is less than or equal to the preset change threshold, adjust the parameters of the cellular automaton model according to the prediction error, and return to execute the training of the cellular automaton model according to the multi-scale sample data set to obtain a first prediction result until the error change value is greater than the preset change threshold.
8. A prediction system for market dynamics, characterized in that, It includes: A first module, configured to perform multi-scale decomposition on the collected original market data to obtain a multi-scale data set, and perform state prediction on the multi-scale data set according to the trained prediction model to obtain a state information set; wherein, the original market data includes time series data of the trading market; A second module, configured to perform feature extraction on the multi-scale data set to obtain a multi-scale feature set, and perform convolutional processing on the multi-scale feature set according to the trained neural network model to obtain a time series information set; A third module, configured to determine a target prediction result according to the state information set and the time series information set; wherein, the target prediction result includes dynamic trend information of the trading market.
9. An electronic device, characterized in that, It includes: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1-7.
10. A computer-readable storage medium storing a program executable by a processor, characterized in that, The program executable by the processor, when executed by the processor, is used to execute the method according to any one of claims 1-7.