Electric heavy truck charging and battery swapping energy consumption prediction method and system based on big data

By integrating multi-dimensional data and optimizing intelligent algorithms, combined with time series models and ensemble learning algorithms, the energy consumption trend and charging/swapping needs of electric heavy-duty trucks are dynamically predicted, solving the complexity of energy consumption prediction in the operation of electric heavy-duty trucks and achieving efficient power dispatch and operation planning.

CN121617165BActive Publication Date: 2026-05-19RES INST OF HIGHWAY MINIST OF TRANSPORT
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
RES INST OF HIGHWAY MINIST OF TRANSPORT
Filing Date
2025-11-28
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately predict charging and battery swapping needs in the complex and ever-changing operating environment of electric heavy-duty trucks, leading to power shortages, battery supply-demand mismatches, and low operational efficiency.

Method used

By integrating multi-dimensional data and optimizing intelligent algorithms, the system utilizes multi-source heterogeneous data on vehicle operating status, road environment, and natural environment, combined with time series models and ensemble learning algorithms, to dynamically and accurately predict energy consumption trends and charging/swapping needs. It also rapidly adapts to new vehicle models or new operating areas through a federated transfer learning framework.

Benefits of technology

It significantly improves the accuracy and reliability of energy consumption prediction for charging and swapping of electric heavy-duty trucks, reduces model maintenance costs, enables scientific decision support for power dispatching and operation planning, and improves energy utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121617165B_ABST
    Figure CN121617165B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of electric heavy truck based on big data's energy consumption prediction method and system of charging and changing, specifically relates to electric heavy truck charging and changing energy consumption prediction field, through multidimensional data fusion and intelligent algorithm optimization, the accuracy and reliability of electric heavy truck charging and changing energy consumption prediction can be significantly improved, it utilizes vehicle operating state, road environment and natural environment and other multi-source heterogeneous data, in combination with time series model and ensemble learning algorithm, dynamically accurately predicts energy consumption trend and charging and changing demand, the system has good self-adapting ability, can be quickly adapted to new vehicle model or new operating area by federal migration learning framework, effectively reduce model maintenance cost, finally for the power dispatching, battery reserve and operation planning of changing station provide scientific decision support, realize the goal of cost reduction and efficiency improvement and energy efficient use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy consumption prediction for charging and swapping of electric heavy-duty trucks, and more specifically, to a method and system for predicting energy consumption for charging and swapping of electric heavy-duty trucks based on big data. Background Technology

[0002] With the rapid development of the new energy vehicle industry, electric heavy trucks have shown great market potential in heavy freight sectors such as trunk logistics and port transportation. However, their large-scale commercial operation still faces severe challenges in energy management, especially in the charging and battery swapping process. The energy consumption characteristics of electric heavy trucks are highly complex, and their operating scenarios usually involve a variety of dynamic internal and external factors. For example, in the low-temperature environment of winter in the north, battery activity will be significantly reduced, leading to a sharp increase in energy consumption. On continuous steep slopes in mountainous areas of the southwest, vehicles need to continuously discharge at high power, resulting in energy consumption far exceeding that in plains areas. In large logistics parks, a large number of heavy trucks often depart at night, forming peak electricity demand. In addition, the vehicle's own load status changes in real time, and the health status of the battery pack also declines with the use cycle. These multi-dimensional dynamic variables are coupled with each other and jointly determine the nonlinear energy consumption curve of the vehicle, making it extremely difficult to accurately predict the remaining power and specific charging and battery swapping needs when it arrives at the battery swapping station.

[0003] Currently, most technical solutions for vehicle energy consumption prediction rely on traditional time series analysis models, such as autoregressive integral moving average models, or simple machine learning regression algorithms based on historical average vehicle speed and mileage data. These solutions have significant limitations: their model input features are limited in dimension, failing to effectively integrate key influencing factors such as real-time road slope information, dynamically changing ambient temperature, actual vehicle load, and battery health status. Due to the lack of synchronous collection and fusion analysis capabilities for multi-dimensional data, existing prediction systems struggle to adapt to changes in complex operating environments. In particular, prediction accuracy drops significantly when encountering sudden weather changes or temporary route adjustments. This inaccurate prediction directly leads to a lack of reliable data support for the operation planning of battery swapping stations, making it impossible to accurately schedule power load and battery reserves. This results in a series of operational inefficiencies and resource waste problems, such as power supply shortages during peak hours, battery supply and demand mismatch, and excessively long vehicle waiting times. Therefore, there is an urgent need in this field for an energy consumption management solution that can comprehensively utilize multi-source big data and possess high-precision adaptive prediction capabilities. Summary of the Invention

[0004] This invention addresses the technical problems existing in the prior art by providing a method and system for predicting the charging and swapping energy consumption of electric heavy-duty trucks based on big data. Through multi-dimensional data fusion and intelligent algorithm optimization, it can significantly improve the accuracy and reliability of predicting the charging and swapping energy consumption of electric heavy-duty trucks, thereby solving the problems mentioned in the background art.

[0005] The technical solution of this invention to solve the above-mentioned technical problems is as follows: a method for predicting the charging and swapping energy consumption of electric heavy-duty trucks based on big data, specifically including the following steps:

[0006] Step S1: When the electric heavy truck starts running, a data acquisition process is triggered to collect multi-source heterogeneous data from vehicle sensors, battery management system, road network service, and meteorological service. The multi-source heterogeneous data is received and buffered in real time through a distributed message queue. Each incoming multi-source heterogeneous data is defined as a data record, and a high-precision spatiotemporal stamp and data lineage information are added to each data record. A predefined semantic data model is used to map the multi-source heterogeneous data into standardized feature units with consistent semantics. These standardized feature units include feature units corresponding to vehicle operating status, road environment conditions, and natural environment conditions, thereby outputting a spatiotemporally aligned standardized real-time data stream composed of multiple processed data records. Each data record contains a high-precision spatiotemporal stamp, data lineage information, and standardized feature units after mapping.

[0007] Step S2: After obtaining the standardized real-time data stream, the feature fusion process is triggered. First, all data records are time-series aligned based on the high-precision spatiotemporal stamps in the data records. Then, based on various feature units in the standardized real-time data stream, dynamic attention weights are calculated for the feature units of vehicle operation status, road environment status, and natural environment conditions through a gated attention fusion network. The calculation of dynamic attention weights introduces the cell state of the long short-term memory network as a context perceptron. The various feature units are weighted and summed according to their corresponding dynamic attention weights to generate a time series of a unified dynamic fusion feature vector, where each time step corresponds to a dynamic fusion feature vector.

[0008] Step S3: After the time series of the dynamically fused feature vector is generated, the energy consumption prediction process is triggered; the time series of the dynamically fused feature vector is input into the prediction model composed of a long short-term memory network encoder and an extreme gradient boosting regressor; the time series of the dynamically fused feature vector is processed by the long short-term memory network encoder to extract the hidden state vector; the hidden state vector is concatenated with the static features and input into the extreme gradient boosting regressor for inference, and the energy consumption prediction value and prediction uncertainty are output simultaneously using the uncertainty estimation loss function;

[0009] Step S4: When a new vehicle model is detected, the prediction model enhancement mechanism is triggered; through the federated transfer learning framework, the parameter gradient increment of the prediction model is calculated locally on multiple nodes using private data, and uploaded to the central server for secure aggregation; based on the similarity of data distribution between the source domain and the target domain, the weight transfer ratio of the prediction model is dynamically calculated to achieve adaptive enhancement of the prediction model;

[0010] In a preferred embodiment, the specific operation of adding a high-precision spatiotemporal stamp and data lineage information to each data record in step S1 is as follows:

[0011] A1. The process of generating a high-precision time stamp is as follows: For each data record, firstly, the reference time signal from the satellite time synchronization system is received, and the original source time information and source spatial location information in the data record are extracted.

[0012] Next, a synthesis algorithm is used to perform immutable hashing on the reference time signal, calculate the difference between the reference time signal and the source time information to correct clock drift, and geocode the source spatial location information. Then, the above processing results are connected in sequence to generate a unique identifier that combines time reference reliability, clock drift correction amount and geospatial coding, which serves as a high-precision spatiotemporal stamp for the data record.

[0013] A2. Simultaneously, the data lineage information generation process is as follows: a data lineage information block is constructed for each data record. This data lineage information block records an information chain, which includes a data source identifier, a transmission link hash value, a processing node identifier, and a high-precision spatiotemporal stamp. The transmission link hash value is generated as follows: first, a first hash operation is performed on the payload of the current data record to obtain a first hash value, and a second hash operation is performed on the data lineage information block of the previous data record to obtain a second hash value. Then, the first hash value and the second hash value are bit-concatenated. Finally, a third hash operation is performed on the bit-concatenated result to generate the transmission link hash value of the current data record.

[0014] In a preferred embodiment, the specific operation of mapping multi-source heterogeneous data into standardized feature units using a predefined semantic data model is as follows:

[0015] The semantic data model is a knowledge graph built upon domain knowledge. This knowledge graph contains nodes representing standardized feature concepts and edges representing mapping rules; the mapping process is as follows:

[0016] For each data record, based on the semantic type of the multi-source heterogeneous data it contains, the data record is associated with the source concept node in the knowledge graph. Then, by calculating the weighted semantic similarity of all attribute paths between the source concept node and the target standardized feature unit node, the optimal mapping relationship from the source concept node to the vehicle operation status feature unit, road environment condition feature unit, or natural environment condition feature unit is determined.

[0017] The weighted semantic similarity is calculated as follows: First, obtain all attribute paths connecting the source concept node and the target standardized feature unit node. For each path, calculate the semantic similarity of the node attribute sequence on the path and multiply it by the preset weight of the path. Then, sum the above product results of all paths. Finally, divide this sum by the sum of the preset weights of all paths to obtain the weighted semantic similarity.

[0018] In a preferred embodiment, step S2, which involves performing time-series alignment processing on all data records based on high-precision spatiotemporal stamps in the data records, specifically includes:

[0019] First, the high-precision spatiotemporal stamp contained in each data record is parsed; its time-series alignment operation is based on the time and spatial components in the high-precision spatiotemporal stamp. The time components include year, month, day, hour, minute, second and millisecond time elements, and the spatial components include longitude, latitude and altitude three-dimensional coordinate elements.

[0020] During the alignment process, all data records are sorted according to the chronological order of their time components. For data records with the same timestamp, they are then grouped according to the proximity of their spatial components. The aligned, standardized real-time data stream forms a continuous and ordered sequence in time and space, where the time index of each data record corresponds to the time component of its high-precision spatiotemporal stamp.

[0021] In a preferred embodiment, the dynamic attention weights are calculated for the feature units of vehicle operating state, road environment condition, and natural environment condition using a gated attention fusion network. The specific process is as follows:

[0022] The calculation of the dynamic attention weights incorporates the cell state of the long short-term memory network as a context perceptron. The cell state vector encodes historical sequence information up to the previous moment, including energy consumption trends and operating modes.

[0023] For the current moment, extract the vehicle operation status feature unit vector, road environment condition feature unit vector, and natural environment condition feature unit vector from the time-aligned standardized real-time data stream;

[0024] During the calculation process, each feature unit type is processed separately first:

[0025] The current feature unit vector and cell state vector are input into a linear transformation layer. The feature unit vector is linearly transformed using a trainable first weight matrix, and the cell state vector is linearly transformed using a trainable second weight matrix. Then, a trainable bias vector is added to form a linear combination result.

[0026] Applying the hyperbolic tangent activation function to the linear combination result for nonlinear mapping yields an intermediate activation value.

[0027] Then, a scalar score is generated by performing a dot product operation between a trainable weight vector and the intermediate activation value.

[0028] Applying an exponential function to the scalar score yields the unnormalized attention score for this feature unit type.

[0029] After calculating the unnormalized attention scores for all feature unit types, these scores are summed to obtain the total value.

[0030] Finally, the unnormalized attention score of each feature unit type is divided by the sum of the values, and the dynamic attention weight of each feature unit type is obtained by soft maximum normalization. The dynamic attention weight value is between zero and one, and the sum of the weights of all feature unit types is one.

[0031] After obtaining the dynamic attention weights, a weighted summation operation is performed. The feature unit of vehicle operation status is multiplied by its corresponding dynamic attention weight to obtain the first weighted feature. The feature unit of road environment status is multiplied by its corresponding dynamic attention weight to obtain the second weighted feature. The feature unit of natural environment conditions is multiplied by its corresponding dynamic attention weight to obtain the third weighted feature. Then, the first weighted feature, the second weighted feature and the third weighted feature are added together to generate a time series of a unified dynamic fusion feature vector, where each time step corresponds to a dynamic fusion feature vector.

[0032] In a preferred embodiment, the specific operation of extracting the hidden state vector by processing the time series of dynamically fused feature vectors through a long short-term memory network encoder in step S3 is as follows:

[0033] The Long Short-Term Memory (LSTM) network encoder is a recurrent neural network, consisting of multiple LSM units connected sequentially. Each LSM unit contains an input gate, a forget gate, an output gate, and a cell state.

[0034] When the time series of dynamically fused feature vectors is input into the Long Short-Term Memory Network Encoder, the Long Short-Term Memory Network Encoder processes each dynamically fused feature vector in the time series step by step. For each time step, the Long Short-Term Memory Network Encoder receives the dynamically fused feature vector of the current time step as input and reads the hidden state vector and cell state vector of the previous time step as the initial state.

[0035] The importance weight of the current input information is calculated through the input gate, the retention weight of historical information is calculated through the forget gate, and the output amplitude of the hidden state vector is controlled through the output gate.

[0036] Then, the cell state vector and the hidden state vector are updated. The cell state vector integrates the current input and historical information, and the hidden state vector is the output of the current time step. The calculation process of the hidden state vector is recursive. That is, for each time step, the current hidden state vector is calculated based on the current dynamic fusion feature vector, the hidden state vector of the previous time step, and the cell state vector of the previous time step, through the synergistic effect of the input gate, the forget gate, and the output gate.

[0037] After processing the entire time series, the Long Short-Term Memory network encoder outputs the hidden state vector of the final time step;

[0038] Subsequently, the hidden state vector of the final time step is concatenated with the static feature vector. The static feature vector includes vehicle identifier and battery health status attributes. The static feature vector has a first dimension, and the hidden state vector of the final time step has a second dimension. The concatenation operation connects the hidden state vector of the final time step and the static feature vector in the vector dimension to generate a combined feature vector.

[0039] In a preferred embodiment, the specific process by which the input extreme gradient boosting regressor performs inference and simultaneously outputs the energy consumption prediction value and the prediction uncertainty using an uncertainty estimation loss function is as follows:

