New energy automobile sales prediction method based on multi-scale sequence fusion LSTM network
Through multi-scale sequence fusion LSTM network, combining multiple influencing factor indicators, a multi-scale time series is constructed and feature extraction is performed, which solves the problem of inaccurate sales forecasts of new energy vehicles in the existing technology, and achieves a more accurate prediction effect.
Patent Information
- Application Number
- CN202411235895.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-24
AI Technical Summary
The existing new energy vehicle sales forecasting method only considers the correlation of the sales data itself, ignores other influencing factors, resulting in inaccurate predictions.
Using a multi-scale sequence fusion LSTM network, a multi-scale sequence generation module and feature extraction module are used to construct a multi-scale time series, combining multiple influencing factor indicators for prediction, and using LSTM units and fully connected layers to extract features and perform integrated prediction.
A more accurate prediction of new energy vehicle sales has been achieved, and the prediction effect has been improved by learning the internal changes between various influencing factors.
Smart Images

Figure CN119180674A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a new energy vehicle sales prediction method based on a multi-scale sequence fusion LSTM network. Background Art
[0002] With the development of science and technology, the market share of new energy vehicles is getting higher and higher. Most of the existing new energy vehicle sales forecasting methods are to directly build models based on sales data for forecasting. The basic idea is: after selecting the required new energy vehicle sales data of previous years, the SSA-SVR research model or some combination model is usually used to directly obtain the predicted sales data by analyzing some linear relationships in the sales of previous years.
[0003] In the process of predicting new energy vehicle sales data, the above method only takes into account the correlation of the sales data itself, and ignores changes in other indicators that may affect the sales of new energy vehicles. Summary of the invention
[0004] In order to solve the above problems existing in the prior art, the present invention provides a new energy vehicle sales forecasting method based on a multi-scale sequence fusion LSTM network. Specifically, it includes:
[0005] In the first aspect, the present invention provides a new energy vehicle sales prediction method based on a multi-scale sequence fusion LSTM network, which is applied to a new energy vehicle sales prediction method based on a multi-scale sequence fusion LSTM network.
[0006] Based on multi-scale sequence fusion LSTM network, including:
[0007] Multi-scale sequence generation module, multi-scale sequence feature extraction and prediction module;
[0008] A multi-scale sequence feature extraction and prediction module, including an integration unit, and N LSTM unit groups and N fully connected layer groups connected one to one, each LSTM unit group includes 2 layers of LSTM units, and each fully connected layer group includes 3 layers of fully connected layers, and N is a positive integer greater than or equal to 1;
[0009] The method comprises:
[0010] The multi-scale sequence generation module intercepts the acquired target influencing factor index time series according to N preset interception lengths and multiple preset moments as starting points, and classifies the sequences with the same interception length into the same sub-time series, and constructs a multi-scale time series according to each sub-time series and the new energy vehicle sales at the corresponding preset moment. The target influencing factor index belongs to the preset new energy vehicle sales influencing factor index system;
[0011] The multi-scale sequence feature extraction and prediction module uses different LSTM unit groups to extract features from each sub-time series to obtain feature extraction results, and obtains sub-prediction results based on the corresponding feature extraction results through the corresponding fully connected layer groups, and obtains the final sales forecast results based on each sub-prediction result through the integrated unit.
[0012] In a second aspect, the present invention also provides a training method based on a multi-scale sequence fusion LSTM network, comprising:
[0013] S71, initialize the weights and biases of the multi-scale sequence fusion LSTM network;
[0014] S72, inputting the obtained time series of the target influencing factor index as an input sequence into the LSTM network based on multi-scale sequence fusion to obtain a predicted value, and the target influencing factor index belongs to a preset new energy vehicle sales influencing factor index system;
[0015] S73, using the MSE loss function to calculate the difference between the predicted value and the true value;
[0016] S74, calculating the gradient of the parameter using a back propagation algorithm according to the gradient of the loss function;
[0017] S75, using the Adam optimization algorithm to update the network parameters of the multi-scale sequence fusion LSTM network according to the gradient;
[0018] S76, repeat steps S72 to S75 until a preset maximum number of iterations is reached.
[0019] In a third aspect, the present invention further provides a multi-scale sequence fusion LSTM network, comprising:
[0020] Multi-scale sequence generation module, multi-scale sequence feature extraction and prediction module;
[0021] A multi-scale sequence feature extraction and prediction module, including an integration unit, and N LSTM unit groups and N fully connected layer groups connected one to one, each LSTM unit group includes 2 layers of LSTM units, and each fully connected layer group includes 3 layers of fully connected layers, and N is a positive integer greater than or equal to 1;
[0022] A multi-scale sequence generation module is used to intercept the acquired target influencing factor index time series according to N preset interception lengths and multiple preset moments as starting points, and classify the sequences with the same interception length into the same sub-time series, and construct a multi-scale time series according to each sub-time series and the new energy vehicle sales at the corresponding preset moment, and the target influencing factor index belongs to the preset new energy vehicle sales influencing factor index system;
[0023] The multi-scale sequence feature extraction and prediction module is used to use different LSTM unit groups to extract features from each sub-time series, obtain feature extraction results, and obtain sub-prediction results based on the corresponding feature extraction results through the corresponding fully connected layer group, and obtain the final sales forecast result based on each sub-prediction result through the integrated unit.
[0024] In a fourth aspect, the present invention further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0025] Memory, used to store computer programs;
[0026] The processor is used to implement any method provided in the first aspect or the second aspect when executing the program stored in the memory.
[0027] In a fifth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any method provided in the first aspect or the second aspect is implemented.
[0028] Beneficial effects of the present invention:
[0029] The new energy vehicle sales prediction method based on the multi-scale sequence fusion LSTM network provided by the present invention can more fully learn the inherent change laws and patterns between various influencing factor indicator systems based on the multi-scale sequence fusion LSTM network. The method specifically intercepts the time series of each preset target influencing factor indicator obtained by the multi-scale sequence generation module according to the preset interception length and the preset time as the starting point to obtain N sub-time series of different lengths, and respectively constructs the corresponding multi-scale time series according to the sub-time series corresponding to each target influencing factor indicator and the new energy vehicle sales at the preset time, introduces the time multi-scale strategy, constructs time series of different time lengths, and then obtains the multi-scale time series. Further, the multi-scale sequence feature extraction and prediction module uses different LSTM units to extract features from each sub-time series to obtain feature extraction results, and obtains sub-prediction results according to the corresponding feature extraction results through the corresponding fully connected layer, and then obtains the final sales prediction result according to each sub-prediction result through the integration unit, so as to obtain multiple sub-prediction results by combining multiple indicators and fully extracting the characteristics of indicators under different time lengths, and then obtains a more accurate final sales prediction result based on the sub-prediction results obtained under different scale branches, thereby achieving a better prediction effect.
[0030] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a flow chart of a new energy vehicle sales forecasting method based on a multi-scale sequence fusion LSTM network provided by the present invention;
[0032] Figure 2 A schematic diagram of an architecture based on a multi-scale sequence fusion LSTM network provided by the present invention;
[0033] Figure 3 A schematic diagram of the architecture of an LSTM unit provided by the present invention;
[0034] Figure 4 A flowchart of a training method based on a multi-scale sequence fusion LSTM network provided by the present invention;
[0035] Figure 5 A schematic diagram of a flow chart of a testing method based on a multi-scale sequence fusion LSTM network provided by the present invention;
[0036] Figure 6 A line graph comparing sales forecast results and actual results provided by the present invention. DETAILED DESCRIPTION
[0037] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.
[0038] Many sales forecasting models have been proposed for the task of predicting sales of new energy vehicles. However, in view of the complex internal relationship between the influencing factors, the prediction of the sales trend of new energy vehicles and various factors affecting sales fluctuations still need further research. The present invention aims to construct a comprehensive, reasonable and accurate sales forecasting method for new energy vehicles to avoid the waste of funds, overcapacity and market share decline caused by inaccurate or wrong sales forecasts, and to aggravate the operating difficulties of enterprises. Facing the sales forecasting task of new energy vehicles, two indicators, namely the ratio of endurance to price and the ratio of endurance to fast charge, are first proposed, and then a new energy vehicle sales forecasting index system consisting of 10 influencing factors is constructed, and the correlation between the indicators of each influencing factor and sales is evaluated and analyzed. Subsequently, based on the multi-scale sequence fusion long short-term memory network (LSTM) model, the proposed algorithm model is used to establish a nonlinear mapping relationship between the feature and the vehicle sales, fully excavating the hidden laws and trends in the influencing factors, realizing the prediction of new energy vehicle sales and the analysis of influencing factors, and obtaining more accurate new energy vehicle sales data.
[0039] Figure 1 A flow chart of a new energy vehicle sales forecasting method based on a multi-scale sequence fusion LSTM network provided by the present invention is provided. The method is applied to a multi-scale sequence fusion LSTM network, such as Figure 2 As shown, based on the multi-scale sequence fusion LSTM network, it includes:
[0040] A multi-scale sequence generation module 21 and a multi-scale sequence feature extraction and prediction module 22.
[0041] The multi-scale sequence feature extraction and prediction module 22 includes an integrated unit, and N LSTM unit groups and N fully connected layer groups connected one to one, each LSTM unit group includes 2 layers of LSTM units, and each fully connected layer group includes 3 layers of fully connected layers, and N is a positive integer greater than or equal to 1.
[0042] Specifically, one LSTM unit group is connected to one fully connected layer, that is, the number of LSTM unit groups and fully connected layers included in the multi-scale sequence feature extraction and prediction module is the same.
[0043] See also Figure 1 , a new energy vehicle sales prediction method based on multi-scale sequence fusion LSTM network, including:
[0044] S101, a multi-scale sequence generation module, which performs interception processing on the acquired target influencing factor indicator time series according to N preset interception lengths and with multiple preset moments as the starting point, and classifies the sequences with the same interception length into the same sub-time series, and constructs a multi-scale time series based on each sub-time series and the new energy vehicle sales at the corresponding preset moment.
[0045] The target influencing factor indicators belong to the preset new energy vehicle sales influencing factor indicator system.
[0046] The number N of preset interception lengths can be set according to actual needs. Reasonable setting of the value of N can not only ensure the accuracy of the prediction results, but also ensure the prediction efficiency. For example, N is 3.
[0047] The value and quantity of the preset time can also be set according to actual needs, without any specific restrictions.
[0048] Specifically, the preset interception length can be determined according to the length of the obtained target influencing factor indicator time series, and can be set according to natural months, such as 2 months, 3 months, 4 months; or according to years, quarters, days, hours, minutes, etc. There is no specific limitation.
[0049] In one possible implementation, the multi-scale time series is represented as:
[0050]
[0051] Where D represents the multi-scale time series, H(t m ,tm+2 )、H(t m ,t m+3 )、H(t m ,t m+4 ) represent the sub-time series obtained by intercepting the time series of the target influencing factor index with three different preset interception lengths starting from the preset time m, Y(t m ) represents the sales volume of new energy vehicles corresponding to the preset time m.
[0052] For example, the time series of the target influencing factor index is represented as H(t0,t n ), the corresponding new energy vehicle sales volume in the corresponding month is the true value label, recorded as Y(t0,t n The multi-scale sequence generation module takes time m as the starting point, intercepts the time series of 2 months, 3 months, and 4 months as a label, and the sales volume at time m is the true value Y(t m ). Finally, the labeled sample dataset D can be obtained.
[0053] When there are multiple preset times, the above expression can also be expressed as:
[0054]
[0055] Among them, H(t g ,t g+2 )、H(t g ,t g+3 )、H(t g ,t g+4 ) represent the sub-time series obtained by intercepting the time series of the target influencing factor index with three different preset interception lengths starting from the preset time g, Y(t g ) represents the sales volume of new energy vehicles corresponding to the preset time g.
[0056] In one possible implementation method, the target influencing factor indicators include: the number of charging piles, the consumer price index, the per capita disposable income of residents, the total amount of investment and financing disclosed in the new energy vehicle industry, the gross domestic product (GDP), the ratio of battery life to price, the ratio of battery life to fast charging, the price of lithium carbonate, the price of gasoline and the production capacity of new energy passenger vehicles.
[0057] Optionally, the multi-scale sequence generation module, before truncating the acquired target influencing factor indicator time series according to N preset truncation lengths and taking multiple preset moments as the starting point, also adopts different strategies of completion methods such as rule filling, fixed value M filling or interpolation method to complete the missing data for different types of data, so as to ensure the accuracy and reliability of data analysis.
[0058] Furthermore, after completing some missing data, the multi-scale sequence generation module normalizes and matrixes the data of each indicator for the convenience of algorithm modeling, training optimization, etc. Specifically, it includes the following steps A1 and A2:
[0059] A1. Normalization: The minimum-maximum normalization method is used to normalize the data to eliminate the dimension and unit influence of data of different dimensions, thereby making the model training more stable and improving the model's generalization ability, training efficiency and prediction accuracy.
[0060] A2. Matrix: In order to better compare and analyze the relationship between various indicators and new energy vehicle sales, the indicator names and new energy vehicle sales are used as the vertical axis.
[0061] Table 1 is a target influencing factor table provided by the present invention, specifically a matrix target influencing factor table constructed with the months from January 2015 to December 2023 as the horizontal direction.
[0062] Table 1 Matrix target influencing factors
[0063]
[0064] Further, as shown in Table 2, the indicator system of factors affecting the sales volume of new energy vehicles includes primary indicators, secondary indicators and tertiary indicators. The primary indicators include factors affecting the sales volume of new energy vehicles. The secondary indicators include policy-related indicators, economic-related indicators, technology-related indicators and resource and environment-related indicators. The tertiary indicators corresponding to the policy-related indicators include the number of charging piles. The tertiary indicators corresponding to the economic-related indicators include the consumer price index, per capita disposable income of residents, the total amount of investment and financing disclosed in the new energy vehicle industry and the gross domestic product (GDP); the tertiary indicators corresponding to the technology-related indicators include the range-to-sale price ratio, the range-to-fast charging ratio and the price of lithium carbonate; the tertiary indicators corresponding to the resource and environment-related indicators include gasoline prices and the production capacity of new energy passenger vehicles.
[0065] Table 2 Index system of factors affecting sales of new energy vehicles
[0066]
[0067] S102, multi-scale sequence feature extraction and prediction module, uses different LSTM unit groups to extract features from each sub-time series to obtain feature extraction results, and obtains sub-prediction results according to the corresponding feature extraction results through the corresponding fully connected layer group, and obtains the final sales prediction result according to each sub-prediction result through the integrated unit.
[0068] It can be understood that the truncation lengths of the sub-time series are different, and different LSTM unit groups are used to extract features from the sub-time series, that is, different truncation lengths correspond to different LSTM unit groups.
[0069] In one possible implementation, the multi-scale sequence feature extraction and prediction module can be described as:
[0070] P1=FC(LSTM2(D2)),
[0071] P2=FC(LSTM3(D3)),
[0072] P3=FC(LSTM4(D4)),
[0073] Among them, FC(·) represents a three-layer fully connected layer group, D2, D3 and D4 represent sub-time series corresponding to three different truncation lengths, LSTM2, LSTM3 and LSTM4 represent LSTM units used to perform feature extraction processing on sub-time series corresponding to three different truncation lengths, and P1, P2, P3 represent sub-prediction results corresponding to three different truncation lengths.
[0074] By using historical sales data collected by big data and combining it with the LSTM network in the artificial intelligence algorithm, accurate prediction of new energy vehicle sales can be achieved, such as Figure 3 As shown in the figure, each LSTM unit contains a memory unit (Cell State) and three gate units (Input Gate, Forget Gate, Output Gate). The LSTM network consists of one or more LSTM units, and each LSTM unit contains the following core components:
[0075] 1. Input gate: controls the degree of information extracted from the input data.
[0076] 2. Forget gate: controls the degree of forgetting the memory of the previous time step.
[0077] 3. Output gate: controls the extent to which the contents of the memory are passed to the next time step.
[0078] 4. Memory unit: the main path for storing and transmitting information.
[0079] 5. State transfer function: controls how to update and transfer memory state.
[0080] In summary, the LSTM network can effectively process time series data and adapt to complex sales change patterns, thereby improving the accuracy and reliability of predictions.
[0081] Furthermore, in a possible implementation, the state update formula of the input gate of the LSTM unit is expressed as:
[0082] i t =σ(W ix x t +W ih h t-1 +b i ),
[0083] Among them, i t represents the output of the input gate, σ(·) represents the sigmoid function, and W ix Represents the input gate and input x t The weight between ih Represents the hidden state h of the input gate and the previous time step t-1 The weight between i Represents the bias of the input gate.
[0084] The forget gate state update formula of the LSTM unit is as follows:
[0085] f t =σ(W fx x t +W fh h t-1 +b f ),
[0086] Among them, f t represents the output of the forget gate, W fx Represents the forget gate and input x t The weight between fh Represents the hidden state h of the forget gate and the previous time step t-1 The weight between f Represents the bias of the forget gate.
[0087] The output gate state update formula of the LSTM unit is as follows:
[0088] o t =σ(W ox x t +W oh h t-1 +b o ),
[0089] Among them, t represents the output of the output gate, W ox Represents the output gate and input x t The weight between oh Represents the hidden state h of the output gate and the previous time step t-1 The weight between o Represents the bias of the output gate.
[0090] The memory unit update formula of the LSTM unit is as follows:
[0091]
[0092]
[0093] in, represents the candidate memory state at the current moment, C t represents the memory state at the current moment, ⊙ represents element-by-element multiplication, C t-1 represents the memory state at time t-1, tanh(·) represents the tanh function, W cx Represents the cell state and input x t The weight between ch Represents the cell state and the hidden state h of the previous time step t-1 The weight between c Represents the bias of the cell state.
[0094] The hidden state update formula of the LSTM unit is as follows:
[0095] h t =o t ⊙tanh(C t ),
[0096] Among them, h t Indicates the hidden state at the current moment.
[0097] Optionally, the integration unit obtains a final prediction result corresponding to the first multi-scale time series based on each sub-prediction result, including the integration unit calculating an average value of each sub-prediction result and determining the average value as the final prediction result corresponding to the first multi-scale time series.
[0098] Specifically, it can be expressed as:
[0099]
[0100] Among them, P represents the final prediction result, and P1, P2, and P3 represent the sub-prediction results corresponding to the sub-time series with lengths of 2, 3, and 4, respectively.
[0101] The new energy vehicle sales prediction method based on the multi-scale sequence fusion LSTM network provided by the present invention can more fully learn the inherent change laws and patterns between various influencing factor indicator systems based on the multi-scale sequence fusion LSTM network. The method specifically intercepts the time series of each preset target influencing factor indicator obtained by the multi-scale sequence generation module according to the preset interception length and the preset time as the starting point to obtain N sub-time series of different lengths, and respectively constructs the corresponding multi-scale time series according to the sub-time series corresponding to each target influencing factor indicator and the new energy vehicle sales at the preset time, introduces the time multi-scale strategy, constructs time series of different time lengths, and then obtains the multi-scale time series. Further, the multi-scale sequence feature extraction and prediction module uses different LSTM units to extract features from each sub-time series to obtain feature extraction results, and obtains sub-prediction results according to the corresponding feature extraction results through the corresponding fully connected layer, and then obtains the final sales prediction result according to each sub-prediction result through the integration unit, so as to obtain multiple sub-prediction results by combining multiple indicators and fully extracting the characteristics of indicators under different time lengths, and then obtains a more accurate final sales prediction result based on the sub-prediction results obtained under different scale branches, thereby achieving a better prediction effect.
[0102] The following is a detailed introduction on how to train and verify the multi-scale sequence fusion LSTM network.
[0103] Figure 4 A flow chart of a training method based on a multi-scale sequence fusion LSTM network provided by the present invention is shown in FIG. Figure 4 As shown, the method includes:
[0104] S401, initialize the weights and biases of the multi-scale sequence fusion LSTM network.
[0105] S402: Input the acquired time series of the target influencing factor index as an input sequence into the multi-scale sequence fusion LSTM network to obtain a predicted value.
[0106] Among them, the target influencing factor indicators belong to the preset new energy vehicle sales influencing factor indicator system.
[0107] S403: Use the MSE loss function to calculate the difference between the predicted value and the true value.
[0108] S404. According to the gradient of the loss function, the gradient of the parameters is calculated using the back propagation algorithm.
[0109] S405. Use the Adam optimization algorithm to update the network parameters of the multi-scale sequence fusion LSTM network according to the gradient.
[0110] S406. Repeat steps S402 to S405 until a preset maximum number of iterations is reached.
[0111] Figure 5 A flow chart of a testing method based on a multi-scale sequence fusion LSTM network provided by the present invention is shown in FIG. Figure 5 As shown, the method includes:
[0112] S501, input the newly acquired time series of the target influencing factor index as an input sequence into the trained multi-scale sequence fusion LSTM network.
[0113] Among them, the target influencing factor indicators belong to the preset new energy vehicle sales influencing factor indicator system.
[0114] S502: Based on the input sequence, a prediction value is obtained through forward propagation calculation.
[0115] S503: Output predicted value.
[0116] Through the above training and testing process, the LSTM network can be used for time series prediction tasks and obtain relatively accurate prediction results.
[0117] In order to better evaluate the trained network, the present invention also provides multiple evaluation indicators, as follows:
[0118] When performing sales forecasting tasks, the loss function is used to measure the difference between the predicted value and the true value. For time series forecasting tasks (i.e. regression tasks), the root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and symmetric mean absolute percentage error are used as evaluation indicators of the forecasting effect. The calculation formula is:
[0119]
[0120]
[0121] in, represents the predicted value at the i-th moment, y i It represents the actual value at the i-th moment. The range of RMSE, MAE, MAPE, and SMAPE is [0, +∞). The larger the value, the greater the error of the model prediction result. The smaller the value, the more accurate the prediction result. n represents the number of observations and represents the moment.
[0122] The present invention also provides a multi-scale sequence fusion LSTM network, comprising:
[0123] Multi-scale sequence generation module and multi-scale sequence feature extraction and prediction module.
[0124] The multi-scale sequence feature extraction and prediction module includes an integrated unit, and N LSTM unit groups and N fully connected layer groups connected one to one. Each LSTM unit group includes 2 layers of LSTM units, and each fully connected layer group includes 3 layers of fully connected layers. N is a positive integer greater than or equal to 1.
[0125] The multi-scale sequence generation module is used to intercept the acquired target influencing factor indicator time series according to N preset interception lengths and multiple preset moments as the starting point, and classify the sequences with the same interception length into the same sub-time series, and construct a multi-scale time series based on the new energy vehicle sales volume of each sub-time series and the corresponding preset moment. The target influencing factor indicator belongs to the preset new energy vehicle sales influencing factor indicator system.
[0126] The multi-scale sequence feature extraction and prediction module is used to use different LSTM unit groups to extract features from each sub-time series, obtain feature extraction results, and obtain sub-prediction results based on the corresponding feature extraction results through the corresponding fully connected layer group, and obtain the final sales forecast result based on each sub-prediction result through the integrated unit.
[0127] In order to further prove the beneficial effects of the present invention, the present invention also provides a set of experimental data, as follows.
[0128] 1. Simulation conditions
[0129] This prediction model is based on the multi-scale sequence fusion LSTM network model (New Energy Vehicle Sales Forecasting and Analysis Based on Multi-Scale Sequence Fusion LSTM Network, MSSF-LSTM), which introduces a time multi-scale strategy to construct indicator sequences with time lengths of 2, 3, and 4 as label samples, and input training samples at different scales into the LSTM unit structure. The characteristic laws at different time lengths can be fully extracted, and finally the prediction results obtained under different scale branches are averaged to obtain a more accurate final prediction result.
[0130] The methods compared in the experiment are as follows:
[0131] This experiment selected 6 comparison algorithms to compare with MSSF-LSTM, namely Autoregressive Integrated Moving Average Model (ARIMA), Seasonal Autoregressive Integrated Moving Average (SARIMA), Random Forest (RF), CatBoost (Categorical Boosting), K-Nearest Neighbor (KNN), and Support Vector Regression (SVR).
[0132] 2. Simulation content
[0133] According to a specific implementation of the present invention, the future sales volume of new energy vehicles is calculated, and the prediction accuracy is compared with six models including ARIMA, SARIMA, RF, CatBoost, KNN and SVR. The results are shown in Table 3.
[0134] Table 3 Prediction results of MSSF-LSTM and other algorithms
[0135] Evaluation indicators ARIMA SARIMA RF CatBoost KNN SVR MSSF-LSTM RMSE 90319 25254 16785 142744 109912 631980 48349 MAE 211976 44227 268905 332889 261824 596067 37801 MAPE 66.3 22.7 4.5 28.6 28.2 66.6 4.32 SMAPE 26.2 4.67 34.8 45.3 33.6 12.4 4.21
[0136] In order to more intuitively display the prediction results of each algorithm, the present invention Figure 6 The line chart intuitively shows the comparison between the sales forecast results and the actual results obtained based on the method provided by the present invention. Figure 6 It can be seen that the sales forecast results corresponding to MSSF-LSTM have the best fit with the actual results, and the forecast is relatively more accurate.
[0137] It can be seen from the above table that the smaller the values of the evaluation indicators RMSE, MAE, MAPE, and SMAPE are, the more accurate the prediction results are. It can be seen that the prediction model provided by the present invention has the smallest values in the four evaluation indicators. Therefore, it is concluded that the prediction model provided by the present invention is the most accurate in predicting the sales volume of new energy vehicles.
[0138] The present invention also provides a structure of an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus.
[0139] Memory, used to store computer programs;
[0140] The processor is used to implement the steps provided in the above method embodiment when executing the program stored in the memory.
[0141] The communication interface is used for communication between the above electronic device and other devices.
[0142] The method provided in the embodiment of the present invention can be applied to electronic devices. Specifically, the electronic device can be: a desktop computer, a portable computer, an intelligent mobile terminal, a server, etc. This is not limited here, and any electronic device that can implement the present invention belongs to the protection scope of the present invention.
[0143] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps provided in the above method embodiment are implemented.
[0144] As for the device / electronic device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the specific content and beneficial effects and other related matters can be referred to the partial description of the method embodiment.
[0145] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0146] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A new energy vehicle sales prediction method based on multi-scale sequence fusion LSTM network, characterized in that: Applied to multi-scale sequence fusion LSTM network, The multi-scale sequence fusion LSTM network includes: Multi-scale sequence generation module, multi-scale sequence feature extraction and prediction module; The multi-scale sequence feature extraction and prediction module includes an integration unit, and N LSTM unit groups and N fully connected layer groups connected one to one, each of the LSTM unit groups includes 2 layers of LSTM units, each of the fully connected layer groups includes 3 layers of fully connected layers, and N is a positive integer greater than or equal to 1; The method comprises: The multi-scale sequence generation module intercepts the acquired target influencing factor index time series according to N preset interception lengths and with multiple preset moments as starting points, and classifies the sequences with the same interception length into the same sub-time series, and constructs a multi-scale time series according to each sub-time series and the new energy vehicle sales at the corresponding preset moments, wherein the target influencing factor index belongs to the preset new energy vehicle sales influencing factor index system; The multi-scale sequence feature extraction and prediction module uses different LSTM unit groups to extract features from each of the sub-time series to obtain feature extraction results, and obtains sub-prediction results based on the corresponding feature extraction results through the corresponding fully connected layer groups, and obtains the final sales forecast result based on each of the sub-prediction results through the integrated unit.
2. The method according to claim 1, characterized in that The multi-scale time series is expressed as: Where D represents the multi-scale time series, H(t m ,t m+2 )、H(t m ,t m+3 )、H(t m ,t m+4 ) represent the sub-time series obtained by intercepting the target influencing factor index time series with three different preset interception lengths starting from the preset time m, Y(t m ) represents the sales volume of new energy vehicles corresponding to the preset time m.
3. The method according to claim 1 or 2, characterized in that: The multi-scale sequence feature extraction and prediction module is described as: P1=FC(LSTM2(D2)), P2=FC(LSTM3(D3)), P3=FC(LSTM4(D4)), Among them, FC(·) represents a three-layer fully connected layer group, D2, D3 and D4 represent sub-time series corresponding to three different truncation lengths, LSTM2, LSTM3 and LSTM4 represent LSTM units used to perform feature extraction processing on sub-time series corresponding to three different truncation lengths, and P1, P2, P3 represent sub-prediction results corresponding to three different truncation lengths.
4. The system according to claim 3, characterized in that The state update formula of the input gate of the LSTM unit is expressed as: i t =σ(W ix x t +W ih h t-1 +b i ), Among them, i t represents the output of the input gate, σ(·) represents the sigmoid function, and W ix Represents the input gate and input x t The weight between ih Represents the hidden state h of the input gate and the previous time step t-1 The weight between i represents the bias of the input gate; The forget gate state update formula of the LSTM unit is as follows: f t =σ(W fx x t +W fh h t-1 +b f ), Among them, f t represents the output of the forget gate, W fx Represents the forget gate and input x t The weight between fh Represents the hidden state h of the forget gate and the previous time step t-1 The weight between f Represents the bias of the forget gate; The output gate state update formula of the LSTM unit is as follows: o t =σ(W ox x t +W oh h t-1 +b o ), Among them, t represents the output of the output gate, W ox Represents the output gate and input x t The weight between oh Represents the hidden state h of the output gate and the previous time step t-1 The weight between o represents the bias of the output gate; The memory unit update formula of the LSTM unit is as follows: in, represents the candidate memory state at the current moment, C t represents the memory state at the current moment, ⊙ represents element-by-element multiplication, C t-1 represents the memory state at time t-1, tanh(·) represents the tanh function, W cx Represents the cell state and input x t The weight between ch Represents the cell state and the hidden state h of the previous time step t-1 The weight between c represents the bias of the cell state; The hidden state update formula of the LSTM unit is as follows: h t =o t ⊙tanh(C t ), Among them, h t Indicates the hidden state at the current moment.
5. The method according to claim 1 or 2, characterized in that: The target influencing factor indicators include: the number of charging piles, the consumer price index, the per capita disposable income of residents, the total amount of investment and financing disclosed in the new energy vehicle industry, the gross domestic product (GDP), the ratio of battery life to price, the ratio of battery life to fast charging, the price of lithium carbonate, the price of gasoline and the production capacity of new energy passenger vehicles.
6. The method according to claim 5, characterized in that The index system of factors influencing the sales volume of new energy vehicles includes primary indexes, secondary indexes and tertiary indexes; The first-level indicators include factors affecting the sales volume of new energy vehicles; The secondary indicators include policy-related indicators, economic-related indicators, technology-related indicators, and resource and environment-related indicators; The third-level indicators corresponding to the policy-related indicators include the number of charging piles; The third-level indicators corresponding to the economic-related indicators include the consumer price index, the per capita disposable income of residents, the total amount of investment and financing disclosed in the new energy vehicle industry, and the gross domestic product (GDP); The third-level indicators corresponding to the technology-related indicators include the battery life-to-price ratio, the battery life-to-fast charging ratio and the lithium carbonate price; The third-level indicators corresponding to the resource and environment-related indicators include the gasoline price and the new energy passenger vehicle production capacity.
7. A training method based on a multi-scale sequence fusion LSTM network, characterized in that: include: S71, initialize the weights and biases of the multi-scale sequence fusion LSTM network; S72, inputting the acquired time series of the target influencing factor index as an input sequence into the multi-scale sequence fusion-based LSTM network to obtain a predicted value, wherein the target influencing factor index belongs to a preset new energy vehicle sales influencing factor index system; S73, using the MSE loss function to calculate the difference between the predicted value and the true value; S74, calculating the gradient of the parameter using a back propagation algorithm according to the gradient of the loss function; S75, using the Adam optimization algorithm to update the network parameters of the multi-scale sequence fusion LSTM network according to the gradient; S76, repeat steps S72 to S75 until a preset maximum number of iterations is reached.
8. A multi-scale sequence fusion LSTM network, characterized in that: include: Multi-scale sequence generation module, multi-scale sequence feature extraction and prediction module; The multi-scale sequence feature extraction and prediction module includes an integrated unit, and N LSTM unit groups and N fully connected layer groups connected one to one, each of the LSTM unit groups includes 2 layers of LSTM units, each of the fully connected layer groups includes 3 layers of fully connected layers, and N is a positive integer greater than or equal to 1; The multi-scale sequence generation module is used to intercept the acquired target influencing factor index time series according to N preset interception lengths and multiple preset moments as starting points, and classify the sequences with the same interception length into the same sub-time series, and construct a multi-scale time series according to each sub-time series and the new energy vehicle sales at the corresponding preset moment, wherein the target influencing factor index belongs to the preset new energy vehicle sales influencing factor index system; The multi-scale sequence feature extraction and prediction module is used to use different LSTM unit groups to extract features from each of the sub-time series to obtain feature extraction results, and obtain sub-prediction results based on the corresponding feature extraction results through the corresponding fully connected layer groups, and obtain the final sales forecast result based on each of the sub-prediction results through the integrated unit.
9. 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; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
