Transaction price prediction method for bulk commodities

Through the hybrid neural network model of multimodal data fusion and fusion of LSTM-Transformer, the problems of low computational efficiency and low accuracy of commodity price prediction in the prior art are solved, and more efficient and accurate price prediction is achieved.

CN120146896APending Publication Date: 2025-06-13YANGZHOU ZHIHUI INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510314879.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In the prior art, the calculation efficiency of commodity price prediction is low, and the accuracy of the prediction results is low.

Method used

The multimodal data fusion method is used to obtain meteorological data, macroeconomic indicator quantization values ​​and natural language processing news event analysis parameters, and input them into the hybrid neural network model fused into the LSTM-Transformer for prediction.

Benefits of technology

It improves the accuracy and calculation efficiency of commodity trading price prediction, and provides a more accurate and stable risk management method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146896A_ABST
    Figure CN120146896A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of bulk commodities, in particular to a bulk commodity transaction price prediction method, which comprises the following steps: acquiring multi-modal data of bulk commodities in the current period; the multi-modal data comprises meteorological data, macroeconomic index quantized values and news event analysis parameters processed by natural languages; the news event analysis parameters comprise market emotion indexes and policy change influence factors; performing data preprocessing on the multi-modal data of the bulk commodities in the current period to obtain preprocessed multi-modal data; inputting the preprocessed multi-modal data into a trained price prediction model to obtain a final prediction price; the price prediction model is a hybrid neural network model fused with an LSTM-Transformer (LSTM-Transformer). According to the method, the accuracy of bulk commodity price prediction is improved, and the calculation efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of bulk commodities, and in particular to a method for predicting the trading price of bulk commodities. Background Art

[0002] Bulk commodities generally refer to traditional commodities that meet certain specification requirements, can be mass-produced, such as primary products like agricultural products, petroleum, coal, natural gas, metal ores, etc., and also include secondary products like automobiles, electricity, gas, water, etc. In the production and consumption processes of bulk commodities, the situation of supply-demand imbalance often occurs. If there are a large number of orders to be processed at this time, it will lead to large price fluctuations. Therefore, for enterprises engaged in related industries, accurately predicting the price of bulk commodities can bring significant economic benefits to the enterprises.

[0003] Currently, the main methods for predicting the price of bulk commodities include: technical analysis school, fundamental analysis school, and quantitative analysis school; among them, the technical analysis school believes that all information will be included in the price, and the price trend will show certain regularity, so as to predict the subsequent price; the fundamental analysis school focuses on factors affecting commodity prices, such as supply-demand relationship, seasonal factors, etc.; the quantitative analysis school uses quantitative methods of statistical modeling for analysis. However, the above methods usually have very low calculation efficiency and the accuracy of the obtained prediction results is relatively low.

[0004] Therefore, there is an urgent need for a method for predicting the trading price of bulk commodities currently. Summary of the Invention

[0005] (1) Technical Problems to be Solved

[0006] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method for predicting the trading price of bulk commodities, which solves the technical problems of low calculation efficiency and relatively low accuracy of the obtained price prediction results in the prior art.

[0007] (2) Technical Solutions

[0008] In order to achieve the above object, the main technical solutions adopted by the present invention include:

[0009] In the first aspect, an embodiment of the present invention provides a method for predicting the trading price of bulk commodities, including:

[0010] S100. Obtain multimodal data of bulk commodities in the current period;

[0011] The multimodal data includes: meteorological data, quantified macroeconomic indicators, and news event analysis parameters processed by natural language processing; the news event analysis parameters include: market sentiment index and policy change impact factor;

[0012] S200. Preprocess the multi-modal data of the commodity in the current period to obtain the preprocessed multi-modal data;

[0013] S300. Input the preprocessed multi-modal data into the trained price prediction model to obtain the final predicted price; the price prediction model is a hybrid neural network model integrating LSTM-Transformer.

[0014] Optionally, S100 includes:

[0015] S110. Obtain the set of original macroeconomic indicators associated with the target commodity according to the multi-source economic database of the World Bank;

[0016] S120. Standardize the multi-country indicators of the set of original macroeconomic indicators and convert the currency unit to obtain the quantified macroeconomic indicators; the quantified macroeconomic indicators include: GDP growth rate, CPI fluctuation value, industrial capacity utilization rate, and cross-border trade flow.

[0017] Optionally, S100 further includes:

[0018] S130. Obtain the news event text associated with the target commodity, perform multi-language unified encoding conversion on the news event text, and use a semantic disambiguation model to eliminate the ambiguity of regional terms to obtain the processed news event information;

[0019] S140. Input the processed news event information into the pre-constructed news event analysis parameter acquisition model to obtain news parameter analysis parameters;

[0020] The news event analysis parameter acquisition model includes: a market sentiment index acquisition sub-model and a policy change impact factor acquisition sub-model.

[0021] Optionally, S140 includes:

[0022] S141. Input the processed news event information into the market sentiment index acquisition sub-model to obtain the market sentiment index; the market sentiment index acquisition sub-model includes:

[0023] A text sentiment feature extraction layer that uses a bidirectional long short-term memory network to perform word semantic parsing on the news event information and outputs a text feature vector containing sentiment polarity;

[0024] An event association layer that constructs a news event semantic association graph and uses a graph attention network to obtain and output the influence weights between event nodes;

[0025] Cross-modal dynamic adjustment layer, the influence weight between the input text feature vector and the event node, and the GRU gating mechanism is used to obtain and output the fused feature vector;

[0026] Emotion propagation quantification layer, input the fused feature vector, analyze the fused feature vector based on the financial sentiment dictionary and the Transformer encoder, and output the market sentiment index.

[0027] Optionally, the S140 further includes:

[0028] S142. Input the processed news event information into the policy change impact factor acquisition sub-model to obtain the policy change impact factor acquisition sub-model; the policy change impact factor acquisition sub-model includes:

[0029] Structured parsing layer, using the SpanBERT model to extract policy triples, the policy triples include: regulatory subject, constrained object, and effective time;

[0030] Influence propagation calculation layer, input the policy triples, and obtain and output the direct conduction coefficient, indirect conduction coefficient, and lag period influence intensity of the policy influence based on the random walk algorithm and the PCMCI algorithm;

[0031] Three-dimensional factor synthesis layer, tensor fusion of the direct conduction coefficient, indirect conduction coefficient, and lag period influence intensity, and output the standardized policy change impact factor.

[0032] Optionally, the S200 includes:

[0033] S210. Concatenate the meteorological data, macroeconomic indicator quantization values, and news event analysis parameters processed by natural language processing into a two-dimensional matrix according to the time stamp, and perform Z-score standardization processing on the two-dimensional matrix to obtain the preprocessed multi-modal data.

[0034] Optionally, in the S300, the price prediction model includes:

[0035] Spatio-temporal feature encoding layer, using causal convolutional LSTM to process the time series features of meteorological data, and output the hidden state carrying spatial position encoding;

[0036] Event feature encoding layer, using a hierarchical Transformer architecture to process news event parameters and macroeconomic indicator quantization values, and output event features;

[0037] Multi-modal fusion layer, realizing dynamic weighted fusion of meteorological features and event features through the gated cross-attention mechanism, and outputting the final predicted price.

[0038] Optionally, when training the price prediction model, the Adam optimizer is adopted, and the loss function adopted is the mean squared error function. When the mean squared error function converges, the training is stopped.

[0039] Optionally, the method further includes:

[0040] When the deviation between the latest market price and the final predicted price exceeds 10%, steps S100 to S300 are re-executed to obtain a second confirmation predicted price as the final predicted price.

[0041] In a second aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;

[0042] The memory stores a computer program;

[0043] The processor is configured to implement the trading price prediction method for bulk commodities as described in any one of the first aspects when executing the computer program stored on the memory.

[0044] (3) Beneficial effects

[0045] The beneficial effects of the present invention are as follows: For the trading price prediction method for bulk commodities of the present invention, since multi-modal data fusion is adopted to increase the prediction dimension, and a hybrid neural network model combining LSTM-Transformer is used, the limitation of traditional models relying on single data is broken through, and at the same time, the accuracy of the prediction result is enhanced. On the premise of ensuring the prediction accuracy, the calculation efficiency is optimized through the GRU gating mechanism, providing a method with both accuracy and stability for global bulk commodity risk management. Description of the drawings

