We were motivated to solve the scheduling problems in real time based on one of the use case provided by Optum. We were inspired by the kind of problem this would solve and believe that it might have a great potential in serving large scale users in a similar situation.

The potential Consider a 100 nodes at a particular location/point requiring to be assigned tasks on the go. We could address this with a straightforward scheduling algorithm, with the given constraints. Now imagine that there are a very high number of nodes at a single location/point and imagine a high number of such locations itself. This becomes a high scale distributed task assignment problem and we aim to tackle that with our system.

What it does

A generic solution to real-time task assignment applications. Given in a few constraints, the system can assign tasks on the go in a large distributed environment based on real team events. This solution is capable of handling real-time analysis of the progress of the task and can handle reassignments as well, to the best fit of the user/organization. We present this system to seamlessly assign tasks to various nodes on a distributed network and can be configured according to the needs of the user.

How we built it

We built this system with the purpose to serve a large number of clients on a distributed network with real-time task assignment. The system is built on a foundation with the distributed streaming platform Apache Kafka. The system is designed based on the producer-consumer model, which allows us to get real-time requests from various clients and serve them efficiently. We implemented the scheduling algorithm in python that could be useful to most scenarios with similar goals. We use SQL databases for logging and storing assignments. We make use of REDIS for efficient update and fast caching and also a temporary assignment of tasks. We were also able to efficiently handle reassignment of tasks on the go using Redis and an on the go scheduling system. The system has a robust architecture which is highly scalable and adaptable to many environments.

Use Case - Optum :

The specific use case was from Optum: They needed a mechanism to handle task management for their Nurses who would usually drive out to serve the patients. There are a number of constraints - a given due date for the task, the priority of each task based on the task type, and most importantly the time constraints which are the time taken to provide the service and the time taken to reach the patient. They needed a system that would efficiently assign these tasks of serving patients on the go when their Nurses opened an application; the nurses would basically be driving to a patient’s place and would remain there until the service is completed. The challenge was to assess the nurses’ situations and assign tasks on the go, keeping the constraints handy.

On the users end: Turns on an application, sees an optimal task assigned and proceeds with it. Repeat the process until their working hours are met or when there are no more tasks available.

What we saw: A producer-consumer system that could handle the assignment of tasks; the producer grabs the location and passes it to the assigned consumer using Apache Kafka and Zookeeper. The consumer has a scheduling server that would take the location as an input and matches it with the list of tasks which are already optimized based on the various parameters and data provided to us by Optum. The server then assigns the best possible match in real time and saves all the assignments on a temporary fast cache using Redis. There is a logging service associated, which would simply log the nurse’s real time location on the go for analysis. We used a geo-location service to get the location coordinates and a geo-mapping service to calculate the ETA. We receive the location of the nurse in regular short intervals of time to assess the realistic feasibility of the task completion and efficiently re-assign the task if necessary.

Challenges we ran into

Designing the real time server that will respond to every user event and schedule the task accordingly. Had to explore kafka and redis to facilitate processing of real time data and running the scheduler.

Accomplishments that we're proud of

We were able to devise a generic scalable system which solves real time scheduling problem on a distributed platform.

What we learned

Contributing to opensource has a charm on its own. We devised a generic distributed scheduler and it is was possible only by using other open source libraries.

What's next for NextStop-A-Distributed-Real-Time-Scheduler

This system architecture is capable of handling a high number of nurse requests from various possible locations and has the potential to scale well in production. Running the whole system on Google Cloud Platform helped us utilize the platform advantages and also make the system more available. Also build an efficient user interface to make it more realistic, with some visualizations.

Built With

Share this project: