The author’s theme today is about the application practice of artificial intelligence in “Ele. me”, which mainly consists of three parts: the first is the introduction of “Ele. me”, the second is the application scenarios of “Ele. me”, and the third is the application examples of operation optimization and machine learning, which will talk about some algorithms.

About being hungry

Most people have some takeout, take-out Chinese dinner now, point of delivery is what kind of level, is everybody startled, is China’s largest fields, taobao, jingdong, followed by travel industry, drops, UBER is Shared shortly bicycle, these companies combined is 230 million orders a day or so. As you all know in the takeout industry, the industry has 25 million orders per day so far, so you can imagine the industry is growing rapidly. Why do data and algorithms play such a big role, because we all know that in the case of Internet plus, there is such a large amount of single volume, at least in the data industry we have so many things to do.

What is the scenario of “Ele. me” in the 25 million orders: We open the APP on our mobile phones, and we can find our favorite restaurants. We choose a restaurant and what we like to eat. In front is the e-commerce trading platform trading food, now is not only food, you can buy flowers, buy drugs, there are local help buy help send and so on, so the e-commerce is only the first part, the e-commerce to what scale do you know? “Ele. me” has 260 million registered users on its C-terminal and 1.3 million b-terminal merchants, and tens of millions of orders are placed every year. This is part of our takeout industry, which is an e-commerce trading platform.

The second part is that you can also see this picture of the rider with the box, either on foot or on an electric scooter. In fact this is why the local logistics platform, to emphasize local, because our industry particularity is not the same as other logistics industry, they arrived a few days, our industry of local logistics must be hope for 30 minutes to hand, so we design this architecture when there is a big challenge, this is a bit different, As we’ll see when we get to the algorithm model, we’re doing some local logistics, so we have a very tight time limit.

Up to now, we have 3 million deliverers, and at any time every day, 300,000 to 400,000 riders are active offline and ready to take orders. This is the same operation model as Didi, which has covered more than 2,000 cities across the country.

About AI @ ele. me

The second part is the application of AI in ele. me. Why does the industry need ARTIFICIAL intelligence? As a platform for local life, we all know that there is a great need for food, clothing and shelter. There are a lot of big players in each direction, and if their technical challenges are different, it must come from their business form.

I’ll give you a quick overview of this: First is taobao, I believe most with taobao, taobao is one of the most commonly used in the online shopping platform, is the main users and merchants on the inside, offline all know that the city is on the same day of order is more open platform, everyone under the hands of the order sent to you, this is a tee, can also be a rookie, or motion, this is an open platform, The most important point is timeliness, usually calculated by days, there will be no so-called compensation over time, this is the case of Taobao.

Let’s look at Ctrip, it can book hotels, hotels, online users and merchants, there will be no offline orders.

Didi is particularly close to the takeout industry. In fact, Uber has also done very well in foreign countries. In terms of business form, Didi is very close to takeout. Drops below the line is always online users and drivers, the order form is also in the form of crowdsourcing, either by joining trader, either by the driver online registration to bear capacity, also won’t punish the driver overtime, because nobody will anticipate there will be no accident, no guarantee this limitation, so it is very similar with the hungry?. Finally, ele. me and the food delivery industry.

The first line is given priority to with users and merchants, offline orders section is more, the blue rider has “hungry?” is a part of the employees, is proprietary, and team and the form of franchisees, of course, is a kind of the package, such as a meeting today, there are four hours in the afternoon, I can send a few single, this is a form of the package. Timeliness in minutes to calculate, our goal is in a long time has been done, the national average for half an hour can send orders to hand, and overtime pay, if there is no to 30 minutes after more than 10 minutes, there is a red envelope compensation, overtime pay pressure is bigger, but this is for customers a service of insufficient compensation.

According to the above, we have entered a big framework, namely, there are three big things in the takeout industry. One is machine learning, and operation optimization is actually inseparable from machine learning. In terms of operations optimization, big data plays a key role as the basis of operations optimization. Now, it’s interesting to look at this graph, and I’ll spend two more minutes talking about algorithms in the business. There are about three levels. The takeout industry at the bottom wants to deliver food in 30 minutes, not 20 or 30 kilometers. Unless you can fly, you can’t deliver 10 kilometers in half an hour. Based on this situation, all industries are based on the current open APP positioning, positioning may be 3 km or 5 km radius, LBS guarantees that operators do all kinds of recommendation or search on the basis of machine learning and optimization two layers above. So let’s talk about these three parts.

Number one: Trading

You can take a look at the module in the middle, which is user business stratification, recommendation search and smart subsidies. These are the major directions that any e-commerce must do.

On the basis of a very detailed user portrait system, we hope to strictly manage the life cycle of users and merchants. On this basis, we make corresponding recommendations, searches and subsidies. For example, when a user falls asleep, we will stimulate the customer in certain ways.