[0040] The extreme gradient boosting regressor is a machine learning model based on decision tree ensemble, consisting of multiple regression trees connected sequentially. Each regression tree makes a splitting decision on the input combined feature vector and generates the prediction output of the leaf node. After the combined feature vector is input into the extreme gradient boosting regressor, the extreme gradient boosting regressor first performs multiple rounds of iteration on the combined feature vector. In each round of iteration, a new regression tree is added to correct the residual of the previous round of prediction. Finally, the prediction outputs of all regression trees are accumulated to obtain the final energy consumption prediction value.

[0041] The uncertainty estimation loss function is a custom loss function that combines quantile regression and regularization techniques to simultaneously optimize point prediction and interval prediction during training. This uncertainty estimation loss function controls the extreme gradient boosting regressor to output two quantile energy consumption prediction values, including the decimal energy consumption prediction value and the ninetieth quantile energy consumption prediction value. The decimal energy consumption prediction value represents the lower bound estimate of the energy consumption value, and the ninetieth quantile energy consumption prediction value represents the upper bound estimate of the energy consumption value.

[0042] The uncertainty scale is defined as half the difference between the 90th percentile energy consumption forecast and the 10th percentile energy consumption forecast, representing the half-width of the forecast interval; the uncertainty estimation loss function is composed of three parts added together:

[0043] The first part is the quantile loss term for the decimal part, which calculates the residual between the actual energy consumption value and the predicted energy consumption value for the decimal part.

[0044] The second part is the quantile loss term for the 90th percentile, which calculates the residual between the actual energy consumption value and the 90th percentile predicted value.

[0045] The third part is the regularization term, which calculates the squared error between the uncertainty scale and the half-width of the prediction interval;

[0046] By minimizing the sum of the above uncertainty estimation loss functions, the extreme gradient boosting regressor outputs both accurate point predictions and smooth uncertainty estimates. The point predictions are taken as the median estimate from the 50th percentile predictions.

[0047] In a preferred embodiment, in step S4, the specific operation of calculating the parameter gradient increment of the prediction model locally on multiple nodes using private data through the federated transfer learning framework and uploading it to the central server for secure aggregation is as follows:

[0048] The federated transfer learning framework consists of multiple local nodes and a central server. Each local node deploys a copy of the prediction model and holds its own private data. When the prediction model enhancement mechanism is triggered, the central server distributes the parameter vector of the current global prediction model to each local node.

[0049] Each local node uses its private data to train the received parameter vector and calculates the gradient of the uncertainty estimation loss function of the prediction model on the local data with respect to the model parameters. This gradient is the parameter gradient increment. Before uploading the parameter gradient increment, each local node uses homomorphic encryption technology to encrypt the parameter gradient increment.

[0050] The encrypted parameter gradient increments are uploaded to the central server. After receiving the encrypted parameter gradient increments from all local nodes, the central server uses the additive homomorphic property of homomorphic encryption to directly sum the multiple parameter gradient increments in the ciphertext state to obtain the encrypted global gradient increment.

[0051] The central server decrypts the encrypted global gradient increment to obtain the plaintext global gradient increment;

[0052] The parameter vector update of the secure aggregation and global prediction model further includes: the central server calculating the arithmetic mean of the plaintext global gradient increments, i.e., the sum of the gradient increments of all node parameters divided by the total number of nodes; subsequently, the central server uses this arithmetic mean to update the parameter vector of the global prediction model, with the update rule as follows:

[0053] The new global prediction model parameter vector is equal to the original parameter vector minus the product of the learning rate and the arithmetic mean; thus completing one round of federated learning aggregation and realizing the collaborative optimization of the global model.

[0054] In a preferred embodiment, the specific operation of dynamically calculating the weight transfer ratio of the prediction model based on the similarity of data distribution between the source domain and the target domain to achieve adaptive enhancement of the prediction model is as follows:

[0055] The source domain refers to the historical data distribution of existing vehicle models and operating areas, while the target domain refers to the current data distribution of new vehicle models.

[0056] The data distribution similarity calculation adopts the maximum mean difference algorithm, which quantifies the distribution difference by comparing the mean distance between the source domain data and the target domain data in the reproducing kernel Hilbert space.

[0057] First, a batch of samples is randomly sampled from the source domain dataset, and a batch of samples is randomly sampled from the target domain dataset;

[0058] Then, each sample is mapped to a high-dimensional feature space using a Gaussian kernel function, and the mean vector of the two batches of samples in the feature space is calculated.

[0059] The maximum mean difference is the Euclidean distance between two mean vectors; the data distribution similarity score is obtained by exponentially transforming the maximum mean difference and taking the negative value, and the similarity score ranges from zero to one.

[0060] The weight transfer ratio is obtained by multiplying the data distribution similarity score by a preset decay factor;

[0061] Finally, adaptive enhancement of the prediction model is achieved through weighted averaging.

[0062] This application also provides a big data-based electric heavy-duty truck charging and swapping energy consumption prediction system, specifically including:

[0063] Data acquisition module: When the electric heavy truck starts running, it triggers the data acquisition process to collect multi-source heterogeneous data from vehicle sensors, battery management system, road network service and meteorological service in real time. It receives and buffers data through a distributed message queue and adds high-precision spatiotemporal stamp and data lineage information to each data record.

[0064] Data preprocessing module: used to map multi-source heterogeneous data into standardized feature units using a predefined semantic data model, and output a spatiotemporally aligned standardized real-time data stream;

[0065] Feature fusion module: Based on standardized real-time data streams, it calculates dynamic attention weights for different feature units through a gated attention fusion network to generate a unified dynamic fusion feature vector;

[0066] Energy consumption prediction module: used to extract the temporal features of the dynamically fused feature vector through the long short-term memory network encoder, and combine it with static features, and use an extreme gradient boosting regressor to predict energy consumption and estimate uncertainty.

[0067] Model Enhancement Module: Used to adaptively enhance the prediction model through a federated transfer learning framework when a new vehicle model is detected.

[0068] The beneficial effects of this invention are: through multi-dimensional data fusion and intelligent algorithm optimization, the accuracy and reliability of energy consumption prediction for electric heavy-duty truck charging and swapping can be significantly improved. It utilizes multi-source heterogeneous data such as vehicle operating status, road environment, and natural environment, combined with time series models and ensemble learning algorithms, to dynamically and accurately predict energy consumption trends and charging and swapping needs. The system has good adaptive capabilities and can quickly adapt to new vehicle models or new operating areas through a federated transfer learning framework, effectively reducing model maintenance costs. Ultimately, it provides scientific decision support for power dispatching, battery storage, and operation planning of swapping stations, achieving the goals of cost reduction, efficiency improvement, and efficient energy utilization. Attached Figure Description

[0069] Figure 1 This is a flowchart of the method of the present invention;

[0070] Figure 2 This is a block diagram of the system structure of the present invention. Detailed Implementation

[0071] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0072] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0073] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0074] Example 1

[0075] This embodiment provides, for example Figure 1 The method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data includes the following steps:

[0076] Step S1: When the electric heavy truck starts operating or enters the monitoring area, the data acquisition process is triggered to collect multi-source heterogeneous data from vehicle sensors, battery management system, road network service, and meteorological service. The multi-source heterogeneous data is received and buffered in real time through a distributed message queue. Each incoming multi-source heterogeneous data is defined as a data record, and a high-precision spatiotemporal stamp and data lineage information are added to each data record. A predefined semantic data model is used to map the multi-source heterogeneous data into standardized feature units with consistent semantics. These standardized feature units include feature units corresponding to the vehicle's operating state, feature units corresponding to road environmental conditions, and... Corresponding to the feature units of natural environmental conditions, the output is a standardized real-time data stream with spatiotemporal alignment, consisting of multiple processed data records. Each data record contains a high-precision spatiotemporal stamp, data lineage information, and standardized feature units after mapping. Step S1 introduces an innovative spatiotemporal stamp synthesis algorithm, chain hash lineage tracing, and knowledge graph-based intelligent semantic mapping to transform multi-source heterogeneous data into a high-quality data base that is highly unified in the three dimensions of time, space, and semantics and has complete traceability. This output lays a solid and indispensable foundation for the accurate fusion and reliable prediction of subsequent steps.

[0077] Step S2: After obtaining the standardized real-time data stream, the feature fusion process is triggered. First, all data records are time-series aligned based on the high-precision spatiotemporal stamps in the data records. Then, based on various feature units in the standardized real-time data stream, dynamic attention weights are calculated for the feature units of vehicle operation status, road environment status, and natural environment conditions through a gated attention fusion network. The dynamic attention weight calculation introduces the cell state of the long short-term memory network as a context-aware sensor. The various feature units are weighted and summed according to their corresponding dynamic attention weights to generate a unified time series of dynamic fusion feature vectors, where each time step corresponds to a dynamic fusion feature vector. Step S2 achieves context-aware fusion of multiple feature units by introducing the cell state of the long short-term memory network in the dynamic attention weight calculation. This logic innovatively incorporates historical sequence information into the weight calculation, enabling the fusion process to dynamically respond to temporal changes. Compared with static weighting or standard attention mechanisms, it significantly improves the discriminative power of feature representation.

[0078] Step S3: After the time series of the dynamically fused feature vector is generated, the energy consumption prediction process is triggered. The time series of the dynamically fused feature vector is input into the prediction model composed of a long short-term memory network encoder and an extreme gradient boosting regressor. The time series of the dynamically fused feature vector is processed by the long short-term memory network encoder to extract the hidden state vector. The hidden state vector is concatenated with the static features and input into the extreme gradient boosting regressor for inference. The uncertainty estimation loss function is used to output the energy consumption prediction value and the prediction uncertainty. Step S3 extracts the time series features through the long short-term memory network encoder (i.e., LSTM encoder), concatenates them with the static features and inputs them into the extreme gradient boosting regressor (i.e., XGBoost regressor). The quantile regression loss function is used to realize energy consumption prediction and uncertainty estimation. This logic innovatively integrates quantile regression into the XGBoost framework and directly outputs the prediction interval, improving the robustness and interpretability of the prediction.

[0079] Step S4: When a new vehicle model or new operating area is detected, the prediction model enhancement mechanism is triggered. Using a federated transfer learning framework, the parameter gradient increments of the prediction model are calculated locally on multiple nodes using private data, and then uploaded to the central server for secure aggregation. Based on the similarity of data distribution between the source and target domains, the weight transfer ratio of the prediction model is dynamically calculated to achieve adaptive enhancement of the prediction model. Step S4, through the federated transfer learning framework, achieves adaptive enhancement of the prediction model in new scenarios. Its effect lies in combining the privacy protection of federated learning with the knowledge transfer of transfer learning, dynamically adjusting the transfer ratio based on distribution similarity to ensure rapid model adaptation and avoid performance degradation. This method improves the generalization ability and practicality of the prediction model, providing a sustainable optimization mechanism for energy consumption prediction.

[0080] In this embodiment, it is specifically necessary to explain the specific operation of adding a high-precision spatiotemporal stamp and data lineage information to each data record in step S1 as follows:

[0081] A1. The process of generating a high-precision time stamp is as follows: For each data record, firstly, the reference time signal from the satellite time synchronization system is received, and the original source time information and source spatial location information in the data record are extracted.

[0082] Next, a synthesis algorithm is employed to perform immutable hashing of the reference time signal (using cryptographic hash functions known in the art), calculate the difference between the reference time signal and the source time information to correct clock drift, and geocode the source spatial location information. The results of these processes are then concatenated in sequence to generate a unique identifier that combines time reference reliability, clock drift correction, and geospatial encoding. This identifier serves as a high-precision spatiotemporal stamp for the data record. The generated high-precision spatiotemporal stamp is not only a time marker but also a unique index identifier that integrates absolute time, time reliability, and spatial location. It ensures that data from different sources (such as vehicle speed and road conditions ahead) can be accurately aligned under the same spatiotemporal reference, providing a strict order and spatial correlation basis for subsequent multimodal fusion, and avoiding the spatiotemporal synchronization problem that simple timestamps cannot solve.

[0083] A2. Simultaneously, the data lineage information generation process is as follows: a data lineage information block is constructed for each data record. This data lineage information block records an information chain, which includes the data source identifier, transmission link hash value, processing node identifier, and high-precision spatiotemporal stamp. The transmission link hash value is generated as follows: first, a first hash operation is performed on the payload of the current data record to obtain the first hash value; then, a second hash operation is performed on the data lineage information block of the previous data record to obtain the second hash value; then, the first hash value and the second hash value are bit-joined; finally, a third hash operation is performed on the bit-joined result to generate the transmission link hash value of the current data record. This chain-like hash operation ensures the continuity and immutability of the data lineage. In addition, the chain-like hash structure ensures that the complete path of data from generation to processing is immutable and traceable. When subsequent steps detect data anomalies, the problematic sensor or transmission link can be quickly located along this data lineage information block, achieving accurate fault diagnosis and data credibility assessment. This is a capability that traditional metadata management does not possess.

[0084] The specific operation of mapping multi-source heterogeneous data into standardized feature units using a predefined semantic data model is as follows:

[0085] The semantic data model is a knowledge graph built upon domain knowledge. This knowledge graph contains nodes representing standardized feature concepts and edges representing mapping rules; the mapping process is as follows:

[0086] For each data record, based on the semantic type of the multi-source heterogeneous data it contains, the data record is associated with the source concept node in the knowledge graph. Then, by calculating the weighted semantic similarity of all attribute paths between the source concept node and the target standardized feature unit node, the optimal mapping relationship from the source concept node to the vehicle operation status feature unit, road environment condition feature unit, or natural environment condition feature unit is determined.

[0087] The weighted semantic similarity is calculated as follows: First, all attribute paths connecting the source concept node (e.g., "slope percentage") and the target standardized feature unit node (e.g., "road slope impact factor") are obtained. For each path, the semantic similarity of the node attribute sequence on the path is calculated and multiplied by the preset weight of the path. Then, the above product results of all paths are summed. Finally, this sum is divided by the sum of the preset weights of all paths to obtain the weighted semantic similarity (a normalized mapping score). The higher the score, the higher the semantic fit and the better the mapping relationship. This calculation method realizes intelligent semantic mapping and can handle synonyms, near-synonyms, and marginal cases not explicitly defined in the rules. It can accurately map multi-source heterogeneous data with different expressions such as "slope percentage" and "inclination angle" but similar meanings to the unified standardized feature unit "road slope impact factor", significantly improving the consistency level of data semantics.

[0088] In this embodiment, it is specifically necessary to explain step S2, which involves performing time-series alignment processing on all data records based on the high-precision spatiotemporal stamps in the data records. This specifically includes:

