As the adoption of electric cars continues to rise globally, addressing the challenges associated with charging infrastructure and refueling options for hybrid electric vehicles (HEVs) has become paramount. These vehicles, which combine internal combustion engines with electric propulsion, offer a practical solution to range anxiety and environmental concerns. However, the uneven utilization of charging stations (CSs) and gas stations (GSs) often leads to inefficiencies, such as long waiting times and suboptimal resource allocation. In this paper, we propose a novel recommendation algorithm based on vertical federated learning (VFL) to provide personalized station recommendations for electric car users while ensuring data privacy and security. Our approach leverages local model training and secure aggregation through a decentralized cloud network, integrated with blockchain technology for enhanced trust and scalability. By focusing on the unique needs of electric car owners, we aim to optimize station selection, reduce operational costs, and improve overall user experience.
The rapid growth of the electric car industry has highlighted the need for intelligent systems that can guide users to available CSs and GSs based on real-time data. Traditional recommendation methods often rely on centralized data processing, which raises privacy concerns due to the sensitive nature of location and vehicle information. In contrast, our VFL-based framework allows multiple parties—such as electric cars, CSs, and GSs—to collaboratively train a model without sharing raw data. This is achieved through encrypted entity alignment and local gradient computations, ensuring that private information remains on-device. Moreover, we incorporate a blockchain-secured cloudlet network to facilitate parameter exchange, mitigating risks associated with single points of failure. Through extensive simulations, we demonstrate that our algorithm not only enhances recommendation accuracy but also significantly reduces communication latency and waiting times, making it suitable for real-time applications in the evolving landscape of electric car mobility.

In our system model, we define three key participants: electric cars (representing HEVs), CSs, and GSs. Each participant maintains a local dataset with distinct features, as summarized in Table 1. For electric cars, features include current location, average speed, battery capacity, and vehicle state (e.g., charging, refueling, or driving). CSs provide data on charging桩 location, number of available ports, charging costs, and service fees, while GSs contribute information on fuel prices, pump availability, and waiting times. The goal is to train a global model that minimizes a loss function combining these features, thereby generating a ranked list of recommended stations. Formally, let $k = \{1, 2, \dots, K\}$ denote the set of data owners, with local datasets $D_k$ and total samples $D = \sum_{k=1}^K D_k$. The model parameters $\Theta \in \mathbb{R}^d$, where $d$ varies across participants due to differing feature vectors. For electric cars, the data structure is $\{x_i^{hev}\}_{i \in D_{hev}}$, while CSs and GSs have $\{x_i^{cs}, y_i\}_{i \in D_{cs}}$ and $\{x_i^{gs}, z_i\}_{i \in D_{gs}}$, respectively, where $y_i$ and $z_i$ are labels derived from historical usage.
| Participant | Feature Description |
|---|---|
| Electric Car | Vehicle location, average speed, current weather, surrounding infrastructure, traffic congestion, battery capacity, charge start/stop times, vehicle state |
| Charging Station (CS) | Geographic coordinates, number of charging ports, average charging capacity, cost, parking fees, service charges, charge duration |
| Gas Station (GS) | Geographic coordinates, number of fuel pumps, average refueling cost, capacity, waiting time, refueling duration |
The VFL training process consists of two main phases: encrypted entity alignment and local model training. In the first phase, participants identify common samples without exposing raw data by exchanging encrypted identifiers, such as geographic coordinates or transaction timestamps. This results in an intersection set $I$ that aligns records across electric cars, CSs, and GSs. For example, if an electric car has a sample ID corresponding to a specific CS transaction, the encryption ensures that only the matched entries are used for training. This privacy-preserving step is crucial for maintaining the confidentiality of electric car data, as it prevents unauthorized access to sensitive information like travel patterns or energy consumption.
In the local model training phase, we initialize the model parameters $\Theta^{hev}$, $\Theta^{cs}$, and $\Theta^{gs}$ for electric cars, CSs, and GSs, respectively. The training objective is to minimize the loss function $L$, which incorporates prediction errors and regularization terms. For a given sample $i$, we define intermediate values $u_i^{hev} = \Theta^{hev} x_i^{hev}$, $u_i^{cs} = \Theta^{cs} x_i^{cs}$, and $u_i^{gs} = \Theta^{gs} x_i^{gs}$. The overall loss function is expressed as:
$$L = \sum_{i} \left( u_i^{hev} + u_i^{cs} – y_i + u_i^{gs} – z_i \right)^2 + \lambda \left( g(\Theta^{hev}) + g(\Theta^{cs}) + g(\Theta^{gs}) \right)$$
where $\lambda$ is a regularization parameter and $g(\cdot)$ is a regularization function, such as $g(\Theta) = \frac{1}{2} \|\Theta\|^2$ for ridge regression. To compute this securely, we decompose the loss into components attributable to each participant and their interactions:
$$L = L^{hev} + L^{cs} + L^{gs} + L^{hev-cs} + L^{hev-gs} + L^{cs-gs}$$
where, for instance, $L^{hev} = \sum_{i} (u_i^{hev})^2 + \lambda g(\Theta^{hev})$ and $L^{hev-cs} = 2 \sum_{i} u_i^{hev} (u_i^{cs} – y_i)$. Similarly, gradients are computed as:
$$\frac{\partial L}{\partial \Theta^{hev}} = \sum_{i} d_i x_i^{hev} + \lambda \Theta^{hev}, \quad \frac{\partial L}{\partial \Theta^{cs}} = \sum_{i} d_i x_i^{cs} + \lambda \Theta^{cs}, \quad \frac{\partial L}{\partial \Theta^{gs}} = \sum_{i} d_i x_i^{gs} + \lambda \Theta^{gs}$$
with $d_i = u_i^{hev} + u_i^{cs} – y_i + u_i^{gs} – z_i$. These gradients are computed locally, encrypted, and sent to a cloud aggregator for secure aggregation. The use of homomorphic encryption allows computations on ciphertexts, ensuring that sensitive electric car data is never exposed during transmission.
To enhance the scalability and security of our recommendation system, we integrate a blockchain-based cloudlet network, referred to as CloudletChain. This network consists of multiple cloud nodes $C = \{c_1, c_2, \dots, c_p\}$ that handle parameter aggregation and exchange. Each cloud node must register with the blockchain through a transaction $TX$ that includes its public key and authorization details. The process involves generating a hash $hash(TX)$ and validating the transaction via a randomly selected miner node $c_m$. Once verified, the transaction is added to a new block $b_{new}$ in the blockchain, which is then broadcast to all nodes. This decentralized approach prevents single points of failure and ensures that only trusted aggregators participate in the network, thereby protecting against malicious attacks targeting electric car data.
The operational workflow of CloudletChain involves several steps. First, a new cloud node $c_{new}$ registers by creating a transaction $TX$ with its credentials. After a waiting period $t_{pool}$, a miner node $c_m$ validates $TX$ and includes it in a block $b_r$. The block header contains a Merkle tree root hash computed as:
$$H(TX_n + TX_{n-1}) = H(hash(TX_n)) + H(hash(TX_{n-1}))$$
iteratively until all transactions are hashed. The miner performs proof-of-work to finalize the block, which is then appended to the ledger. This mechanism ensures transparency and integrity, as all participants—electric cars, CSs, and GSs—can verify the cloud nodes’ authenticity through the public blockchain. By leveraging this infrastructure, our system reduces communication latency and supports real-time recommendations for electric car users, as cloudlets process parameters locally at the network edge.
For experimental evaluation, we simulated a scenario based on data collected from a urban environment over a four-month period, involving 50 electric cars, 20 CSs, and 20 GSs. The cloud network comprised 10 nodes distributed across different geographic locations to ensure low-latency communication. We compared our VFL-based algorithm with two baseline methods: Real-Time Recommendation (RT) and Earliest Finish Time (EFT). The performance metrics included waiting probability, total cost, time utilization, and hourly revenue, as shown in Table 2. Our algorithm achieved zero waiting probability and lower costs, demonstrating its effectiveness in optimizing station utilization for electric car users.
| Algorithm | Waiting Probability | Total Cost ($) | Parking Cost ($) | Time Utilization | Hourly Revenue ($) |
|---|---|---|---|---|---|
| RT | 0.122 | 25.231 | 3.579 | 0.148 | 7916 |
| EFT | 0 | 20.948 | 1.754 | 0.193 | 9021 | Our Algorithm | 0 | 19.426 | 0.126 | 0.202 | 9062 |
We further analyzed the execution time of our system as the number of participants increased. Starting with 2 GSs, 2 CSs, and 5 electric cars, we scaled up to 20 GSs, 20 CSs, and 50 electric cars. The results, plotted in Figure 1, show that execution time grows linearly with participant count, but the rate of increase slows at higher scales, indicating efficient handling of large datasets. This scalability is crucial for real-world deployments where thousands of electric cars may interact with numerous stations simultaneously.
Waiting time analysis focused on the duration electric cars spend before starting to charge or refuel. For CSs, waiting time $T_1$ is defined as $t_{charging+waiting} + t_{arrival}$, while for GSs, it is $T_2 = t_{waiting} + t_{arrival}$, ignoring refueling time due to its brevity. We introduced a metric $\rho$ representing the difference in waiting times between consecutive electric cars. As illustrated in Figure 2, $\rho$ remains stable for most vehicles, but dips for specific instances (e.g., HEV8, HEV13, HEV16) where the system avoids recommending congested stations. This highlights our algorithm’s ability to dynamically route electric cars to less busy options, reducing overall wait times and improving station efficiency.
Communication latency, defined as the average time from a recommendation request by an electric car to the receipt of the final list $L_f$, was evaluated under different cloud node configurations. As shown in Figure 3, a centralized network (no cloud nodes) took approximately 9 seconds to generate recommendations, whereas a decentralized network with 10 cloud nodes reduced this to around 3 seconds. Increasing the number of cloud nodes from 3 to 10 consistently decreased latency, underscoring the benefits of edge computing for real-time electric car applications. Minor fluctuations in latency (denoted as $C$) were observed, possibly due to connection issues or distance variations between electric cars and cloud nodes.
Finally, we assessed the time required to mine new blocks in the CloudletChain as the network expanded. Figure 4 displays the minimum and maximum execution times for adding blocks with varying numbers of cloud nodes. As the network grew from 6 to 10 nodes, the variance in mining time increased, reflecting the computational overhead of consensus algorithms. However, the use of a randomly selected miner node helped minimize delays, ensuring that the blockchain remained efficient for securing electric car data exchanges. This analysis confirms that our decentralized approach maintains security without compromising performance, even as the system scales.
In conclusion, our VFL-based recommendation algorithm effectively addresses the challenges of station selection for electric cars by leveraging privacy-preserving techniques and blockchain-enhanced cloud networks. The results demonstrate significant improvements in cost efficiency, waiting times, and scalability compared to existing methods. Future work will extend this framework to public electric transportation systems, such as buses, where real-time charging scheduling can minimize passenger wait times and maximize operational profits. Additionally, we plan to explore the impact of advanced cryptographic methods on data protection for electric car ecosystems, further enhancing privacy and security in collaborative learning environments.
The integration of federated learning with blockchain technology represents a significant step forward in the development of intelligent systems for electric car mobility. By enabling secure, decentralized model training, our approach not only safeguards user privacy but also promotes the efficient use of charging and refueling infrastructure. As the electric car industry continues to evolve, such innovations will play a crucial role in supporting sustainable transportation and enhancing the overall user experience. We believe that our contributions provide a solid foundation for future research and practical applications in this dynamic field.