Second: Offline

When the transaction takes place, we hope to deliver the food to the user within 30 minutes, which involves machine learning planning. I will talk about intelligent scheduling in detail, and the prediction of meal delivery time and delivery time, as well as dynamic pricing. Smart scheduling is part of scheduling, and we include the preparation time, the travel time, even the guaranteed delivery time, waiting for the elevator to reach you and so on, so 30 minutes is a lot of unpredictable things. So what does pressure balance mean? As we all know, online trading is contradictory to our logistics. For online trading, we certainly hope that the more orders the better. We hope that tens of millions of users can come in a few seconds at a time. However, to deliver all orders within 30 minutes is a problem that is unlikely to be solved all at once. In order to achieve pressure balance, it is necessary to ensure that transactions and logistics, distribution and other balance, not only achieve transaction quality, but also do not lose the enthusiasm of users.

Third: The bottom

After talked about the two is at the bottom of things, now, let’s look at a picture on the left, including site selection recommendation and so on, just when it comes to distribution is local, when a businessman set ready to delivery place will draw a circle, such as I send a circle or a hexagon, this is not easy, first of all, probably this place is a highway or viaduct, Not everyone is the same, some users may always order cheap, we take all factors into consideration when planning the grid and site, which involves a lot of operational optimization issues, the last example will cover the location and grid planning issues. A brief overview of our three sections covers all of our efforts in artificial intelligence, which is very important to our business.

About operational research optimization and application examples

This part will be divided into two categories, respectively, the application case of machine learning and the case of machine learning entertainment optimization.

Case 1: Meal time estimation

For example, if we place an order in the didi scenario, for example, IF I want to go to Pudong Airport, it will tell you that the bus is two kilometers away from here, and it will arrive in 3 minutes. 3 minutes is the estimated waiting time. “Ele. me” is equivalent to placing an order, and it will take about 20 minutes to finish it. I hope that the early arrival is not as good as the early arrival, as my platform rider just arrives in 20 minutes.

The meal time accuracy is the key, when the order is completed, how do you know the order how long will it take to complete, this restaurant is influenced by many factors, the restaurant’s equipment eat time and dining room to eat the number of users, products types, cooking methods, influence factors, such as order size, and after the meal prepared without notice, such as restaurant customers much more special, Usually, it may take 5 minutes to make it, but there may be too many people to make it. There are also problems with product categories, and even the weather of the day, including the attendance rate of the restaurant, and the sudden absence of several restaurant chefs on leave. All these are one of the reasons for inaccurate estimation. Wonder why don’t we let dining-room is ready to tell us, we will go to, the theory is feasible, you imagine the scene in the restaurant, the kitchen is what kind of situation, you can imagine, a chef hands are full of oil out point once this order is good, the next order, this is hard to imagine things, we have no this aspect of the data. This is a premise, our solution is undoubtedly machine learning, the simplest version is the linear model, the effect was not very good at the beginning, gradually evolved to GBDT, we are familiar with the scene to achieve the average is not special average, and the meal time is 10 minutes. We can fix it from 7 to 13 minutes, which is pretty accurate.

I emphasize the average, because there are many special scenarios, and if something happens to the chef, we don’t know, because machine learning can only predict the future based on what happened in the past. In the event of an emergency, we had some product plans. For example, when we saw that the restaurant did not show a linear increase in the number of meals and orders, and there was a blockage in front of the restaurant, we made real-time adjustments to the platform according to the data.

And finally, the method that we’re using right now is deep learning, and we’re using LSTM, and the picture on the right you can look at this article. We through the time correlation to do a more accurate forecasts, there is no doubt that the meal time will be related to the past orders, there’s no need to explain, but why is related to the future, we forecast the future 3 to 5 minutes have new orders, but have in common with the existing order, is likely to be the same dishes, is likely to be a common place, The same dish is an order to the kitchen, so the dishes can be made together. We have learned that the model can also capture these characteristics, which is helpful for order distribution and order packaging.

Case 2: Travel time estimation

Travel time prediction is such, when after the order finished, riders take orders to the hand, he would be running to the office or home, this is the estimate of travel time, drops from point A to point B, transportation must be A car, and there are A lot of map data, like gold or Google maps or baidu map, the data in real time to the server.

In the traffic prediction is more accurate, the relative “hungry” scene is not so much information, first of all, the rider is possible to walk, may go the elevator, or walk up and down the stairs, or ride electric cars, or in a vehicle, this caused us directly in the data collection is highly accurate, it is also mentioned in traffic in the building complex, This data is hard to come by. When we go to work, the restaurant and customers are all in the building. There is no GPS signal in the building or it is not very good. The data or positioning error we receive is as high as several hundred meters.

So time forecast in advance, we need to turn the track up, because time forecast in gold or tencent, baidu map is based on the historical data, the first step we do is historical data cleaning, indoor location are not allowed to be completely missing, even in this case, we want to all kinds of way, we use WIFI, GPS signal, Or we can locate each other to minimize the problem of missing location. Secondly, even if the location has GPS track, its location also has a lot of noise, so it needs to remove noise, so it needs to remove noise. Through the localization algorithm, we combine the relevant time, O point and D point, and finally carry out the trajectory clustering.

Case 3: Smart sorting

The ordering difficulty of Didi is different from ours. In the didi scenario, one driver is required to receive two or three orders at most. In ele. me, a rider can carry 5 to 10 orders per bag at the same time, and there is a time limit between orders, which involves a lot of timeliness requirements.

I’m going to talk about two solutions, and the first solution is the path planning problem, very traditional VRP.

When you give an order, in the case of fixed rider capacity and cost, we need to find a matching line. The commitment time of each order is different, but it cannot exceed the time limit. By default, a rider can deliver five to 10 orders at a time, each with a strict time-limit, and orders explode during the midday rush.

Scheme 1 is vehicle routing planning

  • Input: Order, rider, capacity, cost.
  • Output: matching between orders and riders and walking routes;
  • Optimization objective: minimize time or distance traveled;
  • Constraints: number of riders, number of riders, latest arrival time, etc.

We use Simulated Annealing. Simulated Annealing (SA) is a random optimization algorithm based on a Monte-Carlo iterative solution strategy. By giving the search process a time-varying probability jump that eventually approaches zero, Thus, the optimization algorithm of serial structure can avoid falling into local minimum and finally approach global optimal. In theory this algorithm has the global optimization performance of probability, and has been widely applied in engineering, such as VLSI, production scheduling, control engineering, machine learning, neural network, signal processing, and other fields is to use it to do the order distribution, but in the end result is not very good, because time not preliminary estimates, at the time of path planning, If A or B is taken first, the path planning will be very poor once the time error occurs.

Finally, we use the second algorithm, which is also based on a large number of functions.

The lower left corner is a matrix, each row is an order, each column is a rider, we hope to calculate through some rules and some machine learning algorithm, the right side is an order matching result.

The optimal matching is the KM algorithm. The earliest evolution of scheduling algorithm is VRP.

Then came the KM algorithm, but after the basic framework was defined, there was still a lot of work to be done. In fact, the order is similar, because the order can be packed, and one person can wait for a few minutes. Maybe this order is very similar to that order, that is, when we go to the same place, we can give the order to the same person. So order packaging and water absorption is one of the first things we do, but what orders by rules in peak and off-peak time is not the same, there are two directions of road and two direction Angle is different, so the order matching model is above 2.2 make, with machine learning trained by historical data, Here we also encounter some challenges, because marki habit is different in different site, we promote will encounter A problem, in A site do you think is OK, but not in site B, m standing on the surface of the thousand things we now do, according to the history of the past to share some similar site conditions, we put these models used for training, Do similar sites it has similar points of the way. So there’s no way to say you don’t particularly like the split, there’s a little bit of similarity, so it’s 2.3. The version we’re doing right now is enhanced learning, where we dynamically adjust to what’s happening in real time.

I won’t go into details about the location of the restaurant. In fact, we have started to cooperate with businesses to open some restaurants. We all want to choose the best place and the restaurant covers the largest number of users.

The End

My theme today is application practice. In my personal experience, I have been doing machine learning for more than ten years, and the work challenge comes from the integrity and accuracy of basic data. Just now, we talked about the inaccurate data and the irregular situation of the restaurant, so we could not know some accurate information. We spent a lot of time to adjust the basic data. The second point I talked about ascension and the understanding of human behavior of the algorithm is more important, because in the food industry are needed to carry out, before artificial distribution through the phone, there are a lot of communication in the inside, suddenly spread machine now, they are difficult to understand, and consider the global optimal machine instead of local optimum, is can’t do that. Only when algorithms are improved and product operations are integrated, can this matter finally be pushed down and let people form a habit. The third point is that optimization algorithm and machine learning complement each other in our industry. It is not only machine learning, but also how we can best distribute manpower in such a short time and complete orders in the least time. Thank you!

If you have any ideas, you can leave a message at the bottom. Thank you very much!

The authors introduce

Zhang Hao, vice president of technology at Ele. me, is responsible for artificial intelligence and big data construction. Lead the team to apply machine learning to logistics scheduling, pressure balance, food recommendation and other scenarios, establish a complete data operation system through data mining, and drive business development with data and intelligence. With more than ten years of experience in machine learning, data mining and distribution, he has served as senior director of Didi Research Institute, Big Data Department of Uber in the US, search and Analysis Department of LinkedIn, and Voice team of Microsoft Bing in machine learning and big data.