Method, device, storage medium and electronic device for predicting road slope
By combining the autoregressive integral moving average model ARIMA and the long short-term memory network model LSTM, the problem of low road slope prediction accuracy in the existing technology is solved, high-precision prediction in different environments is achieved, and model parameter determination is simplified.
Patent Information
- Application Number
- CN202410906249.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Existing road slope prediction solutions have low accuracy, especially when the GPS signal is poor or high-precision map updates are frequent and costly, and a single time series ARIMA model cannot guarantee prediction accuracy, especially when the road slope changes greatly. .
Construct the autoregressive integral moving average model ARIMA and the long short-term memory network model LSTM. Train the model by selecting the slope data in the historical time period, use ARIMA to make initial predictions, and input the prediction error into the LSTM for fitting, and combine the two for fusion prediction. .
It improves the accuracy of road slope prediction, can provide higher prediction accuracy in different geographical environments, avoids dependence on GPS and high-precision maps, and simplifies the process of determining model parameters.
Smart Images

Figure CN118445555B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of road slope prediction, and in particular, to a method, device, storage medium and electronic device for predicting road slope. Background Art
[0002] Road slope is an important basic parameter required for the application of modern vehicle intelligent control technology. Accurate prediction of road slope is of great significance to the realization of intelligent navigation.
[0003] There are currently several solutions for road slope prediction:
[0004] Solution 1: Use GPS to obtain the current vehicle location information and the location information of a few hundred meters ahead, and determine the future road slope information based on the high-precision map;
[0005] Solution 2: Road slope prediction based on the ARIMA model. Specifically, the slope is regarded as time series data through GIS system information, and the ARIMA model is used to predict the time series slope.
[0006] Solution 3: Calculate the current road curvature based on historical information recorded by GPS, and predict the road slope based on the curvature.
[0007] The existing solutions have the following shortcomings:
[0008] For Solution 1: The location information recorded by GPS has large errors and is difficult to use when the satellite signal is not good. In addition, high-precision maps need to be updated in a timely manner, and the cost of using high-precision maps is high;
[0009] For Option 2: A single time series ARIMA model has different levels of linear and nonlinear fitting, and cannot guarantee the prediction accuracy;
[0010] For option three: the road curvature can only predict the road slope over a shorter distance. In mountainous areas and other places where the road slope varies greatly, the estimation accuracy is poor. Summary of the invention
[0011] The main purpose of the present application is to provide a method, device, storage medium and electronic device for predicting road slope, so as to at least solve the problem of low accuracy of existing road slope prediction solutions.
[0012] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for predicting road slope is provided, comprising: constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA and the LSTM model are trained using first historical slope data obtained in a selected historical time period; inputting second historical slope data obtained in a previous historical time period into the ARIMA for processing, and the ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period; forming a historical residual sequence from the difference between multiple groups of the initial predicted slope and the second historical slope data, and inputting the historical residual sequence into the LSTM model for processing to obtain a predicted residual; and adding the initial predicted slope and the predicted residual to obtain a fused predicted slope for the previous historical time period.
[0013] Optionally, constructing an autoregressive integrated moving average model ARIMA includes: performing data preprocessing on the first historical slope data to obtain preprocessed historical slope data, wherein the data preprocessing includes filtering and downsampling; determining whether the preprocessed historical slope data is a stationary sequence; if the preprocessed historical slope data is a non-stationary sequence, performing differential processing on the preprocessed historical slope data to convert the preprocessed historical slope data into a stationary sequence, and determining the order d in the process of differencing; and using the first part of the stationary sequence to determine the order p and order q of the ARIMA.
[0014] Optionally, determining whether the preprocessed historical slope data is a stationary sequence includes: using an ADF test method to determine whether the preprocessed historical slope data is the stationary sequence; using the first part of the stationary sequence to determine the order p and the order q of the ARIMA, including: obtaining an autocorrelation graph and a partial autocorrelation graph of the first part of the stationary sequence; and using the autocorrelation graph and the partial autocorrelation graph to determine the order p and the order q.
[0015] Optionally, after using the first part of the stationary sequence to determine the order p and order q of the ARIMA, the method further includes: using the determined order ARIMA to process the second part of the stationary sequence to obtain the corresponding historical predicted slope; obtaining the residual between the historical predicted slope and the historical true slope, and performing residual verification, and if the verification passes, determining the order p and order q determined this time as the order used for prediction; if the verification fails, continuing to perform differential processing on the pre-processed historical slope data until the order p and order q are finally determined.
[0016] Optionally, constructing a long short-term memory network model LSTM model includes: using the residual that has passed the residual check to train an initial LSTM model to obtain the LSTM model.
[0017] Optionally, the method further includes: setting the width of the time window of the initial predicted slope output by the ARIMA to be equal to the width of the time window of the predicted residual output by the LSTM model.
[0018] Optionally, the method is applicable to the prediction of the slope of plain roads and the slope of mountain roads.
[0019] According to another aspect of the present application, a device for predicting road slope is provided, comprising: a construction unit, for constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA and the LSTM model are trained using first historical slope data obtained in a selected historical time period; a first processing unit, for inputting second historical slope data obtained in a previous historical time period into the ARIMA for processing, and the ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period; a second processing unit, for forming a historical residual sequence from the difference between multiple groups of the initial predicted slope and the second historical slope data, and inputting the historical residual sequence into the LSTM model for processing to obtain a predicted residual; and a summing unit, for summing the initial predicted slope with the predicted residual to obtain a fused predicted slope for the previous historical time period.
[0020] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods for predicting road slope.
[0021] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of the methods for predicting road slope.
[0022] Applying the technical solution of the present application, by constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, the second historical slope data obtained in the previous historical time period is input into ARIMA for processing, ARIMA outputs the initial predicted slope, and the difference between multiple groups of initial predicted slopes and the second historical slope data constitutes a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain the predicted residual; the initial predicted slope and the predicted residual are added to obtain the fused predicted slope in the previous historical time period. In this solution, the establishment of the ARIMA model does not require complex regression analysis, the parameters are concise, and the interpretability is strong. The linear part of the time series data can be effectively predicted. The introduction of the long short-term memory neural network model can fit the nonlinear part of the time series data. The combination of the two can improve the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0024] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for predicting a road slope provided in an embodiment of the present application is shown;
[0025] Figure 2 A schematic diagram of a process of predicting a road slope provided in accordance with an embodiment of the present application is shown;
[0026] Figure 3 A flowchart of constructing ARIMA according to an embodiment of the present application is shown;
[0027] Figure 4 Another flow chart for constructing ARIMA according to an embodiment of the present application is shown;
[0028] Figure 5 A structural block diagram of a device for predicting road slope provided according to an embodiment of the present application is shown;
[0029] Figure 6 A schematic diagram of an electronic device provided according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] As introduced in the background technology, the accuracy of the road slope prediction scheme in the prior art is low. To solve the problem of low accuracy of the road slope prediction scheme, the embodiments of the present application provide a method, device, storage medium and electronic device for predicting road slope.
[0034] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0035] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for predicting a road slope according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0036] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for predicting road slope in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0037] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] In this embodiment, a method is provided that runs on a mobile terminal, a computer terminal or a similar computing device. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0039] Figure 2 FIG. 1 is a flow chart of a method for predicting road slope according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0040] Step S201, constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA model and the LSTM model are trained by using the first historical slope data obtained within a selected historical time period;
[0041] Among them, the AutoRegressive Integrated Moving Average Model (ARIMA) is a time series prediction model. The ARIMA model combines autoregression (AR), differencing (I), and moving average (MA) to process non-stationary time series data and make predictions. Autoregression (AR): refers to the correlation between the current value of the model and the past value, that is, the current value can be predicted by its previous value; Difference (I): If the time series is non-stationary, it can be converted into a stationary series by difference. The order of difference (d) indicates how many times the difference needs to be made. Moving average (MA): refers to the correlation between the current value of the model and the past error term, that is, the current value can be predicted by the past prediction error. The ARIMA model is usually expressed as ARIMA (p, d, q), where: p is the order of the autoregressive term; d is the order of the difference; q is the order of the moving average term.
[0042] Among them, LSTM is the abbreviation of Long Short-Term Memory. It is a special recurrent neural network (RNN) structure. The core of the LSTM network is its unit structure. Each unit contains three gates: Forget Gate: Determines which information should be forgotten from the unit state. The forget gate reads the output of the previous time step and the input of the current time step, and outputs a value between 0 and 1, indicating the degree of forgetting. Input Gate: Determines which new information will be stored in the unit state. The input gate consists of two parts: a sigmoid layer that determines which values will be updated, and a tanh layer that creates a new candidate value vector that can be added to the state. Output Gate: Determines the value of the next hidden state, which is based on the unit state and some information. The output gate outputs a value between 0 and 1, indicating the degree of activation of the hidden state.
[0043] Among them, the historical time period can be selected as the historical slope data of the previous week, the historical slope data of the previous half month, and the historical slope data of the previous month;
[0044] Step S202, inputting the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period;
[0045] The previous historical time period can be selected as the historical slope data of the previous half hour, the historical slope data of the previous 10 minutes, and the historical slope data of the previous 5 minutes; for example, the slope data of the previous half hour is used to predict the slope of the current 15 minutes, the slope data of the previous 10 minutes is used to predict the slope of the current 10 minutes, and the slope data of the previous 5 minutes is used to predict the slope of the current 5 minutes;
[0046] Step S203, the difference between the multiple groups of initial predicted slopes and the second historical slope data is used to form a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain a predicted residual;
[0047] For example, the historical residual sequence includes 500 residual values, and 100 predicted residuals are obtained by prediction; the historical residual sequence includes 300 residual values, and 50 predicted residuals are obtained by prediction; wherein 1S, 2S or 5S, etc. may correspond to one residual;
[0048] Step S204, adding the initial predicted slope and the predicted residual to obtain the fused predicted slope in the previous historical time period.
[0049] The method for predicting road slope of the present application constructs an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, inputs the second historical slope data obtained in the previous historical time period into ARIMA for processing, ARIMA outputs the initial predicted slope, and the difference between multiple groups of initial predicted slopes and the second historical slope data forms a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain the predicted residual; the initial predicted slope and the predicted residual are added to obtain the fused predicted slope in the previous historical time period. In this solution, the establishment of the ARIMA model does not require complex regression analysis, the parameters are concise, and the interpretability is strong. The linear part of the time series data can be effectively predicted. The introduction of the long short-term memory neural network model can fit the nonlinear part of the time series data. The combination of the two can improve the prediction accuracy.
[0050] In the optional embodiment of the present application, Figure 3 As shown, step S201: constructing an autoregressive integrated moving average model ARIMA, including:
[0051] Step S2011: performing data preprocessing on the first historical slope data to obtain preprocessed historical slope data, wherein the data preprocessing includes filtering processing and downsampling processing;
[0052] Optionally, the acquired slope data is filtered by low-pass filtering, and then the data is converted to 1 Hz based on downsampling; before downsampling, the signal is low-pass filtered to eliminate frequency components higher than the new sampling rate to prevent aliasing.
[0053] Optionally, downsampling is achieved by using a simple discarding method, that is, discarding some samples from the original data at regular intervals. For example, if the original sampling rate is 100 Hz, downsampling to 50 Hz means that one sample is taken every other sample.
[0054] Optionally, the mean of the data is kept constant during the downsampling process by calculating the average of a certain number of consecutive samples and then using this average as the downsampled data point.
[0055] Step S2012: Determine whether the preprocessed historical slope data is a stationary sequence;
[0056] Step S2013: if the preprocessed historical slope data is a non-stationary sequence, performing differential processing on the preprocessed historical slope data to convert the preprocessed historical slope data into a stationary sequence, and determining the order d in the differential process;
[0057] If the stationary series enters the step of determining the order p and order q of ARIMA;
[0058] Step S2014: Use the first part of the stationary series to determine the order p and order q of ARIMA.
[0059] The above-mentioned preprocessing step, the stationary sequence judgment step, and the difference processing step are used to determine the order d, the order p, and the order q to determine the ARIMA.
[0060] In an optional embodiment of the present application, determining whether the preprocessed historical slope data is a stationary sequence includes: using an ADF test method to determine whether the preprocessed historical slope data is a stationary sequence;
[0061] Among them, the ADF test (Augmented Dickey-Fuller test) is a method commonly used to determine whether time series data is stationary. The basic idea of the ADF test is to test whether there is a unit root in the time series. If there is a unit root, the series is non-stationary; if there is no unit root, the series is stationary. A unit root means that the mean and variance of the time series will increase over time, causing the statistical characteristics of the series to change over time.
[0062] The first part of the stationary sequence is used to determine the order p and the order q of ARIMA, including: obtaining an autocorrelation diagram and a partial autocorrelation diagram of the first part of the stationary sequence; and determining the order p and the order q by using the autocorrelation diagram and the partial autocorrelation diagram.
[0063] Specifically, the order p and the order q are determined by tailing and truncation through the autocorrelation graph ACF (Autocorrelation Function) graph and the partial autocorrelation graph PACF (Partial Autocorrelation Function) graph;
[0064] Optionally, the order p and the order q are determined by information criterion (AIC (Akaike Information Criterion), BIC (Bayesian Information Criterion), HQIC (Hannan-Quinn Information Criterion);
[0065] In an optional embodiment of the present application, after determining the order p and the order q of ARIMA using the first part of the stationary sequence, the method further includes:
[0066] The second part of the stationary series is processed using ARIMA of a certain order to obtain the corresponding historical forecast slope;
[0067] The residual between the historical predicted slope and the historical actual slope is obtained, and a residual check is performed. If the check passes, the order p and order q determined this time are determined as the order used for prediction. If the check fails, the preprocessed historical slope data is continued to be differentially processed until the order p and order q are finally determined.
[0068] Among them, the residual of the historical true slope is the second part of the stationary series;
[0069] In the above, the first part of the stationary sequence is used to determine the order p and the order q of ARIMA, and the second part of the stationary sequence is used to perform residual verification, and two parts of different data are used to achieve accurate determination of the order p and the order q.
[0070] A specific method to determine ARIMA is as follows Figure 4 As shown, firstly, the road slope data within the historical time is obtained (equivalent to the historical slope data), and then the historical slope data is preprocessed, and then it is determined whether the preprocessed data is a stationary sequence. If it is a stationary sequence, the order of parameters is determined. If it is not a stationary sequence, differential processing is performed to obtain a stationary sequence. After the order of parameters is determined, the residual check step is performed. If the test passes, ARIMA that can be used for prediction is obtained. If the test fails, it returns to the differential processing step.
[0071] In an optional embodiment of the present application, a long short-term memory network model LSTM model is constructed, including:
[0072] The residuals that pass the residual check are used to train the initial LSTM model to obtain the LSTM model.
[0073] The LSTM model obtained by residual training with residuals that pass the residual check is more suitable for subsequent residual determination. If the residuals that fail the check are used, the residuals determined subsequently will also be inaccurate.
[0074] In an optional embodiment of the present application, the method further includes:
[0075] Set the width of the time window of the initial forecast slope output by the ARIMA model to be equal to the width of the time window of the forecast residual output by the LSTM model.
[0076] That is, the width of the time window of the initial predicted slope output by ARIMA and the width of the time window of the predicted residual output by the LSTM model are unified to achieve consistency in the time windows, that is, both predict the slope data within the next 5 minutes.
[0077] In the optional embodiments of the present application, the method is applicable to the slope prediction of plain roads and mountain roads. Of course, it can also be applied to scenes such as expressways and national highways, that is, the slope prediction scheme of the present application is applicable to a variety of scenes.
[0078] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for predicting road slope of the present application will be described in detail below in combination with specific embodiments.
[0079] This embodiment relates to a specific method for predicting road slope, including the following steps:
[0080] Step S1: using the first historical slope data obtained in the selected historical time period to construct an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model;
[0081] Step S1 specifically includes:
[0082] Step S11: performing data preprocessing on the first historical slope data to obtain preprocessed historical slope data, wherein the data preprocessing includes filtering processing and downsampling processing;
[0083] Step S12: Determine whether the preprocessed historical slope data is a stationary sequence;
[0084] Step S13: if the preprocessed historical slope data is a non-stationary sequence, performing differential processing on the preprocessed historical slope data to convert the preprocessed historical slope data into a stationary sequence, and determining the order d in the differential process;
[0085] Step S14: using the first part of the stationary series to determine the order p and order q of ARIMA;
[0086] Step S15: using ARIMA of a determined order to process the second part of the stationary sequence to obtain the corresponding historical prediction slope;
[0087] Step S16: Obtain the residual between the historical predicted slope and the historical actual slope, and perform residual verification. If the verification passes, the order p and order q determined this time are determined as the order used for prediction. If the verification fails, continue to perform differential processing on the preprocessed historical slope data until the order p and order q are finally determined.
[0088] Step S17: The initial LSTM model is trained using the residual that has passed the residual check to obtain the LSTM model.
[0089] Step S2: input the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period;
[0090] Step S3: The differences between the multiple groups of initial predicted slopes and the second historical slope data are used to form a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain a predicted residual;
[0091] Step S4: Add the initial predicted slope and the predicted residual to obtain the fused predicted slope for the previous historical time period.
[0092] In the embodiment of the present application, ARIMA and LSTM are used to fit the linear and nonlinear characteristics of the historical slope data respectively, and the future slope is finally predicted. The hybrid model can predict the future slope based on the historical slope data on the basis of considering both the linear factors and the nonlinear factors of the time series, and has high model stability and accuracy.
[0093] It will not be affected by GPS application conditions and does not require the use of high-precision map information. The establishment of the ARIMA model does not require complex regression analysis. The parameters are concise and highly interpretable. It can effectively predict the linear part of the time series data. The introduction of the long short-term memory neural network model can fit the nonlinear part of the time series data. The combination of the two can improve the prediction accuracy.
[0094] The present application embodiment also provides a device for predicting the road slope. It should be noted that the device for predicting the road slope of the embodiment of the present application can be used to execute the method for predicting the road slope provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0095] The following is an introduction to the device for predicting road slope provided in an embodiment of the present application.
[0096] Figure 5 Schematic diagram of a device for predicting road slope according to an embodiment of the present application. Figure 5 As shown, the device comprises:
[0097] A construction unit 51 is used to construct an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA and LSTM models are trained by using the first historical slope data obtained in the selected historical time period;
[0098] The first processing unit 52 is used to input the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period;
[0099] The second processing unit 53 is used to form a historical residual sequence from the differences between the multiple groups of initial predicted slopes and the second historical slope data, and input the historical residual sequence into the LSTM model for processing to obtain a predicted residual;
[0100] The adding unit 54 is used to add the initial predicted slope and the predicted residual to obtain the fused predicted slope in the previous historical time period.
[0101] The device for predicting road slope of the present application constructs an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model through a construction unit. The first processing unit inputs the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs the initial predicted slope. The second processing unit forms a historical residual sequence with the difference between multiple groups of initial predicted slopes and the second historical slope data, and inputs the historical residual sequence into the LSTM model for processing to obtain the predicted residual; the summing unit adds the initial predicted slope and the predicted residual to obtain the fused predicted slope in the previous historical time period. In this solution, the establishment of the ARIMA model does not require complex regression analysis, the parameters are concise, and the interpretability is strong. The linear part of the time series data can be effectively predicted. The introduction of the long short-term memory neural network model can fit the nonlinear part of the time series data. The combination of the two can improve the prediction accuracy.
[0102] In an optional scheme of the present application, the construction unit includes a preprocessing module, a first determination module, a differential processing module and a second determination module. The preprocessing module is used to perform data preprocessing on the first historical slope data to obtain preprocessed historical slope data, wherein the data preprocessing includes filtering processing and downsampling processing; the first determination module is used to determine whether the preprocessed historical slope data is a stationary sequence; the differential processing module is used to perform differential processing on the preprocessed historical slope data if the preprocessed historical slope data is a non-stationary sequence to convert the preprocessed historical slope data into a stationary sequence, and determine the order d in the process of differential processing; the second determination module is used to use the first part of the stationary sequence to determine the order p and order q of ARIMA.
[0103] In the optional scheme of the present application, the first determination module is used to use the ADF test method to determine whether the preprocessed historical slope data is a stationary sequence; the second determination module includes an acquisition submodule and a determination submodule, the acquisition submodule is used to obtain the autocorrelation graph and partial autocorrelation graph of the first part of the stationary sequence; the determination submodule is used to determine the order p and the order q using the autocorrelation graph and the partial autocorrelation graph.
[0104] In an optional scheme of the present application, the device also includes: a third processing unit and a fourth processing unit, the third processing unit is used to use the determined order ARIMA to process the second part of the stationary sequence after determining the order p and order q of ARIMA using the first part of the stationary sequence to obtain the corresponding historical predicted slope; the fourth processing unit is used to obtain the residual between the historical predicted slope and the historical true slope, and perform residual verification. If the verification passes, the order p and order q determined this time are determined as the order used for prediction. If the verification fails, the pre-processed historical slope data continues to be differentially processed until the order p and order q are finally determined.
[0105] In an optional solution of the present application, the construction unit includes a construction module, and the construction module is used to train the initial LSTM model using the residual that passes the residual check to obtain the LSTM model.
[0106] In an optional solution of the present application, the device also includes a setting unit, which is used to set the width of the time window of the initial prediction slope output by the ARIMA to be equal to the width of the time window of the prediction residual output by the LSTM model.
[0107] In an optional solution of the present application, the device is used to predict the slope of plain roads and the slope of mountain roads.
[0108] The device for predicting road slope includes a processor and a memory, wherein the construction unit, the first processing unit, the second processing unit, the summing unit, etc. are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0109] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the accurate prediction of the road slope can be achieved by adjusting the kernel parameters.
[0110] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0111] An embodiment of the present invention provides an electronic device, such as Figure 6 The system shown includes: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of predicting road slopes.
[0112] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, a device where the computer-readable storage medium is located is controlled to execute a method for predicting a road slope.
[0113] Specifically, the method for predicting the road slope includes:
[0114] Step S201, constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA model and the LSTM model are trained by using the first historical slope data obtained within a selected historical time period;
[0115] Step S202, inputting the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period;
[0116] Step S203, the difference between the multiple groups of initial predicted slopes and the second historical slope data is used to form a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain a predicted residual;
[0117] Step S204, adding the initial predicted slope and the predicted residual to obtain the fused predicted slope in the previous historical time period.
[0118] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for predicting a road slope is executed when the program is run.
[0119] Specifically, the method for predicting the road slope includes:
[0120] Step S201, constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA model and the LSTM model are trained by using the first historical slope data obtained within a selected historical time period;
[0121] Step S202, inputting the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period;
[0122] Step S203, the difference between the multiple groups of initial predicted slopes and the second historical slope data is used to form a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain a predicted residual;
[0123] Step S204, adding the initial predicted slope and the predicted residual to obtain the fused predicted slope in the previous historical time period.
[0124] An embodiment of the present invention provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0125] Step S201, constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA model and the LSTM model are trained by using the first historical slope data obtained within a selected historical time period;
[0126] Step S202, inputting the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period;
[0127] Step S203, the difference between the multiple groups of initial predicted slopes and the second historical slope data is used to form a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain a predicted residual;
[0128] Step S204, adding the initial predicted slope and the predicted residual to obtain the fused predicted slope in the previous historical time period.
[0129] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0130] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0131] Step S201, constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA model and the LSTM model are trained by using the first historical slope data obtained within a selected historical time period;
[0132] Step S202, inputting the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period;
[0133] Step S203, the difference between the multiple groups of initial predicted slopes and the second historical slope data is used to form a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain a predicted residual;
[0134] Step S204, adding the initial predicted slope and the predicted residual to obtain the fused predicted slope in the previous historical time period.
[0135] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0136] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0137] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0138] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0139] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0140] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0141] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0142] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape and disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0143] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0144] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0145] 1) The method for predicting road slope of the present application constructs an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, inputs the second historical slope data obtained in the previous historical time period into ARIMA for processing, ARIMA outputs the initial predicted slope, and the difference between multiple groups of initial predicted slopes and the second historical slope data forms a historical residual sequence, which is input into the LSTM model for processing to obtain the predicted residual; the initial predicted slope and the predicted residual are added to obtain the fused predicted slope in the previous historical time period. In this solution, the establishment of the ARIMA model does not require complex regression analysis, the parameters are concise, and the interpretability is strong. It can effectively predict the linear part of the time series data. The introduction of the long short-term memory neural network model can fit the nonlinear part of the time series data. The combination of the two can improve the prediction accuracy.
[0146] 2) The device for predicting the road slope of the present application constructs an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM through a construction unit. The first processing unit inputs the second historical slope data obtained in the previous historical time period into ARIMA for processing, and ARIMA outputs the initial predicted slope. The second processing unit forms a historical residual sequence with the difference between multiple groups of initial predicted slopes and the second historical slope data, and inputs the historical residual sequence into the LSTM model for processing to obtain the predicted residual; the summing unit adds the initial predicted slope and the predicted residual to obtain the fused predicted slope in the previous historical time period. In this solution, the establishment of the ARIMA model does not require complex regression analysis, the parameters are concise, and the interpretability is strong. It can effectively predict the linear part of the time series data. The introduction of the long short-term memory neural network model can fit the nonlinear part of the time series data. The combination of the two can improve the prediction accuracy.
[0147] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for predicting road slope, characterized in that: include: Constructing an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA model and the LSTM model are trained by using the first historical slope data obtained within a selected historical time period; The second historical slope data obtained in the previous historical time period is input into the ARIMA for processing, and the ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period; The difference between the multiple groups of the initial predicted slopes and the second historical slope data forms a historical residual sequence, and the historical residual sequence is input into the LSTM model for processing to obtain a predicted residual; Adding the initial predicted slope and the predicted residual to obtain the fused predicted slope for the previous historical time period; Wherein, constructing an autoregressive integrated moving average model ARIMA includes: performing data preprocessing on the first historical slope data to obtain preprocessed historical slope data, wherein the data preprocessing includes filtering processing and downsampling processing, determining whether the preprocessed historical slope data is a stationary sequence, and if the preprocessed historical slope data is a non-stationary sequence, performing differential processing on the preprocessed historical slope data to convert the preprocessed historical slope data into a stationary sequence, and determining the order d in the process of performing the differential, and using the first part of the stationary sequence to determine the order p and order q of the ARIMA; After using the first part of the stationary sequence to determine the order p and the order q of the ARIMA, the method further includes: using the determined order ARIMA to process the second part of the stationary sequence to obtain the corresponding historical predicted slope; obtaining the residual between the historical predicted slope and the historical true slope, and performing residual verification, and if the verification passes, determining the order p and the order q determined this time as the order used for prediction; if the verification fails, continuing to perform differential processing on the pre-processed historical slope data until the order p and the order q are finally determined.
2. The method according to claim 1, characterized in that Determining whether the preprocessed historical slope data is a stationary sequence includes: using an ADF test method to determine whether the preprocessed historical slope data is the stationary sequence; Using the first part of the stationary sequence to determine the order p and the order q of the ARIMA includes: obtaining an autocorrelation graph and a partial autocorrelation graph of the first part of the stationary sequence; and using the autocorrelation graph and the partial autocorrelation graph to determine the order p and the order q.
3. The method according to claim 1, characterized in that Construct a long short-term memory network model LSTM model, including: The LSTM model is obtained by training the initial LSTM model using the residual that has passed the residual check.
4. The method according to claim 1, characterized in that: The method further comprises: The width of the time window of the initial predicted slope output by the ARIMA is set to be equal to the width of the time window of the predicted residual output by the LSTM model.
5. The method according to claim 1, characterized in that The method is suitable for predicting the slope of plain roads and mountainous roads.
6. A device for predicting road slope, characterized in that: include: A construction unit is used to construct an autoregressive integrated moving average model ARIMA and a long short-term memory network model LSTM model, wherein both the ARIMA model and the LSTM model are trained by using the first historical slope data obtained within a selected historical time period; A first processing unit is used to input the second historical slope data obtained in a previous historical time period into the ARIMA for processing, and the ARIMA outputs an initial predicted slope, wherein the previous historical time period is a time period earlier than the current time period, and the selected historical time period is a time period earlier than the previous historical time period; A second processing unit is used to form a historical residual sequence from the differences between the multiple groups of the initial predicted slopes and the second historical slope data, and input the historical residual sequence into the LSTM model for processing to obtain a predicted residual; A summing unit, configured to sum the initial predicted slope and the predicted residual to obtain the fused predicted slope for the previous historical time period; The construction unit includes a preprocessing module, a first determining module, a differential processing module, and a second determining module. The preprocessing module is used to perform data preprocessing on the first historical slope data to obtain preprocessed historical slope data, wherein the data preprocessing includes filtering processing and downsampling processing. The first determining module is used to determine whether the preprocessed historical slope data is a stationary sequence. The differential processing module is used to perform differential processing on the preprocessed historical slope data to convert the preprocessed historical slope data into a stationary sequence if the preprocessed historical slope data is a non-stationary sequence, and determine the order d in the process of performing the differential processing. The second determining module is used to use the first part of the stationary sequence to determine the order p and order q of the ARIMA; The device also includes a third processing unit and a fourth processing unit. The third processing unit is used to use the ARIMA of the determined order to process the second part of the stationary series after using the first part of the stationary series to determine the order p and the order q of the ARIMA, so as to obtain the corresponding historical predicted slope. The fourth processing unit is used to obtain the residual between the historical predicted slope and the historical true slope, and perform residual verification. If the verification passes, the order p and the order q determined this time are determined as the orders used for prediction. If the verification fails, the pre-processed historical slope data continues to be differentially processed until the order p and the order q are finally determined.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for predicting the road slope according to any one of claims 1 to 5.
8. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for predicting road slope as described in any one of claims 1 to 5.
