Skip to content

Instantly share code, notes, and snippets.

@jejuro
Last active March 6, 2018 17:40
Show Gist options
  • Save jejuro/cce8239445d040485aefedb2c0190f17 to your computer and use it in GitHub Desktop.
Save jejuro/cce8239445d040485aefedb2c0190f17 to your computer and use it in GitHub Desktop.

Part III - Global Autonomous Traffic Infrastructure

This page is made as a video lecture National Transportation Logistics Autonomous Navigation System based on blockchain.

Table of Contents

  1. First Autonomous Drive Mechanism

  2. Second Autonomous Navigation Mechanism

  3. Implementation

  4. Transportation planning

  5. Simulation

  6. Autonomous Car Certification

  7. Traffic Planning

Let's assume walking with our eyes closed and relying on the guidance of a friend. If you absolutely trust your friends, can you close your eyes and easily walk forward? Maybe. However, there is no mechanism to provide absolute trust in human relationships. You can not help but feel uneasy.

Autonomous cars also depend on eyes. Most of the computing resources consumed in autonomous driving to process visual information. See Stanford University Convolutional Neural Network - CS231n Lecture. If a blockchain mechanism provides absolute confidence, would autonomous cars drive without interpreting scenes around?

The Openhash platform provides a car with absolute confidence that allows it to travel at high speeds without looking ahead. Previous blockchain technologies can't.

One of the greatest features of the Openhash technology is that it extends to ​​designing future than recording past only. The autonomous transport/logistics network based on the Openhash platform is for a global or a national traffic/logistics network consisting of autonomous cars and intelligent roads.

1. The first and primitive autonomous driving mechanism

Prepare a number of cars attached with devices to measure the steering angle of handles. Then, let a few experienced drivers drive the cars along all the roads in Korea.

  • A web object (hereinafter, "a road object") and a unique ID are assigned to each road, and car detection sensors are mounted at every 100m along the road.
  • The cars transmit GPS + Timestamp + Handle Angle Data to the road object every second.
  • The road object hashes the data, signs them with a private key, and publishes them.

The data of the steering angles of a car at each point along the road constitutes a series of hashes that can not be forged.

Shown in the drawing below, the data published by the road object at each point from the start point to the end point of a car are interlocked with each other by their hashes. No data can be forged or altered without affecting afterward data.

  • A series of hashes connected from the starting point to the end point of a road consists of a block.

The blocks of all road objects are fused with each other at each intersection. For example, the steering angle data at the point(D5E5) includes both E4 hash and D4 hash. So, any of E1/~E4 and D1/~D4 will break hashes for E7, E8, D6, D7 and so on. I call it hash-weaving. If hashes of all the roads of Korea are weaved this way, the steering angles of cars passing through any point of the nationwide road network can NOT be counterfeited.

Now, let's assume that a person A drive a car along a road, and records the steering angle of each point along the road. If car A runs again the same road afterwards, it can run without its human driver solely depending on the steering data its driver has recorded before.

Let’s suppose that a number of cars are scattered on many roads nationwide. All roads are assumed to be one way roads. Each car records the steering angle data of each point along its running road. Then we can make a map of steering angles for all the roads in Korea.

But, there may be collision among cars front and back. So, we need a solution or a countermeasure for it.

That's what timestamps do. Each time a new car enters and leaves a road, the road creates a new Hash block of timestamps and weaves it to the previous steering Hash block. Recall that a series of hashes from a car running a road is a block.

Referring to the figure below, when a new car B enters and runs on the road, a new block of E1, E2 so on is generated, and weaved with the previous block(D1 to D9) created by the car A.

When we assemble the three sentences below, we can draw a 3D picture.

  • Steering angle data are recorded by the first car driven by a human.
  • Every point of every road has a steering angle data which are kept by the road object itself.
  • Only timestamps are added by the second car and so on running on a road which has already recorded steering angles of each point.

In the picture below, the bottom line represents steering data recorded by the first car passed through the road, and the curved line is timestamps layered one another.

So, if the car C follows the car B, the car C can calculate the safe distance by referring to the timestamp of the specific point recorded by the car B, the latest car which has passed by the point.

In summary,

  • A timestamp is based on atomic clocks.
  • Steering angle information recorded by the first car can not be altered.
  • Timestamps also can't altered as it is weaved to previous timestamps and steering data.

Assuming that the nationwide road is one way, and there is no sudden situation, all of the car in Korea can drive autonomously without human drivers only by steering and communication device. However, the above autonomous mobile network can not operate due to steering errors, a breakdown or an unexpected situation such as a wild animal entering the road.

  • Accuracy of steering system
  • Accuracy of GPS coordinates
  • car failure
  • Sudden obstacles on the road, such as wildlife
  • Fault tolerant network
  • Two-way driving
  • Handling error due to tire pressure

A problem is that when a car get out of path, the exact Steering Synchronization is meaningless.

1.1 Detecting Forgery in the Latest Block

You may think a forgery or falsification in the last block of a road object is possible because it is not weaved with afterward blocks not generated yet. In previous blockchains, it takes a considerable time before a transaction is credited. However, in traffic, immediate trust is necessary.

But, those kinds of forgery are easily detected. Let's see the picture below.

Suppose that three cars are running on the 1001 road in the order of A, B, and C. The car that leaves the steering angle record is A. The new starter D will travel with reference to the steering angle left by A and the timestamp left by C.

If one of the latest timestamp A1, A2, B1, B2, B3, or C1 is forged, then the hashes of afterward data will break. If all the latest hashes are forged, there is no way to find it out when we depends on the data from cars only. So, we need witnesses too.

Witnesses are sensors functioning Web Access Points, normally bluetooth APs, installed along a road in a predefined interbal, for example 100m or 200m so on. Each of them has URI, normally IPv6 address, and is a market participant called player. Remember cars are players too. So, sensing a car is a transaction between a sensor and a car. A road or a section of a road is the lowest Supul, and several roads or sections become a hier tier Supul.

Then, all the same mechanism applies to the traffic network as the case of standard cryptocurrency. No individual or a group of sensors or cars can damage the network with flaudulent data. Remember Who dares Byzantine rebels?

It's a wonderful feature of the Openhash Platform. You can apply the same architecure to quite different social or industrial sectors without modification.

1.2 Exiting from the path

A high-precision GPS system with an error range of about 1 cm is assumed.

If you have already left the route, you will have to go the wrong way even if you are driving at the steering angle of the previous car. There are various error compensation/correction mechanisms. Distance sensors using ultrasound or infrared rays are inexpensive solutions. So, you can use one of these mathematical algorithms. However, in my opinion, a machine learning algorithm is most appropriate to this kind of problems.

  • Prepare a 10 km test driveway with guard lane, ramp section and turn section as appropriate.
  • Install sensor and Bluetooth AP at intervals of 10m and transmit GPS coordinate and steering angle to each car passing through the point.
  • Continue training until you finish without hitting the guard lane.
  • Increase the driving speed gradually.

1.3 Handling angle difference between cars

One car to another, the relationship between the degree of handling and the steering angle may be different depending on the model and the state of the same car. The handling characteristic inherent to individual transportation means can be grasped by the above-described machine learning.

1.4 Emergency situation

An unexpected situation such as a breakdown of a transportation means, an unauthorized crossing, or an obstacle on the road can be avoided as an emergency evacuation to a safe place that does not interfere with the passage of other means of transportation

1.5 Mesh Network

The blockchain-based autonomous routing mechanism assumes a fault-free communication network and can be implemented as a mesh network.

Until now, we implemented an autonomous driving algorithm using a specific steering angle mapped onto each point along each road in Korea. It works, but, there is a better one.

2. The second autonomous driving mechanism

A high-precision digital compass can measures angle between two points on a road, and then determine the steering angle of the car in progress. In the figure below, the blue line is the car's running direction.

