运营商偏好让您可以控制路线规划服务在计算 EV 路线时优先选择哪些充电网络。
您可以在两个位置配置偏好:
- Chargetrip Dashboard:在项目 / 高级 / 充电站运营商偏好下,为您的项目设置全局运营商偏好配置。
- 创建路线请求:在
createRoute 变更中使用 input.operators 字段,动态定义偏好,或针对每个请求覆盖 Dashboard 的运营商偏好配置。
运营商偏好分为四种类型,每种都可以限定到特定国家/地区:
| 偏好 | 路线规划行为 |
|---|
| 排除 | 在任何情况下都严格排除这些运营商的充电站。 |
| 规避 | 除非没有更好的替代方案,否则会避开这些运营商的充电站。 |
| 优先 | 这些运营商的充电站按其排名(高、中、低)获得优先选择。层级越高,该充电站被选中的可能性越大。如果没有更好的替代方案,路线仍会使用未排名或被规避的充电站。 |
| 必选 | 仅使用这些运营商的充电站。在此允许的范围内,排名层级仍然适用,即高排名运营商优先于中、低排名运营商。如果车辆仅使用已排名的充电站无法到达目的地,则路线计算失败。 |
了解请求级别的输入如何与 Dashboard 设置相互作用,可确保路线规划行为可预测:
- Dashboard 中的排除和规避运营商会自动生效:
在 Dashboard 中配置为排除或规避的运营商会应用于每次路线计算,无需在您的
createRoute 请求中提供任何参数。
- 未设置排名类型时,Dashboard 的排名层级保持未激活状态:
在排名层级中配置的运营商必须通过在
createRoute 请求中设置 input.operators.ranking.type 来激活,否则不会影响充电站选择。
- 请求级别的运营商会替换对应的 Dashboard 偏好:
在
createRoute 请求中指定运营商 ID 只会替换 Dashboard 中相应的配置。例如,提供 input.operators.exclude[] 会替换 Dashboard 中整个排除运营商配置,而 Dashboard 级别的规避运营商仍然生效。
仅使用 Dashboard 的排除和规避设置
应用 Dashboard 中设置的排除和规避运营商配置。由于未指定 input.operators.ranking.type,Dashboard 的排名设置处于未激活状态。
createRoute( input: { vehicle: { id: "607823b2c246f9001b97b1a2" } origin: { type: Feature geometry: { type: Point, coordinates: [4.895168, 52.370216] } } destination: { type: Feature geometry: { type: Point, coordinates: [2.352222, 48.856614] } } })
将 Dashboard 排名的运营商用作“优先”
应用 Dashboard 的排除和规避运营商配置,并优先选择属于 Dashboard 排名层级的充电站。
createRoute( input: { vehicle: { id: "607823b2c246f9001b97b1a2" } origin: { type: Feature geometry: { type: Point, coordinates: [4.895168, 52.370216] } } destination: { type: Feature geometry: { type: Point, coordinates: [2.352222, 48.856614] } } operators: { ranking: { type: preferred } } })
将 Dashboard 排名的运营商用作“必选”
将路线限制为仅在属于 Dashboard 排名层级中所配置运营商的充电站充电。
createRoute( input: { vehicle: { id: "607823b2c246f9001b97b1a2" } origin: { type: Feature geometry: { type: Point, coordinates: [4.895168, 52.370216] } } destination: { type: Feature geometry: { type: Point, coordinates: [2.352222, 48.856614] } } operators: { ranking: { type: required } } })
定义自定义偏好并覆盖 Dashboard 设置
直接在 API 调用中提供完整的运营商配置。任何指定的字段(ranking、avoid 或 exclude)都会覆盖该请求对应的 Dashboard 配置。
createRoute( input: { vehicle: { id: "607823b2c246f9001b97b1a2" } origin: { type: Feature geometry: { type: Point, coordinates: [4.895168, 52.370216] } } destination: { type: Feature geometry: { type: Point, coordinates: [2.352222, 48.856614] } } operators: { ranking: { type: preferred level: { high: [{ id: "5e8c22366f9c5f23ab0eff01" }] medium: [{ id: "5e8c22366f9c5f23ab0eff02" }] } } avoid: [{ id: "5e8c22366f9c5f23ab0eff03" }] exclude: [{ id: "5e8c22366f9c5f23ab0eff04" }] } })
为特定国家/地区定义自定义偏好
直接在 API 调用中提供完整的运营商配置。任何指定的字段(ranking、avoid 或 exclude)都会覆盖该请求对应的 Dashboard 配置。
createRoute( input: { vehicle: { id: "607823b2c246f9001b97b1a2" } origin: { type: Feature geometry: { type: Point, coordinates: [4.895168, 52.370216] } } destination: { type: Feature geometry: { type: Point, coordinates: [2.352222, 48.856614] } } operators: { ranking: { type: preferred level: { high: [{ id: "5e8c22366f9c5f23ab0eff01", countries: ["NL", "DE"] }] medium: [{ id: "5e8c22366f9c5f23ab0eff01", countries: ["FR"] }] } } avoid: [{ id: "5e8c22366f9c5f23ab0eff03", countries: ["AT"] }] exclude: [{ id: "5e8c22366f9c5f23ab0eff04" }] } })