Chargetrip technology for dummies

Valentina Neri Serneri Dec 11, 2020 · 4 min read

Software isn’t always an easy grasp for people with a commercial background. With tangled terms like GraphQL, nodes and edges, and protocols, it can all begin to sound a little abstract. In this article, we explain Chargetrip technology for a non-technical audience, helping you to hack through a developer’s vocabulary.

How does Chargetrip route EV drivers?

Let’s get straight to it. Over the years, we’ve developed precise consumption models of 271 EVs. These models consider many different variables like temperature, elevation, and speed to predict the real-time range of an electric vehicle under any condition.

After we calculate the predicted consumption of the vehicle we precompute a big graph of all possible route outcomes. In this graph, charge stations are represented as nodes, and roads are represented as the edges between nodes. We then weigh all the possible routes based on different impact variables like the availability of stations, the charging costs, the weather, and many more. The resulting score carves out the optimal route for the driver, with the most appropriate charge stations along the way. This is the core of our routing engine.

Our car models and our routing engine are exposed via the Chargetrip GraphQL API. But what does that mean? Let’s dive into what an API is. Specifically, a GraphQL API.

What is an API?

API stands for “Application Programming Interface”. It has multiple uses. In our case, the Chargetrip API gives third parties access to our data and allows us to exchange information.

One popular analogy of an API uses a restaurant. Its location is the end-point: where you go to place your order. Once at the right address, you enter the restaurant and give your name at the reception. Your name is the API Key, a unique identifier that authorizes you to sit at the restaurant and order food. The waiter is the API that connects you, the guest, or a Chargetrip customer, to the kitchen. Here’s a handy visualization of all the ‘ingredients’ used in the Chargetrip kitchen. When you make an order, the waiter sends it to the kitchen and returns with your food: in our case, the route you requested.

GraphQL API

GraphQL is a query language. For non-technical people, it’s enough to know that GraphQL APIs beat other architectural systems when it comes to performance. It allows developers to only fetch the relevant data they are querying for, instead of fetching for the whole database and then picking up only certain data.

In a restaurant, you only order the dish you want and if you don’t like mushrooms you can ask to take those out. You wouldn’t ask the kitchen to prepare their entire menu for you to choose later. That would slow the kitchen down. The same principle applies to an application.

Vector Tile Service

Important to the functioning of our maps is a Vector Tile Service. As you may know, maps occupy space and data. A lot of it. This slows down applications, making you wait several seconds before rendering the points. To beat this issue, maps are divided into image tiles, each one containing only a fractional set of data: such as local street names, amenities and charge points. Vector tiles allow for fast rendering of maps, improving the user experience. You may notice them when zooming a map in and out.

Charge station database — OCPI and OCPP

Chargetrip’s API comes installed with a complete European charge station database. If you integrate our API for routing, you can use our charge station database. But we can also ingest your company’s own database if it’s OCPI compliant. But what does OCPI mean?

OCPI means Open Charge Point Interface. It’s an independent open protocol (like a set of rules) to exchange charge station data like location, plug type, operator, and so on.

The EVRoaming Foundation manages the OCPI protocol with the goal of standardizing the communications between different Charge Point Operators (CPOs) and Electric Mobility Service Providers (EMSPs). Today, over 200 companies across the globe support OCPI. You can find the technical OCPI documentation here.

When reading about OCPI, you may also find OCPP. This doesn’t concern Chargetrip or our routing engine, but we’ll explain it for the sake of completeness. OCPP stands for Open Charge Point Protocol. It’s another set of rules that facilitates communication between the charge point and the backend management system (CSMS). OCPP is used to improve interoperability, allowing any CSMS to connect with any charge station.

Missed anything?

Hopefully, this article has armed you with enough knowledge to explore Chargetrip’s Developer Resources. But if we’ve missed anything, let us know in the comments!