1 Introduction

Traffic congestion is a vexing problem felt by residents of most urban areas. Despite centuries of effort and billions of dollars worth of public spending to alleviate congestion, the problem appears to be getting worse. This result affects directly to economies, human health, and environment. By this way, Intelligent Transportation Systems (ITS) have been developed to deal with these emergent problems. ITS have been regarded as advanced applications which applied to transport and infrastructure to transfer information between systems. ITS integrates current and growing communication technologies. Due to emergence of many technologies, the transportation system is able to improve safety, productivity and environmental performance. In this regards, Wireless communication has become an immense area. Wireless Networks connect the devices, transmit the data through signals and use medium (radio wave, microwave) for transferring and sharing the data between nodes [22]. One of the application of wireless networks for traffic control is Vehicular Ad Hoc Network (VANET) [8], as is well-know, VANET turns every participating vehicle into a wireless router or mobile node, enabling vehicles to connect to each other to create a network with a wide range. However, VANET can not provide whole and sustainable services/application. The new era of the Internet of Things (IoT) provides various wireless connectivity for vehicles enables the communication with other objects. Such a connected vehicle solution is expected to be the key to the evolution to next generation ITS [19].

1.1 Problem definition

Among many kinds of applications of ITS, traffic control at intersections is always a significant challenge for the researchers and the developers, because of their complex locations and various shapes. Traffic control at intersections are always a complex problem on any type of highway since vehicles in different directions want to move in same space at the same time. In additional, pedestrians also seek same space for crossing. A small mistake can be a cause of severe accidents. Moreover, traffic congestion often occurs at intersection, it depends on geometry and type of control. The existing system for management traffic flow at intersection still has to face with some challenges, especially in case of high traffic volume such as traffic congestion, the large number of waiting vehicles in queue lanes, and vehicle crash at intersection because of conflict directions. Therefore, the study of traffic control at intersection is very important for traffic engineers to improve the traffic flow.

1.2 Motivation and objective of this study

Recently, optimizing signal of traffic light system is the state-of-the-art issue for improving traffic flow at intersections. However, it is hard for implementing in reality since high computational complexity of these algorithms. With the growing up rapidly of Internet of Things (IoT), vehicles will be a “major element” of this expanding which around 250 million number of vehicles having some sort of wireless network connection by 2020.Footnote 1 This allows the vehicle to share internet access with other devices both inside as well as outside the vehicle (V2V, V2P, V2I) [10]. Moreover, pedestrians based on connected object technologies are equipped to communicate with others for improving traffic flow.

Based on those advanced technologies, in this study, we propose a new model for safe and efficient movement of both vehicular traffic and pedestrians at intersection. In particular, we introduce an approach by using Processing Synchronization Theory (PST) which each object (vehicle, pedestrian) moves into the intersection is regards as a process which executing in critical section (core are of intersection). In this regards, how to manage traffic flow if there are many objects which want to execute in the common resource (race condition) and reduce the waiting time of each object in case of high traffic flow are the main challenges that this study focus on. Moreover, in term of vehicle, the deadlock can occur when two or more vehicles go into an infinite loop. An effective solution for avoiding deadlock is proposed to deal with this problem.

1.3 Contributions and organization of the paper

The main contributions of this paper include: 1) Our approach deals with real-time problems with dynamic traffic flow. 2) Less computational complexity since the proposed approach does not use any optimization algorithm. 3) Traffic system controls the moving at intersection of objects via wireless local area network, so it is feasible and flexible for implement the system in reality. 4) The simulation shows that our results are effective in term of improving traffic flow and reducing waiting time of each object at intersection.

The remaining parts of this paper are organized as follows. In Section 2, we design the simulation modeling of our proposed system. Moreover, basic idea of synchronization theory which supports for our approach will be introduced. Section 3 includes architecture of connected objects at intersection and proposed algorithms for communication between object and management system. Then, the simulation is performed to evaluate the performance of the proposed approach in Section 4. Some problems in our paper and state-of-the-art about traffic control at intersection will be discussed in Section 5. Finally, we conclude this paper in Section 6.

2 Related work and background

