DEVELOPMENT OF MODELS AND MEANS OF THE SERVER PART OF THE SYSTEM FOR PASSENGER TRAFFIC REGISTRATION OF PUBLIC TRANSPORT IN THE " SMART " CITY

Development of modern society, problems with energy sources and tough conditions of competition for markets, require that manufacturers of products develop intelligent systems using modern element base. One of such areas that is developing dynamically is the technology of “smart” city [1], which, on the one hand, enables significant saving of energy and improving the level of management in the city, and, on the other hand, help to improve the level of comfort and quality of services for the consumers. A “smart” city combines aspects of technological infrastructure and “public technologies”. New methods with the usage of smartphones, growth in popularity of online transactions, low cost of equipment and P2P-technologies create prerequisites for the collaboration of municipal authorities and people in the city for better use of resources, data collection and making effective decisions [2]. In the structural aspect, “smart” city is a system of interacting systems. The technology of “smart” city is composed of high-speed optical, sensor, cable and wireless networks [3]. Today, one of the main technologies to organize “smart” cities is the technology of the Internet of things (IoT). At present, IoT can be considered a key trend of world economy of the nearest decade [4]. An important role in the development of technologies for the Internet of things belongs to the intelligent solutions in the area of machine-to-machine communications (M2M). This concept implies the integration of communication equipment with a variety of devices [5]. Regarding the construction of automated control systems, “smart” city can be considered as a combination of several vertical markets, such as transportation [3], medicine, industrial automation, education and energy, security and logistics [6]. All developments in these fields can be applied to build an effective “smart” city. One of the interesting examples of using technologies of machine-to-machine communications M2M is the system for passenger traffic registration of public transport [3]. Such systems are built based on the use of specialized equipment, such as controllers with appropriated sensors for collecting and processing information, positioning systems, etc. Systems for registration of passenger traffic allow control of travel payment, determining transportation load on the routes and optimizing the work of public transport depending on the days of the week [7]. DEVELOPMENT OF MODELS AND MEANS OF THE SERVER PART OF THE SYSTEM FOR PASSENGER TRAFFIC REGISTRATION OF PUBLIC TRANSPORT IN THE "SMART" CITY


Introduction
Development of modern society, problems with energy sources and tough conditions of competition for markets, require that manufacturers of products develop intelligent systems using modern element base.One of such areas that is developing dynamically is the technology of "smart" city [1], which, on the one hand, enables significant saving of energy and improving the level of management in the city, and, on the other hand, help to improve the level of comfort and quality of services for the consumers.
A "smart" city combines aspects of technological infrastructure and "public technologies".New methods with the usage of smartphones, growth in popularity of online transactions, low cost of equipment and P2P-technologies create prerequisites for the collaboration of municipal authorities and people in the city for better use of resources, data collection and making effective decisions [2].
In the structural aspect, "smart" city is a system of interacting systems.The technology of "smart" city is composed of high-speed optical, sensor, cable and wireless networks [3].
Today, one of the main technologies to organize "smart" cities is the technology of the Internet of things (IoT).At present, IoT can be considered a key trend of world economy of the nearest decade [4].An important role in the development of technologies for the Internet of things belongs to the intelligent solutions in the area of machine-to-machine communications (M2M).This concept implies the integration of communication equipment with a variety of devices [5].
Regarding the construction of automated control systems, "smart" city can be considered as a combination of several vertical markets, such as transportation [3], medicine, industrial automation, education and energy, security and logistics [6].All developments in these fields can be applied to build an effective "smart" city.
One of the interesting examples of using technologies of machine-to-machine communications M2M is the system for passenger traffic registration of public transport [3].Such systems are built based on the use of specialized equipment, such as controllers with appropriated sensors for collecting and processing information, positioning systems, etc. Systems for registration of passenger traffic allow control of travel payment, determining transportation load on the routes and optimizing the work of public transport depending on the days of the week [7].
Therefore, design and implementation of the system for passenger traffic registration of public transport (SPTRPT) [3] as part of the "smart" city system is an important task at present.

