Data prediction method, data prediction device, electronic equipment and storage medium
By fusing features of online training data to generate task instructions and call the inference model, combined with reinforcement learning to adjust parameters, the problem of dynamic changes in financial data prediction is solved, achieving higher prediction flexibility and accuracy.
Patent Information
- Application Number
- CN202510728810.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-09-12
AI Technical Summary
The existing financial data prediction methods cannot effectively adapt to the dynamic changes of data, resulting in insufficient prediction accuracy and flexibility.
Online training data fusion features are used to generate task instructions, call the inference model, and adjust the training parameters through reinforcement learning to adapt to real-time data changes.
Improves the forecast flexibility and accuracy of financial data forecasts and adapts to real-time data changes through continuous training parameter updates.
Smart Images

Figure CN120634738A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data prediction method and device, an electronic device, and a computer-readable storage medium. Background Art
[0002] Financial data forecasting refers to the prediction of financial data such as financial market trends, numerical values or trends of financial variables by analyzing historical financial data and applying statistical methods, machine learning models or other quantitative tools.
[0003] Related technologies typically rely on offline training to generate prediction models, or rely on fixed prediction rules to predict financial data. Due to the highly dynamic and complex nature of financial data, these prediction methods lack accuracy and flexibility. Summary of the Invention
[0004] The present disclosure provides a data prediction method and a data prediction device, an electronic device, and a computer-readable storage medium to improve the prediction accuracy and prediction flexibility of financial data prediction.
[0005] In a first aspect, the present disclosure provides a data prediction method, which includes: obtaining online training data corresponding to a first financial data prediction task in a current prediction cycle, wherein the online training data includes multiple training data corresponding to multiple data types; fusing the multiple training data according to a first training parameter to generate a fusion feature corresponding to the multiple training data; performing instruction filling processing on the fusion feature according to a second training parameter to generate a task instruction corresponding to the first financial data prediction task; calling an inference model according to a third training parameter and the task instruction to obtain first prediction data corresponding to the first financial data prediction task; adjusting the first training parameter, the second training parameter and the third training parameter through reinforcement learning according to a comparison result between the first prediction data and the actual data, and processing the second financial data prediction task of the next prediction cycle according to the adjusted first training parameter, the second training parameter and the third training parameter to obtain second prediction data corresponding to the second financial data prediction task.
[0006] In a second aspect, the present disclosure provides a data prediction device, which includes: an acquisition module for acquiring online training data corresponding to a first financial data prediction task in a current prediction cycle, wherein the online training data includes multiple training data corresponding to multiple data types; a fusion module for performing a fusion process on the multiple training data according to a first training parameter to generate a fusion feature corresponding to the multiple training data; a generation module for performing an instruction filling process on the fusion feature according to a second training parameter to generate a task instruction corresponding to the first financial data prediction task; a prediction module for calling an inference model according to a third training parameter and the task instruction to obtain the first prediction data corresponding to the first financial data prediction task; an adjustment module for adjusting the first training parameter, the second training parameter and the third training parameter through reinforcement learning according to a comparison result between the first prediction data and the actual data, and processing the second financial data prediction task of the next prediction cycle according to the adjusted first training parameter, the second training parameter and the third training parameter to obtain the second prediction data corresponding to the second financial data prediction task.
[0007] In a third aspect, the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor to enable the at least one processor to execute the above-mentioned data prediction method.
[0008] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned data prediction method when executed by a processor.
[0009] The data prediction method provided by the embodiment of the present disclosure first obtains online training data corresponding to the first financial data prediction task of the current prediction period. As the name suggests, online training data is training data updated in real time, which is real-time and dynamic. The online training data includes multiple training data corresponding to multiple data types. Secondly, the multiple training data are fused according to the first training parameter to generate fusion features corresponding to the multiple training data. Then, the fusion features are instruction-filled according to the second training parameter to generate task instructions corresponding to the first financial data prediction task. Finally, according to the third training parameter and the task instruction, the inference model is called to obtain the first prediction data corresponding to the first financial data prediction task. Thereby, according to the comparison result between the first prediction data and the actual data, the first training parameter, the second training parameter and the third training parameter are adjusted through reinforcement learning, so as to process the second financial data prediction task of the next prediction period according to the adjusted first training parameter, the second training parameter and the third training parameter to obtain the second prediction data corresponding to the second financial data prediction task.
[0010] It can be seen that, on the one hand, the present disclosure predicts the predicted data corresponding to the financial data prediction task based on the online training data, so that when predicting financial data, it can effectively combine the real-time dynamically changing training data to improve the prediction flexibility of data prediction. On the other hand, the present disclosure divides the financial data prediction process into multiple links, each link has corresponding training parameters for data processing, and finally obtains the first predicted data corresponding to the first financial data prediction task of the current prediction cycle. Accordingly, the present disclosure compares the first predicted data with the actual results and dynamically adjusts each training parameter based on reinforcement learning, so that the financial data prediction task of the next prediction cycle can be processed according to the adjusted training parameters. Therefore, the present disclosure realizes the adaptive adjustment of the training parameters of each link in the financial data prediction process through reinforcement learning, so that each training parameter can continuously adapt to real-time data changes, so as to improve the financial data prediction effect through continuous training parameter updates.
[0011] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings. In the accompanying drawings:
[0013] Figure 1 A diagram illustrating an application scenario of the data prediction method and device provided in an embodiment of the present disclosure;
[0014] Figure 2 A flowchart of a data prediction method provided in an embodiment of the present disclosure;
[0015] Figure 3 A schematic diagram of an application of a data prediction method provided by an embodiment of the present disclosure;
[0016] Figure 4 A block diagram of a data prediction device provided in an embodiment of the present disclosure;
[0017] Figure 5 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] To enable those skilled in the art to better understand the technical solutions of the present disclosure, exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0019] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0020] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0021] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. Similar words such as "connected" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0022] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined as such herein.
[0023] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution complies with relevant national laws and regulations (for example, the "Information Security Technology Personal Information Security Specification", etc.). For example: corresponding prescribed measures are taken to control access to personal information; the display of personal information is subject to prescribed restrictions; the purpose of using personal information does not exceed the scope of direct or reasonable connection; when using personal information, clear identity reference is eliminated to avoid precise positioning of specific individuals.
[0024] Related technologies for financial data forecasting primarily rely on pre-designed forecasting rules or prediction models derived through offline training. Due to the highly dynamic and complex nature of financial markets, market data often exhibits nonlinear, multi-dimensional, and highly noisy characteristics. These financial data forecasting methods are unable to effectively adapt to dynamic data changes, nor can they promptly update forecasting strategies based on actual market data changes. Consequently, they suffer from insufficient forecast accuracy and flexibility.
[0025] In view of this, an embodiment of the present disclosure provides a data prediction method. First, online training data corresponding to the first financial data prediction task of the current prediction cycle is obtained. As the name suggests, online training data is training data updated in real time, which is real-time and dynamic. The online training data includes multiple training data corresponding to multiple data types. Secondly, the multiple training data are fused according to the first training parameter to generate fusion features corresponding to the multiple training data. Then, the fusion features are instruction-filled according to the second training parameter to generate task instructions corresponding to the first financial data prediction task. Finally, according to the third training parameter and the task instruction, the inference model is called to obtain the first prediction data corresponding to the first financial data prediction task. Thus, according to the comparison result of the first prediction data and the actual data, the first training parameter, the second training parameter and the third training parameter are adjusted through reinforcement learning to process the second financial data prediction task of the next prediction cycle according to the adjusted first training parameter, the second training parameter and the third training parameter to obtain the second prediction data corresponding to the second financial data prediction task.
[0026] It can be seen that, on the one hand, the present disclosure predicts the predicted data corresponding to the financial data prediction task based on the online training data, so that when predicting financial data, it can effectively combine the real-time dynamically changing training data to improve the prediction flexibility of data prediction. On the other hand, the present disclosure divides the financial data prediction process into multiple links, each link has corresponding training parameters for data processing, and finally obtains the first predicted data corresponding to the first financial data prediction task of the current prediction cycle. Accordingly, the present disclosure compares the first predicted data with the actual results and dynamically adjusts each training parameter based on reinforcement learning, so that the financial data prediction task of the next prediction cycle can be processed according to the adjusted training parameters. Therefore, the present disclosure realizes the adaptive adjustment of the training parameters of each link in the financial data prediction process through reinforcement learning, so that each training parameter can continuously adapt to real-time data changes, so as to improve the financial data prediction effect through continuous training parameter updates.
[0027] Figure 1 This is a diagram of an application scenario of the data prediction method and device provided in an embodiment of the present disclosure.
[0028] like Figure 1 As shown, an application scenario of an embodiment of the present disclosure may include a terminal device 101, a network 103, and a server 102. The network 103 is used as a medium for providing a communication link between the terminal device 101 and the server 102. The network 103 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0029] The user can use the terminal device 101 to interact with the server 102 via the network 103 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0030] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.
[0031] The server 102 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the terminal device 101. The background management server may analyze and process received user requests and other data, and feed back the processing results (e.g., web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0032] It should be noted that the data prediction method and apparatus provided in the embodiments of the present disclosure can be executed by the server 102. Accordingly, the data prediction method and apparatus provided in the embodiments of the present disclosure can be set in the server 102. The data prediction method and apparatus provided in the embodiments of the present disclosure can also be executed by a server or server cluster that is different from the server 102 and can communicate with the terminal device 101 and / or the server 102. Accordingly, the data prediction method and apparatus provided in the embodiments of the present disclosure can also be set in a server or server cluster that is different from the server 102 and can communicate with the terminal device 101 and / or the server 102.
[0033] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0034] Figure 2 This is a flow chart of a data prediction method provided by an embodiment of the present disclosure. Figure 2 , the method comprising:
[0035] Step S210: obtaining online training data corresponding to the first financial data prediction task in the current prediction cycle, wherein the online training data includes a plurality of training data corresponding to a plurality of data types.
[0036] A prediction cycle refers to the training cycle corresponding to one iteration of the training parameter process. In other words, a prediction cycle represents one round of training parameter updates, i.e., one training round. During each prediction cycle, the training parameters used to process financial data prediction tasks are updated. Accordingly, the current prediction cycle represents the training round in which the training process is currently progressing.
[0037] It should be noted that the prediction cycle can be adaptively divided according to actual training needs, and the embodiments of the present disclosure do not limit this. For example, the prediction cycle can be divided according to preset time periods, can be divided according to the number of tasks of the processed financial data prediction tasks, and can also be divided according to the prediction time range (such as performing second-level, minute-level, and hour-level data predictions). For example, each hour is determined as a prediction cycle, and 100 financial data prediction tasks are set to be processed in one prediction cycle. Alternatively, if minute-level financial data prediction is required, the prediction cycle can be divided into minute-level time periods. In addition, the time period size of each prediction cycle and the number of tasks of the processed financial data prediction tasks may also be different.
[0038] The first financial data forecasting task refers to a financial data forecasting task that needs to be processed during the current forecasting cycle. A financial data forecasting task can be determined based on a data forecasting request initiated by a user. A financial data forecasting task is used to indicate the performance of financial data forecasts, such as predicting market trends in financial markets or the values or changing trends of financial variables (such as stock prices and exchange rates).
[0039] It should be noted that the number of tasks in the first financial data prediction task can be multiple, and the data prediction requirements corresponding to each first financial data prediction task can be different. For example, task A is used to indicate the predicted market trend, and task B is used to indicate the predicted stock price change trend. The embodiments of the present disclosure do not limit this.
[0040] The online training data corresponding to the first financial data prediction task refers to the reference data associated with the first financial data prediction task. The online training data is obtained in real time. Therefore, the online training data is real-time and dynamic.
[0041] It should be noted that the online training data needs to include multiple training data corresponding to multiple data types, each data type corresponds to a data source, and each data type can be adaptively set according to actual application needs, which is not limited in the embodiments of the present disclosure.
[0042] In one optional implementation, to improve the quality of online training data, the multiple data types include a structured data type, an unstructured data type, and an online search data type. Accordingly, the online training data includes first training data corresponding to the structured data type, second training data corresponding to the unstructured data type, and third training data corresponding to the online search data type.
[0043] The first training data corresponding to the structured data type refers to training data with a fixed format that can be logically expressed using a two-dimensional table. For example, the first training data corresponding to the structured data type can be stock data, futures data, financial report data, etc. The first training data can be obtained from public data interfaces, financial report API structures, or historical transaction data.
[0044] The second training data corresponding to unstructured data types refers to training data that lacks a fixed format and cannot be logically expressed using a two-dimensional table. For example, the second training data corresponding to unstructured data types can include financial news data, social media text data, research report data, etc. The second training data can be obtained from information sources such as news, social media, and policy announcements.
[0045] The third training data corresponding to the online search data type refers to training data obtained by online searching for the first financial data prediction task. For example, by calling a search interface, Internet search information corresponding to the first financial data prediction task is obtained.
[0046] In actual financial data prediction scenarios, by combining training data corresponding to multiple data types, we can more comprehensively capture financial market dynamics and improve the accuracy of financial data prediction.
[0047] Step S220: performing fusion processing on the multiple training data according to the first training parameter to generate fusion features corresponding to the multiple training data.
[0048] The first training parameter may also be referred to as a fusion parameter, which is used to perform fusion processing on multiple training data, that is, to construct multiple training data into a fusion feature.
[0049] The first training parameter includes a weight parameter corresponding to each training data point. The weight parameter is used to represent the weight value corresponding to each training data point. Thus, by extracting features from each training data point and weighting the feature vector corresponding to each training data point according to the weight parameter, a fused feature can be obtained.
[0050] It should be noted that when extracting features from multiple training data, a preset feature extraction algorithm can be used to obtain the feature sub-vectors corresponding to each training data. For example, natural language processing algorithms (such as BERT model, Word2Vec model, etc.) and feature engineering methods (such as word frequency statistics, part-of-speech feature fusion, etc.) can be used to convert each training data into a vector representation.
[0051] Among them, the fusion feature is obtained by fusing the feature sub-vectors corresponding to each training data, and the fusion feature can represent the effective information of each training data.
[0052] In one optional implementation, training data often contains multi-dimensional data information, thus reflecting data change trends across multiple dimensions. For example, news text data can reflect whether the market is stable, whether market sentiment is positive, and whether the financial situation is healthy. Therefore, feature extraction can be performed on the training data according to preset evaluation dimensions to obtain multiple feature sub-vectors corresponding to multiple evaluation dimensions for each training data point. Feature sub-vectors corresponding to the same evaluation dimension are then fused according to weight parameters to obtain fused features, thereby improving the granularity, accuracy, and completeness of the fused features.
[0053] In an optional implementation, the first training parameter includes a weight parameter corresponding to each training data, and multiple training data are fused according to the first training parameter to generate fusion features corresponding to the multiple training data, including: for each training data, feature extraction is performed on the training data according to a preset evaluation dimension to obtain multiple feature sub-vectors of the training data, wherein each feature sub-vector corresponds to a preset evaluation dimension; according to the weight parameter corresponding to each training data, the feature sub-vectors corresponding to the same evaluation dimension in the multiple training data are fused to generate fusion sub-features corresponding to each evaluation dimension, wherein the fusion features include the fusion sub-features corresponding to each evaluation dimension.
[0054] Preset evaluation dimensions refer to specific perspectives or standards used to measure or describe data characteristics. These dimensions are used to extract valuable information from complex training data. Preset evaluation dimensions can be adaptively configured based on the needs of financial data forecasting. For example, these dimensions may include market status, market sentiment, or financial evaluation dimensions.
[0055] It should be noted that the preset evaluation dimension may be a pre-set fixed evaluation dimension, or may be set in the first training parameter, and the first training parameter may be adjusted to achieve dynamic adjustment of the evaluation dimension.
[0056] Accordingly, the first training parameter may further include a dimension parameter indicating a dimension for extracting features from the training data. The dimension parameter is used to represent a preset evaluation dimension, such as a market status evaluation dimension, a market sentiment evaluation dimension, a financial change evaluation dimension, and the like.
[0057] When extracting features of each training data according to a preset evaluation dimension to obtain multiple feature sub-vectors of the training data, the preset first extraction method or the second extraction method can be used to extract features.
[0058] The first extraction method can also be called a rule matching method. Accordingly, feature extraction is performed on the training data according to the preset evaluation dimension to obtain multiple feature sub-vectors of the training data, which can include: extracting dimension keywords corresponding to any evaluation dimension in the training data; counting the first word number of positive type dimension keywords and the second word number of negative type dimension keywords; determining the first score corresponding to any evaluation dimension based on the first word number, and determining the second score corresponding to any evaluation dimension based on the second word number; obtaining the feature sub-vector corresponding to any evaluation dimension based on the first score and the second score.
[0059] Among them, through the first extraction method, dimension keywords related to the evaluation dimension can be extracted from the training data, and then by counting the number of positive and negative dimension keywords, the first score and the second score can be determined. The first score can also be called the positive score. The higher the score, the stronger the positive trend of the data under the evaluation dimension. The second score can also be called the negative score. The higher the score, the stronger the negative trend of the data under the evaluation dimension. Therefore, based on the first score and the second score, the characteristic sub-vector of the training data under the evaluation dimension can be obtained, thereby improving the accuracy of the characteristic sub-vector.
[0060] The second extraction method can also be called the confidence extraction method. Accordingly, feature extraction is performed on the training data according to the preset evaluation dimension to obtain multiple feature sub-vectors of the training data. It can include: for any evaluation dimension, using a preset evaluation dimension classifier to determine the confidence of the training data corresponding to any evaluation dimension; based on the confidence, obtaining the feature sub-vector corresponding to any evaluation dimension.
[0061] Among them, a corresponding evaluation dimension classifier can be trained for each evaluation dimension, such as a logistic regression model, an LSTM model, etc., so that the training data is input into the evaluation dimension classifier to obtain the confidence of the training data corresponding to the evaluation dimension, and the confidence can be used as the feature sub-vector corresponding to the evaluation dimension.
[0062] The confidence value is used to characterize the strength of the trend corresponding to the evaluation dimension. For example, for the market sentiment evaluation dimension, a confidence value greater than 0.5 indicates positive market sentiment, while a confidence value less than or equal to 0.5 indicates negative market sentiment. Furthermore, the confidence value can be used as a feature subvector of the training data under the evaluation dimension to effectively characterize the data trend of the training data under this evaluation dimension and improve the accuracy of the feature subvector.
[0063] After extracting the feature sub-vectors corresponding to each evaluation dimension, the feature sub-vectors corresponding to the same evaluation dimension in multiple training data can be fused according to the weight parameters corresponding to each training data, thereby generating fused sub-features corresponding to each evaluation dimension.
[0064] In the embodiment of the present disclosure, the first training parameter is used to set corresponding weight values for different training data, and when performing feature extraction on each training data, the corresponding feature sub-vector can be extracted according to the preset evaluation dimension, so that based on the weight parameter, the feature sub-vectors corresponding to the same evaluation dimension are fused to obtain fused features, thereby improving the generation effect of the fused features.
[0065] Step S230: performing instruction filling processing on the fusion feature according to the second training parameter to generate a task instruction corresponding to the first financial data prediction task.
[0066] The second training parameter is used to generate task instructions corresponding to the first financial data prediction task based on the fused features. Specifically, when generating the task instructions, the fused features are added to the corresponding positions in the instruction template to obtain the task instructions. The instruction template includes placeholders for descriptions of each evaluation dimension, which are used to insert descriptions of the corresponding evaluation dimension into the placeholders.
[0067] It should be noted that if different financial data forecasting tasks correspond to different forecasting requirements, a corresponding instruction template can be set for each financial data forecasting task with each forecasting requirement. In this way, the instruction template sets the data forecasting requirement corresponding to the task and the description information placeholder corresponding to the evaluation dimension.
[0068] For example, the instruction template corresponding to a financial data forecasting task with market trend forecasting requirements is: "Please predict the market trend based on the following information:
[0069] Financial report data: {Financial report description}
[0070] News summary: {news description}
[0071] Live search: {search description}"
[0072] Correspondingly, the second training parameter is a filling parameter indicating information filling. For example, the second training parameter includes information weights and / or information representation methods of the descriptive information corresponding to different evaluation dimensions in the task instruction.
[0073] The information weight of the descriptive information represents the information contribution of the descriptive information in the task instruction. The greater the information weight, the greater the contribution of the descriptive information to the task instruction and the greater its reference value for financial data forecasting. The information representation method is used to constrain the description style of the descriptive information in the task instruction, for example, its sentence complexity, sentence structure, and the number of words contained in the information.
[0074] In an optional implementation method, the fused sub-features corresponding to each evaluation dimension in the fused feature can be directly used as the descriptive information corresponding to the evaluation dimension in the task instruction. In order to improve the information representation capability of the descriptive information, the fused sub-features can be mapped to the evaluation information of the evaluation dimension. The evaluation information is used to evaluate the data performance of the corresponding evaluation dimension, which can be determined based on the characteristic value of the fused sub-feature, so that the evaluation information is used as the descriptive information corresponding to the evaluation dimension in the task instruction.
[0075] Correspondingly, the fusion feature includes multiple fusion sub-features, each fusion sub-feature corresponds to a preset evaluation dimension, and the fusion feature is instruction-filled according to the second training parameter to generate a task instruction corresponding to the first financial data prediction task, including: for each fusion sub-feature, mapping the feature value corresponding to the fusion sub-feature to the evaluation information of the evaluation dimension corresponding to the fusion sub-feature; according to the second training parameter, filling the evaluation information of each evaluation dimension into the instruction template to generate a task instruction.
[0076] The eigenvalues of the fused sub-features reflect the performance of each training data point in the corresponding evaluation dimension. For example, a higher eigenvalue indicates a better data trend in the corresponding evaluation dimension. Therefore, the eigenvalues of the fused sub-features can be mapped to evaluation information for the evaluation dimension corresponding to the fused sub-features.
[0077] Thus, based on the second training parameter, the evaluation information obtained by fusing the sub-feature maps can be filled into the instruction template to generate the task instruction. Accordingly, in this case, the second training parameter is used to determine the information weight and / or information representation method corresponding to the evaluation information in the task instruction.
[0078] Among them, the information weight corresponding to the evaluation information is used to characterize the information contribution of the evaluation information in the task instruction. The higher the information weight, the higher the information contribution. The information representation method corresponding to the evaluation information is used to characterize the information description style of the evaluation information in the task instruction. For example, the information representation method is used to adjust the sentence structure, word formality, grammatical complexity, etc. corresponding to the evaluation information. Exemplarily, the second training parameter is set to a higher word formality, a sentence text length of less than 25 words, and a number of clauses of less than 3, so that the words in the evaluation information are domain-specific terms and the grammatical complexity of the evaluation information is low.
[0079] Therefore, the evaluation information can be further processed according to the second training parameter, and the processed evaluation information can be filled into the corresponding instruction template.
[0080] For example, a task instruction corresponding to a financial data forecasting task with a market trend forecasting requirement is: "Please forecast the market trend based on the following information:
[0081] Financial report data: The latest financial report shows a solid financial situation
[0082] News Summary: Overall news sentiment is positive
[0083] Real-time Search: Latest search results indicate positive market dynamics.”
[0084] In one optional implementation, a data mapping relationship can be constructed for each evaluation dimension, between the eigenvalue and the evaluation information for that evaluation dimension. This data mapping relationship can then be queried based on the eigenvalue of the fused sub-feature to obtain the evaluation information for that evaluation dimension. For example, if the eigenvalue is 0.6, the evaluation information for the market sentiment evaluation dimension indicates a positive market sentiment.
[0085] It should be noted that, in order to improve the mapping accuracy of evaluation information, for each evaluation dimension, multiple eigenvalue intervals can be set for its adaptability, thereby setting corresponding evaluation information for each eigenvalue interval. For example, for the market dynamics evaluation dimension, an eigenvalue interval of (0, 0.4) indicates a negative market dynamics, an eigenvalue interval of (0.4, 0.6) indicates a relatively stable market dynamics, and an eigenvalue interval of (0.6, 1) indicates a positive market dynamics.
[0086] Correspondingly, the eigenvalue corresponding to the fusion sub-feature is mapped to the evaluation information of the evaluation dimension corresponding to the fusion sub-feature, including: determining multiple eigenvalue intervals of the evaluation dimension corresponding to the fusion sub-feature; comparing the eigenvalue corresponding to the fusion sub-feature with the multiple eigenvalue intervals, and determining the target eigenvalue interval that matches the fusion sub-feature based on the comparison result; querying the evaluation information corresponding to the target eigenvalue interval to obtain the evaluation information corresponding to the preset evaluation dimension corresponding to the fusion sub-feature.
[0087] Different evaluation dimensions may have different corresponding eigenvalue intervals. For example, for the market dynamics evaluation dimension, the eigenvalue interval (0.8, 1) corresponds to positive market dynamics, while for the market sentiment evaluation dimension, the eigenvalue interval (0.7, 1) corresponds to positive market sentiment.
[0088] Therefore, for any fused sub-feature, by comparing its eigenvalue with the eigenvalue interval of its corresponding evaluation dimension, we can determine the eigenvalue interval in which the eigenvalue falls. This eigenvalue interval is the target eigenvalue interval that matches the fused sub-feature. Furthermore, by querying the evaluation information corresponding to the target eigenvalue interval, we can obtain the evaluation information of the evaluation dimension corresponding to the fused sub-feature.
[0089] In the disclosed embodiments, multiple eigenvalue intervals are set for each evaluation dimension, and corresponding evaluation information is set for each eigenvalue interval. This allows rapid access to evaluation information corresponding to fused sub-features simply by matching the intervals, converting the eigenvalues into intuitive, easy-to-read natural language descriptions. This mapping approach reduces subjective bias and facilitates adaptive adjustment of evaluation information. For example, simply modifying the interval boundaries of the eigenvalue intervals allows dynamic adjustment of the evaluation information corresponding to the eigenvalue.
[0090] Step S240: calling the inference model according to the third training parameter and the task instruction to obtain first prediction data corresponding to the first financial data prediction task.
[0091] The third training parameter is used to instruct the inference model on how to reason about the data in the task instructions. For example, the third training parameter includes a temperature parameter, which is used to control the randomness of the data reasoning. When the temperature parameter is low, the data reasoning method is more deterministic, which can improve the consistency of the wording and make the data expression generated during the reasoning process more rigorous. When the temperature parameter is high, the data reasoning method is more random, which can generate more flexible expressions.
[0092] For another example, the third training parameter includes a sampling parameter, which is used to constrain vocabulary selection during data inference, for example, to determine the vocabulary probability of each evaluation information and select the target vocabulary from the vocabulary with the highest probability.
[0093] For example, the third training parameter includes a generation length parameter, which is used to constrain the maximum length of text sequences processed and / or generated by the inference model. By limiting the input length of the text, the inference model is prevented from performing data reasoning based on overly long text, which could lead to model memory overflow. By limiting the output length of the text, the model is prevented from excessively reasoning about task instructions.
[0094] The third training parameter can be used to determine the data inference method corresponding to the inference model. The task instruction is then input into the inference model, allowing the inference model to obtain first prediction data based on the data inference method. The first prediction data is the prediction result output by the inference model for the first financial data prediction task, such as predicted market trend data.
[0095] Among them, the inference model can be any preset large language model, such as a GPT model, and the embodiments of the present disclosure are not limited to this.
[0096] In an optional implementation, the inference model is called according to the third training parameter and the task instruction, including: determining the data inference method corresponding to the inference model according to the third training parameter, wherein the third training parameter includes at least one of a temperature parameter, a generation length parameter, and a sampling parameter; inputting the task instruction into the inference model so that the inference model obtains the first prediction data corresponding to the first financial data prediction task according to the data inference method.
[0097] Among them, the temperature parameter, generation length parameter, and sampling parameter can be referred to the description above and will not be repeated here. Accordingly, when the third training parameter includes the temperature parameter, determining the data inference method corresponding to the inference model based on the third training parameter includes: determining the data random tendency of the first prediction data generated by the inference model according to the task instruction based on the temperature parameter. When the temperature parameter is low, it indicates that the lower the data random tendency, the more rigorous the data expression of the first prediction data generated.
[0098] When the third training parameter includes a generation length parameter, determining the data inference method corresponding to the inference model based on the third training parameter includes: determining, based on the generation length parameter, the instruction length of the task instruction processed by the inference model and / or the data length of the first prediction data generated. A larger generation length parameter indicates a longer instruction length of the task instruction processed at a time, a longer data length of the first prediction data that can be generated, and thus more inference resources of the inference model are consumed.
[0099] When the third training parameter includes a sampling parameter, determining a data inference method corresponding to the inference model based on the third training parameter includes determining, based on the sampling parameter, a vocabulary selection method for important vocabulary in the task instruction when the inference model processes the task instruction. For example, important vocabulary may be selected from a preset number of vocabulary words with the highest probability, thereby improving the rationality of vocabulary selection and thereby improving the accuracy of data inference performed by the inference model based on the vocabulary.
[0100] Correspondingly, after the data inference method of the inference model is determined according to the third training parameter, the task instruction is input into the inference model so that the inference model can process the task instruction according to the data inference method, thereby obtaining the first prediction data.
[0101] In the embodiment of the present disclosure, the data inference method of the inference model is determined through the third training parameter, so that the inference model can adapt to the inference requirements of the task instructions, and then the output prediction data follows the changes of the third training parameter, and can dynamically balance between randomness and certainty, diversity and accuracy, so as to improve the prediction effect of the prediction data.
[0102] Step S250: Based on the comparison result between the first predicted data and the actual data, the first training parameters, the second training parameters and the third training parameters are adjusted through reinforcement learning, and the second financial data prediction task of the next prediction cycle is processed according to the adjusted first training parameters, the second training parameters and the third training parameters to obtain the second prediction data corresponding to the second financial data prediction task.
[0103] The actual data refers to the real data corresponding to the first financial data prediction task. For example, if the prediction requirement of the first financial data prediction task is to predict the stock price 5 minutes later, then the actual data is the actual stock price 5 minutes later.
[0104] Accordingly, after obtaining the first predicted data, the predicted data can be stored first, so that the corresponding actual data can be obtained at a preset time, and then the first predicted data can be compared with the actual data, for example, the data difference between the two can be calculated to obtain the prediction error. Assuming that the first predicted data is P and the actual data is A, the prediction error is defined as:
[0105] error=|PA|
[0106] Thus, by determining the loss function corresponding to the reinforcement learning based on the comparison result between the first predicted data and the actual data, and then optimizing the reinforcement learning network based on the loss function to adjust the first training parameter, the second training parameter, and the third training parameter.
[0107] Accordingly, the second financial data prediction task for the next prediction cycle can be processed based on the first, second, and third training parameters. The second financial data prediction task, i.e., the financial data prediction task to be processed for the next prediction cycle, comprises continuing to execute steps S210 to S250 to obtain second prediction data and continuing to adjust the first, second, and third training parameters.
[0108] That is, the current prediction cycle is the i-th prediction cycle, and the first training parameter, second training parameter, and third training parameter are the first training parameter, second training parameter, and third training parameter obtained after parameter adjustment for the i-1-th prediction cycle. In the i-th prediction cycle, by adjusting each training parameter, the adjusted first training parameter, second training parameter, and third training parameter corresponding to the i-th prediction cycle are obtained. The adjusted first training parameter, second training parameter, and third training parameter corresponding to the i-th prediction cycle are used to process the financial data prediction task for the i+1-th prediction cycle, i.e., the next prediction cycle. Thus, by adjusting each training parameter in each prediction cycle, the training parameters can continuously adapt to the dynamic changes of the data, thereby improving the accuracy of financial data prediction.
[0109] On the one hand, the embodiment of the present disclosure predicts the predicted data corresponding to the financial data prediction task based on online training data, so that when predicting financial data, it can effectively combine the real-time dynamically changing training data to improve the prediction flexibility of data prediction. On the other hand, the embodiment of the present disclosure divides the financial data prediction process into multiple links, each link has corresponding training parameters for data processing, and finally obtains the first predicted data corresponding to the first financial data prediction task of the current prediction cycle. Accordingly, the embodiment of the present disclosure compares the first predicted data with the actual results and dynamically adjusts each training parameter based on reinforcement learning, so that the financial data prediction task of the next prediction cycle can be processed according to the adjusted training parameters. Therefore, the present disclosure realizes the adaptive adjustment of the training parameters of each link in the financial data prediction process through reinforcement learning, so that each training parameter can continuously adapt to real-time data changes, so as to improve the financial data prediction effect through continuous training parameter updates.
[0110] In an optional implementation, based on the comparison result of the first predicted data and the actual data, the first training parameter, the second training parameter and the third training parameter are adjusted through reinforcement learning, including: taking the first training parameter, the second training parameter and the third training parameter as state information; obtaining a first adjustment action corresponding to the state information according to the reinforcement learning network; determining a loss function corresponding to the reinforcement learning network according to the first adjustment action and the comparison result of the first predicted data and the actual data; updating the reinforcement learning network according to the loss function, determining a second adjustment action corresponding to the state information according to the updated reinforcement learning network, and obtaining the adjusted first training parameter, second training parameter and third training parameter.
[0111] The reinforcement learning network may be any preset reinforcement learning algorithm, such as a policy gradient algorithm, an actor-critic algorithm, etc., and the embodiments of the present disclosure do not limit this.
[0112] State information refers to the current state of the interactive environment, which serves as the basis for the reinforcement learning network's decision-making. By using each training parameter as state information, the reinforcement learning network can determine an adjustment action, or first adjustment action, based on this state information. The first adjustment action represents the parameter adjustment strategy for each training parameter, such as increasing or decreasing the parameter value. If the state of the environment at time t is st, the next state st+1 depends on st and the current adjustment action at.
[0113] Exemplarily, state information (State): includes a first training parameter (the weight θ of each training data), a second training parameter (such as the weight of the evaluation information corresponding to each evaluation dimension, the information description style) and a third training parameter (such as the temperature parameter T, the generation length parameter, i.e., the maximum number of tokens M).
[0114] The adjustment action (Action) is used to adjust the training parameters, such as modifying the weight θ or adjusting the temperature parameter ΔT.
[0115] Correspondingly, reinforcement learning networks such as policy networks output action probability distributions based on the state, select an adjustment action, and update the training parameters:
[0116] θ new =θ old +Δθ
[0117] T new =T old +ΔT
[0118] Furthermore, a loss function corresponding to the reinforcement learning network is generated based on the first adjustment action and the comparison result between the first predicted data and the actual data. By minimizing the loss function, the network parameters of the reinforcement learning network are updated, so that the updated reinforcement learning network can determine the optimal adjustment action for each training parameter, i.e., the second adjustment action, and then adjust the training parameters according to the second adjustment action.
[0119] In the disclosed embodiment, each training parameter is used as state information, and then the adjustment action of the state information is determined based on the reinforcement learning network. The reinforcement learning network is updated according to the adjustment action and the comparison result between the predicted data and the actual data, so that the updated reinforcement learning network can determine the final adjustment action of the training parameters, and then obtain the adjusted training parameters. There is no need to explicitly define the supervision signal in the intermediate step. Only the goal-oriented loss function needs to be set to allow the model to autonomously explore the optimal parameter adjustment strategy, thereby realizing online adaptive update of the training parameters and effectively adapting to dynamic environmental changes.
[0120] In an optional implementation, a loss function corresponding to the reinforcement learning network is generated based on the first adjustment action and the comparison result between the first predicted data and the actual data, including: generating a reward function of the reinforcement learning network based on the comparison result between the first predicted data and the actual data; determining to generate a loss function corresponding to the reinforcement learning network based on the reward function of the reinforcement learning network and the action selection probability corresponding to the first adjustment action.
[0121] It should be noted that the comparison result between the first predicted data and the actual data is used to represent the prediction error of the first predicted data. Therefore, when generating the reward function of the reinforcement learning network, the smaller the prediction error, the larger the reward function value. Therefore, the reward function R can be designed as:
[0122] R=1 / (error+∈)
[0123] Where ∈ is a small constant to prevent division by zero (e.g. ∈ = 1×10 -5 ),error is the prediction error.
[0124] Furthermore, a loss function can be generated based on the reward function R and the action selection probability corresponding to the first adjustment action. For example, using the policy gradient algorithm, the loss function is:
[0125] L=-logπ(a|s)×R
[0126] Among them, π(a|s) represents the probability of selecting the first adjustment action a under the state information s, and R is the reward function. Therefore, the reinforcement learning network can be updated through the loss function, so that the probability of action selection corresponding to the optimal action becomes larger, so that the updated reinforcement learning network can determine the optimal parameter adjustment action, and then based on the updated reinforcement learning network, the optimal adjustment value of each training parameter is obtained to ensure that a better training parameter configuration is adopted in the next prediction cycle.
[0127] It should be noted that the method of generating the loss function corresponding to the reinforcement learning network based on the reward function of the reinforcement learning network and the action selection probability corresponding to the first adjustment action can be determined according to the adaptability of the selected reinforcement learning network, and the embodiments of the present disclosure do not limit this.
[0128] In the disclosed embodiment, the probability of selecting the action for parameter adjustment and the reward function constructed based on the comparison result are used together to construct a loss function, thereby converting environmental feedback into the optimization direction of the parameter adjustment action, avoiding optimization oscillations caused by the dynamic changes of the reward target with the reinforcement learning network parameters, making the update process of the reinforcement learning network more stable, improving the update effect of the reinforcement learning network, and further improving the strategy selection effect of the parameter adjustment strategy.
[0129] In an optional implementation, corresponding summary information can be generated from the original multiple training data, and the summary information and task instructions can be input into the reasoning model, so that the reasoning model can perform data reasoning based on both the summary information and the task instructions, thereby improving the prediction accuracy of the predicted data.
[0130] Correspondingly, the task instructions are input into the inference model, including: generating summary information corresponding to multiple training data; inputting the summary information and the task instructions into the inference model, so that the inference model performs inference based on the summary information and the task instructions to obtain the first prediction data corresponding to the first financial data prediction task.
[0131] Specifically, a preset information extraction model can be used to extract key information from multiple training data to obtain summary information corresponding to the multiple training data. Thus, by inputting the summary information and task instructions into the inference model, the inference model can perform data inference based on the data content in the summary information and task instructions to obtain the first predicted data.
[0132] To facilitate understanding, the following describes the specific implementation details of the above embodiment using a specific example:
[0133] In recent years, with the rapid development of artificial intelligence (AI), large language models (LLMs) and reinforcement learning (RL) have been increasingly applied across various fields, particularly in the financial industry. Existing financial data forecasting systems are gradually transitioning from traditional statistical models to intelligent forecasting based on deep learning and natural language processing. These large models leverage comprehensive analysis of multi-dimensional information, including historical data, real-time news, and financial reports, to intelligently assist in market trends, risk warnings, and investment decisions. Simultaneously, real-time search technology and data capture methods have continued to improve, providing a timely and high-quality source of information for financial data forecasting.
[0134] Although large models and reinforcement learning techniques have brought unprecedented potential to financial forecasting, many problems still exist in practical applications. First, financial markets are inherently highly dynamic and complex, and market information is often nonlinear, multidimensional, and noisy, which poses huge challenges to data preprocessing and feature extraction. Second, when integrating structured and unstructured data, current systems often have difficulty capturing the deep connections between various information sources, resulting in large deviations in forecast results. In addition, existing models lack real-time feedback mechanisms for parameter tuning and adaptive adjustment, making it impossible to update forecasting strategies in a timely manner based on actual market changes, resulting in accumulated forecast errors and insufficient model robustness. Therefore, how to achieve efficient fusion and real-time dynamic adjustment of multimodal data while ensuring data timeliness has become a key problem that needs to be solved urgently.
[0135] Currently, to address the problems existing in financial data forecasting, current financial data forecasting methods generally rely on pre-designed rules and offline training, lacking the ability to provide real-time feedback and adaptive adjustments. This makes it difficult to respond to drastic market fluctuations in a short period of time. Overall forecasting accuracy and flexibility are still insufficient, and their main shortcomings are reflected in the following three aspects:
[0136] 1. Insufficient real-time feedback and adaptive capabilities: Existing methods mostly rely on offline training and fixed rules. They lack a mechanism for real-time feedback based on actual market data and are unable to respond quickly to drastic market fluctuations.
[0137] 2. Reliance on manually designed rules and feature engineering: Currently commonly used methods require manually designed features, preset weights, and thresholds to correct prediction results. This method lacks flexibility and is easily affected by subjective factors and rule limitations.
[0138] 3. Model updates lack a dynamic tuning mechanism: The existing model structure is fixed and the update cycle is long, making it difficult to make instant parameter adjustments based on real-time data and prediction errors, resulting in insufficient overall prediction accuracy and robustness.
[0139] With this in mind, this example proposes a data forecasting method. This method leverages real-time search technology to automatically capture the latest market news, financial reports, and other real-time information. It then deeply integrates structured and unstructured data through a multimodal data fusion engine, thereby constructing a more comprehensive and dynamic description of market conditions. Furthermore, after each forecast cycle, this method uses a reward function and reinforcement learning algorithm to adjust training parameters in real time based on the error between the forecasted data and actual market data. This closed-loop feedback mechanism enables the system to rapidly adjust its forecasting strategy in response to changing market conditions, significantly improving forecast accuracy while also enhancing the system's robustness and adaptability.
[0140] Compared to traditional methods, this example uses automatic learning and continuous optimization to break away from the reliance on preset fixed rules, demonstrating greater flexibility and continuous improvement capabilities, providing a new solution for financial forecasting. The main innovations of this solution include:
[0141] 1. Multimodal data fusion: Automatically collect market news, financial reports, and other information through real-time search technology, and use a multimodal data fusion engine to deeply integrate structured and unstructured data to build a comprehensive description of market status.
[0142] 2. Adaptive parameter adjustment mechanism: After each forecast cycle, based on the forecast error feedback, the reinforcement learning algorithm is used to adjust the training parameters in real time to ensure that the system can quickly adapt to different market environments.
[0143] 3. Automated learning and optimization: The system automatically updates prediction strategies through reinforcement learning algorithms, eliminating reliance on manually designed rules, improving prediction accuracy and flexibility, and achieving continuous improvement.
[0144] This solution addresses the shortcomings of current financial data forecasting systems in terms of real-time feedback, adaptive tuning, and data fusion. It automatically captures the latest market information and uses multimodal data fusion to build a comprehensive description of market status. At the same time, it uses reinforcement learning to achieve real-time adjustment of training parameters, thereby significantly improving forecast accuracy and system robustness.
[0145] Specifically, Figure 3This is a schematic diagram of the application of the data prediction method in this example, refer to Figure 3 The figure shows a financial forecasting system based on large-scale real-time search, reinforcement learning error feedback, multimodal data fusion, and adaptive parameter adjustment. The system aims to integrate structured data (such as financial reports and historical transaction data) and unstructured data (such as news, social media, and real-time search information) in real time, using large models for trend inference. It also uses reinforcement learning to optimize parameters and dynamic prompt generation strategies in real time, thereby continuously improving forecast accuracy and system robustness. The entire system adopts a microservices architecture and consists of the following main layers and modules:
[0146] 1. User layer: The user front end (web / mobile) is used to initiate prediction requests, provide real-time feedback, and view prediction results.
[0147] 2. API interface layer: It provides RESTful API and WebSocket real-time communication interface to realize user request forwarding, data query, prediction call and result feedback.
[0148] 3. Data collection layer, which includes: Structured data collection module: used to regularly capture structured data from public data interfaces, financial report APIs, and historical transaction data, that is, structured type training data. Unstructured data capture module: used to use crawler technology to obtain unstructured data such as news, social media, and policy announcements, that is, unstructured type training data. Real-time search API call module: used to use the large model's built-in or external search interface to obtain the latest Internet information, that is, online search type training data. Data storage and caching module: used to store historical data through PostgreSQL and use Redis to provide high-speed caching support.
[0149] 4. The data processing layer is primarily responsible for: Data cleaning and preprocessing: De-noising, format standardization, and deduplication of collected raw training data. Multimodal data fusion: Based on the first training parameters, structured and unstructured training data are deeply integrated to extract multimodal fusion features and construct a comprehensive description of market conditions. Feature extraction and vectorization: Using NLP models and feature engineering methods, text and numerical data are converted into vector form for subsequent model use.
[0150] Specifically, the data processing layer cleans and standardizes each data source, and then uses feature extraction algorithms to convert text data into vector representations. For example: for structured data: after feature engineering processing, vector F s ; Unstructured data (news, social media): vector F is obtained through feature extraction u ; Real-time search information: vector F is obtained after abstract extraction rThen, multimodal data fusion is performed on the extracted vectors to obtain the fusion feature F, whose weighted formula is as follows:
[0151] F=αF s +βF u +γF r , α+β+γ=1
[0152] Among them, α, β, and γ are the weight coefficients of structured, unstructured, and real-time search information, respectively, which can be dynamically adjusted according to historical data and model feedback. For example:
[0153] After processing the structured data of a certain stock, we get the vector F s =[0.8,0.6,0.7]
[0154] The news text is extracted by the NLP model to obtain the vector F u =[0.4,0.9,0.5]
[0155] After processing the summary information returned by the real-time search, the vector Fr = [0.7, 0.3, 0.8] is obtained.
[0156] Set the weights to: α = 0.5, β = 0.3, γ = 0.2, then the fused vector after fusion is:
[0157] F=0.5×[0.8,0.6,0.7]+0.3×[0.4,0.9,0.5]+0.2×[0.7,0.3,0.8]
[0158] Among them, the calculation components are: First dimension: 0.5×0.8+0.3×0.4+0.2×0.7=0.4+0.12+0.14=0.66
[0159] Second dimension: 0.5 × 0.6 + 0.3 × 0.9 + 0.2 × 0.3 = 0.3 + 0.27 + 0.06 = 0.63
[0160] The third dimension: 0.5 × 0.7 + 0.3 × 0.5 + 0.2 × 0.8 = 0.35 + 0.15 + 0.16 = 0.66
[0161] The final fused overall feature vector is F = [0.66, 0.63, 0.66].
[0162] 5. Model prediction layer, mainly including: Dynamic Prompt Generation Module: Based on the fused multimodal data, i.e., fused features and the second training parameters, it automatically generates task instructions, i.e., prediction prompts, and appends the latest information obtained by real-time search. Large Model Inference Module: Used to call the deployed LLM model (such as GPT-4) for predictive reasoning based on the third training parameters, and output analysis results such as financial market trends and risk warnings. Real-time Search Information Integration Module: Used to filter and summarize the information returned by the search interface, integrate it with the basic prompt, and provide the model with the latest background information.
[0163] The dynamic prompt generation module is mainly responsible for automatically generating input text, i.e., task instructions, for the large model based on the fused multimodal data and the information obtained from real-time search. Its architecture mainly includes:
[0164] 1) Data input layer: receives the fusion features and various raw data summaries output by the fusion module.
[0165] 2) Template management layer: stores predefined prompt templates, which contain placeholders for inserting various data descriptions.
[0166] 3) Mapping and decoding layer: Map the numerical fused feature vector into a natural language description using a table lookup mapping method.
[0167] For example, for the fusion vector F = [0.66, 0.63, 0.66], it is converted into a natural language description. The table lookup mapping example is: if the first component is greater than 0.65, it is mapped to "the latest financial report shows a solid financial situation"; if the second component is close to 0.63, it is mapped to "the overall news sentiment is positive"; the third component 0.66 corresponds to "real-time search results show positive market dynamics."
[0168] 4) Dynamic adjustment layer: Dynamically adjust the description content and weight of each part of the template based on real-time feedback and reinforcement learning tuning results.
[0169] 5) Output layer: Generates the final Prompt instruction text for the large model to use for reasoning.
[0170] 6. Reinforcement learning optimization layer, mainly including: Prediction error calculation module: compares the predicted data with the actual market data and calculates the error (such as absolute error or mean square error). Reward function design: designs the reward function based on the error, so that the smaller the error, the higher the reward, and the larger the error, the more punishment. RL strategy adjustment module: uses RL algorithms such as policy gradient and Actor-Critic to adjust the prediction strategy online, and automatically optimizes the first training parameters, second training parameters, and third training parameters such as Prompt generation parameters and LLM call parameters. Adaptive parameter tuning module: updates each training parameter in real time based on RL feedback, so that the system can dynamically adapt to market changes.
[0171] In the reinforcement learning optimization layer, if the subsequent actual market situation deviates from the prediction, it will analyze the error and adjust the training parameters (for example, increasing the weight of the news description or changing the description wording) to optimize the prompt generation strategy for the next round.
[0172] For example, assuming that in a certain prediction period: the predicted stock increase P = 5%, the actual increase A = 2%, then the calculation error: error = |5%-2% | = 3%, and the reward value calculation (assuming ∈ = 0.001): R = 1 / (error+∈)≈32.26.
[0173] Furthermore, the current state information s contains the current Prompt parameter θ and temperature T = 0.7, so the policy network outputs an action, suggesting to reduce the weight of the structured data by 0.05 and adjust the temperature to T = 0.65. The new parameter update is:
[0174] θ new =θ old -0.05, T new =0.65
[0175] The policy network calculates the loss based on the current reward R and action probability π(a|s) and backpropagates the updated parameters, so that in the next prediction cycle, the system can more accurately generate prompts and model call parameters, i.e., training parameters, that are in line with the actual market situation.
[0176] 7. Data storage and log monitoring layer, mainly including:
[0177] Historical data database: used to store all collected raw training data, processed training data, and prediction history (such as PostgreSQL).
[0178] Cache and index system: Use Redis to cache hot data and provide fast query support.
[0179] Log and monitoring system: Use ELK, Prometheus, Grafana, etc. to provide real-time monitoring and alarms for system operation, prediction logs, and RL training processes.
[0180] This example integrates large-scale real-time search, reinforcement learning error feedback, multimodal data fusion, and adaptive parameter adjustment mechanisms to achieve intelligent and dynamic optimization of the financial data forecasting system across data collection, processing, and decision support, significantly improving the overall forecasting accuracy and robustness of the system. The system utilizes real-time search technology to automatically capture multiple sources of data, including the latest market news, financial reports, and social media. Through efficient multimodal data fusion technology, it deeply integrates structured data with unstructured information to construct a comprehensive and dynamic description of market conditions. Furthermore, a closed-loop feedback tuning mechanism based on reinforcement learning enables rapid parameter adjustments and prompt generation strategy optimization based on forecast errors after each forecast cycle, enabling rapid adaptation and continuous improvement in the face of volatile market conditions.
[0181] It is understood that the above-mentioned various method embodiments mentioned in this disclosure can be combined with each other to form combined embodiments without violating the principle logic. Due to space limitations, this disclosure will not go into details. It is understood by those skilled in the art that in the above-mentioned methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.
[0182] In addition, the present disclosure also provides a data prediction device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any data prediction method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method section and will not be repeated here.
[0183] Figure 4 A block diagram of a data prediction device provided in an embodiment of the present disclosure.
[0184] Reference Figure 4 , an embodiment of the present disclosure provides a data prediction device, the data prediction device comprising:
[0185] An acquisition module 41 is configured to acquire online training data corresponding to a first financial data prediction task in a current prediction cycle, wherein the online training data includes a plurality of training data corresponding to a plurality of data types;
[0186] A fusion module 42 is configured to perform fusion processing on the plurality of training data according to a first training parameter to generate fusion features corresponding to the plurality of training data;
[0187] A generating module 43 is configured to perform instruction filling processing on the fusion feature according to the second training parameter to generate a task instruction corresponding to the first financial data prediction task;
[0188] A prediction module 44 is configured to call an inference model based on the third training parameter and the task instruction to obtain first prediction data corresponding to the first financial data prediction task;
[0189] An adjustment module 45 is configured to adjust the first training parameter, the second training parameter, and the third training parameter through reinforcement learning based on a comparison result between the first predicted data and the actual data, and to process the second financial data prediction task of the next prediction cycle based on the adjusted first training parameter, the second training parameter, and the third training parameter to obtain second prediction data corresponding to the second financial data prediction task.
[0190] In an optional implementation, the fused feature includes multiple fused sub-features, each fused sub-feature corresponds to a preset evaluation dimension, and the instruction filling processing is performed on the fused feature according to the second training parameter to generate a task instruction corresponding to the first financial data prediction task, including:
[0191] For each fused sub-feature, mapping the feature value corresponding to the fused sub-feature to evaluation information of the evaluation dimension corresponding to the fused sub-feature;
[0192] According to the second training parameter, the evaluation information of each evaluation dimension is filled into the instruction template to generate the task instruction, wherein the second training parameter is used to determine the information weight and / or information representation method corresponding to the evaluation information in the task instruction.
[0193] In an optional implementation, mapping the feature value corresponding to the fused sub-feature to evaluation information of the evaluation dimension corresponding to the fused sub-feature includes:
[0194] Determining multiple feature value intervals of the evaluation dimension corresponding to the fusion sub-features;
[0195] Comparing the feature value corresponding to the fused sub-feature with the multiple feature value intervals, and determining a target feature value interval that matches the fused sub-feature based on the comparison result;
[0196] The evaluation information corresponding to the target feature value interval is queried to obtain the evaluation information of the evaluation dimension corresponding to the fusion sub-feature.
[0197] In an optional implementation, the first training parameter includes a weight parameter corresponding to each training data, and fusing the multiple training data according to the first training parameter to generate fused features corresponding to the multiple training data includes:
[0198] For each training data, feature extraction is performed on the training data according to the preset evaluation dimension to obtain multiple feature sub-vectors of the training data, wherein each feature sub-vector corresponds to a preset evaluation dimension;
[0199] According to the weight parameters corresponding to each training data, the feature sub-vectors corresponding to the same evaluation dimension in the multiple training data are fused to generate fused sub-features corresponding to each evaluation dimension, wherein the fused features include the fused sub-features corresponding to each evaluation dimension.
[0200] In an optional implementation, adjusting the first training parameter, the second training parameter, and the third training parameter through reinforcement learning according to a comparison result between the first predicted data and the actual data includes:
[0201] using the first training parameter, the second training parameter, and the third training parameter as state information;
[0202] Obtaining a first adjustment action corresponding to the state information according to a reinforcement learning network;
[0203] generating a loss function corresponding to the reinforcement learning network according to the first adjustment action and a comparison result between the first predicted data and the actual data;
[0204] The reinforcement learning network is updated according to the loss function, and a second adjustment action corresponding to the state information is determined according to the updated reinforcement learning network to obtain adjusted first training parameters, second training parameters, and third training parameters.
[0205] In an optional implementation, generating a loss function corresponding to the reinforcement learning network according to the first adjustment action and a comparison result between the first predicted data and the actual data includes:
[0206] Determining a reward function of the reinforcement learning network based on a comparison result between the first predicted data and the actual data;
[0207] A loss function corresponding to the reinforcement learning network is generated according to the reward function of the reinforcement learning network and the action selection probability corresponding to the first adjustment action.
[0208] In an optional implementation, calling the inference model according to the third training parameter and the task instruction includes:
[0209] Determining a data inference mode corresponding to the inference model according to the third training parameter, wherein the third training parameter includes at least one of a temperature parameter, a generation length parameter, and a sampling parameter;
[0210] The task instruction is input into the reasoning model so that the reasoning model obtains the first prediction data corresponding to the first financial data prediction task according to the data reasoning method.
[0211] Each module in the above-mentioned data prediction device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0212] Figure 5 A block diagram of an electronic device provided in an embodiment of the present disclosure.
[0213] Reference Figure 5 An embodiment of the present disclosure provides an electronic device, which includes: at least one processor 501; at least one memory 502, and one or more I / O interfaces 503, connected between the processor 501 and the memory 502; wherein the memory 502 stores one or more computer programs that can be executed by the at least one processor 501, and the one or more computer programs are executed by the at least one processor 501 to enable the at least one processor 501 to perform the above-mentioned data prediction method.
[0214] Each module in the above-mentioned electronic device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0215] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned data prediction method when executed by a processor. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0216] An embodiment of the present disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned data prediction method.
[0217] It will be understood by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all 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 may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium).
[0218] As is well known to those skilled in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc 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, as is well known to those skilled in the art, communication media typically contains computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0219] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0220] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0221] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0222] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.
[0223] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0224] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0225] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the prescribed function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0226] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A data prediction method, characterized in that: include: Acquire online training data corresponding to a first financial data prediction task in a current prediction period, wherein the online training data includes a plurality of training data corresponding to a plurality of data types; Performing fusion processing on the multiple training data according to the first training parameter to generate fusion features corresponding to the multiple training data; Performing instruction filling processing on the fusion feature according to the second training parameter to generate a task instruction corresponding to the first financial data prediction task; Invoking the inference model according to the third training parameter and the task instruction to obtain first prediction data corresponding to the first financial data prediction task; Based on the comparison result between the first predicted data and the actual data, the first training parameters, the second training parameters and the third training parameters are adjusted through reinforcement learning. Based on the adjusted first training parameters, the second training parameters and the third training parameters, the second financial data prediction task of the next prediction cycle is processed to obtain second prediction data corresponding to the second financial data prediction task.
2. The method according to claim 1, characterized in that The fused feature includes a plurality of fused sub-features, each fused sub-feature corresponds to a preset evaluation dimension, and the instruction filling processing is performed on the fused feature according to the second training parameter to generate a task instruction corresponding to the first financial data prediction task, including: For each fused sub-feature, mapping the feature value corresponding to the fused sub-feature to evaluation information of the evaluation dimension corresponding to the fused sub-feature; According to the second training parameter, the evaluation information of each evaluation dimension is filled into the instruction template to generate the task instruction, wherein the second training parameter is used to determine the information weight and / or information representation method corresponding to the evaluation information in the task instruction.
3. The method according to claim 2, characterized in that Mapping the feature value corresponding to the fused sub-feature to evaluation information of the evaluation dimension corresponding to the fused sub-feature includes: Determining multiple feature value intervals of the evaluation dimension corresponding to the fusion sub-features; Comparing the feature value corresponding to the fused sub-feature with the multiple feature value intervals, and determining a target feature value interval that matches the fused sub-feature based on the comparison result; The evaluation information corresponding to the target feature value interval is queried to obtain the evaluation information of the evaluation dimension corresponding to the fusion sub-feature.
4. The method according to claim 2, characterized in that The first training parameter includes a weight parameter corresponding to each training data, and the fusing process of the plurality of training data according to the first training parameter to generate fusion features corresponding to the plurality of training data includes: For each training data, feature extraction is performed on the training data according to the preset evaluation dimension to obtain multiple feature sub-vectors of the training data, wherein each feature sub-vector corresponds to a preset evaluation dimension; According to the weight parameters corresponding to each training data, the feature sub-vectors corresponding to the same evaluation dimension in the multiple training data are fused to generate fused sub-features corresponding to each evaluation dimension, wherein the fused features include the fused sub-features corresponding to each evaluation dimension.
5. The method according to any one of claims 1 to 4, characterized in that The adjusting the first training parameter, the second training parameter, and the third training parameter by reinforcement learning according to the comparison result between the first predicted data and the actual data includes: using the first training parameter, the second training parameter, and the third training parameter as state information; Obtaining a first adjustment action corresponding to the state information according to a reinforcement learning network; generating a loss function corresponding to the reinforcement learning network according to the first adjustment action and a comparison result between the first predicted data and the actual data; The reinforcement learning network is updated according to the loss function, and a second adjustment action corresponding to the state information is determined according to the updated reinforcement learning network to obtain adjusted first training parameters, second training parameters, and third training parameters.
6. The method according to claim 5, characterized in that Generating a loss function corresponding to the reinforcement learning network according to the first adjustment action and a comparison result between the first predicted data and the actual data includes: Determining a reward function of the reinforcement learning network based on a comparison result between the first predicted data and the actual data; A loss function corresponding to the reinforcement learning network is generated according to the reward function of the reinforcement learning network and the action selection probability corresponding to the first adjustment action.
7. The method according to any one of claims 1 to 4, characterized in that The calling of the inference model according to the third training parameter and the task instruction includes: Determining a data inference mode corresponding to the inference model according to the third training parameter, wherein the third training parameter includes at least one of a temperature parameter, a generation length parameter, and a sampling parameter; The task instruction is input into the reasoning model so that the reasoning model obtains the first prediction data corresponding to the first financial data prediction task according to the data reasoning method.
8. A data prediction device, characterized in that: include: An acquisition module, configured to acquire online training data corresponding to a first financial data prediction task in a current prediction cycle, wherein the online training data includes a plurality of training data corresponding to a plurality of data types; a fusion module, configured to perform fusion processing on the plurality of training data according to a first training parameter to generate fusion features corresponding to the plurality of training data; a generating module, configured to perform instruction filling processing on the fusion feature according to the second training parameter to generate a task instruction corresponding to the first financial data prediction task; a prediction module, configured to call the inference model according to the third training parameter and the task instruction to obtain first prediction data corresponding to the first financial data prediction task; An adjustment module is used to adjust the first training parameter, the second training parameter, and the third training parameter through reinforcement learning based on the comparison result of the first predicted data and the actual data, and process the second financial data prediction task of the next prediction cycle based on the adjusted first training parameter, the second training parameter, and the third training parameter to obtain second prediction data corresponding to the second financial data prediction task.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the data prediction method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the data prediction method according to any one of claims 1 to 7.
Citation Information
Cited By
Landslide hidden danger point land settlement prediction method and device based on multi-modal data
CN120929781A
Landslide hazard point land subsidence prediction method and device based on multi-modal data
CN120929781B