[0046] Figure 1 It is a schematic flowchart of a trading price prediction method for bulk commodities according to an embodiment of the present invention. Detailed implementation manners

[0047] To better explain the present invention for easy understanding, the present invention will be described in detail below with reference to the drawings through specific implementation manners.

[0048] Bulk commodities refer to material goods that can enter the circulation field but not the retail link, have commodity attributes, and are used for large-scale trading in industrial and agricultural production and consumption. In the financial investment market, bulk commodities refer to homogeneous, tradable, and widely used commodity as basic raw materials for processing, such as crude oil, non-ferrous metals, steel, agricultural products, iron ore, coal, etc. It includes three categories, namely energy commodities, basic raw materials, and agricultural and sideline products.

[0049] Commodities can be set as futures, and options can be traded as financial instruments to better achieve price discovery and avoid price risks. Since most commodities are the industrial foundation and are at the uppermost stream, the changes in futures and spot prices reflecting their production processes will directly affect the entire economic system. For example, an increase in copper prices will raise the production costs of the electronics, construction, and power industries, while an increase in oil prices will lead to an increase in chemical product prices and drive up the prices and supplies of other energy sources such as coal and alternative energy.

[0050] To better understand the above technical solution, the exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more clear and thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0051] Embodiment 1

[0052] See Figure 1 , a trading price prediction method for a commodity according to an embodiment of the present invention, includes:

[0053] Step S100: Obtain multimodal data of the commodity in the current period;

[0054] The multimodal data includes: meteorological data, quantified values of macroeconomic indicators, and news event analysis parameters processed by natural language processing; the news event analysis parameters include: market sentiment index and policy change impact factors;

[0055] Step S200: Perform data preprocessing on the multimodal data of the commodity in the current period to obtain preprocessed multimodal data;

[0056] Step S300: Input the preprocessed multimodal data into a trained price prediction model to obtain the final predicted price; the price prediction model is a hybrid neural network model integrating LSTM-Transformer.

[0057] In a specific implementation process, the meteorological data is meteorological data related to abnormal weather and the price trend of the commodity in the past time, such as temperature data. The occurrence times of different abnormal weathers are periodic. According to the different meteorological categories, the meteorological cycle of each meteorological condition is obtained. Within the meteorological cycle, the cold cycle that affects the increase in the price of the commodity and the warm cycle that affects the decrease in the price are obtained, and the times of the cold cycle and warm cycle of the commodity are obtained as meteorological data.

[0058] In the specific implementation process, bulk commodities are substances that can enter the market for circulation but are not sold retail, have commodity attributes, and are used for large-scale trading in industrial and agricultural production and consumption, such as crude oil, cotton, etc. During the cold cycle, as the temperature gradually decreases, people's demand for energy increases. During the warm cycle, as the temperature gradually rises, people's demand for energy decreases.

[0059] Furthermore, the news event analysis parameters in this embodiment are obtained by analyzing and processing news event texts; the news event texts are collected in real time from global news media, government announcements, and industry report texts through a distributed crawler system, and the collected news event texts are news event texts of the past month.

[0060] A trading price prediction method for a bulk commodity in this embodiment is applied to enterprises specifically involved in the procurement or sale of bulk commodities (such as manufacturing, agriculture), and can be used to evaluate market risks and design effective hedging strategies to cope with the uncertainties brought about by market price fluctuations.

[0061] Furthermore, it is particularly applicable to bulk commodities with global market characteristics, such as oil, natural gas, metals, agricultural products (wheat, corn, etc.), and the prices of these commodities are significantly affected by various factors such as global economic activities, meteorological conditions, and policy changes.

[0062] A trading price prediction method for a bulk commodity in this embodiment uses meteorological data, macroeconomic indicator quantification values, and news event analysis parameters processed by natural language processing for trading price prediction, breaking through the limitations of traditional methods that rely on single data and improving the dimension and accuracy of prediction.

[0063] Embodiment 2

[0064] A trading price prediction method for a bulk commodity in this embodiment includes:

[0065] Step S100: Obtain the multi-modal data of the bulk commodity in the current period;

[0066] The multi-modal data includes: meteorological data, macroeconomic indicator quantification values, news event analysis parameters processed by natural language processing; the news event analysis parameters include: market sentiment index and policy change impact factor;