[0089] First, the standardized real-time data stream output in step S1 is read. This standardized real-time data stream consists of multiple data records. Each data record contains a high-precision spatiotemporal stamp, data lineage information, and standardized feature units. The high-precision spatiotemporal stamp contained in each data record is parsed. This high-precision spatiotemporal stamp is generated in step S1 and integrates satellite timing reference time, device source time correction, and geospatial coding information. Its time alignment operation is based on the time and spatial components in the high-precision spatiotemporal stamp. The time components include year, month, day, hour, minute, second, and millisecond time elements, and the spatial components include longitude, latitude, and altitude three-dimensional coordinate elements.

[0090] During the alignment process, all data records are sorted according to the chronological order of their time components to ensure that the time series is strictly monotonically increasing. At the same time, data records with the same timestamp are grouped or interpolated based on the proximity of their spatial components to solve the problems of data delay or out-of-order processing. The aligned and standardized real-time data stream forms a continuous and ordered sequence in time and space, where the time index of each data record corresponds to the time component of its high-precision spatiotemporal stamp, providing a foundation for subsequent feature fusion steps.

[0091] Dynamic attention weights are calculated for feature units representing vehicle operating status, road environment conditions, and natural environment conditions using a gated attention fusion network. The specific process is as follows:

[0092] The calculation of dynamic attention weights introduces the cell state of the long short-term memory network as a context perceptron. The cell state vector encodes historical sequence information up to the previous time step, including energy consumption trends and operating modes.

[0093] For the current moment, extract the vehicle operation status feature unit vector, road environment condition feature unit vector, and natural environment condition feature unit vector from the time-aligned standardized real-time data stream;

[0094] During the calculation process, each feature unit type is processed separately first:

[0095] The current feature unit vector and cell state vector are input into a linear transformation layer. The feature unit vector is linearly transformed using a trainable first weight matrix, and the cell state vector is linearly transformed using a trainable second weight matrix. Then, a trainable bias vector is added to form a linear combination result.

[0096] Applying the hyperbolic tangent activation function to the linear combination result for nonlinear mapping yields an intermediate activation value.

[0097] Then, a scalar score is generated by performing a dot product operation between a trainable weight vector and the intermediate activation value.

[0098] Applying an exponential function to the scalar score yields the unnormalized attention score for this feature unit type.

[0099] After calculating the unnormalized attention scores for all feature unit types, these scores are summed to obtain the total value.

[0100] Finally, the unnormalized attention score for each feature unit type is divided by the sum of these values, and the dynamic attention weight for each feature unit type is obtained through soft maximum normalization. This dynamic attention weight is between zero and one, and the sum of the weights for all feature unit types is one, thus reflecting the relative importance of each feature unit in the historical context. This calculation process ensures that the dynamic attention weight not only depends on the current feature value but also incorporates long-term temporal dependencies, thereby adaptively adjusting the contribution of different features in the fusion and improving the robustness and accuracy of feature fusion.

[0101] After obtaining the dynamic attention weights, a weighted summation operation is performed. The feature unit of vehicle operating status is multiplied by its corresponding dynamic attention weight to obtain the first weighted feature. The feature unit of road environment condition is multiplied by its corresponding dynamic attention weight to obtain the second weighted feature. The feature unit of natural environment condition is multiplied by its corresponding dynamic attention weight to obtain the third weighted feature. Then, the first, second, and third weighted features are added together to generate a unified dynamic fusion feature vector time series, where each time step corresponds to a dynamic fusion feature vector. This dynamic fusion feature vector integrates the essential information of multiple feature units while retaining the weight distribution relationship of each feature. It is used as the input to the prediction model in step S3, ensuring seamless data flow and accuracy of subsequent prediction steps.

[0102] In this embodiment, it is specifically necessary to explain the following steps in step S3: processing the time series of dynamically fused feature vectors through a long short-term memory network encoder to extract the hidden state vectors.

[0103] The Long Short-Term Memory (LSTM) network encoder is a recurrent neural network, consisting of multiple LSM units connected sequentially. Each LSM unit contains an input gate, a forget gate, an output gate, and a cell state.

[0104] When the time series of dynamically fused feature vectors is input into the Long Short-Term Memory Network Encoder, the Long Short-Term Memory Network Encoder processes each dynamically fused feature vector in the time series step by step. For each time step, the Long Short-Term Memory Network Encoder receives the dynamically fused feature vector of the current time step as input and reads the hidden state vector and cell state vector of the previous time step as the initial state.

[0105] The importance weight of the current input information is calculated through the input gate, the retention weight of historical information is calculated through the forget gate, and the output amplitude of the hidden state vector is controlled through the output gate.

[0106] Then, the cell state vector and the hidden state vector are updated. The cell state vector integrates the current input and historical information, and the hidden state vector is the output of the current time step. The calculation process of the hidden state vector is recursive. That is, for each time step, the current hidden state vector is calculated based on the current dynamic fusion feature vector, the hidden state vector of the previous time step, and the cell state vector of the previous time step, through the synergistic effect of the input gate, the forget gate, and the output gate.

[0107] After processing the entire time series, the Long Short-Term Memory network encoder outputs the hidden state vector of the final time step. This vector captures the long-term dependencies and temporal patterns in the dynamically fused feature vector sequence (i.e., it integrates current and historical fusion information, avoiding the limitations of the simple sliding window method).

[0108] Subsequently, the hidden state vector of the final time step is concatenated with the static feature vector. The static feature vector includes vehicle identifiers and attributes of battery health that do not change over time. The static feature vector has a first dimension, while the hidden state vector of the final time step has a second dimension. The concatenation operation connects the hidden state vector of the final time step and the static feature vector along the vector dimension to generate a combined feature vector. This combined feature vector has a dimension equal to the sum of the first and second dimensions and contains both temporal dynamic information and static attribute information. This provides comprehensive and rich input features for the extreme gradient boosting regressor, ensuring the accuracy of subsequent predictions.

[0109] The specific process of inputting an extreme gradient boosting regressor for inference and simultaneously outputting the energy consumption prediction and prediction uncertainty using an uncertainty estimation loss function is as follows:

[0110] The extreme gradient boosting regressor is a machine learning model based on decision tree ensemble (i.e., XGBoost regressor), which consists of multiple regression trees connected sequentially. Each regression tree makes a splitting decision on the input combined feature vector and generates the prediction output of the leaf node. After the combined feature vector is input into the extreme gradient boosting regressor, the extreme gradient boosting regressor first performs multiple rounds of iteration on the combined feature vector. In each round of iteration, a new regression tree is added to correct the residual of the previous round of prediction. Finally, the prediction outputs of all regression trees are accumulated to obtain the final energy consumption prediction value.

[0111] The uncertainty estimation loss function is a custom loss function that combines quantile regression and regularization techniques to simultaneously optimize point prediction and interval prediction during training. This uncertainty estimation loss function controls the extreme gradient boosting regressor to output two quantile energy consumption prediction values, including the decimal energy consumption prediction value and the ninetieth quantile energy consumption prediction value. The decimal energy consumption prediction value represents the lower bound estimate of the energy consumption value, and the ninetieth quantile energy consumption prediction value represents the upper bound estimate of the energy consumption value.

[0112] The uncertainty scale is defined as half the difference between the 90th percentile energy consumption forecast and the 10th percentile energy consumption forecast, representing the half-width of the forecast interval; the uncertainty estimation loss function is composed of three parts added together:

[0113] The first part is the quantile loss term for the decimal place. This quantile loss term calculates the residual between the actual energy consumption value and the predicted energy consumption value for the decimal place, and assigns a higher weight to cases where the residual is negative (that is, when calculating the loss corresponding to the decimal place, if the actual energy consumption value is lower than the predicted value for that quantile place (i.e., the residual is negative), the weight factor used in the loss calculation is 0.9; conversely, if the actual energy consumption value is higher than the predicted value (the residual is positive), the weight factor is 0.1), in order to penalize the underestimation error.

[0114] The second part is the quantile loss term for the 90th percentile. This quantile loss term calculates the residual between the actual energy consumption value and the predicted value of the 90th percentile, and assigns a higher weight to cases where the residual is positive (that is, when calculating the loss corresponding to the 90th percentile, if the actual energy consumption value is higher than the predicted value of this quantile (the residual is positive), the weight factor is 0.9; if the actual energy consumption value is lower than the predicted value (the residual is negative), the weight factor is 0.1) to penalize overestimation errors.

[0115] The third part is the regularization term, which calculates the squared error between the uncertainty scale and the half-width of the prediction interval. This is used to encourage extreme gradients to improve the learning consistency of the regressor in uncertainty estimation and avoid excessive fluctuations in uncertainty estimation results due to small changes in training data.

[0116] By minimizing the sum of the above uncertainty estimation loss functions, the extreme gradient boosting regressor can simultaneously output accurate point predictions and smooth uncertainty estimates. The point predictions are taken as the median estimate using the 50th percentile predictions. The prediction uncertainty provides confidence information for the prediction results. The prediction model obtains the final prediction model parameters through the training process. These prediction model parameters include all the weights and bias parameters of the long short-term memory network encoder and the extreme gradient boosting regressor, which are used for subsequent model enhancement steps.

[0117] In this embodiment, the specific operation in step S4, which involves using the federated transfer learning framework to calculate the parameter gradient increments of the prediction model locally on multiple nodes using private data and then uploading them to the central server for secure aggregation, is as follows:

[0118] The federated transfer learning framework consists of multiple local nodes and a central server. Each local node deploys a copy of the prediction model and holds its own private data. When the prediction model enhancement mechanism is triggered, the central server distributes the parameter vector of the current global prediction model to each local node.

[0119] Each local node uses its private data to train the received parameter vector and calculates the gradient of the uncertainty estimation loss function of the prediction model on the local data with respect to the model parameters. This gradient is the parameter gradient increment. The parameter gradient increment reflects the direction of the influence of the local data distribution on the model parameters. To ensure data privacy, each local node uses homomorphic encryption technology to encrypt the parameter gradient increment before uploading it.

[0120] The encrypted parameter gradient increments are uploaded to the central server. After receiving the encrypted parameter gradient increments from all local nodes, the central server uses the additive homomorphic property of homomorphic encryption to directly sum the multiple parameter gradient increments in the ciphertext state to obtain the encrypted global gradient increment.

[0121] The central server decrypts the encrypted global gradient increment to obtain the plaintext global gradient increment;

[0122] The parameter vector update for the secure aggregation and global prediction model further includes: the central server calculates the arithmetic mean of the plaintext global gradient increments, i.e., the sum of the gradient increments of all node parameters divided by the total number of nodes; subsequently, the central server uses this arithmetic mean to update the parameter vector of the global prediction model, with the update rule as follows:

[0123] The new global prediction model parameter vector is equal to the original parameter vector minus the product of the learning rate and the arithmetic mean; thus completing one round of federated learning aggregation and achieving collaborative optimization of the global model;

[0124] Based on the similarity of data distribution between the source and target domains, the specific operation of dynamically calculating the weight transfer ratio of the prediction model to achieve adaptive enhancement of the prediction model is as follows:

[0125] The source domain refers to the historical data distribution of existing vehicle models and operating areas, while the target domain refers to the current data distribution of new vehicle models or new operating areas.

[0126] The data distribution similarity calculation adopts the maximum mean difference algorithm, which quantifies the distribution difference by comparing the mean distance between the source domain data and the target domain data in the reproducing kernel Hilbert space.

[0127] First, a batch of samples is randomly sampled from the source domain dataset, and a batch of samples is randomly sampled from the target domain dataset;

[0128] Then, each sample is mapped to a high-dimensional feature space using a Gaussian kernel function, and the mean vector of the two batches of samples in the feature space is calculated.

[0129] The maximum mean difference is the Euclidean distance between two mean vectors. The smaller the distance, the more similar the distributions are. The data distribution similarity score is obtained by exponentially transforming the maximum mean difference and taking the negative value. The similarity score ranges from zero to one. The higher the score, the more similar the distributions are.

[0130] The weight transfer ratio is obtained by multiplying the data distribution similarity score by a preset decay factor. The decay factor is used to control the transfer intensity and takes a positive real number less than one to avoid over-transfer.

[0131] Finally, adaptive enhancement of the prediction model is achieved through weighted averaging. The enhanced target model parameter vector is calculated by weighting the source model parameter vector and the federated learning updated model parameter vector. The weight transfer ratio serves as the weight of the source model parameter vector, and the difference between the weight transfer ratio and the weight of the federated learning updated model parameter vector serves as the weight. The source model parameter vector comes from the prediction model parameters trained in step S3, and the federated learning updated model parameter vector comes from the parameter vector of the global prediction model after secure aggregation in step S4. When the distribution similarity is high, the weight transfer ratio is close to one, and the enhanced target model parameter vector mainly retains the knowledge of the source model. When the distribution similarity is low, the weight transfer ratio is close to zero, and the enhanced target model parameter vector mainly relies on the knowledge of the new data. This achieves adaptive enhancement of the model, ensuring that the model can quickly adapt to new scenarios while maintaining stability.

[0132] Example 2

[0133] This embodiment provides, for example Figure 2 The system shown is a big data-based energy consumption prediction system for electric heavy-duty truck charging and swapping, specifically including:

[0134] Data acquisition module: When the electric heavy truck starts running or enters the monitoring area, it triggers the data acquisition process, collects multi-source heterogeneous data from vehicle sensors, battery management system, road network service and meteorological service in real time, receives and buffers data through distributed message queue, and adds high-precision spatiotemporal stamp and data lineage information to each data record;

[0135] Data preprocessing module: used to map multi-source heterogeneous data into standardized feature units using a predefined semantic data model, and output a spatiotemporally aligned standardized real-time data stream;

[0136] Feature fusion module: Based on standardized real-time data streams, it calculates dynamic attention weights for different feature units through a gated attention fusion network to generate a unified dynamic fusion feature vector;

[0137] Energy consumption prediction module: used to extract the temporal features of the dynamically fused feature vector through the long short-term memory network encoder, and combine it with static features, and use an extreme gradient boosting regressor to predict energy consumption and estimate uncertainty.

[0138] Model Enhancement Module: Used to adaptively enhance the prediction model through a federated transfer learning framework when a new vehicle model or a new operating area is detected.

