EOS演示页面:预测数据可视化与图表展示
概述
EOS(Energy Optimization System)演示页面是能源优化系统的核心可视化界面,通过Bokeh图表库实现了多维度能源数据的实时可视化展示。该页面集成了光伏发电预测、电价预测、气象数据、负载预测等关键功能,为用户提供直观的能源系统状态监控和数据分析能力。
核心功能模块
1. 光伏发电预测可视化
def DemoPVForecast(predictions: pd.DataFrame, config: dict) -> FT:
source = ColumnDataSource(predictions)
provider = config["pvforecast"]["provider"]
plot = figure(
x_axis_type="datetime",
title=f"PV Power Prediction ({provider})",
x_axis_label="Datetime",
y_axis_label="Power [W]",
sizing_mode="stretch_width",
height=400,
)
plot.vbar(
x="date_time",
top="pvforecast_ac_power",
source=source,
width=BAR_WIDTH_1HOUR * 0.8,
legend_label="AC Power",
color="lightblue",
)
return Bokeh(plot)
功能特点:
- 时间序列柱状图展示光伏交流功率预测
- 支持多光伏平面配置(最多4个平面)
- 实时显示不同方位角和倾角的光伏板发电情况
- 自适应宽度设计,确保在不同屏幕尺寸下的显示效果
2. 电价预测可视化
def DemoElectricityPriceForecast(predictions: pd.DataFrame, config: dict) -> FT:
source = ColumnDataSource(predictions)
provider = config["elecprice"]["provider"]
plot = figure(
x_axis_type="datetime",
y_range=Range1d(
predictions["elecprice_marketprice_kwh"].min() - 0.1,
predictions["elecprice_marketprice_kwh"].max() + 0.1,
),
title=f"Electricity Price Prediction ({provider})",
x_axis_label="Datetime",
y_axis_label="Price [€/kWh]",
sizing_mode="stretch_width",
height=400,
)
plot.vbar(
x="date_time",
top="elecprice_marketprice_kwh",
source=source,
width=BAR_WIDTH_1HOUR * 0.8,
legend_label="Market Price",
color="lightblue",
)
return Bokeh(plot)
数据指标:
- 市场电价(€/kWh)预测
- 自动调整Y轴范围确保数据可视化效果
- 支持Akkudoktor和EnergyCharts等多种数据提供商
3. 气象数据可视化
3.1 温湿度双轴图表
def DemoWeatherTempAirHumidity(predictions: pd.DataFrame, config: dict) -> FT:
source = ColumnDataSource(predictions)
provider = config["weather"]["provider"]
plot = figure(
x_axis_type="datetime",
title=f"Air Temperature and Humidity Prediction ({provider})",
x_axis_label="Datetime",
y_axis_label="Temperature [°C]",
sizing_mode="stretch_width",
height=400,
)
# 添加湿度次级Y轴
plot.extra_y_ranges["humidity"] = Range1d(start=-5, end=105)
y2_axis = LinearAxis(y_range_name="humidity", axis_label="Relative Humidity [%]")
y2_axis.axis_label_text_color = "green"
plot.add_layout(y2_axis, "left")
plot.line("date_time", "weather_temp_air", source=source,
legend_label="Air Temperature", color="blue")
plot.line("date_time", "weather_relative_humidity", source=source,
legend_label="Relative Humidity [%]", color="green",
y_range_name="humidity")
return Bokeh(plot)
3.2 辐照度三线图表
def DemoWeatherIrradiance(predictions: pd.DataFrame, config: dict) -> FT:
source = ColumnDataSource(predictions)
provider = config["weather"]["provider"]
plot = figure(
x_axis_type="datetime",
title=f"Irradiance Prediction ({provider})",
x_axis_label="Datetime",
y_axis_label="Irradiance [W/m2]",
sizing_mode="stretch_width",
height=400,
)
plot.line("date_time", "weather_ghi", source=source,
legend_label="Global Horizontal Irradiance", color="red")
plot.line("date_time", "weather_dni", source=source,
legend_label="Direct Normal Irradiance", color="green")
plot.line("date_time", "weather_dhi", source=source,
legend_label="Diffuse Horizontal Irradiance", color="blue")
return Bokeh(plot)
气象数据维度: | 数据指标 | 单位 | 描述 | |---------|------|------| | 气温 | °C | 环境空气温度 | | 相对湿度 | % | 空气湿度百分比 | | 总水平辐照度 | W/m² | 水平面上的总太阳辐射 | | 直接法向辐照度 | W/m² | 垂直于太阳方向的直接辐射 | | 散射水平辐照度 | W/m² | 天空散射辐射 |
4. 负载预测可视化
def DemoLoad(predictions: pd.DataFrame, config: dict) -> FT:
source = ColumnDataSource(predictions)
provider = config["load"]["provider"]
if provider == "LoadAkkudoktor":
year_energy = config["load"]["provider_settings"]["loadakkudoktor_year_energy"]
provider = f"{provider}, {year_energy} kWh"
plot = figure(
x_axis_type="datetime",
title=f"Load Prediction ({provider})",
x_axis_label="Datetime",
y_axis_label="Load [W]",
sizing_mode="stretch_width",
height=400,
)
# 添加标准差次级Y轴
stddev_min = predictions["load_std"].min()
stddev_max = predictions["load_std"].max()
plot.extra_y_ranges["stddev"] = Range1d(start=stddev_min - 5, end=stddev_max + 5)
y2_axis = LinearAxis(y_range_name="stddev", axis_label="Load Standard Deviation [W]")
y2_axis.axis_label_text_color = "green"
plot.add_layout(y2_axis, "left")
plot.line("date_time", "load_mean", source=source,
legend_label="Load mean value", color="red")
plot.line("date_time", "load_mean_adjusted", source=source,
legend_label="Load adjusted by measurement", color="blue")
plot.line("date_time", "load_std", source=source,
legend_label="Load standard deviation", color="green",
y_range_name="stddev")
return Bokeh(plot)
负载预测特性:
- 均值负载预测曲线(红色)
- 测量调整后的负载曲线(蓝色)
- 负载标准差置信区间(绿色)
- 双Y轴设计,主轴为负载功率,次轴为标准差
技术架构
可视化技术栈
数据流架构
配置参数详解
演示页面使用标准化的配置参数:
{
"elecprice": {
"charges_kwh": 0.21,
"provider": "ElecPriceAkkudoktor"
},
"general": {
"latitude": 52.5,
"longitude": 13.4
},
"prediction": {
"historic_hours": 48,
"hours": 48
},
"load": {
"provider": "LoadAkkudoktor",
"provider_settings": {
"loadakkudoktor_year_energy": 20000
}
},
"pvforecast": {
"planes": [
{
"peakpower": 5.0,
"surface_azimuth": 170,
"surface_tilt": 7,
"userhorizon": [20,27,22,20],
"inverter_paco": 10000
}
],
"provider": "PVForecastAkkudoktor"
},
"weather": {
"provider": "BrightSky"
}
}
部署与使用
启动演示服务
# 启动EOS服务器
python -m akkudoktoreos.server.server
# 启动EOSdash演示界面
python -m akkudoktoreos.server.eosdash
访问演示页面
默认访问地址:http://localhost:8504/eosdash/demo
页面布局
演示页面采用响应式网格布局:
最佳实践
1. 数据更新策略
演示页面采用智能数据更新机制:
- 首次访问时自动获取最新预测数据
- 配置临时切换确保演示数据准确性
- 完成后自动恢复原始配置
2. 可视化优化技巧
- 使用适当的时间间隔(1小时柱状图宽度)
- 自动调整Y轴范围确保数据可见性
- 多Y轴设计处理不同量级的数据
- 颜色编码区分不同类型的数据系列
3. 性能考虑
- Bokeh客户端渲染减轻服务器压力
- 数据序列化优化减少网络传输
- 缓存策略提升重复访问性能
总结
EOS演示页面通过专业的可视化技术,将复杂的能源预测数据转化为直观易懂的图表展示。其多维度、交互式的设计理念,为能源系统管理者提供了强大的决策支持工具。无论是光伏发电预测、电价波动分析,还是负载模式识别,都能通过这个统一的界面获得清晰的数据洞察。
该演示页面不仅展示了EOS系统的技术能力,更体现了数据可视化在能源优化领域的重要价值,为用户提供了从数据到洞察的完整解决方案。
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考



