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