There have been many approaches to deal with the traffic congestion at intersection. Traffic light scheduling is the traditional approach where the vehicles stop-and-go according to the control of traffic light. The state-of-the-art issues in this approach focus on adaptive and dynamic traffic light system. There have some papers using optimized signal solutions to solve this problem. Chen and Shi [5] proposed a Genetic Algorithm for optimization the signal at intersection. On the other hand, the approaches in [13, 21] used fuzzy logic for traffic signal control. Srinivasan et al. [27] introduced the Neural Network to deal with real-time management. Moreover, some approaches focus on optimizing time of green light [31, 32].These approaches are interesting and come out with good result, however, they are hard to implement since the complexity of computation. In this regards, Cajias et al. [3, 4] based on Particle Swarm optimization techniques to designed and implemented a multi-agent traffic for evaluating the impact of traffic lights. For reduce the complexity of computation, Wu et al. [29] introduced a new approach for dynamic the traffic light control based on distributed mutual exclusion algorithm. Although the system will be complicated in case of high traffic flow. With the developing of internet of things, many studies suggested the use of Wire-less Sensor Network (WSN) [6, 14, 18, 30, 33] for adaptive and cost-effective traffic control. However, with designing large number of sensor, the energy-efficient problem is still a big challenge for the developers. In this regards, using Vehicular Ad hoc Network (VANET) is a good solution for energy problem. Bento et al. [2, 7] proposed the intelligent traffic managements based on VANET. Jabbarpour et al. [15] take an investigation on how density along with velocity can affect intelligent position-based routing protocols in VANET. By this way, the vehicles are able to avoid the conflict based on send their signal. Nevertheless, the vehicles are only able to communicate in short range of transmission. To deal with this problem, Internet of Things (IoT) is emerging as promising solution. The IoT enables the integration of communications, control and information processing across transportation systems, allowing for dynamic real time interaction in case of large range transmission [25].

As we mention above, this paper focus on how to improve traffic flow at intersection based on connected objects technologies. In this study, we assume a single intersection with four directions leading to the road of intersection are North, East, South and West which are marked as (\(\mathcal {N}\)), (\(\mathcal {E}\)), (\(\mathcal {S}\)) and (\(\mathcal {W}\)), respectively. Each direction has two lanes for vehicles in the incoming direction, which are go-forward (\(\mathcal {F}\)) and turn-left (\(\mathcal {L}\)) and one lane for pedestrians which is go-forward (\(\mathcal {PF}\)) . Notice that in this paper, we do not consider for turn-right direction of vehicle, since for almost kind of crossroads, the vehicle is able to take right-direction without any obstructions. By this way, a lane where the object pass at intersection can be determined by a path (\(\mathcal {P}\)) of {\(\mathcal {N}\), \(\mathcal {E}\), \(\mathcal {S}\), \(\mathcal {W}\) } and a direction \(\mathcal {D}\) of {\(\mathcal {L}\), \(\mathcal {F},\mathcal {PF}\)}. As result, there is total twelve lanes which operating in the model that are described by the pair (\(\mathcal {P},\mathcal {D}\)): { \(\mathcal {NL},\mathcal {NF}\), \(\mathcal {EL}\), \(\mathcal {EF}\), \(\mathcal {SL}\), \(\mathcal {SF}\), \(\mathcal {WL},\mathcal {WD}\), \(\mathcal {NPF}\), \(\mathcal {WPF}\), \(\mathcal {SPF}\), \(\mathcal {WPF}\)} as shown in Fig. 1.

Fig. 1
figure 1

Intersection and lanes

Table 1 and Table 2 shows relationships between lanes of vehicles and between lanes of vehicle and pedestrian, respectively. which include concurrent and conflicting lanes. In this regards, it is up to status of relationship among directions, vehicles will be allowed to operate (Blank) or inoperative (X) to one another. According to previous traffic rules, to avoiding the conflict among vehicles at intersection, when the vehicles are passing, the system will lock all the conflicting lanes by controlling traffic light system (red light). However, in this case, the vehicles which in the different paths can not move even there are some lanes which are concurrent lanes. For instance, when a vehicle in lane \(\mathcal {NF}\) is passing, all remaining three paths have to be blocked, although the lane \(\mathcal {SF}\) in path \(\mathcal {S}\) is concurrent with lane \(\mathcal {NF}\). In order to deal with this problem, the existing systems allow the vehicles in the paths \(\mathcal {N}\) and \(\mathcal {S}\) pass together (the same with paths \(\mathcal {W}\) and \(\mathcal {E}\)). Even though, the conflicts among vehicles sometimes still occur since the vehicles in conflicting lanes pass simultaneously (e.g., \(\mathcal {NF}\) and \(\mathcal {SL}\)).

Table 1 Relationship between Lanes of vehicles
Table 2 Relationship between Lanes of vehicle and pedestrian

2.1 Interprocess communication and message passing model

The idea of our proposed approach based on synchronization theory. In computer science, process synchronization refers to the idea that multiple processes are to join up at a certain point, in order to reach an agreement or commit to a certain sequence of action. In this regards, processes can communicate through share areas of memory [23]. Figure 2 shows synchronous message passing mechanism of Inter-Process Communication (IPC). IPC provides two operations which are send(message) and receive(message). There is a communication link between two processes when they want to communicate to each other, they will use send and receive functions for the communication. After finishing the communication, the link will be removed.

Fig. 2
figure 2

Inter-process communication: message passing

Based on connected objects technologies where each object is able to communicate with others, we can apply this theory for traffic control system at intersection. In this regards, when an object (vehicle or pedestrian) arrives to the intersection, they will send a message to management system for requesting the passing. Based on traffic flow in real-time, the system will decide the time when the object can pass the intersection. Note that in this paper, we only propose message passing for communication between objects because it is not costly for developing the communication links and effectiveness in term of transmission data by using wireless local area network. More detail of connected object architecture at intersection will be introduced in next section.

3 Process synchronization approach (PSA)

3.1 Traffic connected object architecture

In connected vehicle concept, the vehicles can be identified based their ID (e.g number plate of the vehicle). The vehicle communicate with infrastructure (V2I) and other vehicles (V2V) under the ID as the address. Each vehicle is equipped the positioning system (VPS) to determine its location. In case of pedestrians, by using connect devices (e.g smart phone), they are able to communicate with the system for requesting passing the intersection. In this regards, the traffic management system which located in the intersection is able to get the information of object in term of their location and directions when they move into the intersection area. Figure 3 shows the architecture of the traffic connected-object at intersection.

Fig. 3
figure 3

Traffic connected objects architecture

Sensors are developed in each path to determine the vehicles and pedestrian when they move into the simulation area which follow a certain random distribution. Traffic light system and traffic pedestrian signals are designed for indicating the status of a variable (red or green). In this case, their role as a lock which define status of objects whether they can go (passing) or stop (waiting) at intersection. The wireless communication devices (Cellular Base Station) are designed in the intersection to enable the communications between object and controller. We assume that the transmission range of wireless devices are able to cover all of the intersection area. Moreover, the wireless channel is FIFO channel, it means the traffic management system will receive the request from object as FIFO model.

Figure 4 shows an interaction between object and controller for passing the intersection of object. By this way, when an object want to pass the intersection, they have to send a request to the controller. Based on the traffic flow at intersection, the controller will reply the permit passing message to object or put the request in the pending list, and the object have to wait until receive reply from controller. After passing the intersection, the object has to send a release message to Controller. The algorithms for this process are proposed in next section.

Fig. 4
figure 4

Interaction between vehicle and controller

3.2 The PSA algorithms

The Algorithms 1 shows the communication between object and controller. When an object i moves into the simulation area, it sends a request message with id and its lane li to controller and waiting until receiving the acknowledgement (reply message) from controller.

figure a

On the other hand, when the controller receives the request message from object i, it will check the traffic flow in the core area of the intersection (Algorithms 2). If in core area, there is a vehicle (or pedestrian) j which from conflicting lane with the lane of vehicle i is moving, or if the deadlock (in case of vehicle only) occurs when vehicle i pass into the intersection (Algorithm 3), then it will put the object i in the pending list Pl and block the path of vehicle P i based on traffic light system (red-light). In other case, it sends a rely message to object for permitting the passing.

When the vehicle already exits the intersection, it has to send a release message to the controller. After receiving the release message, the controller checks the pending list. If there is an object which are waiting, the system will send reply message to that object . In case of more than one waiting reply message in the pending list, the controller will check one by one based on FIFO model.

figure b

3.3 Deadlock avoidance algorithm

Although we are able to manage the conflict among vehicles by using the process synchronization approach which only allows the vehicles in concurrent lanes passing the intersection simultaneously. However, in case of high traffic flow, the traffic deadlock sometimes still happens when two or more vehicles are each waiting for the other (deadlock occurs in case of vehicle only). Figure 5 shows an example of the deadlock. The vehicles go into an infinite loop since they have to wait to each other. For almost existing systems, they assume that deadlock never occurs because the time intervals between occurrences of traffic deadlock are large and the time for waiting is tolerable. In connected vehicles technology, the traffic management system is able to collect all necessary information from vehicles such as time of arrival at intersection of vehicles and their lane. By this way, the system will estimate whether the deadlock happens or not at the certain time when a vehicle pass into the intersection. The deadlock can be detected based on wait-for graph algorithm [11].

figure c
Fig. 5
figure 5

Example of traffic deadlock

The process of the detection deadlock algorithm is given as follow: 1) first, we transform the deadlock detection problem into wait-for graph G(N,E) problem. By this way, the vehicles are represented as nodes, an edge from vehicle i to vehicle implies j is holding a space that i need and thus i waiting for j pass that place. 2) Then, using finding-cycle algorithm in a directed graph to detect the cycle in graph. 3) The deadlock will be detected if the result is True. In contrast, the vehicle can pass the intersection (more detail in Algorithms 3). Figure 6 shows a wait-for graph with a cycle. The complexity computation of this algorithm is O(n 2) where n is total number of vehicles which are moving in the considering time at intersection.

Fig. 6
figure 6

Wait-for graph with a cycle

3.4 Expected outputs

The objective of this study is that we use process synchronization approach to improve the traffic congestion at the intersection and reducing the waiting time for object, especially in case of high traffic flow. In this paper, we focus on evaluating effectiveness of the system by calculating number of objects passing the intersection at a certain time and the waiting time of each objects. The time for an object i pass the intersection can be calculated by

$$ T_{i} = {T_{i}^{e}} - {T_{i}^{s}} $$
(1)

where \({T_{i}^{s}}\) and \({T_{i}^{e}}\) are the time for arriving and existing the intersection of object i, respectively. Consequently, average waiting time of objects passing the intersection at a certain time from the start-time T s to the end-time T e can be calculated

$$\begin{array}{@{}rcl@{}} && \bar{T} = \frac{{\sum\limits_{i = 1}^{n} {{T_{i}^{e}} - {T_{i}^{s}}} }}{n} \\ && \text{subject to } {T_{i}^{e}},{T_{i}^{s}} \in [T^{s},T^{e}] \end{array} $$
(2)

where \(\sum \limits _{i = 1}^{n} {{T_{i}^{e}} - {T_{i}^{s}}}\) is traffic volume at intersection. Result of the proposed approach will be showed more details in next section.

4 Performance evaluation

4.1 Comparative approaches and simulation parameters

To evaluate the effectiveness of the proposed approach, in this section, we take a comparison our system with the existing system using Round-Robin scheduling algorithm for controlling traffic light. Although, recently, there have been some adaptive algorithms focus on dynamic traffic light system, however, as we mention in introduction section, since their computational complexity, it is infeasibility to real-time control. In contrast, our approach is able to implement based on connected technologies among objects. In this study, we measure the performance of the traffic control algorithms in term of increasing density of object which arrive to the intersection according to random distribution in each direction of the intersection.

In this paper, we use Netlogo simulator, an agent-based modelling (ABM) environment, to design and implement a simple working traffic. Table 3 shows parameters which we use for the evaluation. In this regards, we simulate an intersection of 100*100 pxcor with simulation time is 1000 ticks [12]. In case of traffic volume, to evaluate the system effectively, instead of using static number of objects arriving at intersection, we vary it for each run. In particular, the density of traffic flow of vehicles in each direction (\(\mathcal {N}\), \(\mathcal {E}\), \(\mathcal {S}\) and \(\mathcal {W}\)) is from 5 % to 30 % per 10 ticks. It means for every 10 ticks, the rate for vehicle arriving at intersection in each direction is from 5 % to 30 %. In case of pedestrian, the density is from 2 % to 10 %. Figures 7 and 8 show the number of vehicles and pedestrians arriving at intersection (in ascending order) after 1000 ticks for 10 times of trials, respectively.

Fig. 7
figure 7

Random distribution for traffic flow of vehicles

Fig. 8
figure 8

Random distribution for traffic flow of pedestrian

Table 3 Simulation parameters

4.2 Experimentation

Figure 9 shows the number of vehicle passing the intersection at a certain time (1000 ticks).

Fig. 9
figure 9

Number of vehicles pass the intersection at a certain time

As result, our outperform is better than existing system since our system is a dynamic traffic light system in real-time, the vehicle can pass into the intersection anytime when there has not any vehicle in conflicting lanes is passing. Consequently, we can save the waiting time of vehicles. For more details, Fig. 10 shows the maximum and minimum waiting time of vehicle. The waiting time of vehicle obviously increase when the density of vehicle get higher. However, in our approach, the change does not vary too different. The reason is that in our system, the priority of request messages from vehicle is FIFO model, so the vehicle is able to pass into the intersection as soon as possible. The waiting time only get high when the traffic flow is overload. Generally, Fig. 11 shows average waiting time of total vehicle passing the intersection.

Fig. 10
figure 10

Maximum and Minimum waiting time of vehicle

Fig. 11
figure 11

Average Waiting time of vehicle

In term of increasing density of pedestrian, Figs. 12 and 13 show traffic flow of objects at intersection in case of number of object passing intersection and waiting time of each object, respectively. The number of vehicle and pedestrians which are able to passing the intersection at a certain time in our approach are always better than Round-Robin Scheduling (Fig. 12). In case of average waiting time, Fig. 13 shows the results of two approaches. The waiting time is directly proportional to the traffic volume, however, in PSA approach, the number of objects passing the intersection are almost same with various density, the reason is that object can pass the intersection immediately if there has not any vehicle on conflicting lanes moving.

Fig. 12
figure 12

Number of objects pass the intersection at a certain time

Fig. 13
figure 13

Average waiting time of objects

In this experiment, we also take into account the effect of distribution of traffic volume of vehicle. In this regards, we set two patterns which are uniform volume and non-uniform volume. For uniform volume, we assume that vehicles come to the intersection with same arrival rate of lanes. Meanwhile, non-uniform indicates the volume in west-east road is two times compare with north-south road. Figures 14 and 15 show the total time that all vehicles need to pass the simulation area in term of same arrival rate of lanes and different arrival rate, respectively.

Fig. 14
figure 14

Total time for all vehicles pass the intersection with same arrival rate

Fig. 15
figure 15

Total time for all vehicles pass the intersection with different arrival rate

5 Discussion

Recently, the ‘connected vehicles’ concept has been identified as the most promising future solution to enhance road traffic conditions and achieve the goal for more efficient and sustainable traffic management solutions. It refers to the wireless connectivity enabled vehicles that can communicate with their internal and external environments such as supporting the interactions of V2S (vehicle-to-sensor), V2V (vehicle-to-vehicle) and V2I (vehicle-to-internet) [19]. In these interactions, vehicles are enhanced the situational awareness not only collecting the information about them-selves but also communicating with other objects such as traffic management system and others vehicles. Based on these advanced technologies, in this paper, we proposed an new model for real-time traffic control at intersection. Moreover, our system also consider about pedestrians at intersection. Although there have several research which take into account in this problem [1, 9, 20, 26], however, our study which integrated pedestrians and vehicles in the system is a new model. In particular, pedestrians and vehicles are regards as object can communicate with controller to get permitting for passing the intersection via wireless network by send and receive messages. Notice that in this paper, we do not consider about message loss in the algorithms since it is not related with our topic in this study. Nevertheless, we are able to handle this by using some mechanisms of timeout retransmission [24] for detecting message loss and resending.

The proposed system is feasible and flexible for development based on advanced vehicle technologies. In particularly, the auto industry is on the brink of a revolution, and the driving force is the suite of technologies known as the Internet of Things. With IoT applications, grounded in advances in everything from sensors to artificial intelligence to big-data analysis all manner of objects can be not only connected but also ‘smart’. By this way, in our system, with the connected objects technologies, the controller is able to collect data in real-time to improve traffic flow at intersection by dynamic Traffic Light Control System. However, to implement in real world case where there have various shapes of intersections, we have to extend the model to the multiple crossroads (e.g., multiple intersections, roundabout-intersection model and so on). Furthermore, in this work, we are not consider in case of providing preference to emergency vehicles (e.g., ambulance, fire truck). One suggestion to deal with this problem is that with IoT applications, we can apply Vehicle Recognition technologies [28] for recognize and provide preference for the vehicles. Moreover, in reality, it require an extremely large amount of heterogeneous IoT devices to develop an connected object system at intersection. In this regards, semantic should be considered as a key technology to solve the problem of automating the deployment of applications in heterogeneous IoT environments [16, 17]. There are interesting issues for our future work in this research area.

6 Conclusion

In this paper, inspired of advanced vehicle technologies, we introduce a new approach for real-time management the traffic flow based on process synchronization approach. In this regards, when objects move into the intersection area, they can communicate with controller to avoid the conflict between them, so that they are able to improve their waiting time in case of high traffic flow. Moreover, in this work, we also propose a new algorithm for avoiding the traffic deadlock of vehicles which was not considered in existing systems. The results show that our approach can reduce the waiting time of objects when they pass into the intersection.