[0139] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0140] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0141] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0142] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0143] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0144] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0145] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data, characterized in that, Specifically, the following steps are included: Step S1: When the electric heavy truck starts running, a data acquisition process is triggered to collect multi-source heterogeneous data from vehicle sensors, battery management system, road network service, and meteorological service. The multi-source heterogeneous data is received and buffered in real time through a distributed message queue. Each incoming multi-source heterogeneous data is defined as a data record, and a high-precision spatiotemporal stamp and data lineage information are added to each data record. A predefined semantic data model is used to map the multi-source heterogeneous data into standardized feature units with consistent semantics. These standardized feature units include feature units corresponding to vehicle operating status, road environment conditions, and natural environment conditions, thereby outputting a spatiotemporally aligned standardized real-time data stream composed of multiple processed data records. Each data record contains a high-precision spatiotemporal stamp, data lineage information, and standardized feature units after mapping. Step S2: After obtaining the standardized real-time data stream, the feature fusion process is triggered. First, all data records are time-series aligned based on the high-precision spatiotemporal stamps in the data records. Then, based on various feature units in the standardized real-time data stream, dynamic attention weights are calculated for the feature units of vehicle operation status, road environment status, and natural environment conditions through a gated attention fusion network. The calculation of dynamic attention weights introduces the cell state of the long short-term memory network as a context perceptron. The various feature units are weighted and summed according to their corresponding dynamic attention weights to generate a time series of a unified dynamic fusion feature vector, where each time step corresponds to a dynamic fusion feature vector. Step S3: After the time series of the dynamically fused feature vector is generated, the energy consumption prediction process is triggered; the time series of the dynamically fused feature vector is input into the prediction model composed of a long short-term memory network encoder and an extreme gradient boosting regressor; the time series of the dynamically fused feature vector is processed by the long short-term memory network encoder to extract the hidden state vector; the hidden state vector is concatenated with the static features and input into the extreme gradient boosting regressor for inference, and the energy consumption prediction value and prediction uncertainty are output simultaneously using the uncertainty estimation loss function; Step S4: When a new vehicle model is detected, the prediction model enhancement mechanism is triggered; through the federated transfer learning framework, the parameter gradient increment of the prediction model is calculated locally on multiple nodes using private data, and uploaded to the central server for secure aggregation; based on the similarity of data distribution between the source domain and the target domain, the weight transfer ratio of the prediction model is dynamically calculated to achieve adaptive enhancement of the prediction model.

2. The method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data according to claim 1, characterized in that: In step S1, the specific operation of adding a high-precision spatiotemporal stamp and data lineage information to each data record is as follows: A1. The process of generating a high-precision time stamp is as follows: For each data record, firstly, the reference time signal from the satellite time synchronization system is received, and the original source time information and source spatial location information in the data record are extracted. Next, a synthesis algorithm is used to perform immutable hashing on the reference time signal, calculate the difference between the reference time signal and the source time information to correct clock drift, and geocode the source spatial location information. Then, the above processing results are connected in sequence to generate a unique identifier that combines time reference reliability, clock drift correction amount and geospatial coding, which serves as a high-precision spatiotemporal stamp for the data record. A2. Simultaneously, the data lineage information generation process is as follows: a data lineage information block is constructed for each data record. This data lineage information block records an information chain, which includes a data source identifier, a transmission link hash value, a processing node identifier, and a high-precision spatiotemporal stamp. The transmission link hash value is generated as follows: first, a first hash operation is performed on the payload of the current data record to obtain a first hash value, and a second hash operation is performed on the data lineage information block of the previous data record to obtain a second hash value. Then, the first hash value and the second hash value are bit-concatenated. Finally, a third hash operation is performed on the bit-concatenated result to generate the transmission link hash value of the current data record.

3. The method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data according to claim 2, characterized in that: The specific operation of mapping multi-source heterogeneous data into standardized feature units using a predefined semantic data model is as follows: The semantic data model is a knowledge graph built upon domain knowledge. This knowledge graph contains nodes representing standardized feature concepts and edges representing mapping rules; the mapping process is as follows: For each data record, based on the semantic type of the multi-source heterogeneous data it contains, the data record is associated with the source concept node in the knowledge graph. Then, by calculating the weighted semantic similarity of all attribute paths between the source concept node and the target standardized feature unit node, the optimal mapping relationship from the source concept node to the vehicle operation status feature unit, road environment condition feature unit, or natural environment condition feature unit is determined. The weighted semantic similarity is calculated as follows: First, obtain all attribute paths connecting the source concept node and the target standardized feature unit node. For each path, calculate the semantic similarity of the node attribute sequence on the path and multiply it by the preset weight of the path. Then, sum the above product results of all paths. Finally, divide this sum by the sum of the preset weights of all paths to obtain the weighted semantic similarity.

4. The method for predicting the charging and swapping energy consumption of electric heavy-duty trucks based on big data according to claim 3, characterized in that: In step S2, the step of performing time-series alignment processing on all data records based on the high-precision spatiotemporal stamps in the data records specifically includes: First, the high-precision spatiotemporal stamp contained in each data record is parsed; its time-series alignment operation is based on the time and spatial components in the high-precision spatiotemporal stamp. The time components include year, month, day, hour, minute, second and millisecond time elements, and the spatial components include longitude, latitude and altitude three-dimensional coordinate elements. During the alignment process, all data records are sorted according to the chronological order of their time components. For data records with the same timestamp, they are then grouped according to the proximity of their spatial components. The aligned, standardized real-time data stream forms a continuous and ordered sequence in time and space, where the time index of each data record corresponds to the time component of its high-precision spatiotemporal stamp.

5. The method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data according to claim 4, characterized in that: The dynamic attention weights for the feature units representing vehicle operating status, road environment conditions, and natural environment conditions are calculated using a gated attention fusion network, and the specific process is as follows: The calculation of the dynamic attention weights incorporates the cell state of the long short-term memory network as a context perceptron. The cell state vector encodes historical sequence information up to the previous moment, including energy consumption trends and operating modes. For the current moment, extract the vehicle operation status feature unit vector, road environment condition feature unit vector, and natural environment condition feature unit vector from the time-aligned standardized real-time data stream; During the calculation process, each feature unit type is processed separately first: The current feature unit vector and cell state vector are input into a linear transformation layer. The feature unit vector is linearly transformed using a trainable first weight matrix, and the cell state vector is linearly transformed using a trainable second weight matrix. Then, a trainable bias vector is added to form a linear combination result. Applying the hyperbolic tangent activation function to the linear combination result for nonlinear mapping yields an intermediate activation value. Then, a scalar score is generated by performing a dot product operation between a trainable weight vector and the intermediate activation value. Applying an exponential function to the scalar score yields the unnormalized attention score for this feature unit type. After calculating the unnormalized attention scores for all feature unit types, these scores are summed to obtain the total value. Finally, the unnormalized attention score of each feature unit type is divided by the sum of the values, and the dynamic attention weight of each feature unit type is obtained by soft maximum normalization. The dynamic attention weight value is between zero and one, and the sum of the weights of all feature unit types is one. After obtaining the dynamic attention weights, a weighted summation operation is performed. The feature unit of vehicle operation status is multiplied by its corresponding dynamic attention weight to obtain the first weighted feature. The feature unit of road environment status is multiplied by its corresponding dynamic attention weight to obtain the second weighted feature. The feature unit of natural environment conditions is multiplied by its corresponding dynamic attention weight to obtain the third weighted feature. Then, the first weighted feature, the second weighted feature and the third weighted feature are added together to generate a time series of a unified dynamic fusion feature vector, where each time step corresponds to a dynamic fusion feature vector.

6. The method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data according to claim 5, characterized in that: In step S3, the specific operation of processing the time series of dynamically fused feature vectors through a long short-term memory network encoder to extract the hidden state vectors is as follows: The Long Short-Term Memory (LSTM) network encoder is a recurrent neural network, consisting of multiple LSM units connected sequentially. Each LSM unit contains an input gate, a forget gate, an output gate, and a cell state. When the time series of dynamically fused feature vectors is input into the Long Short-Term Memory Network Encoder, the Long Short-Term Memory Network Encoder processes each dynamically fused feature vector in the time series step by step. For each time step, the Long Short-Term Memory Network Encoder receives the dynamically fused feature vector of the current time step as input and reads the hidden state vector and cell state vector of the previous time step as the initial state. The importance weight of the current input information is calculated through the input gate, the retention weight of historical information is calculated through the forget gate, and the output amplitude of the hidden state vector is controlled through the output gate. Then, the cell state vector and the hidden state vector are updated. The cell state vector integrates the current input and historical information, and the hidden state vector is the output of the current time step. The calculation process of the hidden state vector is recursive. That is, for each time step, the current hidden state vector is calculated based on the current dynamic fusion feature vector, the hidden state vector of the previous time step, and the cell state vector of the previous time step, through the synergistic effect of the input gate, the forget gate, and the output gate. After processing the entire time series, the Long Short-Term Memory network encoder outputs the hidden state vector of the final time step; Subsequently, the hidden state vector of the final time step is concatenated with the static feature vector. The static feature vector includes vehicle identifier and battery health status attributes. The static feature vector has a first dimension, and the hidden state vector of the final time step has a second dimension. The concatenation operation connects the hidden state vector of the final time step and the static feature vector in the vector dimension to generate a combined feature vector.

7. The method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data according to claim 6, characterized in that: The specific process of inputting an extreme gradient boosting regressor for inference and simultaneously outputting the energy consumption prediction and prediction uncertainty using an uncertainty estimation loss function is as follows: Extreme gradient boosting regressor is a machine learning model based on decision tree ensemble, consisting of multiple regression trees connected sequentially. Each regression tree makes a split decision on the combined feature vector of the input and generates the predicted output of the leaf node. After the combined feature vector is input into the extreme gradient boosting regressor, the extreme gradient boosting regressor first performs multiple iterations on the combined feature vector. In each iteration, a new regression tree is added to correct the residual of the previous prediction. Finally, the prediction outputs of all regression trees are accumulated to obtain the final energy consumption prediction value. The uncertainty estimation loss function is a custom loss function that combines quantile regression and regularization techniques to simultaneously optimize point prediction and interval prediction during training. The uncertainty estimation loss function controls the extreme gradient boosting regressor to output two quantile energy consumption predictions, including the decimal energy consumption prediction and the ninetieth percentile energy consumption prediction; the decimal energy consumption prediction represents the lower limit estimate of the energy consumption value, and the ninetieth percentile energy consumption prediction represents the upper limit estimate of the energy consumption value. The uncertainty scale is defined as half the difference between the 90th percentile energy consumption forecast and the 10th percentile energy consumption forecast, representing the half-width of the forecast interval; the uncertainty estimation loss function is composed of three parts added together: The first part is the quantile loss term for the decimal part, which calculates the residual between the actual energy consumption value and the predicted energy consumption value for the decimal part. The second part is the quantile loss term for the 90th percentile, which calculates the residual between the actual energy consumption value and the 90th percentile predicted value. The third part is the regularization term, which calculates the squared error between the uncertainty scale and the half-width of the prediction interval; By minimizing the sum of the above uncertainty estimation loss functions, the extreme gradient boosting regressor outputs both accurate point predictions and smooth uncertainty estimates. The point predictions are taken as the median estimate from the 50th percentile predictions.

8. The method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data according to claim 7, characterized in that: In step S4, the specific operation of calculating the parameter gradient increment of the prediction model locally on multiple nodes using private data through the federated transfer learning framework and uploading it to the central server for secure aggregation is as follows: The federated transfer learning framework consists of multiple local nodes and a central server. Each local node deploys a copy of the prediction model and holds its own private data. When the prediction model enhancement mechanism is triggered, the central server distributes the parameter vector of the current global prediction model to each local node. Each local node uses its private data to train the received parameter vector and calculates the gradient of the uncertainty estimation loss function of the prediction model on the local data with respect to the model parameters. This gradient is the parameter gradient increment. Before uploading the parameter gradient increment, each local node uses homomorphic encryption technology to encrypt the parameter gradient increment. The encrypted parameter gradient increments are uploaded to the central server; After receiving the encrypted parameter gradient increments from all local nodes, the central server uses the additive homomorphic property of homomorphic encryption to directly sum the gradient increments of multiple parameters in the ciphertext state to obtain the encrypted global gradient increment. The central server decrypts the encrypted global gradient increment to obtain the plaintext global gradient increment; The parameter vector update of the secure aggregation and global prediction model further includes: the central server calculates the arithmetic mean of the plaintext global gradient increment, that is, the sum of the gradient increments of all node parameters divided by the total number of nodes; Subsequently, the central server uses this arithmetic mean to update the parameter vector of the global prediction model, with the following update rule: The new global prediction model parameter vector is equal to the original parameter vector minus the product of the learning rate and the arithmetic mean; thus completing one round of federated learning aggregation and realizing the collaborative optimization of the global model.

9. The method for predicting the charging and battery swapping energy consumption of electric heavy-duty trucks based on big data according to claim 8, characterized in that: The specific operation of dynamically calculating the weight transfer ratio of the prediction model based on the similarity of data distribution between the source domain and the target domain, and realizing the adaptive enhancement of the prediction model, is as follows: The source domain refers to the historical data distribution of existing vehicle models and operating areas, while the target domain refers to the current data distribution of new vehicle models. The data distribution similarity calculation adopts the maximum mean difference algorithm, which quantifies the distribution difference by comparing the mean distance between the source domain data and the target domain data in the reproducing kernel Hilbert space. First, a batch of samples is randomly sampled from the source domain dataset, and a batch of samples is randomly sampled from the target domain dataset; Then, each sample is mapped to a high-dimensional feature space using a Gaussian kernel function, and the mean vector of the two batches of samples in the feature space is calculated. The maximum mean difference is the Euclidean distance between two mean vectors; the data distribution similarity score is obtained by exponentially transforming the maximum mean difference and taking the negative value, and the similarity score ranges from zero to one. The weight transfer ratio is obtained by multiplying the data distribution similarity score by a preset decay factor; Finally, adaptive enhancement of the prediction model is achieved through weighted averaging.

10. The big data-based electric heavy-duty truck charging and swapping energy consumption prediction system is applied to the big data-based electric heavy-duty truck charging and swapping energy consumption prediction method as described in any one of claims 1-9, characterized in that: Specifically, it includes: Data acquisition module: When the electric heavy truck starts running, it triggers the data acquisition process to collect multi-source heterogeneous data from vehicle sensors, battery management system, road network service and meteorological service in real time. It receives and buffers data through a distributed message queue and adds high-precision spatiotemporal stamp and data lineage information to each data record. Data preprocessing module: used to map multi-source heterogeneous data into standardized feature units using a predefined semantic data model, and output a spatiotemporally aligned standardized real-time data stream; Feature fusion module: Based on standardized real-time data streams, it calculates dynamic attention weights for different feature units through a gated attention fusion network to generate a unified dynamic fusion feature vector; Energy consumption prediction module: used to extract the temporal features of the dynamically fused feature vector through the long short-term memory network encoder, and combine it with static features, and use an extreme gradient boosting regressor to predict energy consumption and estimate uncertainty. Model Enhancement Module: Used to adaptively enhance the prediction model through a federated transfer learning framework when a new vehicle model is detected.