Home  >  Article  >  Backend Development  >  javascript - Hello everyone, I want to make a software similar to Didi Taxi. What kind of technologies are needed?

javascript - Hello everyone, I want to make a software similar to Didi Taxi. What kind of technologies are needed?

WBOY
WBOYOriginal
2016-08-18 09:16:182056browse

We want to do a project like this, similar to Didi Taxi and Meituan Crowdsourcing

javascript - Hello everyone, I want to make a software similar to Didi Taxi. What kind of technologies are needed?

In fact, it is intra-city delivery: when there is a new takeout order, it is pushed to the delivery staff near the order in real time, and the delivery staff delivers the order after receiving the order.

It seems very simple, but for me, a web developer, I don’t know where to start. The first thing I thought of:

The APP of the delivery staff’s mobile phone is directly connected to the server WebSocket, and the geographical location, longitude and latitude are uploaded to the server in real time. The server uses an in-memory database to save the location (redis/mongodb), and then continuously detects new orders in a regular cycle , constantly calculate whether there are delivery personnel near the new order, and if so, push it to the corresponding delivery personnel.

The idea is very simple, but there are a few problems:

  1. How does the delivery staff obtain the location and transmit it to the server in real time? Every few seconds. That is not like ajax. I want to use WebSocket to make it more stable. Delivery staff are always running around on bicycles.

  2. Does the server use in-memory data to store the location information of delivery personnel? But does redis support geographical location index? How do I check when I check next time? How do I check the delivery personnel near the order?

  3. Will this generate a large amount of data? Can memory database be implemented?

I don’t know what knowledge is needed here. I guess there should be these technologies:
1: nosql, in-memory database
2: Real-time communication, multi-process, multi-thread, concurrency
3: Queue, Timing program, CLI, background resident service
4: spatial index, spatial calculation, geographical location index calculation
5: Socket programming, Socket communication, Socket push, H5 Socket
6: APP development , but can I use Socket of web H5? The delivery staff does not necessarily need to use APP, as long as the WebSocket is stable (I ask again weakly, can ajaxwork)

I hope experienced masters can give me some advice and don’t tell me to give up. I may not understand the knowledge involved, but you might as well tell me and I will study them one by one. At least I will know what knowledge is needed.

Supplementary pictures (Hummingbird crowdsourcing/Dada delivery):
javascript - Hello everyone, I want to make a software similar to Didi Taxi. What kind of technologies are needed?javascript - Hello everyone, I want to make a software similar to Didi Taxi. What kind of technologies are needed?

Thank you everyone^_^

Reply content:

We want to do a project like this, similar to Didi Taxi and Meituan Crowdsourcing

javascript - Hello everyone, I want to make a software similar to Didi Taxi. What kind of technologies are needed?

In fact, it is intra-city delivery: when there is a new takeout order, it is pushed to the delivery staff near the order in real time, and the delivery staff delivers the order after receiving the order.

It seems very simple, but for me, a web developer, I don’t know where to start. The first thing I thought of:

The APP of the delivery staff’s mobile phone is directly connected to the server WebSocket, and the geographical location, longitude and latitude are uploaded to the server in real time. The server uses an in-memory database to save the location (redis/mongodb), and then continuously detects new orders in a regular cycle , constantly calculate whether there are delivery personnel near the new order, and if so, push it to the corresponding delivery personnel.

The idea is very simple, but there are a few problems:

  1. How does the delivery staff obtain the location and transmit it to the server in real time? Every few seconds. That is not like ajax. I want to use WebSocket to make it more stable. Delivery staff are always running around on bicycles.

  2. Does the server use in-memory data to store the location information of delivery personnel? But does redis support geographical location index? How do I check when I check next time? How do I check the delivery personnel near the order?

  3. Will this generate a large amount of data? Can memory database be implemented

I don’t know what knowledge is needed here. I guess there should be these technologies:
1: nosql, in-memory database
2: Real-time communication, multi-process, multi-thread, concurrency
3: Queue, Timing program, CLI, background resident service
4: spatial index, spatial calculation, geographical location index calculation
5: Socket programming, Socket communication, Socket push, H5 Socket
6: APP development , but can I use Socket of web H5? The delivery staff does not necessarily need to use APP, as long as the WebSocket is stable (I ask again weakly, can ajaxwork)

I hope experienced masters can give me some advice and don’t tell me to give up. I may not understand the knowledge involved, but you might as well tell me and I will study them one by one. At least I will know what knowledge is needed.

Supplementary pictures (Hummingbird crowdsourcing/Dada delivery):
javascript - Hello everyone, I want to make a software similar to Didi Taxi. What kind of technologies are needed?javascript - Hello everyone, I want to make a software similar to Didi Taxi. What kind of technologies are needed?

Thank you everyone^_^

First of all, thank you for inviting me to answer.
This kind of project involves server and client
Client
If the client uses H5, it is recommended to use socket.io instead of the built-in websocket. The former has many solutions and can be disconnected and reconnected. There is not much logic on the front end. It is nothing more than obtaining coordinates regularly and then going to the server while people move on the map.
Server

  1. web server

  2. socket.io server
    The language of the web server is not limited. Please note that the WEB server does not use complex calculations. The web server is only responsible for displaying database data

There are many background programs, such as message queues and location calculations, which require large amounts of calculation and need to be placed in the background.

In fact, there is nothing complicated to implement.
First establish a long connection (any network technology, any network framework will do, as long as a long connection can be established). When an order comes, the server will push a message to inform the client to send the geographical location. (obtained based on the map API), and then the server compares the geographical location of the customer who placed the order (you can compare it yourself, if the map provides an API, you can use the API comparison), select the nearest group of people, and then dispatch the order ( common programming logic).

Then the order tracking function does not need to be implemented in the first phase (that is, the trajectory data of the personnel does not need to be saved), and it will be implemented later. To implement order tracking, location information needs to be sent every few seconds (this can be cached or persisted, It depends on whether it is needed for future analysis. You can use redis or mongodb for caching, whatever you want), and then the server updates the location information.

The technology used can actually be chosen. Now location information and location comparison are basically obtained by calling the map’s API. If you want to know the principle, you can do your own research after completing the project.

The logic is simple, and the technology used in the first phase is not too complicated. Big data and other things are used in equal amounts for filtering. If you think too complicated, it will become over-design, which is a taboo.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn