Expressway energy demand prediction method and system, terminal and storage medium
Through ARIMA, LSTM and XGBoost models, the multi-source data of highways is predicted and integrated, which solves the problem of inaccurate energy demand forecasts in traditional methods, and achieves more efficient energy demand forecasts, ensuring the normal operation of highways.
Patent Information
- Application Number
- CN202510516467.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-25
AI Technical Summary
Traditional highway energy demand forecasting methods rely on historical data and rules of thumb, and it is difficult to accurately capture the impact of real-time changing factors such as traffic flow and climatic conditions, resulting in a mismatch between energy supply and demand, affecting the normal operation of highways.
The ARIMA model, LSTM model and XGBoost model are used to predict multi-source data of highways, and the integrated model is used to fuse the prediction results of these models to generate more accurate energy demand forecast values.
Through the comprehensive utilization and model integration of multi-source data, the accuracy of energy demand prediction is significantly improved, and the factors affecting highway energy demand can be more comprehensively reflected, the prediction error is reduced, and the stability and efficiency of energy supply are ensured.
Smart Images

Figure CN120373784A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of transportation energy management, and particularly relates to an energy demand prediction method, system, terminal and storage medium for expressways. Background Art
[0002] At present, with the accelerating global urbanization process, expressways, as an important part of the modern transportation system, have seen a sharp rise in their energy demand with the continuous growth of traffic flow. The energy consumption of expressways covers multiple aspects such as vehicle passage, lighting, monitoring, and information transmission, which is crucial for ensuring smooth traffic and driving safety.
[0003] However, in terms of energy demand prediction, the expressway field still faces many challenges. Traditional energy demand prediction methods mainly rely on historical data and empirical rules, and it is difficult to accurately capture the impact of real-time changing factors such as traffic flow and weather conditions on energy demand. Especially in the face of special situations such as sudden traffic events, adverse weather conditions, or holidays, traditional methods often seem inadequate, and there is a large deviation between the prediction results and the actual demand. This problem of inaccurate prediction directly leads to the mismatch between energy supply and demand, affecting the normal operation of expressways. Summary of the Invention
[0004] Aiming at the defects in the prior art that traditional energy demand prediction methods mainly rely on historical data and empirical rules, it is difficult to accurately capture the impact of real-time changing factors such as traffic flow and weather conditions on energy demand, resulting in inaccurate prediction, leading to the mismatch between energy supply and demand, and affecting the normal operation of expressways, the present invention provides an energy demand prediction method, system, terminal and storage medium for expressways to solve the above technical problems.
[0005] In the first aspect, the present invention provides an energy demand prediction method for expressways, including: Obtaining multi-source data of the expressway, including traffic data, environmental data, and time data of the expressway; Preprocessing the obtained multi-source data of the expressway and storing the preprocessed multi-source data in a pre-constructed data warehouse; Inputting the preprocessed multi-source data of the expressway into a pre-constructed ARIMA model, LSTM model, and XGBoost model, respectively predicting the input multi-source data of the expressway, and outputting energy demand prediction results; Inputting the prediction results of the ARIMA model, LSTM model, and XGBoost model into an integrated energy demand prediction model for fusion to generate a fused energy demand prediction value.
[0006] A further improvement of this technical solution is to obtain multi-source data of highways, and the specific method includes: By using geomagnetic sensors or infrared sensors installed on highways, the number of vehicles, vehicle types, and vehicle speeds on highways are obtained in real time; by using cameras installed on highways, the traffic flow and traffic density on highways are obtained in real time; By using weather stations distributed along highways, the temperature, humidity, precipitation, and wind speed in the areas where highways are located are obtained in real time; by using air quality monitors distributed along highways, the concentrations of PM2.5, PM10, and carbon dioxide in the areas where highways are located are obtained in real time; By accessing the public holiday database through the API interface, holiday, working day, and weekend labels are automatically marked.
[0007] A further improvement of this technical solution is to preprocess the obtained multi-source data and store the preprocessed multi-source data in a pre-constructed data warehouse, and the specific method includes: Perform deduplication processing, missing value processing, outlier removal processing, data standardization processing, and normalization processing on the obtained multi-source data; Perform time alignment processing on the processed multi-source data, fuse the time-aligned multi-source data, and store the fused highway data in a pre-constructed data warehouse.
[0008] A further improvement of this technical solution is to perform time alignment processing on the processed multi-source data of highways, and its calculation formula is: ; Among them, is the i-th multi-source data of highways aligned at time t, and t is the target alignment time point; and both are the timestamps of the multi-source data; is the value of the i-th multi-source data of highways at time ; is the value of the i-th multi-source data of highways at time ; A further improvement of this technical solution is to fuse the time-aligned multi-source data, and its calculation formula is: ; Among them, is the highway data after fusing the multi-source data at time t; is the weight of the i-th multi-source data of highways; n is the number of multi-source data for parameter fusion.
[0009] A further improvement of this technical solution is that the prediction formula of the pre-constructed ARIMA model is: ; Among them, is the predicted value of highway energy demand by the ARIMA model at time t; is the constant term; p is the order of the autoregressive term, representing the number of past time points, used to predict the current energy demand; is the autoregressive coefficient, representing the influence degree of the energy demand at the d-th past time point on the energy demand at the current time point; q is the order of the moving average term, representing the number of past prediction errors; is the predicted value of highway energy demand at time ; is the moving average coefficient, representing the influence degree of the g-th past prediction error on the current predicted value; is the prediction error at time , that is, the difference between the actual highway energy demand and the predicted energy demand at this moment; The prediction formula of the LSTM model is: ; ; ; ; ; ; Among them, is the predicted value of highway energy demand by the LSTM model at time t; is the output value of the forget gate in the LSTM model, ranging from 0 to 1, controlling the retention ratio of information in the memory cell at the previous moment; is the Sigmoid activation function; is the weight matrix of the forget gate, used to connect the fused highway data input into the LSTM model at time t and the predicted value of highway energy demand at the previous moment; is the bias term of the forget gate; is the output value of the input gate in the LSTM model; is the weight matrix of the input gate; is the bias term of the input gate; is the candidate memory value at time t, ranging from 0 to 1; is the weight matrix of the candidate memory; is the bias term of the candidate memory; is the long - term memory value at time t; is the output value of the output gate in the LSTM model; is the weight matrix of the output gate; is the bias term of the output gate; is through the hyperbolic tangent function compress the long - term memory value at time t to the range ; The prediction formula of the XGBoost model is: ; where, is the predicted value of the highway energy demand by the XGBoost model at time t; is the output value of the k - th decision tree in the XGBoost model for the input - fused highway data at time t ; K is the total number of decision trees constructed in the XGBoost model; The objective function of the XGBoost model is: ; where, is the objective function of the XGBoost model; is the loss function of the XGBoost model; is the actual energy demand of the highway at time t; is the regularization term, used to control the complexity of the XGBoost model.
[0010] A further improvement of this technical solution is that the calculation formula of the integrated energy demand prediction model is: ; where, is the predicted value of the highway energy demand output by the integrated energy demand prediction model; is the prediction weight of the ARIMA model; is the prediction weight of the LSTM model; is the prediction weight of the XGBoost model.
[0011] In the second aspect, the present invention provides an energy demand prediction system for highways, including: A multi - source data acquisition module, configured to acquire multi - source data of highways, including traffic data, environmental data, and time data of highways; A data pre - processing module, configured to pre - process the acquired multi - source data of highways and store the pre - processed multi - source data in a pre - constructed data warehouse; Energy demand prediction module: It is used to input the preprocessed multi-source highway data into the pre-constructed ARIMA model, LSTM model, and XGBoost model, respectively predict the input multi-source highway data, and output the energy demand prediction results; Prediction fusion module: It is used to input the prediction results of the ARIMA model, LSTM model, and XGBoost model into the integrated energy demand prediction model for fusion, and generate the fused energy demand prediction value.
[0012] Thirdly, the present invention provides a terminal, including: A processor and a memory, wherein, The memory is used to store a computer program, The processor is used to call and run the computer program from the memory, so that the terminal executes the method of the above terminal.
[0013] Fourthly, the present invention provides a computer storage medium. Instructions are stored in the computer-readable storage medium. When it runs on a computer, it enables the computer to execute the methods described in the above aspects.
[0014] The beneficial effects of the present invention are as follows. The present invention obtains multi-source data such as traffic data, environmental data, and time data of highways and conducts comprehensive fusion processing on them. The comprehensive utilization of this multi-source data can more comprehensively reflect the factors affecting highway energy demand. Compared with the traditional method that only relies on single or a small amount of historical data, it greatly enriches the prediction basis and significantly improves the accuracy of energy demand prediction. The present invention uses the ARIMA model, LSTM model, and XGBoost model to respectively predict the preprocessed multi-source data, and then inputs the prediction results of these three models into the integrated energy demand prediction model for fusion; by integrating the prediction results of these models, the advantages of each model can be fully utilized and complement each other, thereby reducing the prediction error of a single model and improving the overall prediction accuracy.
[0015] In addition, the design principle of the present invention is reliable, the structure is simple, and it has a very wide application prospect. Description of the Drawings
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 It is a schematic flowchart of the method for an embodiment of the present invention.
[0018] Figure 2 Schematic block diagram of a system according to an embodiment of the present invention.
[0019] Figure 3 Schematic structural diagram of a terminal provided by an embodiment of the present invention.
[0020] 210 is a multi-source data acquisition module, 220 is a data preprocessing module, 230 is an energy demand prediction module, and 240 is a prediction fusion module. Detailed implementation manners
[0021] To make the objectives, features, and advantages of the present invention more obvious and understandable, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the specific embodiments of the present invention. Obviously, the embodiments described below are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without making creative efforts belong to the scope of protection of the present application.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs. The terms used in the description of the present invention herein are only for the purpose of describing specific embodiments, and are not intended to limit the present invention.
[0023] The energy demand prediction method for expressways provided by the embodiments of the present invention is executed by a computer device. Correspondingly, the energy demand prediction system for expressways runs in the computer device.
[0024] Figure 1 is a schematic flowchart of a method according to an embodiment of the present invention. Among them, Figure 1 The execution subject can be an energy demand prediction system for expressways. According to different requirements, the order of the steps in this flowchart can be changed, and some can be omitted.
[0025] As Figure 1 shown, the method includes: Step 110, acquiring multi-source data of the expressway, including traffic data, environmental data, and time data of the expressway; Step 120, preprocessing the acquired multi-source data of the expressway, and storing the preprocessed multi-source data in a pre-constructed data warehouse; Step 130, inputting the preprocessed multi-source data of the expressway into a pre-constructed ARIMA model, LSTM model, and XGBoost model, respectively predicting the input multi-source data of the expressway, and outputting an energy demand prediction result; Step 140: Input the prediction results of the ARIMA model, LSTM model, and XGBoost model into the integrated energy demand prediction model for fusion to generate the fused energy demand prediction value.
[0026] For the convenience of understanding the present invention, the principle of the energy demand prediction method for expressways of the present invention will be further described below in combination with the process of predicting the energy demand of expressways in the embodiments.
[0027] Step 110: Obtain multi-source data of the expressway, including traffic data, environmental data, and time data of the expressway.
[0028] S111: Real-time obtain the number of vehicles, vehicle types, and vehicle speeds on the expressway through geomagnetic sensors or infrared sensors installed on the expressway; real-time obtain the traffic flow and traffic density on the expressway through cameras installed on the expressway.
[0029] Deploy a geomagnetic sensor (model: XYZ-2000) at intervals of 500 meters at key sections of the expressway (such as entrances, exits, intersections, etc.), and deploy an infrared sensor (model: IR-Tracker Pro) every 1 kilometer at long straight sections of the expressway (such as tunnel entrances, service area exits). These sensors can monitor the metal parts of passing vehicles in real time (by detecting the changes in the geomagnetic field caused by the metal parts of the vehicle to generate pulse signals) or heat changes, so as to accurately count the number of vehicles and preliminarily judge the vehicle types (such as small cars, large cars, etc.). At the same time, the vehicle speed can be calculated through the distance between the sensors and the time difference of vehicle passing. Install high-resolution cameras along the expressway. These cameras (using the YOLOv5 algorithm to identify vehicle bounding boxes in real time and perform statistics) can take pictures of the traffic conditions in real time. Through image processing techniques (such as edge detection, target tracking, etc.), vehicles can be automatically identified and the traffic flow can be counted. At the same time, combined with the road section length and the vehicle passing time, the traffic density (that is, the number of vehicles on the road section per unit length) can be calculated.
[0030] S112: Real-time obtain the temperature, humidity, precipitation, and wind speed of the area where the expressway is located through weather stations distributed along the expressway; real-time obtain the concentrations of PM2.5, PM10, and carbon dioxide in the area where the expressway is located through air quality monitors distributed along the expressway.
[0031] Deploy weather stations at suitable locations along the highway (installed within 100 meters around service points such as service areas and near toll stations, avoiding building shading), and deploy one multi-parameter weather station every 20 kilometers. These weather stations can monitor meteorological parameters such as temperature, humidity, precipitation, and wind speed in real time and transmit the data to the data center. Also deploy air quality monitors along the highway. These devices can monitor the concentrations of pollutants such as PM2.5, PM10, and carbon dioxide in the air in real time, providing environmental data support for the prediction model.
[0032] S113. Access the public holiday database through the API interface to automatically label holiday, working day, and weekend tags.
[0033] Use the API interface provided by the existing public holiday database (such as third-party data service providers) to connect the highway energy demand prediction system to this database. According to the timestamp information obtained by the system, automatically query and label the current date as a holiday, working day, or weekend from the holiday database. These information are of great significance for analyzing traffic flow patterns and energy demand changes. It also includes: Based on historical data clustering analysis, divide the peak hours of working days (07:00 - 09:00, 17:00 - 19:00). If the traffic volume in a certain hour is ≥ 1.2 times the monthly average value, mark it as "peak"; or obtain construction and accident events from the API (Application Programming Interface) of the government traffic management system to generate dynamic tags.
[0034] In addition, preprocess the obtained multi-source data and store the preprocessed multi-source data in a pre-constructed data warehouse. The specific methods include: S121. Perform deduplication processing, missing value processing, outlier removal processing, data standardization processing, and normalization processing on the obtained multi-source data; S122. Perform time alignment processing on the processed multi-source data, fuse the time-aligned multi-source data, and store the fused highway data in a pre-constructed data warehouse.
[0035] Among them, the formula for performing time alignment processing on the processed multi-source highway data is: ; Among them, is the i-th multi-source highway data aligned at time t, where t is the target alignment time point; and both are the timestamps of the multi-source data; is the value of the i-th multi-source highway data at time ; is the value of the i-th highway multi-source data at time ; Furthermore, the multi-source data after time alignment is fused, and its calculation formula is: ; where is the highway data after fusing the multi-source data at time t; is the weight of the i-th highway multi-source data; n is the number of multi-source data for parameter fusion.
[0036] Through deduplication, missing value and outlier processing, the present invention eliminates data redundancy and noise interference, greatly improves the data integrity rate and accuracy, and lays a reliable foundation for subsequent analysis. The data standardization and normalization operations unify the characteristic scales of data with different dimensions, eliminate the influence of dimension differences on model training, and improve the convergence speed and prediction accuracy of machine learning algorithms. The present invention further explores the collaborative value of multi-source data through time alignment and fusion. The time alignment mechanism based on the interpolation algorithm realizes the precise synchronization of data with different sampling frequencies and ensures the consistency of data in the time dimension. The weighted fusion strategy dynamically assigns data weights according to business requirements, so that the fused data set can comprehensively reflect the operating state of the highway.
[0037] In addition, the prediction formula of the pre-constructed ARIMA model is: ; where is the predicted value of highway energy demand of the ARIMA model at time t; is the constant term; p is the order of the autoregressive term, indicating the number of past time points for predicting the current energy demand; is the autoregressive coefficient, indicating the influence degree of the energy demand at the d-th past time point on the energy demand at the current time point; q is the order of the moving average term, indicating the number of past prediction errors; is the predicted value of highway energy demand at time ; is the moving average coefficient, indicating the influence degree of the g-th past prediction error on the current predicted value; is the prediction error at time , that is, the difference between the actual highway energy demand and the predicted energy demand at this moment.
[0038] The preprocessed highway data is input into the ARIMA model. During the model construction process, determining the order of the model is a crucial step. First, the values of p and q are initially determined by observing the autocorrelation function (ACF) and partial autocorrelation function (PACF) of the data. Suppose through analysis, it is found that the autocorrelation function rapidly approaches 0 after a lag of 2, and the partial autocorrelation function approaches 0 after a lag of 1. Then p = 1 and q = 2 are initially determined. Then, historical data is used for model training, and the model parameters are continuously adjusted to achieve the best fitting effect for the training data. During the training process, the least squares method is used to estimate the model parameters, such as the constant term c, the autoregressive coefficient ϕ, and the moving average coefficient θ.
[0039] In the actual prediction stage, take the prediction of the energy demand in the next 1 hour as an example. Suppose the current time is t. The ARIMA model calculates according to the above prediction formula based on the previously collected and processed data and the determined model parameters. The model comprehensively considers the energy demand at past time points (reflected by the autoregressive term) and the past prediction errors (reflected by the moving average term) to obtain the predicted value at time t. If during the prediction process, sudden events (such as traffic accidents, bad weather, etc.) are detected, the system will activate the dynamic adjustment mechanism. If a traffic accident is detected, resulting in a sudden decrease in the traffic flow on a certain section, the model will correct the prediction result according to the type and severity of the event, combined with corresponding rules or machine learning models, to improve the prediction accuracy. The ARIMA model has significant advantages in dealing with short-term energy demand prediction. It can effectively capture the short-term trends and seasonal characteristics of the data, and through time series analysis of historical data, it can discover the internal laws of the data. In practical applications, this means that highway management departments can more accurately predict the short-term energy consumption, make preparations for energy allocation in advance, and avoid problems caused by insufficient or excessive energy supply. During the morning rush hour, according to the prediction results of the ARIMA model, the energy supply for lighting and monitoring equipment is increased in advance to ensure the normal operation of road facilities and avoid energy waste at the same time.
[0040] The prediction formula of the LSTM model is: ; ; ; ; ; ; Among them, is the predicted value of the highway energy demand by the LSTM model at time t; is the output value of the forget gate in the LSTM model, ranging from 0 to 1, and controls the retention ratio of the information in the memory cell at the previous moment ; is the Sigmoid activation function; is the weight matrix of the forget gate, used to connect the fused highway data input into the LSTM model at time t and the predicted value of the highway energy demand at the previous moment ; is the bias term of the forget gate; is the output value of the input gate in the LSTM model; is the weight matrix of the input gate; is the bias term of the input gate; is the candidate memory value at time t, ranging from 0 to 1; is the weight matrix of the candidate memory; is the bias term of the candidate memory; is the long-term memory value at time t; is the output value of the output gate in the LSTM model; is the weight matrix of the output gate; is the bias term of the output gate; is through the hyperbolic tangent function compress the long-term memory value at time t to the range ;
[0041] The preprocessed data enters the LSTM model. During the model construction process, it is crucial to determine the parameters. The forget gate weight matrix , the input gate weight matrix , the candidate memory weight matrix , the output gate weight matrix and the corresponding bias terms , , , , the initial values of these parameters are set by random initialization, but will be continuously adjusted during the training process.
[0042] Taking the prediction of the energy demand of a certain section of the highway in the next 4 hours as an example, the prediction process of the model is described in detail. Assume that the current moment is t, and first calculate the output value of the forget gate . At this time, the information input to the forget gate includes the fused highway data at time t and the predicted value of the highway energy demand at the previous moment , and they are linearly transformed through the forget gate weight matrix and the bias term , and then pass through the Sigmoid activation function to obtain . The value range of is between 0 and 1, which determines the retention ratio of the information in the memory cell at the previous moment. If is close to 1, it means that most of the information in the memory cell at the previous moment will be retained; if is close to 0, most of the information will be forgotten.
[0043] Next, calculate the input gate output value and the candidate memory value . The input gate output value is also obtained by performing a linear transformation on the input data and (implemented by the weight matrix and the bias term ), and then passing through the Sigmoid activation function. The candidate memory value is obtained by performing another linear transformation on the input data (weight matrix and the bias term ), and the result is restricted between -1 and 1 by the hyperbolic tangent function tanh.
[0044] Then update the long-term memory value , which is obtained by adding the information retained in the memory cell at the previous moment ∗ and the memory information updated at the current moment ∗ . This step realizes the inheritance of historical information and the integration of new information in the memory cell.
[0045] Finally, calculate the output gate output value and the energy demand prediction value at the current moment . The output gate output value is obtained by performing a linear transformation on the input data and (weight matrix and the bias term ), and then passing through the Sigmoid activation function. The energy demand prediction value at the current moment is obtained by multiplying the output gate output value by the long-term memory value processed by the hyperbolic tangent function, which is output as the final prediction result.
[0046] During the prediction process, the model continuously updates its state based on newly input data. If an unexpected event occurs, such as a traffic accident that causes a significant drop in the traffic flow on a certain road section, the model can sense this change through the input real-time data and accordingly adjust the output values of each gate and the state of the memory unit, so that the prediction result is more in line with the actual situation. When it is detected that an accident has occurred, the new traffic data and environmental data are input into the model, which may cause the output value of the forget gate to become smaller, reducing the dependence on the memory information under the previous normal traffic state; the output value of the input gate and the candidate memory value will be adjusted according to the new data to update the memory unit and adapt to the change in traffic conditions, and then more accurately predict the change in energy demand.
[0047] The traffic conditions on highways are complex and changeable, and the energy demand shows a complex time series pattern. With its powerful learning ability, the LSTM model can adapt to this complex pattern. It can handle non-linear relationships and make accurate responses to sudden changes in traffic flow, abnormal fluctuations in weather conditions, etc. When encountering extreme weather, such as heavy rain or heavy snow, the traffic flow on the highway will change significantly, and the energy demand will also change accordingly. The LSTM model can adjust its own parameters through learning the input data and accurately capture the impact of this change on energy demand. Under heavy rain weather, the visibility decreases, the vehicle driving speed slows down, and the energy consumption of lighting and warning equipment increases. The LSTM model can comprehensively consider these factors and predict the increase in energy demand, providing an accurate reference for the adjustment of energy supply. This helps highway management departments make preparations for energy allocation in advance and ensure the stability and reliability of energy supply under complex conditions.
[0048] The prediction formula of the XGBoost model is: ; where, is the predicted value of highway energy demand by the XGBoost model at time t; is the output value of the k-th decision tree in the XGBoost model for the input-fused highway data at time t; K is the total number of decision trees constructed in the XGBoost model; The objective function of the XGBoost model is: ; where, is the objective function of the XGBoost model; is the loss function of the XGBoost model; is the actual energy demand of the highway at time t; is a regularization term used to control the complexity of the XGBoost model.
[0049] Furthermore, the loss function of the XGBoost model is: .
[0050] Regularization term The calculation formula is: ; where K is the total number of decision trees constructed in the XGBoost model; is the minimum gain threshold of the decision tree. If the gain of a certain split is less than γ, the split is stopped (pruning); is the L2 regularization coefficient, which constrains the magnitude of the leaf node weights; is the leaf node weight of the k-th decision tree.
[0051] The preprocessed data is divided into a training set, a validation set, and a test set in a ratio of 7:2:1. When constructing the XGBoost model, the total number of decision trees K = 200 is initialized, the minimum gain threshold γ = 0.1 of the decision tree is set, and the L2 regularization coefficient λ = 0.1. These parameters can be adjusted according to experience and subsequent tuning.
[0052] During the training process, taking the prediction of the energy demand on this section of the road in the next 3 hours as an example. The model constructs decision trees through continuous iteration based on the training set data. Each decision tree is trained based on the residual of the previous decision tree, gradually fitting the complex patterns in the data. When constructing the decision tree, node splitting is performed according to the data features, and the split gain is calculated. If the gain of a certain split is less than the set minimum gain threshold γ, the split is stopped, that is, pruning is performed to prevent the model from overfitting. For example, when analyzing the relationship between traffic flow and energy demand, the decision tree may divide nodes according to features such as traffic volume and vehicle type to explore the variation law of energy demand in different situations.
[0053] During the training process, the model continuously adjusts the leaf node weights of the decision tree to minimize the objective function. The logarithmic loss function mentioned above is used as the loss function; this loss function can effectively measure the difference between the predicted value and the true value and has an important impact on the accuracy of the prediction result. The regularization term is used to control the model complexity, avoid the model from overfitting on the training data, and ensure that the model has good generalization ability.
[0054] After training to obtain a stable model, prediction begins. When new fused highway data is input, the K decision trees in the model process it respectively, and each decision tree outputs a predicted value , for example, at a certain moment, the current traffic flow, environmental data, and time information are input. The first decision tree judges the data according to its internal splitting rules and outputs a predicted value at the leaf node; the second decision tree also processes the data and outputs a predicted value. The predicted values of all decision trees are accumulated to obtain the predicted value of the energy demand for the next 3 hours at this moment.
[0055] In practical applications, in case of emergencies such as traffic jams caused by traffic accidents, the system will update the data in real time and re-enter it into the model for prediction. The model can quickly adjust the prediction results according to the new data, providing timely and accurate energy demand predictions for the highway management department to rationally allocate energy resources.
[0056] The XGBoost model shows extremely high accuracy in predicting highway energy demand. Its feature of ensemble learning can fully explore the complex relationships in the data through the collaborative work of multiple decision trees. Compared with traditional prediction methods, it has obvious advantages in processing multi-source data. Traditional methods such as simple linear regression are difficult to capture the non-linear relationships among traffic flow, environmental factors, and time factors, while the XGBoost model can accurately discover these potential connections. This enables the highway management department to more precisely grasp the energy demand situation, make energy allocation plans in advance, avoid energy waste or insufficient supply, and effectively reduce operating costs.
[0057] Finally, the calculation formula of the integrated energy demand prediction model is: ; where, is the predicted value of the highway energy demand output by the integrated energy demand prediction model; is the prediction weight of the ARIMA model; is the prediction weight of the LSTM model; is the prediction weight of the XGBoost model.
[0058] Different models have different advantages in processing data. ARIMA is accurate in short-term baseline prediction, LSTM is good at capturing long-term dependencies, and XGBoost can effectively handle multi-variable non-linear problems. By integrating models, the advantages of each model can be fully utilized to make up for the limitations of single models. When facing complex and changing highway energy demand scenarios, by synthesizing the prediction results of multiple models, various factors affecting energy demand can be more comprehensively considered, reducing prediction errors and greatly improving prediction accuracy.
[0059] In some embodiments, the energy demand prediction system 200 of the highway may include multiple functional modules composed of computer program segments. The computer programs of each program segment in the energy demand prediction system 200 of the highway may be stored in the memory of the computer device and executed by at least one processor to perform the energy demand prediction function of the highway (see details in Figure 1 description).
[0060] In this embodiment, according to the functions it performs, the energy demand prediction system 200 of the highway can be divided into multiple functional modules, as Figure 2 shown. The functional modules may include: a multi-source data acquisition module 210, a data preprocessing module 220, an energy demand prediction module 230, and a prediction fusion module 240. The module referred to in the present invention means a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in the memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0061] Specifically, the multi-source data acquisition module is used to acquire multi-source data of the highway, including traffic data, environmental data, and time data of the highway; the data preprocessing module is used to preprocess the acquired multi-source data of the highway and store the preprocessed multi-source data in a pre-constructed data warehouse; the energy demand prediction module is used to input the preprocessed multi-source data of the highway into pre-constructed ARIMA model, LSTM model, and XGBoost model, respectively predict the input multi-source data of the highway, and output energy demand prediction results; the prediction fusion module is used to input the prediction results of the ARIMA model, LSTM model, and XGBoost model into an integrated energy demand prediction model for fusion to generate a fused energy demand prediction value.
[0062] Figure 3 FIG. 14 is a schematic structural diagram of a terminal 300 provided in an embodiment of the present invention. The terminal 300 can be used to execute the energy demand prediction method of the highway provided in the embodiment of the present invention.
[0063] Among them, the terminal 300 may include: a processor 310, a memory 320, and a communication module 330. These components communicate through one or more buses. Those skilled in the art can understand that the structure of the server shown in the figure does not constitute a limitation to the present invention. It can be a bus structure, a star structure, and may also include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.
[0064] Among them, the memory 320 can be used to store the execution instructions of the processor 310. The memory 320 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disc. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 can execute some or all of the steps in the above method embodiments.
[0065] The processor 310 is the control center of the storage terminal, connecting various parts of the entire electronic terminal through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 320, and by calling the data stored in the memory, it executes various functions of the electronic terminal and / or processes data. The processor can be composed of an integrated circuit (IC). For example, it can be composed of a single packaged IC, or can be composed of multiple packaged ICs with the same or different functions connected together. For example, the processor 310 can include only a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single arithmetic core or can include multiple arithmetic cores.
[0066] The communication module 330 is used to establish a communication channel so that the storage terminal can communicate with other terminals. It receives user data sent by other terminals or sends user data to other terminals.
[0067] The present invention also provides a computer storage medium. Among them, the computer storage medium can store a program, and when the program is executed, it can include some or all of the steps in the various embodiments provided by the present invention. The storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), a random access memory (RAM), etc.
[0068] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solutions in the embodiments of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc, etc., various media that can store program codes, including several instructions for causing a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0069] For the same or similar parts among the various embodiments in this specification, reference can be made to each other. In particular, for the terminal embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the descriptions in the method embodiments.
[0070] In several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there can be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the systems or modules can be in electrical, mechanical, or other forms.
[0071] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they can be located in one place, or they can be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0072] In addition, in each embodiment of the present invention, the various functional modules can be integrated in a processing module, or each module can exist physically alone, or two or more modules can be integrated in one module.
[0073] Although the present invention has been described in detail by referring to the accompanying drawings and in conjunction with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, those of ordinary skill in the art can make various equivalent modifications or substitutions to the embodiments of the present invention, and all such modifications or substitutions should fall within the scope of the present invention. / Any person skilled in the art within the technical scope disclosed by the present invention can easily conceive of changes or substitutions, and all should be covered within the protection scope of the present invention.
Claims
1. A method for predicting the energy demand of an expressway, characterized in that, including: Obtain multi-source data of the highway, including traffic data, environmental data, and time data of the highway; Preprocess the obtained multi-source data of the highway and store the preprocessed multi-source data in a pre-constructed data warehouse; Input the preprocessed multi-source data of the highway into pre-constructed ARIMA model, LSTM model, and XGBoost model, respectively predict the input multi-source data of the highway, and output the energy demand prediction results; Input the prediction results of the ARIMA model, LSTM model, and XGBoost model into an integrated energy demand prediction model for fusion to generate a fused energy demand prediction value.
2. The energy demand prediction method for expressways according to claim 1, wherein Obtain multi-source data of the highway, and the specific method includes: Through geomagnetic sensors or infrared sensors installed on the highway, real-time obtain the number of vehicles, vehicle types, and vehicle speeds on the highway; through cameras installed on the highway, real-time obtain the traffic flow and traffic density on the highway; Through weather stations distributed along the highway, real-time obtain the temperature, humidity, precipitation, and wind speed in the area where the highway is located; through air quality monitors distributed along the highway, real-time obtain the concentrations of PM2.5, PM10, and carbon dioxide in the area where the highway is located; Access the public holiday database through the API interface to automatically label holiday, working day, and weekend tags.
3. The energy demand prediction method for expressways according to claim 1, characterized in that, Preprocess the obtained multi-source data and store the preprocessed multi-source data in a pre-constructed data warehouse, and the specific method includes: Perform deduplication processing, missing value processing, outlier removal processing, data standardization processing, and normalization processing on the obtained multi-source data; Perform time alignment processing on the processed multi-source data, fuse the time-aligned multi-source data, and store the fused highway data in a pre-constructed data warehouse.
4. The energy demand prediction method for expressways according to claim 3, wherein Perform time alignment processing on the processed multi-source data of the highway, and its calculation formula is: ; Among them, is the i-th highway multi-source data aligned at time t, where t is the target alignment time point; and both are the timestamps of the multi-source data; is the value of the i-th highway multi-source data at time ; is the value of the i-th highway multi-source data at time .
5. The energy demand prediction method for expressways according to claim 4, characterized in that Fuse the time-aligned multi-source data, and its calculation formula is: ; Among them, is the highway data after the fusion of multi-source data at time t; is the weight of the i-th highway multi-source data; n is the number of multi-source data for parameter fusion.
6. The method for predicting the energy demand of a highway according to claim 5, wherein The prediction formula of the pre-constructed ARIMA model is: ; Among them, is the predicted value of highway energy demand by the ARIMA model at time t; is the constant term; p is the order of the autoregressive term, representing the number of past time points used to predict the current energy demand; is the autoregressive coefficient, representing the impact of the energy demand at the d-th past time point on the energy demand at the current time point; q is the order of the moving average term, representing the number of past prediction errors; is the predicted value of highway energy demand at time ; is the moving average coefficient, representing the impact of the g-th past prediction error on the current predicted value; is the prediction error at time , that is, the difference between the actual highway energy demand and the predicted energy demand at this moment; The prediction formula of the LSTM model is: ; ; ; ; ; ; Wherein, is the predicted value of highway energy demand of the LSTM model at time t; is the output value of the forget gate in the LSTM model, ranging from 0 to 1, controlling the retention ratio of information in the memory cell at the previous moment ; is the Sigmoid activation function; is the weight matrix of the forget gate, used to connect the fused highway data input into the LSTM model at time t and the predicted value of highway energy demand at the previous moment ; is the bias term of the forget gate; is the output value of the input gate in the LSTM model; is the weight matrix of the input gate; is the bias term of the input gate; is the candidate memory value at time t, ranging from 0 to 1; is the weight matrix of the candidate memory; is the bias term of the candidate memory; is the long-term memory value at time t; is the output value of the output gate in the LSTM model; is the weight matrix of the output gate; is the bias term of the output gate; is passed through the hyperbolic tangent function to compress the long-term memory value at time t to the range ; The prediction formula of the XGBoost model is: ; Among them, is the predicted value of the highway energy demand of the XGBoost model at time t; is the output value of the k-th decision tree in the XGBoost model for the input-fused highway data at time t; K is the total number of decision trees constructed in the XGBoost model; The objective function of the XGBoost model is: ; Among them, is the objective function of the XGBoost model; is the loss function of the XGBoost model; is the actual energy demand of the highway at time t; is the regularization term used to control the complexity of the XGBoost model.
7. The energy demand prediction method for expressways according to claim 6, characterized in that The calculation formula of the integrated energy demand prediction model is: ; Among them, is the predicted value of highway energy demand output by the integrated energy demand forecasting model; is the prediction weight of the ARIMA model; is the prediction weight of the LSTM model; is the prediction weight of the XGBoost model.
8. An energy demand prediction system for expressways, characterized in that, including: A multi-source data acquisition module for obtaining multi-source data of the highway, including traffic data, environmental data, and time data of the highway; A data preprocessing module for preprocessing the obtained multi-source data of the highway and storing the preprocessed multi-source data in a pre-constructed data warehouse; An energy demand prediction module; For inputting the preprocessed multi-source data of the highway into pre-constructed ARIMA model, LSTM model, and XGBoost model, respectively predict the input multi-source data of the highway, and output the energy demand prediction results; A prediction fusion module for inputting the prediction results of the ARIMA model, LSTM model, and XGBoost model into an integrated energy demand prediction model for fusion to generate a fused energy demand prediction value.
9. A terminal, characterized in that, including: A processor; A memory for storing execution instructions of a processor; Wherein, the processor is configured to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the program is executed by the processor, the method according to any one of claims 1-7 is implemented.