Literature review and problem statement
The basis of operation of the system for passenger traffic registration of public transport in the "smart" city system is a client -server interaction.This feature implies establishing and implementation of certain requirements that are set to both client and server part of the system to ensure proper and reliable functioning of the registration system of passenger traffic as a whole.
The systems designed for the registration of passenger traffic by the criterion of the side, where the process of calculation actually occurs, can be divided into two types [10].
In the first case [11], data collection and processing occurs at the client side of the system with specific result, a number, sent to the server.The server in this case serves only to store data from clients and to display comprehensible statistics and analytical information for a particular client, or groups of clients.
In the second case [12], only the collection and preliminary processing of incoming data is conducted at the client side.Data are structured and sent to the server in a "raw" form.Then the process of calculation takes place at the server side.Thus, the server side has a larger number of functions and, accordingly, requirements to the reliability and efficiency of its work are more strict.
The proposed system is developed with a focus on the second type, that is, the process of calculation takes place at the server side.
First, at the client side, a video recording of passenger traffic is captured by videocameras placed over the front and rear doors of the vehicle.After that, photo registration of passengers with the right to free travel takes place [13], GPS-coordinates and other system information are defined.All processes occur by the interaction between the controller, based on the single board mini-computer Raspberry Pi [14], and peripheral devices at the client side [15].
The next stages are preliminary processing of data from the periphery, structuring, packages formation and sending the packages to the server (WEB and FTP server) [16] for their storage and further processing.

The purpose and objectives of the study
The purpose of present study is the development of models and tools of the server side of the system for automated registration of passenger traffic of public transport, which is characterized by a wide functionality and low price.
To achieve this purpose, it is necessary to solve the following tasks: -to develop a structure of the server side of the system for passenger traffic registration of public transport, which should be based on module principle; -to build a functioning algorithm and develop specialized software for the server part of SPTRPT, which is based on the use of object-oriented approach; -to develop an information model that will ensure reliable data exhange between a client and the server of the developed system; -to build a technical support for the server part of the system for passenger traffic registration of public transport that provides for a low cost of technical solution.

Structure of the system for passenger traffic registration in the "smart" city
A client-server interaction is the basis of the developed structural scheme of the system for passenger traffic registration of public transport in the "smart" city, which is shown in Fig. 1.A controller that is installed in a vehicle and receives data from sensors and the driver is related to the client part.The server side consists of hardware and software implementation of the server, as well as operators that manage the process of processing data coming in from the controllers (clients).
Data collection and processing in the system for passenger traffic registration of public transport proceed in several stages.
At the first stage, each controller, installed in a unit of public transport vehicle, receives data from the periphery (GPS-module, cameras).At the same stage, controller receives data from the driver.Next, the driver activates the camera by pushing an appropriate button for the registration of passengers with the right for a free travel [17].
The next stage is the transfer by controller of received data to be processed by server.At the server side, all data are structured and stored for their further processing by the system and by operators, if necessary.
The final stage is the data processing with consequent representation of detailed and accurate statistics and analytics on the passenger traffic dynamics in public transport over the appropriate period.In the process of implementation of the system for passenger traffic registration of public transport in the "smart" city, a modular principle is employed that makes it possible to effectively organize the improvement and modification of the designed system.

Information model of the system for passenger traffic registration of public transport of the "smart" city
The designed server part of the system includes a hardware server with software realizations of database server, a server for saving files and the Web server.Processing of data, received from clients, takes place at the server side.Operators deal with incomplete or ambiguous information.
The information model developed aims to describe information processes, options and system properties for passenger traffic registration of public transport of the "smart" city (Fig. 2).
The model is presented in the form of a diagram that shows all basic composition elements of the system, interaction between them and describes data flow and stages of interpretation of them into complete information analytics.

Fig. 2. Structure of data flow in the information model of the system for passenger traffic registration of public transport
In a general case, each controller-client sends data about the event.The structures of data on the event can be divided into two types.In the first case, the fact of opening the front or rear door of the vehicle and pressing a special button for registering beneficiaries can be considered as the event.
Both by the fact of doors opening and by the fact of pressing the button for registering beneficiaries by the driver, a report is formed by the controller that includes a set of specific data.Such data are the following: -specific coordinates of the place where the event took place from a GPS-module; -exact time when the event occurred; -the title of the video (if the door opened) or photo (after camera was activated by a button to register the beneficiaries); -service data (front/rear door, certificates and etc.).
Multimedia data, such as video and photo in particular, belong to the second type, Thus, the data sent from the client to the server, are related to the first type.They arrive in a form of a POST-request to the Web server.Multimedia data coming in for saving at the file server are related to the second type.A simplified diagram of the developed structures of data is shown in Fig. 3.
The reports contain information about the time of the event, its location and the content itself (the information about the event is the video from doors and what exactly, or the photo from the camera of fixing beneficiaries).Reports are generated in a POST request to the Web server, and multimedia files (photos of beneficiaries, video from the doors) are sent to the FTP server.All POST-requests from controllers are stored in the database on the server and the files are converted for processing and are stored in the server's disk space.Processed statistical data are stored as XML-files [18].Fig. 3 Types of structures of data in the system for passenger traffic registration of public transport Therefore, the developed structures of data of two types make it possible to control, maintain and work out effectively parameters of passenger traffic of public transport of the "smart" city.In the process of realization of the information model, list structures of data were used.

Working algorithm of the server part of the system
The data received from the client side and saved on the server are checked for their integrity, accuracy and correctness.When the verification is completed, some data undergo automatic processing, while the data, which is characterized by a kind of ambivalence, are sent for processing by the operator.
A fragment of flowchart of the algorithm for the procedure of processing data from clients at the server part is shown in Fig. 4.
The developed algorithm of the server part of the system for passenger traffic registration of public transport of the "smart" city includes the following steps (stages): 1. Parameters initialization -preparation of all hardware and software tools of the server to receive data from clients (software running, downloading initial data, etc.).
2. Check the availability of input data -software checks the fact of the requests implementation from clients to the server (WEB-server, FTP-server).3. Data save -in the case of getting queries and data from clients, save them to database and disk space of server, otherwise expect requests from clients.
4. Verification of correctness and completeness of dataanalysis of the data received from the clients and evaluation of the possibility of further work with them.For example, if the GPS coordinates are correct, to build a GPS-track to display the route of the vehicle on the map, otherwise skip; to send for processing data with proven reliability only, completeness and correctness.
5. Check a possibility of automatic data processing -if data received from clients meet all the stated requirements, then perform their automated processing, otherwise send to be manually handled by the operator.
6. Data processing -actually processing by the server part of the system the data received from clients in the automatic or manual (if necessary) mode.
7. Representation of results -report and compilation of all statistical and analytical information by each particular client based on the data obtained from him.The basis of software (SW) structure of the server part of the system is the server environment of the Ubuntu operating system [19] and software implementations of the servers (Fig. 5).Programming language of server part of the system is PHP [20].Web-framework is Zend Framework [21].
A model of software organization of server side of the system is shown in Fig. 6.This model includes three hierarchical levels of processing and storing of data from the client side.At the first level, the system receives requests from clients that come through Internet.At the second level, all requests are sorted according to their purpose (POST requests are for the Web server, files are to FTP server).At the third level, the help of tools of PHP programming language, we save and, if necessary, take out the data received from the client side of the system through the Web server.
PHP Hypertext PreProcessor is the script programming language, which is used for execution at the server side.PHP is created for building dynamic and interactive Internet sites.This programming language proved to be very flexible and powerful, so it gained popularity and started to be used in multi-scale projects: ranging from basic blog to large Web applications.The advantages of this language are: -PHP relates to free software that is distributed under a special license (PHP license); -easy to master at each stage; -widely supported by users and developers; -there are essential tools to maintain databases (DB); -a lot of libraries is implemented, as well as extensions of this language; -it offers valid resources for the development of Web sessions, software interface of extensions; -it may be deployed on almost any server; -it is applicable for a large number of hardware and software platforms.
Zend Framework is a Web application framework developed by Zend (USA) (the company, which carries out support and coordination of PHP project,).Zend Framework widens the PHP language while keeping its spirit, its main criterion is simplicity, it used the best techniques of object-oriented programming, a friendly license, and a well-tested code that is quickly executed.It is important that Zend Framework includes a possibility to design well-protected, reliable and modern applications of WEB 2.0 and Web services and widely available API functions from the teams of leaders in this fielde, such as Google, Yahoo!, Amazon, Flickr (USA).
As the Web server, we chose Apache server [22].Apache server is an application of Web server with open-source software developed by the Apache Software Foundation (USA).Server software is freely distributed and licensed with open source code, which means that users can edit the basic code to adjust productivity and contribute to the development of the program.
Apache is cross-platform, and is most often used in the combination with the Linux operating system, which is also distributed with open source code.These two components, combined with MySQL [23], database and PHP script language, form a popular solution for the Web server called LAMP (complex server software).
Main advantages of Apache and LAMP server systems are: -low cost, as well as the license for software is free; -flexible programming through the open source code; -improved security, because Apache was developed for the Unix-like operating systems.
Database server (SQL Server) is presented by the MySQL package.This package is well adapted for use in a Web environment, DMS (database management system).To be processed by operator Place to unprocessed NO Usually, on most hosting platforms, to execute client applications, service providers allocate not a very large amount of resources (computing, disk).That is why it is important to use efficient DMS, which is characterized by high reliability (preferably web-applications and internet sites should work under 24-hour mode without days off).
In connection with the enumerated reasons, MySQL turned to be a rock-hard standard in the area of DMS for Web, and now it is also developing capabilities for use in a variety of mission-critical business applications.
The advantages of MySQL are the following: -multiflow and the ability to support multiple concurrent requests; -possibility to optimize connections by adding much data over a single cycle; -support of records with fixed or variable length; -ODBC driver; -the use of a flexible system and privileges; -flexible support, number of formats and time tags; -fast work, easy scalability; -possible interface with C and Perl, PHP languages; -compatibility with ANSI SQL; -good support of hosting services by providers; -fast support of transactions due to InnoDB mechanism.

Fig. 5. Structural model of the server software
Pure-FTPd Server is used as a FTP server [24].Pure-FT-Pd is a free FTP server for the UNIX family of operating systems, distributed by BSD license.Its main focus is security and simplicity of tuning.
It was compiled from the source code for Linux, OpenBSD, NetBSD, DragonFly BSD, FreeBSD, Solaris, Tru64, Darwin, IRIX and HP-UX for Android.A distinctive feature is that the server does not read the settings directly from the configuration files, and accepts them only from the command line.But a possibility of using configuration files exists.
Therefore, developed SW of the server part of the system for passenger traffic registration of public transport of the «smart» city provides desired functionality and is free.

Development of hardware provision of the server part of the system
Analysis of technical task, as well as the requirements to the software of the server part of the system for passenger traffic registration of public transport of the "smart" city, allowed us to draw conclusions about the requirements to hardware provision of the server part of the system.An important condition is maintaining the possibility of continuous scaling, increasing technical capabilities of the equipment for further development of the project.
The main server parameters and, accordingly, its selection criteria are: 1) CPU (central processing unit), based on which it operates; 2) TYPE and volume of RAM (random access memory); 3) volume of PAM (permanent access memory).Thus, Intel Pentium G3260 (USA) is selected as the central processor for the server operation [25].The main technical parameters are given in Table 1.Random access memory is represented by the Kingston DDR3-1600 8 GB (USA) (two microchips per 4 GB) [26].Device settings are listed in Table 2. Volume of permanent access memory is 500 GB.All the main characteristics of the hardware server SPTRPT of the "smart" city are summarized in Table 3.
Thus, the developed technical provision of the server part of SPTRPT provides a low cost of technical solution, provides a possibility of continuos scaling and increasing equipment capacity in the process of the system development.

Discussion of results: examples of application and prospects for the system development
The developed tools of the system allow mapping a route of the vehicle in real time, which, as an example, is shown in Fig. 7.At any time, it is possible to receive information about location of the selected vehicle.However, the constructed system makes it possible to receive a report by specific route, where the information on the date, start and end time of the motion, driver's name, etc. is represented (Fig. 8).

Fig. 7. Example of representation of the route of vehicle motion
An example of the menu with statistics of the route is shown in Fig. 9. Accordingly, the reports generated using a software part of the system provide a full picture of passenger traffic parameters of each of the routes and their total indicators.The goven generated reports with the use of the developed system display a full picture of the passenger traffic route of the vehicle.The developed registration system of passenger traffic of public transport was tested at the ATP "Mens-Auto" and "Etalon" in the city of Ternopil (Ukraine).
Regarding further development of the system, it might include the optimization of its work by two major directions -software and hardware.
It is possible to change the PHP programming language to the Python language, which is better organized syntactically and structurally [27].This in its turn will lead to applying one of the most popular and effective Python Web-frameworks.For example, such frameworks as Django, Flask [28,29], etc. might be used.Collection of data on the work of the server part of the system and their detailed analysis is an important stage in the operation of the developed system.Such data may point to certain shortcomings in the process of increasing the number of clients.This in its turn may lead to debating the question on changing the Web-server.The use an alternative Web server, for example, Ngnix could be a solution to this problem [30].
Regarding development of hardware provision for SPTRPT of the "smart" city, it implies scaling of hardware capacity.Such scaling can be achieved by increasing the random access memory and permanent access memory.There is also a possibility of a more serious optimization in the form of using the hardware, which is based on the work of the more advanced central processor.

Conclusions
1. We developed a structure of the server part of the system for passenger traffic registration of city public transport.This structure is based on a modular principle, which provides a simple and fast replacement of the particular module in the case of its failure.As a result, increased reliability of the system as a whole is achieved, as well as the smooth scaling and increase of the developed system in the future.
2. The algorithm of functioning of the server part of SPTRPT is built.Its characteristic features are the use of a systemic approach to the implementation of incoming data processing and automation of work of the human-machine system.Thanks to these features, the capability of complete verification of accuracy of processed incoming data becomes possible, as well as clear and understandable representation of results of the calculation of passenger traffic parameters.The application of automated processing of incoming data made it possible to improve efficiency of the system by covering up the set of cases of incompleteness and/or damage of incoming data.We developed specialized software of the server part of the system for passenger traffic registration of public transport.The SW implements all the above features of the device and is based on the use of modern approaches to object-oriented programming, including the use of Web-frameworks.
3. We developed information software that enables secure and reliable data exchange between a client and a server of the system.Informational support includes a range of modern technologies and protocols.These technologies include video data collection using IP cameras, data transfer with the help of 3G, storing them in a relational DB and on disk space of FTP server, data processing using list structures of data and saving statistics in the form of XML-files.Accordingly, the developed information software is based on the application of modern protocols for the collection, transmission, processing and storage of data (TCP/IP, MySQL Client/Server Protocol, HTTP, FTP, etc.).Thus, the employed technologies and protocols allow implementing effectively the transfer and processing of data and meet all the stated system requirements.
4. Technical support of the server part for SPTRPT is developed.Using modern approaches to SW development and optimization of DB, we managed to reduce the load on CPU and RAM of the server.Due to this, it became possible to carry out the selection of optimal, in terms of price-quality, hardware server.Emphasis is also placed on the modularity of hardware of the server part for easy subsequent scaling.Accordingly, the technical support developed provides low cost of technical solution and is based on the use of low-cost elements that ensure reliable operation of the system in full.

Fig. 1 .
Fig. 1.Structure of the system for passenger traffic registration in the "smart" city

Fig. 4 .
Fig. 4. Flowchart of working algorithm of the server

Fig. 6 .
Fig. 6.Multilevel model of software organization of the server part of the system

Fig. 8 .
Fig. 8. Example of the menu of SPTRPT software of the "smart" city with routes parameters

Table 1
Technical specifications of Intel Pentium G3260 processor

Table 3
Technical specifications of the server