Recently, as traffic accidents caused by the use of smartphones while walking have increased, the new word "Smombie, " a combination of smartphones and zombies, has emerged. The number of traffic accident casualties in smartphone use has already exceeded 1, 300 as of 2018, and it is increasing by more than 10% every year. 95.7% of the respondents said they had used a smartphone while walking, and more than one in five said they had almost experienced an accident while walking. In response, each local government is proposing solutions such as installing smartphone usage prevention signs while walking and floor traffic lights. However, considering that using a smartphone while walking decreases the sense of distance by 40% and the field of view by 56%, it is not a fundamental solution. As can be seen from the survey that 25.3% of Seoul citizens need to develop smartphone warning technology for pedestrian safety, direct preventive measures are needed.
Why do we need to solve it?The number of traffic accident deaths per 100, 000 people in Korea is 6.5, ranking 27th among 36 OECD member countries, and the percentage of pedestrians among deaths (38.9%) is twice as high as the average of OECD member countries. Given the statistics that 60% of traffic accidents while walking occurred while using smartphones, the development of smartphone warning technology is urgently needed. Now that the entry into the super-aging era is accelerating due to the declining birth rate, efforts are needed to reduce the risk of accidents exposed to the younger generation in their 10s to 30s, who use smartphones the most
ScenarioThe user is walking on the sidewalk, and the GPS on your smartphone checks your location in real time. It detects when the user starts using the smartphone and then provides a notification when approaching a crosswalk, entering a crosswalk, or jaywalking when crossing the road at a red light.
Additionally, it collects crosswalk walking times, and analyzes the collected data to provide optimal signals based on location and time. It also provides the function of extending the walking signal by identifying the vulnerable to traffic such as the elderly, the disabled, and children approaching the crosswalk.
The smart pedestrian traffic light system consists of Mobius 3.0 (oneM2M platform), smart pedestrian traffic light, user (app), and control center (web).
The pedestrian traffic lights consisting of Raspberry4, module, etc. operate by subscribing to AE for each traffic light ID and processing the information coming through the issuance to display the correct signal. If the latency of each signal changes, the signal with the changed latency is displayed.
The user obtains and stores pedestrian traffic light information about a certain range of traffic lights around them through geoQuery, and when approaching each traffic light, receives a callback signal through geoFencing, subscribes to the traffic light, and displays the status of the current traffic light on the user' app. A notification is sent when a user enters a crosswalk at a walking signal. If the user fails to completely cross the crosswalk at the point where the walking signal time is running out, the app sends a signal time and notification to encourage quick crossing. If a pedestrian attempts to cross at a red light, the app judges it as jaywalking and warns the user that it is dangerous until the crossing ends.
Users can be classified into separate types (elderly, disabled, children, etc.) that correspond to transportation vulnerabilities other than the general public. When registering as a member, the user types are classified through authentication, and if the type of user corresponding to the transportation vulnerable enters the crosswalk, the walking signal time of the traffic light is extended.
The app collects users' behavior, such as the time they walk on the crosswalk, whether they use a smartphone, and whether they jaywalk, sends it to the oneM2M platform, accumulates the data, and uses it for statistics and analysis for optimal signal time.
The Web allows you to check the status of pedestrian traffic lights in a specific area and change the waiting time for them. And you can check the number of people crossing the crosswalk and the number of jaywalking at each traffic light through the statistical screen.
oneM2M platform functions to control and provide information from multiple platforms in the middle based on MQTT communication. The reason for using oneM2M is explained in the following sections.
Sequence diagram- App notification
- Detection of vulnerable traffic
- Web Statistics
In order to develop this service, we needed to use the oneM2M standard technology as below.
- Group management : By creating group resources, many query requests for multiple resources are replaced by a single query request for that group resource, and multiple resource information can be viewed in a single transaction to identify data.
- Subscription/Notification : We took advantage of the ability to be automatically notified of changed information when the status changes, by subscribing to a specific resource you are interested in. A user may receive notification of signal information of a corresponding traffic light through subscription to an upcoming traffic light.
- Location information(geo-query) : Using the geo-query API of the oneM2M standard, we can search or query the resources of the measuring device on a latitude and longitude coordinate basis. A user can search for information on traffic lights in a specific location or area by checking the location of a traffic light displayed on a map.
There is each traffic light (AE) under Mobius. Each traffic light (AE) has the following its container.
- state container for viewing status information
- info container for viewing user statistics so far
- ci container for viewing the cross-information of individual users
Also, Where the status and information of the crosswalk are changed, To deliver information to apps and servers in real time, the notification is positioned under the status information(state) for each traffic light(AE). In addition, the same level as AE has the following groups.
- Group to view current status information (state) of each traffic light (AE)
- Group to view user statistics (info) so far for each traffic light (AE)
The development program is Visual Studio Code, developed in Flutter and Dart languages.
Future<respGroupState?> requestTlGroupState() async {
Uri uri = Uri.parse('http://127.0.0.1:7579/Mobius/grp_tl_state/fopt');
finalresponse = await http.get(uri,headers: {
"accept": "application/json",
"X-M2M-RI": "12345",
"X-M2M-Origin": "SummitG"
});
if (response.statusCode == 200) {
return respGroupState.fromJson(jsonDecode(response.body));
} else {
print(response.body);
}
return null;
}
The first server sets the initial value by bringing the state data of traffic lights contained in each AE (traffic light) standard state container under Mobius.
The data contained in the state container is as follows.
Current traffic light status / Green light holding time / Red light holding time / Last time the traffic light status changed.
After that, the current state value of the traffic light is requested to be changed according to the corresponding holding time.
Future<respTlInfo?> requestTlInfo(String tl, Constate) async {
Uri uri = Uri.parse('http://127.0.0.1:7579/Mobius/$tl/info');
finalresponse = await http.post(uri,
headers: {
"accept": "application/json",
"X-M2M-RI": "12345",
"X-M2M-Origin": "Summit",
"Content-Type": "application/json;ty=4"
},
body: jsonEncode(reqTlInfo(m2mCin: M2mCins(con:state))));
if (response.statusCode == 201) {
return respTlInfo.fromJson(jsonDecode(response.body));
} else {
print(response.body);
}
return null;
}
When the user accesses the crosswalk and completes the crossing, the app puts the user's status information and the crossing information in the ci container of the corresponding AE(traffic light) under Mobius.
The data contained in the ci container is as follows.
Traffic light ID / User's SSAID / User classification (normal, elderly, pregnant, etc.) / Time spent crossing / Status of crossing (normal, jaywalking) / User's condition (normal, smombie) / Time
The server periodically(1minute) collects and separates user crosswalk walking information contained in the ci container of all AE(traffic light) and puts it in the info container of the corresponding AE(traffic light).
The data contained in the info container is as follows.
Average crossing time / Number of vulnerable people(children, elderly, disabled, pregnant) / Number of general crossing people per 3 hours / Number of smombies per 3 hours / Number of jaywalking / latitude and longitude of the crosswalk
For the first time, the Web (Administrator Center) uses Mobius' Group function to import status data from traffic lights contained in ‘state’ containers of all AE (traffic light) into a single query. Based on the data thus obtained, the location and condition of the initial traffic light are set.
After that, whenever the value is changed, a marker including the status of the traffic light is displayed in real time.
void setStreamData() {
final docRef = db.collection("STL");
docRef.snapshots().listen(
(event) {
if (isFirst) {
isFirst = false;
return;
}
Map<String, dynamic> data = event.docs.last.data();
if(data['ready']) {
if (addTime[data['tl'] - 1] == 0) {
stateDatas[data['tl'] - 1].gTime =
stateDatas[data['tl'] - 1].gTime! + 10;
setState(() {
var index = data['tl'] - 1;
targetMarker =data['tl'] - 1;
_markers[index] = Marker(
markerId: MarkerId("${index + 1}"),
draggable: false,
icon: stateDatas[data['tl'] - 1].state == 'green'
? greenImage_w
: redImage_w,
onTap: () => {
setState(() {
selectTL = index + 1;
selectInfo = infoDatas[index];
selectState = stateDatas[index];
targetView = !targetView;
_messageInputController_red.text =
selectState.rTime.toString();
_messageInputController_green.text =
selectState.gTime.toString();
}),
},
position: LatLng(infoDatas[index].lat!, infoDatas[index].lang!),
);
});
}
If the user's classification is not general, the app sends the information of the signal light being subscribed and the user's information to Cloud Firestore. When data addition is detected on the server that was subscribing to Cloud Fiestore, it adds a certain amount of time (10 seconds) to the next green light time of the traffic light.
When you click on each traffic light icon on the web(Administrator Center), it displays the current status information for that traffic light. In addition, it is possible to change the setting value at the set green light holding time and red light holding time of the corresponding traffic light by directly manipulating the UI.
In the statistics tab of the web (administrator center), the collected data of each traffic light may be checked by collectively inquiring. The displayed information is the data in the info container, such as traffic light ID, latitude and longitude of the crosswalk, number of jaywalkers, number of smombi crossers, number of ordinary crossers, number of elderly crossers, number of children crossing, number of pregnant women crossing, It is the number of disabled crossers and the average crossing time. The alignment order of the corresponding data may be changed through a priority alignment button.
Future<respGeoQuery?> requestGeoQuery(listLatLongdata) async {
Uri uri = Uri.parse('http://127.0.0.1:7579/Mobius?gmty=3&gsf=1&geom=$data&rcn=8&ty=2 ');
finalresponse = await http.get(uri,headers: {
"accept": "application/json",
"X-M2M-RI": "12345",
"X-M2M-Origin": "SummitGeo"
});
if (response.statusCode == 200) {
return respGeoQuery.fromJson(jsonDecode(response.body));
} else {
print(response.body);
}
return null;
}
The Web (Administrator Center) supports the function of filtering traffic lights through maps. If you click the Search for traffic lights on a map button, the map is exposed, and if you select the four desired coordinates on the map, the area is designated. When data is requested through Mobius' GeoQuery function based on the corresponding coordinates, only traffic light information in the area is filtered and received. Data of filtered traffic lights can be found in statistics.
App(Pedestrian)The App was implemented using Android Studio and Kotlin. App is composed of login page and main page.
- Login page
You must log in before you can use the app. Login is based on the user's name, and membership registration is required to log in.
Membership registration requires name, phone number, and identity verification. The phone number will be used to determine whether the user is vulnerable or not through user authentication. The function of determining the transportation vulnerable cannot be implemented at present. However, it is assumed that it can be determined through self-certification afterwards.
- Main page
When entering the main page, the SSAID is obtained and stored in the device so that each user can be identified. This prevents the user from being able to be identified through de-identification.
SSAID refers to a unique identifier value for each device, which is maintained until the device is initialized, and will have the same value even if the app is deleted and reinstalled. If you use phone numbers, e-mails, etc. to send data to Mobius and servers, you can identify users, so you can determine which users stayed where. Unlike phone numbers and e-mails, SSAIDs simply contain device ID values, so it is impossible to identify users with only SSAIDs. If you want to identify the user, the only way to look up the SSAID of the specific target user device and compare it with the data on the server. Android has unique ID values other than SSAIDs. However, the reason why SSAID is adopted as a de-identification means is that the lifetime of the ID consists solely of device initialization. In the case of GUID, advertising ID, and instance ID, it is initialized when you delete and reinstall the app, or reset certain settings. When sending data to Mobius and servers, the app uses SSAID, not user-specific user phone numbers, emails, etc.
The main screen consists of a notification switch and user status. Turning on the notification switch activates a foreground service to collect the user's location and status in real time. The service collects the current user's location and behavior to provide appropriate notifications to the user.
Before we can collect user behavior, we need to know where the traffic lights are. The app receives the location of the surrounding traffic lights based on the user, generates GeoFence, and registers it with the service. GeoFence is created after setting the position, time of stay, and a range of meters is created based on that position. When the user enters the range, stays for a set amount of time, and is out of range, a CallBack can be received, indicating that the user has entered or left the traffic light.
The user's behavior is largely divided into normal, waiting section of the crosswalk, crossing the crosswalk, and jaywalking.
"Normal" means that the user has not yet approached the traffic light. No notifications are sent at this time, but your location information is still being collected from the device, and GeoFence continues to operate to determine whether you enter the traffic light from time to time.
Crosswalk wait zone entry refers to the state in which the user has approached the traffic light. When there is an entry CallBack signal in GeoFence, it is determined that the traffic light is approaching. When entering CallBack, the app takes the traffic light ID value in GeoFence and requests the current traffic light status inquiry API to inquire and display the current traffic light status on the screen. The status of the traffic light is a walking signal/time remaining. Once you have completed a status check, start a subscription for that light.
When a user enters the waiting section of the crosswalk using a cell phone, the user judges it as Smombie. The app checks whether the phone is used or not through Android Power Manager. It is possible to check whether the user is performing activities through the device through PowerManager. If the user is using a smartphone when there is a CallBack signal entering GeoFence, the app sets the user to Smombie and checks for Smombie when sending information to Mobius.
If the user who enters the waiting section of the crosswalk is vulnerable to traffic, such as the elderly and the disabled, the waiting time for the pedestrian signal is increased. This information is registered in the Firebase Data Store. If you leave the traffic light without crossing the crosswalk in this state, unsubscribe from the traffic light. Deviation is confirmed through GeoFence's Deviation CallBack.
After entering the waiting section of the crosswalk, if the traffic light changes to a walking signal, a notification that it has changed to a walking signal is sent, and the screen informs the waiting time of the walking signal.
Crossing the crosswalk and jaywalking refer to the state in which the user has started crossing. The condition varies depending on when you cross at the walking signal and when you cross at the red signal. When crossing a walking signal, it is judged to be a normal crosswalk crossing and the time for the user to cross is collected. The status of the user crossing the crosswalk is also determined by GeoFence. The app generates a small GeoFence based on the middle of the crosswalk. When the user enters the GeoFence, it is determined that the crossing has started, and the time of departure is checked to calculate the crossing time according to the time difference between entry and departure. Upon completion of the crossing, the app sends user information, including the time to cross, to Mobius to add it to the statistics.
If you enter GeoFence with a red light, you will be notified that it is dangerous until you complete the crossing. After completing the jaywalking, the app sends user information and adds jaywalking status.
The hardware consists of a Raspberry Pi4, a module and a sensor. The connection between the Raspberry Pi4 and the module and the sensor is BCM mode, and the development language is Python. The lights at the traffic lights used a 12V Flexible LED. We use batteries and 2ch Relay Modules to power traffic lights. The signal time was expressed using 7-Segment. Each 7-Segment displays the signal time on the 7-Segment by attaching an SN74LS47N chip that helps ensure that the binary scale data is represented in the correct number. Each hardware means one traffic light.
The traffic light has a unique ID value, which is the same as the traffic light ID registered in Mobius. Communication between the hardware and Mobius takes place via MQTT and requests subscription to the path corresponding to each traffic light ID. If your subscription is successful, you will receive data on traffic light information from Mobius.
Data comes in whenever the status of the traffic lights changes, and the data is organized in JSON format. The data contains data for the current traffic light status, red light time, and blue light time, and the hardware uses that data to control the status of the traffic light. If data about the traffic light status is issued after the status of the traffic light changes, the hardware receives a subscription message. Parsing the received JSON data to see the data corresponding to the current traffic light status, red light time, and blue light time. The traffic light displays the light that matches the current status data, takes the current signal time and displays the signal time through 7-Segment.
Each signal time is updated whenever data comes in because there are transportation vulnerabilities such as the elderly and the disabled, or because it can vary depending on various situations. Therefore, the changed signal time is applied in real time.
Demopoints to be supplementedThe service only considers dangerous situations that the pedestrian can control. This alone can sufficiently reduce the occurrence of traffic accidents, but control of the vehicle is also needed to reduce the risk more completely. If we can even provide driver notifications for signal violations, speeding, and right-turn violations, we expect to reduce traffic accident damage very innovatively.
Comments