The six directons are represented by X, Y and Z axes. Two points in the three-dimensional space are represented by GPS coordinates with an error of about 1 cm. Coordinates include latitude, longitude, and altitude.

You can determine the steering angle with xy(θ) and yz value and the push of the excellator with the value of xz(φ), positive (+) on the uphill and minus (-) on the downhill.

The steering characteristic inherent to each car can be trained by the above machine learning.

  1. Implementation

The implementation process of the National Autonomous Traffic Network that actually operates is described in detail. It is assumed that it is composed of each of the 193 UN countries.

The technologies, paradigms and tools to be used in implementation include:

  • Lua and Prosody
  • Cycle.js JavaScript Framework
  • VS Code
  • TensorFlow
  • Google Cloud Functions
  • Google Cloud Platform
  • Redis

3.1 Server Hierarchy

Refer to the server hierarchy described in the Openhash Platform.

3.2 Internet AP

For any purpose in OP, it is essential to install Internet APs at regular intervals on the road.

Every time an Internet AP (Access Point) detects a car, it can transmit a unique ID of the car to the server. Alternatively, the car can add a signature to the data including the unique ID of the AP and transmit it to the server. In any case, the server can monitor the traffic conditions of a specific road through the data reception time, the ID of the AP, and the car ID.

There is no need for the car or the AP to generate data with a hash every time. The following scenarios are possible.

  • The car detects the AP.
  • Carries the unique ID of the car and the current GPS coordinates, Timestamp. This data is not signed by the car.
  • The AP combines its own ID with the data received from the car and sends it to the server.
  • The car carries data with its own signature at a certain period (eg, 60 seconds).

3.3 Telecommunication

All servers are XMPP servers, and all communication is by XMPP. Real-time communication is essential for transportation logistics. For that, the amount of data transmission should be reduced as much as possible. The arrow is the direction of communication.

3.3.1 Client => Server

  • A car entering a road sends data containing its own IPv6 address, current time, and current GPS coordinates to the server. The address, time, and GPS coordinates in this case are complete (year, month, day, hour, minute, second, millisecond).
  • The car may omit repeated information from the second batch of data to be transmitted.
    • In case of time, it may omit year, month, day, hour, minute, and second information and include only millisecond information. Therefore, the data capacity can be reduced to about 1/6. Includes new seconds information only when the seconds unit is changed. Min (min) and hour (hr).
    • For GPS coordinates, it may omit time second and include only millisecond (1/1000) information. Of course, including the new time-of-second information at the point where the time-second unit changes is the same as before.

3.3.1 Server => Client (car)

The first time the client connects to the server, the server delivers one of the following two pieces of information to each car:

  • GPS coordinate (latitude, longitude, altitude) of each point by the second mechanism

Remember the communication rules of the [Openhash Platform]. The car delivers the unique JabberID and IPv6 address of each car to the server. The client can obtain 2-bytes (16-bits = 65,536 car-specific IDs) ID or 1-byte (8-bits = 256 unique to the car) from the interface ID of the IP address consisting of 128- It is possible to assign one ID.) It extracts the ID and generates the unique ID of the car. It maps the JabberID to the unique ID. Therefore, in subsequent client-server communication, the JabberID and IPv6 address data size of the client included in the data coming and going between the stub and the car can be reduced to about 1/9.

3.4 FIFO: First In First Out

In terms of accident prevention, a single car only needs to consider the distance between itself and its front car. Therefore, the server sends the current position of car B to car A and informs B of the current position of C. If each car maintains a constant or safe distance from the car ahead, there is no collision.

3.5 Real-time communication

Communication between cars and servers should be done in real time. It means that the time difference between the time when the client sends a message and the time when the server receives the message or vice versa is less than 1/1000 second (= 1 msec).

Therefore, the server should be able to flexibly respond to load changes, and slower clients should be able to operate the exit process in accordance with predefined rules on the road.

One way of real-time communication is to keep the port between server and client open for a certain period of time. For example, a car and a server that are scheduled to arrive in Pusan from Seoul can have a particular port open while driving, so that the two machines can each be regarded as a file that resides in their memory.

4. Transportation Plan

The departure time, route, speed and arrival time of the autonomous driving means are determined by the ** traffic control module assigned to the stump, the bush and the oneway.

The process of creating the traffic control module uses machine learning or artificial intelligence. In particular, see [Pacman Algorithm] for reorganizing Berkeley University CS188 courses into Korean courses.

The principle of creating a transportation plan for autonomous cars is based on the ** path search algorithm ** and ** machine learning **. For technical details, refer to [Korean Patent Application Publication - Autonomous cars and Systems] ().

  • Enter a map showing roads, traffic lights, crossings, etc. on the server.
  • Enter one car object that runs along the road on the map.
  • Enter the starting point and the destination point.
  • derive the optimal path to reach the destination in the shortest time.
  • Increase the number of cars and continue training.

5. Simulation

First, the simulation is performed on the map of Jeju Island, and then the car is tested.

After designating the starting and ending points as shown in the figure, one virtual car is trained to arrive at the destination without reaching the road edge line (dark color obstacle).

Next, one virtual car learns the driving method using the road map of Jeju Island.

  • Divide the whole Jeju Island into units of Euphyeon-dong (stump) and city / municipal district (lower bush), bundle the whole into one upper shrubbery, and assign hierarchical control module. The role of each control module is as described above.

  • While one virtual car A runs on the road, it generates TxData including the steering angle, Timestamp, brake, and accelerator information, and records it in each road object.

  • The new virtual car B trains the method of driving by referring to only the steering angle left by the preceding car A .

  • Trains how to travel at the same time by referring to a plurality of virtual cars (C, D, E, ...) referring to the steering angles and Timestamp left by each car before each.

  • The distance between autonomous cars running can be reduced to 1 ~ 10cm.

  • The narrower the distance between cars, the less likely it is that an unexpected situation (such as an unauthorized traverse) occurs.

  • Communication between cars is real time.

Therefore, as shown in the simulation in the next section, the road utilization rate can be significantly increased.

6. Autonomous Car Certification

The following information requires AI's knowledge of Reinforcement Learning. See [Berkeley University CS188 Korean Language Instruction] (https://goo.gl/WbdaAP) in the AI ​​course. Like a person's driver license qualification test, a car also needs to undergo an autonomous driving qualification test. Unlike people, the car learns autonomous driving at the test site.

The figure below shows the ranking of traffic volume in Korea (Source: Ministry of Land Transportation).

These roads are 8 to 12 lanes each way. Along with some assumptions, you can easily calculate whether the current traffic volume can be completely extinguished with one-way autonomous roads (= two-way lanes).

  • Each road is an average of 10 lanes.

  • The speed of cars driving in each lane is constant.

  • The average distance between cars is 100m.

  • The average length of one car is 9m.

  • Two lanes (= two lanes) of each road are autonomous roads.

  • The average running distance of autonomous cars is 1m.

  • Therefore, the road utilization rate of the autonomous car is 10 times or 1,000% that of the conventional one.

In the case of Gangnam-gu, there are 170,000 cars a day for 12 round trip lanes. If the autonomous road is a two-lane two-lane road, traffic volume can be reduced to 60% of the total volume of the road.

However, reality differs from theory. If a self-driving road is installed only in some roads such as Gangnam-daero road, a bottleneck can not be avoided at the connection point with the general road. Therefore, transportation logistics planning is needed.

7. Transportation Planning

Apart from the mechanism by which autonomous cars can autonomously drive independently, the server needs to establish a transportation plan for each of the autonomous cars. The goal is to maximize the total value of social value production by transportation logistics.

Stubs, bushes, etc. establish a transportation logistics plan within the jurisdiction. This process is based on a typical ML algorithm, in particular, [rule-based AI].

  • Configure Deep Neural Net.
  • Prepare a digital map.
  • Arrange 100 cars randomly on the digital map and designate each destination.
  • specify rules related to traffic lights, crossings, intersections, etc.
  • Repeat the RL until the goal is achieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment