This is the official PyTorch implementation of the paper "Charging demand prediction for fast charging stations via behavior-driven dynamic graphs and continuous spatiotemporal evolution" (CSTGCN).
Accurate forecasting of charging demand for public Fast Charging Stations (FCS) is critical for V2G and green mobility. To address the dynamic and open-network nature of FCS, we propose CSTGCN, a systematic framework that integrates Behavior-constrained Dynamic Graphs and Continuous Spatiotemporal Evolution via Neural ODEs.
Our model effectively suppresses the over-smoothing issue in traditional STGNNs by introducing physical accessibility and economic thresholds. It also alleviates error accumulation and state drift in long-horizon predictions.
CSTGCN/
├── conf/ # Configuration files (YAML)
├── data/ # Data directory (Put your CSVs here)
├── models/ # Core model architecture (Layers, Neural ODEs, etc.)
├── utils/ # Utilities (Dataloader, Metrics, Helpers)
├── train.py # Training script
└── test.py # Evaluation and inference script
It is recommended to use Python 3.9+. Install dependencies via:
pip install -r requirements.txt1. Prepare Data & Configuration
Configure your dataset paths and hyperparameters in conf/config.yaml. (Note: For privacy reasons, the full dataset of Wuhan is not provided here. Please place your own dataset or request the sample data)
2. Train the Model
python train.py --config conf/config.yaml3. Test and Evaluate
python test.py --checkpoint saved_models/best_model.pth --config conf/config.yaml- Multi-view Dynamic Graphs: Integrates traffic, price, and adaptive graphs bounded by physical and economic constraints.
- Periodicity-driven Neural ODEs: Explicitly extracts multi-scale periodic fingerprints as the driving force for continuous evolution.
- Dual-branch Synergistic Decoder: Adaptively fuses long-term trends and short-term fluctuations via a horizon gate.
If you find our code or paper useful, please consider citing:
@article{cstgcn2026,
title={Charging demand prediction for fast charging stations via behavior-driven dynamic graphs and continuous spatiotemporal evolution},
author={Your Name and Co-authors},
journal={Journal Name},
year={2026}
}本仓库是论文 "基于行为驱动动态图与连续时空演化的快速充电站充电需求预测" (CSTGCN) 的官方 PyTorch 实现代码。
准确预测城市公共快速充电站(FCS)的充电需求对支撑绿色出行与车网互动(V2G)具有重要意义。针对快充网络高度开放、动态的特征,本文提出了一种融合行为约束动态多图与神经常微分方程 (Neural ODE) 的连续时空预测框架 (CSTGCN)。
本模型通过显式引入出行物理阈值和价格经济边界,从机理上抑制了图学习的过平滑现象;同时,通过将提取的周期性指纹注入常微分方程,将离散状态递推升级为潜在空间内的连续时空演化,有效缓解了长视野预测中的误差累积。
CSTGCN/
├── conf/ # 超参数与路径配置文件 (YAML)
├── data/ # 存放所需数据集的目录
├── models/ # 核心模型代码
├── utils/ # 工具函数 (数据加载, 性能评估, 随机种子设定)
├── train.py # 模型训练主脚本
└── test.py # 模型推理与评估脚本
建议使用 Python 3.9 及以上版本,运行以下命令安装依赖:
pip install -r requirements.txt1. 数据准备与配置修改
在 conf/config.yaml 中配置您的数据路径和超参数。(注:因隐私保护,武汉市全量真实运营数据未直接提供,您可以放入自己的数据集或申请 Sample 数据进行调试)
2. 训练模型
python train.py --config conf/config.yaml3. 模型测试 支持加载预训练权重并在测试集上计算 MAE, RMSE 和 MAPE 指标:
python test.py --checkpoint saved_models/best_model.pth --config conf/config.yaml- 动态多图系统:深度融合交通可达性、价格经济竞争与自适应潜变量图。
- 周期驱动的连续演化:基于 FFT 提取长序列特征指纹,将其作为节律驱动力注入连续的动力学方程中。
- 视野自适应双分支解码:巧妙解耦确定性长程趋势与随机性微观波动,适应全部多步视野预测。
如果您觉得我们的代码或论文对您的研究有帮助,请引用我们的论文:
@article{cstgcn2026,
title={基于行为驱动动态图与连续时空演化的快速充电站充电需求预测},
author={作者姓名等},
journal={期刊名称},
year={2026}
}