📜 ⬆️ ⬇️

Sports Timekeeping System - Inside View

Hello dear readers. Surely, many of you are involved in or playing sports. This is a great hobby and generally good for health. I spent most of my childhood at sport orienteering camps. Alas, I didn’t achieve great results in sports, but I really didn’t want to part with it (with sports). And then I began to participate in the organization of sports competitions. Now this is not a job, but rather a hobby. And today I would like to tell you about my role in the organization of these competitions.

In this article I will tell


There will also be several large photos and pictures from the thick of events.
Sometimes I will use the term “ judging ”. For us, this is a familiar word that means “ control of the course of a sports competition ”. It has nothing to do with the state justice body.

Our role is timing


')


People have always loved to compete. In all ages, they find out who is faster, who is stronger and more enduring.
For an objective identification of the strongest, three things are always needed:

  1. Rules or regulations for which competitions are held
  2. Equal conditions for all participants
  3. An independent and unbiased third party is a sports judge who records the results of the competition.

The central place in the judging of many cyclical sports is timekeeping , that is, the determination of the time of the distance of each participant .

We hold sports competitions in various sports: cycling races, multisports, orienteering and even city quests, but always the most vivid impressions remain from organizing ski races (here we are talking about cross-country skiing).

Every year mass ski races become more popular and collect an increasing number of participants. Several thousand people from all over Russia and sometimes Europe come to the race in order to find out at distances of 10, 25 and 50 kilometers who is better. In Russia, about 20 major ski marathons take place every year.


Ski marathon "Holiday of the North" in Murmansk.

I have always been surprised and admired by people who fly 10 thousand kilometers by plane to take part in such a race. They pay a lot of money for the flight, accommodation and the race itself.

That is why the quality of the competition and the service provided must be high, the preliminary results of the race must appear as quickly as possible, there must be at least errors in them. The results of the race are the final part of the event and the second (after the race itself) for which the athletes come.

From the foregoing, we conclude: timekeeping is one of the most important parts of a sporting event. Requires high accuracy, discipline and speed of each member of the timing team.

What's the big deal?



Photo of Maria Shalneva from the marathon in Dubna 14-02-2015

“ What is difficult to measure the time of the athletes and print out the final results table on the printer? The reader will ask. The thing is that the work of the timekeeping brigade takes place in a rather stressful atmosphere.

Here are a few reasons for this:


The equipment we use



Enabling antennas in RFID reader

The number of participants in the race of two to five thousand people implies the mandatory use of electronic timekeeping equipment. If we use watches, pencil and paper to calculate the results, then we will have to wait for “at least an eternity”.

The task is as follows: it is necessary to automatically determine the exact time of each participant’s passing through a certain point at a distance and save a pair of participant’s number - time of crossing the finish line to the database.

Initially, we considered two versions of the solution, one of which was immediately dropped due to its imperfection and the complexity of implementation.

The first option (from which we immediately refused) is the recognition of the participants' numbers in a photo or video taken at the intersection point by an automatic camera or camera. So does our valiant traffic police - remove, recognize, send letters with fines. Example: a skier drove through the finish line, crossed the "ray", which is connected to the camera. The photo is immediately recognized, the time and the number from it gets into the database. You yourself can judge the complexity of the development and the probable problems of such a system. when using it at public events.



The second option (which we use) is the use of RFID tags embedded in the T-shirts of the participants . The principle of radio frequency identification, I copied from Wikipedia:
An object that needs to be monitored is set with a radio frequency tag. When an object with a tag gets into the range of the reader, the reader receives from the tag the information about the object contained in it and transmits it to the computing device.

Scheme of work you can understand from the photo below:



The participant passes by the antennas, a passive (that is, without their own power source) RFID tag in the participant’s T-shirt picks up the reader’s electromagnetic waves and sends it a response signal. Next - a matter of technology in the literal and figurative sense. You must select a response with the maximum signal level (this is done by the software in the reader) and send the “time-number” packet over the network to the server.

The technology works well. The problem of “skipping” participants is mainly related to “elbows pressed to the body” (the human body screens the signal) and insufficient power of passive tags (using active tags is very expensive for mass marathons).

First of all, we install antennas and readers at control points (usually this is one intermediate point and finish).


Scheme (top view) of the finish town of the ski marathon

Wires have to bury in the snow, because they can catch the skis. Most often, to dig snow ice is very difficult, so the chainsaw enters the battle.



Then we pull the wires: all the readers, the IP camera, the service computers, the printer must be assembled into one network.



In the tent, we put a gas heater, because the risk of freezing and getting sick sitting at a computer in the cold is very high.


Photo with intermediate cutoff

Timekeeping and refereeing software


The main task of the timekeeping brigade is to firstly provide the chief referee of the competition with current and error-free results of the race. In simple language, the results protocol is a table of participants in the race, divided into age groups and sorted by the time of the distance. It sounds simple enough and it seems you can do with Excel alone to create such a table.

Some old-timers and organizers really use Excel to judge such starts. They have file templates for each type of race, a well-established collection of macros, very strict and strict rules of work. In my opinion, this is difficult, inconvenient and very restricts the use of additional buns (tell me, for example, send via Excel SMS messages with the results to participants who have just finished, to make a GPS broadcast on a large monitor in the competition center and on-line broadcast of the results on the Internet ?)

We decided to go ahead and make the program . More precisely, not even a program but a web application. OpenEventor (as we called it) is written in PHP (here some readers should frown and shake their heads slightly). Quite a strange choice for writing narrow-specific software, which, moreover, should work with the equipment, skeptics will say.



We chose consciously the choice of technology stack for development and here are a few reasons:

  1. The possibilities that PHP, HTML5 and JS gives us are quite enough for the implementation of our plans.
  2. No need to compile each time . Alas, but often I have to edit the code during the race, so to speak on the "armor of a burning tank." At this point, the ability to add 2 lines of code, and pressing F5 in the browser to get the result is a very good opportunity.
  3. PHP is very popular , which means that you can find a cheap programmer for writing plugins (more on this below).
  4. No need to install software on each computer. At that moment, the chief judge of the competition or the commentator wants to “ see the participants finish on his MacBook ,” it’s enough to turn it on and open the page in the browser. And when you need to quickly put five girls on the registration of new participants - the implementation of OpenEventor as a web application seems wise.
  5. Our readers work on the network . IP camera, of course, too. Therefore, we can work with equipment quite comfortably in PHP.
  6. I unfortunately do not know other programming languages, as well as PHP. Perhaps we would have made a program in Java or C # if someone from our team knew Java or C #.

For those who are not aware that you can “ work in a browser without the Internet, ” this is done as follows:

  1. Computers are combined into one network using a switch and a twisted pair or using a Wi-Fi router.
  2. We are running a web server on one of the computers (we use Maxim Arkhipov’s OpenServer ArhMax )
  3. All those who need access to the program simply open the browser and enter the address there, such as 192.168.1.15 and go to the main page of OpenEventor.

SQLite was immediately selected for data storage. For those who have never used SQLite, I highly recommend adopting it ( article on Habré ). This is a very reliable and very fast database. A special server is not needed for it.

For us, the concept of SQLite turned out to be perfect: each event (marathon, race, or something else) is a separate database. Each SQLite database is a separate * .db file. Old databases are easy to archive so that they do not take up space and are not lost, and current databases are easy to transfer if there is such a need. Working with SQLite on PHP is very simple and secure, it is supported by the PDO interface. If suddenly you have to do something super-complicated that cannot be done by OpenEventor, you can write a SQL query with your hands.


Split Monitor (left) and the "Plugins" section (right)

As I mentioned above, the system is expanded with plugins.
To make a universal system for judging sports competitions is not realistic.

Firstly , each organizer has his own wishes and requirements regarding how to judge. And if there are any standards in skiing, then in such sports as, for example, multi-races - you can think of only one hundred thousand ways for what parameters to form the finishing protocol.

Secondly , to include such minor things as sending SMS and automatic publication of photos from the final alignment (which makes an automatic camera) - is not logical.

That is why the program implements only the basic functionality: basic work with participants, groups, teams and splits, and all additional chips, we and everyone can complete our own.

A little bit about the program device


There are two key entities in the system:


The rest (teams, groups, distances) are secondary and I will not talk about them for a long time. At any sporting event where athletes compete individually there is a division into teams (for example: by city or sports clubs) and groups (for example: by age and sex). The distance in cyclic sport (running, skiing, cycling, orienteering, etc.) is the correct sequence of splits (see above) that the participant must “assemble” during the race.

Example: A skier from the age group M35 (male, 35 years old) overcomes a distance of 50 km, which consists of 5 laps. He drives a ten-kilometer circle five times, passes an intermediate cut-off 4 times and for the fifth time finishes a cut-off in another place of the route. For a skier, it's just 50 kilometers (although, of course, it’s not very easy :). For me, as for the timekeeper, this is the distance lap, lap, lap, lap, finish .

Our main job during the race is to control the equipment and correct errors very quickly. Readers sometimes miss participants. Usually it is 3 splits out of 100. Our task is to determine “who didn’t catch anyone”, to calculate the split time (for example, to watch the saved video from the ip camera, which records video for 4 hours). Sometimes you even have to use a paper double.


In the split monitor, we immediately see the "problem" participants

Solving the problem with gaps is not difficult. It is much more difficult to determine in time what the problem is. For this we have made a split monitor: this is a plugin, which displays the most current information about splits. The plugin analyzes the splits of the participant, comparing with a given distance determines whether there is a problem. At this point, it is still possible to understand what happened: the skier simply accidentally covered the chips with his elbows (rfid tags) and “did not get caught” at the last intermediate finish, withdrew the race after the second lap and made a wrong turn and instead of a 25 km circle he drove only 10. It will not be real to understand further: he will collect things and go home, and then he will grumble at the forum all week that he will be disqualified for nothing ...



The outcome of the event is always a record of the results for which the winners are awarded.


Photo of Maria Shalneva from the marathon in Dubna 14-02-2015

Thanks for attention


Thanks to everyone who read to the end. If the article seemed interesting to you, I will definitely write some more, for example, about the specifics and software for organizing city quests, about using technologies in orienteering.

Source: https://habr.com/ru/post/366249/


All Articles