[0067] Step S200: Perform data preprocessing on the multi-modal data of the bulk commodity in the current period to obtain the preprocessed multi-modal data;

[0068] Step S300: Input the preprocessed multi-modal data into the trained price prediction model to obtain the final predicted price; the price prediction model is a hybrid neural network model that fuses LSTM-Transformer.

[0069] In this embodiment, step S100 includes:

[0070] Step S110: Obtain the original set of macroeconomic indicators associated with the target bulk commodity according to the World Bank's multi-source economic database;

[0071] Step S120: Perform multi-country indicator standardization processing on the original set of macroeconomic indicators and convert the currency unit to obtain the quantified values of macroeconomic indicators; the quantified values of macroeconomic indicators include: GDP growth rate, CPI volatility value (consumer price index volatility rate), industrial capacity utilization rate, and cross-border trade flow.

[0072] In the specific implementation process, obtain multi-country macroeconomic indicators through the API or database download interface of the World Bank Open Data Platform; and select the original set of macroeconomic indicators associated with the target bulk commodity according to the industrial chain characteristics of the target bulk commodity. The time frequency of the macroeconomic indicators in the original set of macroeconomic indicators is monthly.

[0073] Furthermore, due to differences in economic scale, statistical caliber, etc. among different countries, it is necessary to adjust the base numbers of the same type of indicators from different countries. For example, for GDP data, it is necessary to convert the GDP data of each country to the same benchmark according to purchasing power parity or the exchange rate method for easy comparison. For index-type indicators, such as the industrial production index, it is necessary to determine the same base period to make the data of different countries comparable on the same scale.

[0074] Specifically, GDP growth rate: Extract the GDP-related data from the standardized and currency unit-converted indicator set, and calculate the GDP growth rate of different countries or regions during a specific period. The formula is: GDP growth rate = (current period GDP - previous period GDP) / previous period GDP × 100%;

[0075] CPI volatility value: Measure the volatility by calculating the difference in CPI between adjacent periods or calculating the growth rate of CPI.

[0076] Industrial capacity utilization rate: Obtain the industrial capacity utilization rate according to the industrial production data and industrial capacity data;

[0077] Cross-border trade flow: Obtain the import and export data from the standardized indicator set to obtain the cross-border trade flow. The total trade volume (import volume + export volume) can be calculated, or the changes in import flow and export flow can be analyzed.

[0078] Step S130: Obtain the news event text associated with the target bulk commodity, perform multi-language unified coding conversion on the news event text, and use a semantic disambiguation model to eliminate the ambiguity of regional terms to obtain the processed news event information;

[0079] Among them, the news event text is collected in real time from global news media, government announcements, and industry report texts through a distributed crawler system, and the collected news event text is the news event text of the past month. Additionally, for different types of bulk commodities, relevant industry websites (such as the official website of OPEC in the oil industry, etc.) can also be concerned about.

[0080] In the specific implementation process, web crawler tools in the distributed crawler system are used to collect news event text from selected news sources (on the premise of complying with the website's terms of use and laws and regulations). These tools can automatically capture relevant news article content according to the set search keywords and search scope (such as a specific date range, a specific website section, etc.). For news content that cannot be obtained through crawling, such as news that requires subscription or has access restrictions, it is collected manually from the publicly available part and marked as text that requires further obtaining of the complete content.

[0081] After that, the collected news events are preliminarily sorted out, removing duplicate news content, removing advertisements, irrelevant pictures, and multimedia content, and sorting them in the order of the news release time for convenient subsequent processing.

[0082] Furthermore, the langdetect library in Python is used to identify the language of the collected news event text, determine the text language, and perform conversion according to the corresponding encoding conversion mapping table and encoding conversion algorithm. For example, if the unified encoding standard for multiple languages is UTF-8, and the original text is encoded in ISO-8859-1 encoding, then the original text encoding needs to be converted to UTF-8.

[0083] After the unified encoding conversion of multiple languages, an existing pre-trained semantic disambiguation model is selected to eliminate the ambiguity of the news event text. The model performs semantic analysis on regional terms based on context information, including other words in the text, the orange structure, etc., to obtain the processed news event information; for example, when "bank" appears in a news event text related to finance, the model determines its meaning as "bank" according to the context, rather than the meaning of "riverbank"; when "apple" appears in an agricultural-related news, it is judged as the meaning of fruit, rather than the meaning of a technology company.

[0084] By performing unified encoding conversion and semantic disambiguation on the news event text, the news event information becomes more accurate and clear, facilitating subsequent analysis and utilization.

[0085] Step S140: Input the processed news event information into the pre-constructed news event analysis parameter acquisition model to obtain news parameter analysis parameters;

[0086] The news event analysis parameter acquisition model includes: a market sentiment index acquisition sub-model and a policy change impact factor acquisition sub-model.

[0087] Specifically, step S140 includes:

[0088] Step S141: Input the processed news event information into the market sentiment index acquisition sub-model to obtain the market sentiment index; the market sentiment index acquisition sub-model includes:

[0089] A text sentiment feature extraction layer that uses a bidirectional long short-term memory network to perform word semantic parsing on the news event information and outputs a text feature vector containing sentiment polarity; the sentiment polarity includes: positive, negative, or neutral.

[0090] An event correlation layer that constructs a news event semantic correlation graph and uses a graph attention network to obtain and output the influence weights between event nodes; constructing a news event semantic correlation graph includes: identifying and extracting events in the news event information, determining nodes based on the identified event entities to construct an initial node set; analyzing the semantic relationships in the news event information to determine the edges between nodes. For example, if there is a causal relationship, event sequence relationship, or logical association relationship between two events, an edge is established between the corresponding nodes. Construct a news event semantic correlation graph based on the nodes and edges, and assign corresponding attributes to the nodes and edges in the graph, such as the importance weight of the nodes; further, input the constructed correlation graph into the GAT (graph attention network) to analyze the relationship between each node and its neighbor nodes in the graph. The attention mechanism calculates the influence weight of each neighbor node on the current node based on the features of the node and the neighbor nodes. After multiple layers of calculations, the GAT outputs the influence weights between event nodes.

[0091] A cross-modal dynamic adjustment layer that inputs the text feature vector and the influence weights between event nodes and uses a GRU gating mechanism to obtain and output a fused feature vector; where the GRU dynamically adjusts the input data through a gating mechanism (update gate, reset gate). The update gate determines how much new information is to be updated into the hidden state, and the reset gate determines how much past information is to be forgotten. After the calculation of the GRU, a fused feature vector is output. This fused feature vector combines the information of text sentiment features and event correlation relationships.

[0092] An emotion propagation quantification layer that inputs the fused feature vector and analyzes the fused feature vector based on a financial sentiment dictionary and a Transformer encoder to output the market sentiment index.

[0093] The financial sentiment dictionary contains words related to the financial field and their corresponding sentiment scores. For example, "rise" may correspond to a positive sentiment score, and "fall" may correspond to a negative sentiment score.

[0094] During the encoding process, the Transformer encoder refers to the financial sentiment dictionary to quantify the sentiment of the words in the fused feature vector. For example, if a word in the fused feature vector has a corresponding sentiment score in the financial sentiment dictionary, then this word is quantified according to this score. The market sentiment index is output.

[0095] Furthermore, step S140 further includes:

[0096] Step S142: Input the processed news event information into the policy change impact factor acquisition sub-model to obtain the policy change impact factor acquisition sub-model; the policy change impact factor acquisition sub-model includes:

[0097] The structured parsing layer uses the SpanBERT model to extract policy triples, and the policy triples include: the regulatory subject, the constrained object, and the effective time; among them, the SpanBERT model extracts policy triples by identifying the relationships between entities in the sentence; for the extraction of the regulatory subject, the model will focus on relevant words or phrases indicating government departments, regulatory agencies, etc., such as "China Securities Regulatory Commission", etc. The extraction of the constrained object focuses on entities such as industries, enterprises, and people affected by the policy, such as "banking financial institutions", "small and micro enterprises", etc. The extraction of the effective time needs to identify words indicating time, date formats, or time descriptions related to policy release and implementation, such as "since January 1, 2025", "30 days after release", etc.

[0098] The influence propagation calculation layer inputs the policy triples and obtains and outputs the direct conduction coefficient, indirect conduction coefficient, and lag period influence intensity of the policy influence based on the random walk algorithm and the PCMCI algorithm;

[0099] In the specific implementation process, the restart probability of the random walk algorithm = 0.3, and the direct conduction coefficient and indirect conduction coefficient of the policy influence are calculated through the random walk algorithm; the influence intensity of the lag period of 24h / 7d / 30d after the policy release is identified using the time series causal discovery model (PCMCI algorithm, PCα = 0.05, CMI conditional independence test);

[0100] The three-dimensional factor synthesis layer performs tensor fusion on the direct conduction coefficient, indirect conduction coefficient, and lag period influence intensity, and outputs the standardized policy change impact factor.

[0101] A trading price prediction method for bulk commodities in this embodiment predicts the trading price of bulk commodities by obtaining meteorological data, macroeconomic indicator quantification values, market sentiment indices, and policy change impact factors, ensuring the comprehensiveness and accuracy of the predicted price.

[0102] Embodiment 3

[0103] A trading price prediction method for bulk commodities in this embodiment includes:

[0104] Step S100: Obtain multimodal data of bulk commodities in the current period;

[0105] The multimodal data includes: meteorological data, macroeconomic indicator quantification values, news event analysis parameters processed by natural language processing; the news event analysis parameters include: market sentiment indices and policy change impact factors;

[0106] Step S200: Perform data preprocessing on the multimodal data of bulk commodities in the current period to obtain preprocessed multimodal data;

[0107] Step S300: Input the preprocessed multimodal data into a trained price prediction model to obtain the final predicted price; the price prediction model is a hybrid neural network model integrating LSTM-Transformer.

[0108] In this embodiment, step S200 includes:

[0109] Step S210: Concatenate the meteorological data, macroeconomic indicator quantification values, and news event analysis parameters processed by natural language processing into a two-dimensional matrix according to timestamps, and perform Z-score normalization processing on the two-dimensional matrix to obtain preprocessed multimodal data.

[0110] Specifically, based on timestamps, align the meteorological data, macroeconomic indicator quantification values, and news event analysis parameters. If a certain data is missing at a specific time point, according to the distribution characteristics of the data, methods such as the 3sigma principle are used for identification and processing.

[0111] Among them, the rows of the two-dimensional matrix represent different time points, and the columns of the matrix represent different variables from the meteorological data, macroeconomic indicator quantification values, and news event analysis parameters.

[0112] In step S300, the price prediction model includes:

[0113] A spatio-temporal feature encoding layer, which uses causal convolutional LSTM to process the time series features of meteorological data and outputs hidden states carrying spatial position encoding; the causal convolutional LSTM has a convolutional kernel size of 3, a stride of 1, 2 hidden layers, and 64 neurons in each hidden layer.

[0114] Specifically, the time series features of meteorological data are input into the causal convolutional LSTM. The convolutional operation in the causal convolutional LSTM processes the time series according to the causal relationship (i.e., only considering past and current information, not future information). For example, when processing meteorological data at a certain moment, only the meteorological data before that moment is used. As the time series is gradually input, the causal convolutional LSTM continuously updates the hidden state through its internal memory units (the characteristics of LSTM) and convolutional operations. At the same time, in order to introduce spatial position encoding, according to the geographical location information (such as longitude and latitude) of the meteorological data collection points, a suitable encoding method (such as sine-cosine position encoding) is used to integrate the spatial position information into the hidden state. After being processed by multiple layers of causal convolutional LSTM, the hidden state carrying spatial position encoding is output. This hidden state contains both the time series information of the meteorological data and the spatial position information, providing a spatio-temporal feature representation for subsequent multimodal fusion.

[0115] The event feature encoding layer uses a hierarchical Transformer architecture to process news event parameters and macroeconomic indicator quantization values and outputs event features;

[0116] Specifically, the news event parameters and macroeconomic indicator quantization values in the preprocessed multimodal data are input into the hierarchical Transformer architecture. The hierarchical Transformer architecture performs global correlation analysis on each element in the input vector through its self-attention mechanism, capturing the complex relationships between news event parameters and macroeconomic indicator quantization values. In the hierarchical structure, different layers further abstract and combine features, gradually extracting higher-level event features. For example, the bottom layer may focus on the changes of individual indicators, while the upper layer can capture the co-variation relationships between multiple indicators and their impacts on the overall event. After being processed by the hierarchical Transformer architecture, event features are output. These event features integrate the information of news events and macroeconomic indicators and can reflect the comprehensive impacts of these factors on the prices of bulk commodities.

[0117] The multimodal fusion layer realizes the dynamic weighted fusion of meteorological features and event features through the gated cross-attention mechanism and outputs the final predicted price.

[0118] The gated cross-attention mechanism first calculates the cross-attention scores between meteorological features and event features. This score represents the degree of correlation between the features of the two modalities. For example, the periodic weather changes in meteorological data may be related to policy adjustments in news events or fluctuations in the macroeconomy, and this relationship is quantified by the cross-attention score. According to the cross-attention scores, dynamic weights are calculated through a gating mechanism. The gating mechanism can dynamically adjust the weights of meteorological features and event features based on the current input features, so that in different situations (such as different market environments, different meteorological conditions, etc.), the contributions of the features of the two modalities to the final predicted price can be reasonably adjusted. The obtained dynamic weights are used to weightedly fuse the meteorological features and event features. The fused features contain comprehensive information from meteorological data, news events, and macroeconomic indicators.

[0119] The fused features are input into a fully connected layer to output the final predicted price. The final predicted price is the predicted trading price of the commodity comprehensively obtained based on multi-modal data (meteorological data, news event parameters, quantified values of macroeconomic indicators).

[0120] Specifically, when training the price prediction model, the Adam optimizer is adopted, and the loss function used is the mean square error function. When the mean square error function converges, the training is stopped.

[0121] The method for predicting the trading price of the commodity in this embodiment further includes:

[0122] When the deviation between the latest market price and the final predicted price exceeds 10%, steps S100 to S300 are re-executed to obtain the second confirmation predicted price as the final predicted price.

[0123] A method for predicting the trading price of a commodity in this embodiment obtains the final predicted price through a hybrid neural network model that fuses LSTM-Transformer, ensuring the accuracy of the final predicted price and making the prediction result more in line with the actual situation. Further, the Transformer architecture can perform parallel computing, thereby improving the computing efficiency.

[0124] Embodiment 3

[0125] This embodiment provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus;

[0126] The memory stores a computer program;

[0127] A processor, when executing a computer program stored in a memory, implements the trading price prediction method for bulk commodities as described in any one of Embodiment 1 and Embodiment 2.

[0128] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.

[0129] In the present invention, unless otherwise clearly defined and limited, the terms "mounted", "connected", "connected to", "fixed" and other terms should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or integrated; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium; it may be the internal communication of two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0130] In the present invention, unless otherwise clearly defined and limited, the first feature being "on" or "under" the second feature may be that the first and second features are in direct contact, or the first and second features are indirectly in contact through an intermediate medium. Moreover, the first feature being "above", "over" and "on" the second feature may be that the first feature is directly above or obliquely above the second feature, or merely indicates that the first feature has a higher horizontal height than the second feature. The first feature being "under", "below" and "beneath" the second feature may be that the first feature is directly below or obliquely below the second feature, or merely indicates that the first feature has a lower horizontal height than the second feature.

[0131] In the description of this specification, the descriptions of the terms "an embodiment", "some embodiments", "embodiments", "examples", "specific examples" or "some examples", etc., mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0132] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for predicting the transaction price of bulk commodities, characterized in that: include: S100, obtain multimodal data of commodities in the current period; The multimodal data includes: meteorological data, quantitative values ​​of macroeconomic indicators, and news event analysis parameters processed by natural language; the news event analysis parameters include: market sentiment index and policy change influencing factors; S200, performing data preprocessing on the multimodal data of the bulk commodity in the current period to obtain preprocessed multimodal data; S300, inputting the preprocessed multimodal data into a trained price prediction model to obtain a final predicted price; the price prediction model is a hybrid neural network model integrating LSTM-Transformer.

2. The method for predicting the transaction price of bulk commodities according to claim 1, characterized in that: The S100 includes: S110. Obtain the original macroeconomic indicator set associated with the target commodity based on the World Bank's multi-source economic database; S120. Perform multi-country indicator standardization on the original macroeconomic indicator set, convert the monetary unit, and obtain the quantitative values ​​of macroeconomic indicators; the quantitative values ​​of macroeconomic indicators include: GDP growth rate, CPI fluctuation value, industrial capacity utilization rate and cross-border trade flow.

3. The method for predicting the transaction price of bulk commodities according to claim 2, characterized in that: The S100 further includes: S130, obtaining news event text associated with the target commodity, performing multilingual unified encoding conversion on the news event text, and using a semantic disambiguation model to eliminate regional term ambiguity to obtain processed news event information; S140, inputting the processed news event information into a news event analysis parameter acquisition model constructed in advance to acquire news parameter analysis parameters; The news event analysis parameter acquisition model includes: a market sentiment index acquisition sub-model and a policy change impact factor acquisition sub-model.

4. The method for predicting the transaction price of bulk commodities according to claim 3, characterized in that: The S140 includes: S141, inputting the processed news event information into a market sentiment index acquisition sub-model to acquire a market sentiment index; the market sentiment index acquisition sub-model includes: The text sentiment feature extraction layer uses a bidirectional long short-term memory network to perform word semantic analysis on the news event information and output a text feature vector containing sentiment polarity; Event association layer, constructs a news event semantic association graph, and uses a graph attention network to obtain and output the influence weights between event nodes; The cross-modal dynamic adjustment layer inputs the influence weights between the text feature vector and the event node, and uses the GRU gating mechanism to obtain and output the fused feature vector; The sentiment propagation quantification layer inputs the fused feature vector, analyzes the fused feature vector based on the financial sentiment dictionary and the Transformer encoder, and outputs the market sentiment index.

5. The method for predicting the transaction price of bulk commodities according to claim 4, characterized in that: The S140 further includes: S142, inputting the processed news event information into a policy change impact factor acquisition sub-model to acquire a policy change impact factor acquisition sub-model; the policy change impact factor acquisition sub-model includes: The structured parsing layer uses the SpanBERT model to extract policy triples, which include: regulatory subject, constraint object, and effective time; The impact propagation calculation layer inputs the policy triplet, obtains and outputs the direct transmission coefficient, indirect transmission coefficient, and lag period impact intensity of the policy impact based on the random walk algorithm and the PCMCI algorithm; The three-dimensional factor synthesis layer performs tensor fusion on the direct transmission coefficient, indirect transmission coefficient and lag period impact intensity, and outputs the standardized policy change impact factor.

6. The method for predicting the transaction price of bulk commodities according to claim 1, characterized in that: The S200 includes: S210, concatenating the meteorological data, the quantitative values ​​of macroeconomic indicators, and the news event analysis parameters processed by natural language into a two-dimensional matrix according to timestamps, and performing Z-score standardization processing on the two-dimensional matrix to obtain pre-processed multimodal data.

7. The method for predicting the transaction price of bulk commodities according to claim 1, characterized in that: In S300, the price prediction model include: The spatiotemporal feature encoding layer uses causal convolutional LSTM to process the time series features of meteorological data and outputs hidden states with spatial position encoding; The event feature encoding layer uses a hierarchical Transformer architecture to process news event parameters and macroeconomic indicator quantitative values ​​and output event features; The multimodal fusion layer realizes the dynamic weighted fusion of meteorological features and event features through the gated cross-attention mechanism, and outputs the final predicted price.

8. The method for predicting the transaction price of bulk commodities according to claim 7, characterized in that: The price prediction model uses the Adam optimizer during training, and the loss function used is the mean square error function. When the mean square error function converges, the training is stopped.

9. The method for predicting the transaction price of bulk commodities according to claim 1, characterized in that: The method further comprises: When the deviation between the latest market price and the final predicted price exceeds 10%, steps S100 to S300 are re-executed to obtain the second confirmed predicted price as the final predicted price.

10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory stores a computer program; A processor, for implementing the commodity transaction price prediction method as claimed in any one of claims 1 to 9 when executing a computer program stored in a memory.

Citation Information

Cited By

  • Food and beverage network sales trend prediction model construction system and method based on multi-source data fusion and deep learning

    CN120655340A

  • Risk early warning method for bulk commodities

    CN120707185A