Import and export prediction method and device based on foreign trade industry and medium
By constructing a multidimensional data warehouse and a hybrid prediction architecture, and combining Bayesian optimization and residual weighted fusion, the problem of real-time and accurate prediction of foreign trade import and export data was solved, achieving high-precision and high-interpretive prediction results, and supporting multi-dimensional interactive analysis and risk identification.
Patent Information
- Application Number
- CN202511703214.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies cannot predict foreign trade import and export data in real time and accurately, especially the seasonal, cyclical and sudden effects of events in industries such as machinery and electronics and agricultural products. Furthermore, data fragmentation leads to information gaps, delayed prediction results and accumulated errors.
By constructing a multidimensional data warehouse, we use a seasonal autoregressive integral moving average model and a two-layer long short-term memory network for data feature extraction and analysis. Combined with Bayesian optimization and residual weighted fusion, we achieve deep integration and standardization of multidimensional data and use a visualization engine to display the prediction results.
It significantly improves the accuracy and explanatory power of foreign trade import and export forecasts, and can identify seasonal demand peaks, exchange rate sensitive windows and freight rate shock points, supporting multi-dimensional interactive analysis and risk identification.
Smart Images

Figure CN121616336A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the interdisciplinary field of computer science and data science, and in particular to a method, equipment and medium for import and export forecasting based on the foreign trade industry. Background Technology
[0002] Currently, the global industrial chain, supply chain and value chain are undergoing profound restructuring, international trade rules are evolving rapidly, and the scale of foreign trade continues to expand. Import and export data exhibit complex characteristics of high concurrency, high noise, high coupling and high heterogeneity in six dimensions: time, space, commodities, market, subject and policy.
[0003] Existing analytical techniques have long relied on customs monthly reports or quarterly statistics and static summary tables, combined with simple linear extrapolation or single-equation econometric models for analysis. This approach cannot incorporate exchange rate fluctuations in real time, nor can it accurately depict the combined effects of seasonality, cyclicality, trends, and unforeseen events in key industries such as machinery and electronics and agricultural products.
[0004] Meanwhile, key data is scattered across multiple platforms, including customs clearance, finance, logistics, and industry intelligence, leading to issues such as differing definitions, asynchronous updates, and semantic ambiguity. This results in fragmented information, delayed predictions, accumulated errors, and diminished explanatory power. Industry research institutions, macroeconomic management departments, enterprises, and financial institutions generally face the dilemma of massive amounts of data yet scarce insights, and abundant information yet slow action. Summary of the Invention
[0005] This application provides an import and export forecasting method, equipment, and medium based on the foreign trade industry. The method includes: collecting macroeconomic data and import and export customs declaration data according to a preset data collection cycle; preprocessing the macroeconomic data and customs declaration data to generate standardized data; performing star schema modeling on the standardized data according to preset indexing rules to obtain a multidimensional data warehouse; extracting and analyzing features from the data in the multidimensional data warehouse using a seasonal autoregressive integral moving average model and a two-layer long short-term memory network, and weighting and fusing the analysis results to obtain forecast data for a preset future time period; constructing a forecasting theme library based on foreign trade scenarios and forecasting data; and matching the received foreign trade scenarios with the foreign trade scenarios in the forecasting theme library to visualize the relevant forecasting data.
[0006] In one example, the macroeconomic data and customs declaration data are preprocessed to generate standardized data. Specifically, this includes: filling in missing values and removing outliers in both the customs declaration data and macroeconomic data; converting monetary fields from different sources in both data to a specified base currency, and converting trade quantity and weight units to international standard units of measurement; generating a composite primary key based on HS codes, trade country codes, and data timestamps to align the customs declaration data and macroeconomic data; parsing and normalizing descriptive text in both data using regular expressions to generate feature labels; and integrating the cleaned, transformed, aligned, and labeled customs declaration data and macroeconomic data to determine the standardized data.
[0007] In one example, a star schema is constructed on the standardized data according to preset indexing rules to obtain a multidimensional data warehouse. Specifically, this includes: constructing a star schema on the standardized data using time-industry-product-country as the composite primary key to obtain a fact table of the star schema; constructing time dimension tables, industry dimension tables, product dimension tables, and country dimension tables based on the fact tables; associating the fact tables with each dimension table through the composite primary key and establishing corresponding indexes at the database level; and storing all associated data to generate a multidimensional data warehouse.
[0008] In one example, a seasonal autoregressive integral moving average model is used to extract and analyze features from data in a multidimensional data warehouse. Specifically, this includes: aggregating import and export value and quantity data according to industry dimensions to generate a time series dataset; aggregating exchange rate series and freight rate index data to generate an exogenous variable dataset; capturing short-term dependencies in the time series dataset through autoregressive components; modeling the lagged effects of random errors through moving average components; eliminating periodic fluctuations in the data through seasonal differencing; quantifying the marginal effect of the exogenous variable dataset on import and export through exogenous variables; and integrating short-term dependencies, lagged effects, periodic fluctuations, and marginal effects to output the first prediction result for a future preset time period.
[0009] In one example, a two-layer long short-term memory network is used to extract features and analyze data in a multidimensional data warehouse. Specifically, this includes: modeling the association patterns at the product and country levels based on the product and country dimensions using the non-linear activation function of the two-layer long short-term memory network to form a high-dimensional non-linear association dataset; calculating the weights of different time steps and different product and market combinations using the attention mechanism of the hidden layer of the two-layer long short-term memory network to obtain long-short-term dependencies; and integrating the high-dimensional non-linear association dataset with the long-short-term dependencies to output a second prediction result for a future preset time period.
[0010] In one example, the analysis results are weighted and fused to obtain predicted data for a future preset time period. Specifically, this includes: calculating the prediction residuals of the first and second prediction results during the validation period, and assigning fusion weights based on the prediction residuals; where the smaller the prediction residual, the larger the weight; fusing the first and second prediction results using a weighted average algorithm based on the fusion weights to determine the distribution characteristics of the fused residuals; and calculating the confidence intervals for import and export amounts and quantities for the future preset time period based on the residual distribution characteristics to form the final predicted data.
[0011] In one example, the method also includes: monitoring the drift of residuals and external variables of the seasonal autoregressive integral moving average model and the two-layer long short-term memory network according to a preset monitoring period; when the changes in residuals and drift are found to be greater than a preset threshold, triggering the data resampling, model retraining and parameter reoptimization process.
[0012] In one example, before performing feature extraction and analysis on data in a multidimensional data warehouse using a seasonal autoregressive integral moving average model, the method further includes: optimizing the parameters of the seasonal autoregressive integral moving average model using a Bayesian optimization algorithm to determine the optimal parameters of the seasonal autoregressive integral moving average model.
[0013] On the other hand, embodiments of this application provide an import and export forecasting device based on the foreign trade industry, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute any of the above-mentioned import and export forecasting methods based on the foreign trade industry.
[0014] On the other hand, embodiments of this application provide a non-volatile computer storage medium for import and export forecasting based on the foreign trade industry, which stores computer-executable instructions that can execute any of the above-mentioned import and export forecasting methods based on the foreign trade industry.
[0015] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: This application overcomes the limitations of traditional single-statistical approaches by constructing a comprehensive data collection and governance system encompassing macroeconomics, industry, commodities, and markets, achieving deep integration and standardization of multi-dimensional foreign trade data. Through a hybrid prediction architecture combining a seasonal autoregressive integral moving average model and a two-layer long short-term memory network, it accurately captures seasonal and cyclical characteristics at the industry level and high-dimensional nonlinear correlations at the commodity and market levels. Bayesian optimization and residual weighted fusion significantly improve prediction accuracy and explanatory power, effectively identifying seasonal demand peaks, exchange rate sensitive windows, and freight rate shock points. Furthermore, the development of a three-dimensional visualization engine for time, space, and commodities enables dynamic overlay display of historical performance, prediction intervals, and risk thresholds, supporting multi-dimensional interactive analysis and helping users intuitively understand import and export trends and potential risks. Attached Figure Description
[0016] To more clearly illustrate the technical solution of this application, some embodiments of this application will be described in detail below with reference to the accompanying drawings, in which: Figure 1 A flowchart illustrating an import and export forecasting method based on the foreign trade industry, provided for an embodiment of this application; Figure 2 A process diagram illustrating the stages of an import / export forecasting method for the foreign trade industry, provided for an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an import and export forecasting device for the foreign trade industry, provided as an embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] Some embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0019] Figure 1 This is a flowchart illustrating an import / export forecasting method for the foreign trade industry, provided as an embodiment of this application. This method can be applied to different business sectors. Certain input parameters or intermediate results in this process can be manually adjusted to help improve accuracy.
[0020] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.
[0021] Based on this Figure 1 The process may include the following steps: S101: Collect macroeconomic data and import / export customs declaration data according to the preset data collection cycle; the macroeconomic data includes monthly exchange rate midpoint, import / export price index, and Baltic Dry Index.
[0022] In some embodiments of this application, a multi-source data acquisition system is constructed to achieve comprehensive acquisition of foreign trade-related data.
[0023] First, through the customs clearance public data interface provided by the General Administration of Customs, the system automatically retrieves all import and export customs declaration data on a daily basis. The key fields collected include commodity code (HS code), commodity name, trade amount (including original currency and US dollar), trade quantity (covering various units of measurement such as weight and number of pieces), country of trade (distinguishing between country of origin and country of destination), customs district code for entry and exit, and trade method (such as general trade, processing trade, etc.).
[0024] Simultaneously, multiple macroeconomic data are collected in parallel: at the beginning of each month, the monthly average exchange rate midpoint of major currencies against the RMB is automatically obtained through the JSON data interface officially released by the State Administration of Foreign Exchange; authoritative import and export price indices are obtained monthly through the API service opened by the National Bureau of Statistics, with particular attention to the index changes of key commodities such as electromechanical products and high-tech products; and the Baltic Dry Index (BDI) and its various sub-ship type indices are collected daily through the public data source released by the Baltic Exchange to comprehensively reflect changes in the international shipping market.
[0025] All data collection processes are executed automatically through configured scheduled tasks, and the collection frequency is set differently according to the update characteristics of various types of data: customs declaration data is collected daily, exchange rates and price indices are collected monthly, and freight rate indices are tracked daily to ensure the timeliness and completeness of the data source.
[0026] S102: Preprocess the macroeconomic data and the customs declaration data to generate standardized data.
[0027] In some embodiments of this application, after obtaining macroeconomic data and customs declaration data, the data preprocessing stage is entered, and data quality is ensured by constructing a standardized data cleaning pipeline.
[0028] Firstly, to address the issue of missing values, the system adopts a differentiated processing strategy: for missing amount fields in customs declarations, the average transaction value of the most recent 30 days under the same commodity code is used for intelligent filling; for missing exchange rate data, forward filling is used to maintain time continuity; and for missing freight rate indices, linear interpolation is used for reasonable supplementation.
[0029] In terms of outlier detection, an automatic identification mechanism is established based on statistical distribution characteristics. The Z-score value is calculated for the unit price (ratio of amount to quantity) of each commodity in the customs declaration, effectively eliminating abnormal records that deviate from the mean by more than 3 standard deviations. At the same time, the exchange rate volatility is continuously monitored to eliminate abnormal fluctuation points caused by data transmission errors.
[0030] Meanwhile, to address data consistency issues, a unified system was implemented: all trade amounts in customs declarations were converted to US dollars using the collected monthly exchange rate midpoint for accurate conversion; various units of quantity were also converted to international standard units, such as weight in kilograms and volume in cubic meters. Based on this, the system intelligently concatenates the HS code (first 6 digits), trade country code (using ISO 3166 standard), and data timestamp (accurate to the day) to generate a globally unique composite primary key, laying the foundation for subsequent cross-source data association.
[0031] Finally, the system uses a pre-defined regular expression rule base to perform deep cleaning and standardization of product name text. For example, it standardizes "iPhone 13 Pro Max 256GB" to "iPhone 13 Pro Max" and "polyester-cotton blend shirt" to "polyester-cotton blend shirt". It also generates product feature tags that can be used for structured queries and outputs a complete and reliable standardized dataset.
[0032] S103: According to the preset indexing rules, star schema modeling is performed on the standardized data to obtain a multidimensional data warehouse; the indexing rules include indexes for time, industry, product, and country.
[0033] In some embodiments of this application, after data standardization is completed, the process proceeds to the multidimensional data warehouse construction stage, where a star schema architecture is used to organize and manage the data in multiple dimensions.
[0034] First, a joint primary key is established based on four core dimensions: time, industry, commodity, and country. This leads to the construction of a central fact table, which not only stores core measurement fields such as import and export amount (uniformly denominated in US dollars), quantity (standard unit), and unit price, but also integrates key exogenous variables such as exchange rate, price index, and freight rate index.
[0035] Furthermore, based on the fact table, four professional dimension tables are constructed: the time dimension table contains complete date-level attributes, such as year, month, day, quarter, and weekday, and marks holiday information and seasonal characteristics; the industry dimension table uses the first four digits of the HS code for refined industry classification mapping, and establishes a three-level industry hierarchy system of "major category, intermediate category, and minor category" with reference to the National Economic Industry Classification Standard (GB / T 4754); the commodity dimension table comprehensively records commodity codes, standardized commodity names, commodity feature labels, categories, and physical attributes (such as flammability, fragility, temperature control requirements, and other special attributes); and the country dimension table covers country codes, country names, continents, and regional economic organizations (such as ASEAN, the European Union, etc.).
[0036] Meanwhile, at the database implementation level, an efficient clustered index is created for the composite primary key of the fact table in the MySQL database, a B+ tree index is created for the primary key of each dimension table, and a dedicated covering index is created for commonly used query conditions (such as time range filtering and industry-specific queries), which significantly improves query performance.
[0037] Finally, a professional ETL tool is used to accurately load the standardized data into the star schema structure, ensuring that the fact table and the dimension tables are correctly linked through foreign keys, forming a complete and unified multidimensional data warehouse, which provides a solid foundation for subsequent complex analysis and queries.
[0038] S104: Feature extraction and analysis of data in a multidimensional data warehouse are performed using a seasonal autoregressive integral moving average model and a two-layer long short-term memory network, respectively. The analysis results are then weighted and fused to obtain predicted data for a future preset time period.
[0039] In some embodiments of this application, after the multidimensional data warehouse is built, the core predictive analysis stage is entered, and a hybrid modeling strategy is adopted to give full play to the advantages of different algorithms.
[0040] Firstly, at the industry level, the system extracts the monthly import and export value time series data for the past five years from the data warehouse and conducts in-depth analysis using a seasonal autoregressive integral moving average model. This model automatically optimizes key parameters using a Bayesian optimization framework, seeking the optimal configuration within a defined parameter space. Simultaneously, it incorporates exchange rate fluctuations and freight rate index fluctuations as exogenous variables into the model, ultimately outputting point predictions and confidence intervals for the import and export value and quantity of each industry for the next two months.
[0041] Meanwhile, at the commodity and country segmentation level, a two-layer long short-term memory network is used to mine high-dimensional nonlinear features, and daily trade data of commodity and country combinations are extracted from the data warehouse to construct high-dimensional time series input.
[0042] It should be noted that the dual-layer Long Short-Term Memory (LSTM) network architecture is designed as a dual-layer LSTM structure. The first layer is configured with 128 units to extract long-term dependency features of the time series, while the second layer is configured with 64 units to focus on capturing the complex relationships between different product-market combinations. The intermediate layer introduces an attention mechanism to dynamically weight the impact of key time steps. The model training adopts a strategy of predicting the trend of the next 60 days using a 90-day historical data window, and sets dropout=0.2 to effectively prevent overfitting.
[0043] Finally, in the model fusion stage, the average absolute error of the seasonal autoregressive integral moving average model and the two-layer long short-term memory network on the validation set of the most recent 6 months is calculated, and the fusion weights are dynamically allocated based on the principle of the inverse of error.
[0044] After weighted averaging of the point prediction results from the two models, a 95% confidence interval is calculated based on the standard deviation of the fused residuals, resulting in an interval prediction result that combines accuracy and reliability.
[0045] S105: Based on the foreign trade scenario and the predicted data, construct a prediction theme library; the prediction theme library is distinguished by industry, country, and time period.
[0046] In some embodiments of this application, after obtaining the prediction results, the process proceeds to the topic library construction stage, where the practicality and accessibility of the prediction results are improved through a scenario-based organization approach.
[0047] First, based on the actual needs of different types of users, several professional forecasting topics are predefined, such as "Forecast of Electromechanical Products Exports to the US", "ASEAN Agricultural Product Import Trends", and "Monthly Monitoring of EU High-Tech Products". Each topic is tailored to specific business scenarios and decision-making needs.
[0048] To provide intelligent early warning services, a flexible early warning threshold system is configured for each topic. For example, a yellow warning is triggered when the year-on-year fluctuation of the amount exceeds ±15%, and a red warning is triggered when it exceeds ±25%. When the width of the prediction interval exceeds twice the historical average width, a model reliability warning is automatically triggered to remind users to pay attention to the uncertainty of the prediction results.
[0049] At the technical implementation level, a powerful early warning logic processing capability is built based on the Drools rule engine, supporting the definition of rules with complex combinations of conditions. For example, when the forecast shows that the export value to a certain country will decrease by 20% while the freight rate index increases by 30% in the same period, a supply chain risk warning will be automatically triggered. At the same time, a standard RESTful API interface is provided for each forecast topic, supporting flexible acquisition of forecast results by various parameters such as topic category, time range, and data granularity, facilitating integration and calling by other business systems.
[0050] To ensure the timeliness of the forecast data, an automatic synchronization mechanism was established between the subject database and the multidimensional data warehouse. Every month, as new data is added to the database, the update calculation of the forecast results for each subject is automatically triggered, ensuring that users always have access to analytical insights based on the latest data.
[0051] S106: Match the received foreign trade scenarios with the foreign trade scenarios in the prediction topic library to visualize the relevant prediction data.
[0052] In some embodiments of this application, after the topic library is built, the final visualization stage is entered, where complex predictive data is transformed into intuitive business insights through an advanced interactive interface.
[0053] When users select or input the foreign trade scenarios they are interested in through the web interface (such as viewing the export forecast of electromechanical products to the EU), the system first uses an intelligent matching algorithm to accurately match them with predefined scenarios in the forecast topic library, quickly locates and returns the most relevant forecast data.
[0054] In terms of visualization, in the time dimension, a dynamic line chart clearly displays historical trends and future forecast intervals, supporting smooth dragging and free scaling of the time axis; in the spatial dimension, a flow map intuitively presents international trade links, where the thickness of the lines accurately represents the size of trade volume, and color changes vividly reflect growth or decline trends; in the commodity dimension, a heat map effectively displays the forecast results for different commodity categories, and the depth of the color intuitively represents the magnitude of forecast changes.
[0055] To enhance user experience, the system offers a wealth of interactive features: it supports multi-dimensional linked filtering, automatically focusing the spatial view on the distribution of relevant trading countries when a user selects a specific industry; it provides deep drill-down capabilities, allowing users to drill down from the industry level to specific product categories, and from monthly trend data to more granular weekly data. The system also features a dedicated alert panel that displays various triggered alerts in real time, allowing users to view detailed analysis and targeted recommendations. Through responsive design, the system ensures consistent and excellent visualization across different devices such as PCs, tablets, and mobile phones, and fully supports touch gestures, meeting users' needs for analysis and decision-making anytime, anywhere.
[0056] It should be noted that, although the embodiments in this application are based on... Figure 1 Steps S101 to S106 will be described sequentially, but this does not mean that steps S101 and S106 must be performed in a strict order. The reason this embodiment follows this order is... Figure 1The order in which steps S101 to S106 are described is provided to facilitate understanding of the technical solutions of the embodiments of this application by those skilled in the art. In other words, in the embodiments of this application, the order of steps S101 to S106 can be appropriately adjusted according to actual needs.
[0057] pass Figure 1 This application utilizes a comprehensive data collection and governance system encompassing macroeconomic, industry, commodity, and market data across the entire process. This system overcomes the limitations of traditional single-statistical approaches, achieving deep integration and standardization of multi-dimensional foreign trade data. By establishing a hybrid prediction architecture combining a seasonal autoregressive integral moving average model and a two-layer long short-term memory network, it accurately captures seasonal and cyclical characteristics at the industry level and high-dimensional nonlinear correlations at the commodity and market levels. Through Bayesian optimization and residual weighted fusion, it significantly improves prediction accuracy and explanatory power, effectively identifying seasonal demand peaks, exchange rate sensitive windows, and freight rate shock points. Furthermore, by developing a three-dimensional visualization engine for time, space, and commodities, it enables dynamic overlay display of historical performance, prediction intervals, and risk thresholds, supporting multi-dimensional interactive analysis and helping users intuitively understand import and export trends and potential risks.
[0058] Figure 2 A process diagram illustrating the stages of an import / export forecasting method for the foreign trade industry, provided in this application embodiment.
[0059] exist Figure 2 The document demonstrates the entire process of this application from start to finish, including data acquisition, data preprocessing, data association and integration, multi-dimensional modeling and prediction, topic library construction, multi-dimensional visualization and interaction, and dynamic updates and optimization.
[0060] Figure 3 A schematic diagram of an import and export forecasting device for the foreign trade industry provided in this application embodiment includes: At least one processor; and, A memory that is communicatively connected to at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, which enable at least one processor to perform any of the above-mentioned import and export forecasting methods based on the foreign trade industry.
[0061] Some embodiments of this application provide a non-volatile computer storage medium for import and export forecasting based on the foreign trade industry, which stores computer-executable instructions that can execute any of the above-mentioned import and export forecasting methods based on the foreign trade industry.
[0062] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0063] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0064] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0065] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0066] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0067] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0068] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0069] Memory may include non-persistent storage in computer-readable media, random access memory (RAM), and non-volatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0070] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0071] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0072] The above are merely embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the technical principles of this application should fall within the protection scope of this application.
Claims
1. A method for predicting import and export based on foreign trade industry, characterized in that, The method comprises: According to the preset data acquisition period, collect macroeconomic data and import and export customs declaration data; the macroeconomic data includes monthly exchange rate intermediate price, import and export price index, Baltic dry cargo freight index; Pretreatment of the macroeconomic data and the customs declaration data to generate standardized data; According to the preset index rule, star modeling is performed on the standardized data to obtain a multidimensional data warehouse; the index rule includes time, industry, commodity and country index; Through seasonal autoregressive integrated moving average model and double-layer long short-term memory network, the data in the multidimensional data warehouse is respectively extracted and analyzed, and the analysis results are weighted and fused to obtain prediction data in a future preset time period; According to the foreign trade scene and the prediction data, a prediction theme library is constructed; the prediction theme library is distinguished by industry, country, time period; The received foreign trade scene is matched with the foreign trade scene in the prediction theme library to visually display the related prediction data.
2. The method of claim 1, wherein, The pretreatment of the macroeconomic data and the customs declaration data to generate standardized data, specifically includes: The missing value filling and abnormal value elimination are performed on the customs declaration data and the macroeconomic data respectively; The amount fields of different sources in the customs declaration data and the macroeconomic data are uniformly converted into a specified reference currency, and the trade quantity and weight units are converted into international standard measurement units; According to the HS code, the trade country code and the data timestamp, a composite primary key is generated to align the customs declaration data and the macroeconomic data; The descriptive text in the customs declaration data and the macroeconomic data is analyzed and normalized by regular expression to generate feature labels; The customs declaration data and the macroeconomic data which have completed cleaning, conversion, alignment and labeling processing are integrated and determined as standardized data.
3. The method of claim 1, wherein, The star modeling of the standardized data according to the preset index rule to obtain a multidimensional data warehouse, specifically includes: The standardized data is star modeled with time-industry-commodity-country as the joint primary key to obtain a fact table of the star model; According to the fact table, time dimension table, industry dimension table, commodity dimension table and country dimension table are respectively constructed; the time dimension table includes different granularity time levels such as year, month and day, and corresponding season and holiday flags; the industry dimension table maps the industry according to the first several digits of the HS code, and includes the industry hierarchy relationship; the commodity dimension table includes standardized commodity feature labels, belonging category and physical property classification; the country dimension table includes trade country code, belonging continent region and whether it is a key trade partner flag; The fact table and each dimension table are associated through the joint primary key, and corresponding indexes are established at the database level; All associated data is stored to generate a multidimensional data warehouse.
4. The method of claim 1, wherein, The data in the multidimensional data warehouse is extracted and analyzed by the seasonal autoregressive integrated moving average model, specifically including: According to the industry dimension, the import and export amount and quantity data are aggregated to generate a time series data set; the exchange rate sequence and freight index data are aggregated to generate an exogenous variable data set; The short-term dependence relationship of the time series data set is captured through the autoregressive component; The lagging effect of the random error is modeled through the moving average component; The periodic fluctuations of the data are eliminated through the seasonal difference; The marginal effect of the exogenous variable data set on the import and export is quantified through the exogenous variable; The first prediction result of the future preset time period is output by integrating the short-term dependence relationship, the lagging effect, the periodic fluctuations and the marginal effect.
5. The method of claim 1, wherein, The data in the multi-dimensional data warehouse are feature extracted and analyzed through the double-layer long short-term memory network, specifically including: According to the commodity and country dimensions, the double-layer long short-term memory network is used to model the correlation pattern of the commodities and countries through the nonlinear activation function, and a high-dimensional nonlinear correlation data set is formed; The long short-term dependence is obtained by calculating the weight of different time steps and different commodity and market combinations through the attention mechanism of the double-layer long short-term memory network hidden layer; The second prediction result of the future preset time period is output by integrating the high-dimensional nonlinear correlation data set and the long short-term dependence.
6. The method of claim 1, wherein, The prediction data in the future preset time period is obtained by weighted fusion of the analysis results, specifically including: The prediction residuals of the first prediction result and the second prediction result in the verification period are calculated respectively, and the fusion weight is allocated according to the prediction residuals; the smaller the prediction residual, the greater the weight; The first prediction result and the second prediction result are fused by weighted average algorithm according to the fusion weight to determine the residual distribution characteristics after fusion; The confidence interval of the import and export amount and quantity in the future preset time period is calculated according to the residual distribution characteristics to form the final prediction data.
7. The method of claim 1, wherein, The method further includes: According to the preset monitoring period, the drift of the residual and the external variable of the seasonal autoregressive integrated moving average model and the double-layer long short-term memory network is monitored; When the change amplitude of the residual and the drift is greater than the preset threshold, the data resampling, model retraining and parameter reoptimization process are triggered.
8. The method of claim 1, wherein, Before the data in the multi-dimensional data warehouse are feature extracted and analyzed through the seasonal autoregressive integrated moving average model, the method further includes: The parameters of the seasonal autoregressive integrated moving average model are optimized through the Bayesian optimization algorithm to determine the optimal parameters of the seasonal autoregressive integrated moving average model.
9. An import / export prediction device based on foreign trade industry, characterized by, It includes: At least one processor; And The memory is in communication connection with the at least one processor; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the import and export prediction method based on the foreign trade industry in any one of claims 1-8.
10. An import and export prediction storage medium based on an foreign trade industry, storing computer executable instructions, characterized in that, The computer executable instructions can perform the import and export prediction method based on the foreign trade industry in any one of claims 1-8.