DEVELOPMENT OF SPECIALIZED SERVICES FOR PREDICTING THE BUSINESS ACTIVITY INDICATORS BASED ON MICRO-SERVICE ARCHITECTURE

Effectiveness of modern business in the commercial sector is closely connected with forecasting various indicators, such as sales and demand for goods. Without confidence in what future sales will be, it is impossible to effectively manage resources and cash flows, or create a plan to improve performance. In addition, rapidly changing business conditions make businesses face the need to implement innovative means to increase their competitiveness. One of these means is the introduction of effective models for the prediction of arbitrary indicators of business processes. This is a challenging work because so many different factors may affect business processes. They include economic decline, staff turnover, changing trends and fashions, increased competition and other factors. The purpose of forecasting is to provide information that may be used to make substantiated business decisions, where historical data are commonly used to predict short-term or long-term indicators. Today, there are many methods of prediction, combination of which may enhance the quality of a forecast, but algorithms of combining these methods are still far from perfect. One of the promising directions is creation of ensembles of forecasting models, which are a combination of known methods or models [1]. In addition, active development of approaches to building scalable information systems creates ground for development of effective and unified solutions for inter-service interaction [2]. In this regard, creation of a unified decision regarding forecasting services as a part of the infrastructural component of information systems of an enterprise is considered relevant and appropriate.


Introduction
Effectiveness of modern business in the commercial sector is closely connected with forecasting various indicators, such as sales and demand for goods.Without confidence in what future sales will be, it is impossible to effectively manage resources and cash flows, or create a plan to improve performance.In addition, rapidly changing business conditions make businesses face the need to implement innovative means to increase their competitiveness.One of these means is the introduction of effective models for the prediction of arbitrary indicators of business processes.This is a challenging work because so many different factors may affect business processes.They include economic decline, staff turnover, changing trends and fashions, increased competition and other factors.
The purpose of forecasting is to provide information that may be used to make substantiated business decisions, where historical data are commonly used to predict short-term or long-term indicators.Today, there are many methods of prediction, combination of which may enhance the quality of a forecast, but algorithms of combining these methods are still far from perfect.One of the promising directions is creation of ensembles of forecasting models, which are a combination of known methods or models [1].
In addition, active development of approaches to building scalable information systems creates ground for development of effective and unified solutions for inter-service interaction [2].In this regard, creation of a unified decision regarding forecasting services as a part of the infrastructural component of information systems of an enterprise is considered relevant and appropriate.

Literature review and problem statement
The need for constant business development and enhancement of processes efficiency provides grounds for the creation of a scalable information infrastructure of a company.A specific feature of this infrastructure is a capacity of processing large data arrays that are constantly increasing and the possibility of a dynamic expansion of its functionality depending on business needs [3].
Today, Service-Oriented Architecture (SOA), Service Component Architecture (SCA) and micro-service architecture are used as a basis for information infrastructures [4].

Предложена математическая модель специализированных сервисов прогнозирования произвольных показателей деятельности предприятия, как части микросервисной архитектуры системы предприятия. Эта модель основана на нейронной сети с встроенной моделью скользящего среднего и обеспечивает унифицированный подход к обеспечению взаимодействия между составляющими сервисами. Такой подход позволяет изменять, добавлять, удалять сервисы прогнозирования без перенастройки информационной среды предприятия
Ключевые слова: информационные системы, модели прогнозирования, микросервисная архитектура, нейронные сети, распределенные объекты UDC 519.7:007.52DOI: 10.15587/1729-4061.2017.98991SOA is one of the most powerful architectural software templates, within which a modular approach to software development is used.At the heart of SOA lies the principle of using distributed, weakly related, changeable components with standardized interfaces for interaction by standardized protocols.Lately, the term SOA closely intersects with the concept of "web-services", which creates preconditions for using SOA and web-services as synonymous in some respects.Indeed, web-services in accordance with the principles of SOA are based on open standards such as XML (Extensible Markup Language) and may be applied to all distributed information systems and technologies that are used by businesses [5].On the other hand, the SCA is more perfect architecture based on the SOA.The SCA adds to the SOA the capabilities of effective management of building blocks of services of varying complexity and provides the infrastructure for unified data exchange via the Service Data Object.Taking into account the distributiveness of an enterprise infrastructure, the SOA/SCA provide obvious advantages over the monolithic application architecture, but at the same time, like monolithic ones, the SOA/SCA are unprotected from the human factor [6].In this respect, using micro-services as architecture demonstrates more favorable opportunities to reduce dependence on the software developers.The thing is that the information system based on the micro-service architecture is constructed as a set of smaller services that are built with consideration of business needs and are deployed independently, using a fully automated environment.This approach allows us to increase consistency of a system and reduces its connectivity.This makes it possible to add and modify the functionality of a system at any time and reduces dependence on a particular specialist-developer of a service, which for some reason can stop service development or support [6].
Thus, micro-service architecture is a favorable environment for development of the means of automation of business processes, including forecasting processes.
Forecasting at enterprises is one of the main management functions, along with analysis, organization, planning, control, etc. [7].In general, importance of forecasting implies revealing hidden relationships of phenomena of objective reality and identifying potential options for development of the studied system [8].As a result, forecasting contributes to making effective management decisions [1].
Today, many software implementations of different models and methods of forecasting in popular programming languages such as Python and R have been studied and created [9].Let us note that a prediction construction is based on the construction of a time series model and calculation of the required value using this model.
The simplest approach to forecast construction is the use of linear models, a particular case of which is a model of Autoregressive Integrated Moving Average, ARIMA.Usually, the use of ARIMA is associated with serious difficulties in selection of parameters of the models [10,11].
The use of predictors' ensembles is considered to be a more advanced approach.Thus, by using the AdaBoost method, it is possible to construct predictors' ensembles, the errors of which are minimally correlated [12].In addition, this method as a basic forecasting model enables us to use a decision tree.
On the other hand, the neural network approach to forecasting [13] allows us to approximate almost any non-linear dependence, hidden in input data.In addition, neural networks as forecasting models established themselves as sufficiently flexible and fast tools for an analysis of historical data [11].
At the same time, forecasting various aspects of business activity may require the use of different forecasting models.These models may not always be defined at the stage of design and development of information system of an enterprise, so it is considered appropriate to develop a mechanism to extend functionality of the information system.In particular, standardized tools and formal basis for dynamic embedding of required forecasting models as services in micro-service architecture of the information system of an enterprise are developed.
The choice of a particular direction of research into certain aspects of activity of an enterprise determines the specialization of forecasting, which with regard to the selection of the required forecasting model needs unification of the process of adding new models to the service.
Thus, a specialized forecasting service will be defined as one of the services in the micro-service architecture of the information system of a company, which provides a possibility of dynamic, that is, in the course of its functioning, replacement or addition of forecasting models without changing the overall algorithm of the service operation.

The aim and tasks of research
The aim of present research is to increase effectiveness of forecasting arbitrary indicators of enterprise activity through developing the flexible forecasting means with the possibilities of dynamic replacement or addition of forecasting models without changing the overall algorithm of operation of these means.
To achieve the set goal, the following tasks were to be solved: -development of a mathematical model of specialized services for forecasting arbitrary indicators of the company's activity; -development of forecasting model as a part of the service of forecasting of an enterprise IS based on neural network with an integrated model of moving average; -development of the learning algorithm of a forecasting model with an integrated model of moving average based on reverse error spread; -consideration of practical aspects of implementation of a special forecasting service and conducting experimental research.

Mathematical model of specialized forecasting services of information system of an enterprise
Let the information infrastructure of an enterprise be a totality of services, united only business logic [14].Then, in general view, an information system of enterprise IS will be presented by a mathematical model in the form of the following tuple: where S are the services that define a logical structure and semantics of software implementation of the information system of an enterprise, provide means of solving specific business problems within the information infrastructure of an enterprise, B are the methods that implement functionality of services.We will formalize the definition of service S as a means of solving business problems of a company.In general view, the service may be represented as a tuple of totality of models M, methods F S and procedures MF for provision of both inter-model interaction and interaction with methods.Thus, the service will be presented using the following expression: Taking into account the fact that methods F S are a part of business logic of an application of the information system, we will define F S as a subset of methods B ( S B B ⊆ ).Let us present specialization of service s as specification of a business task, solved by the service, using the definition and specification of models, methods and procedures of interactions.Given that the aim of the work is the creation of forecasting services, the mathematical model of a similar service S PR will be defined using the following expression: where F PR are the forecasting models; M PR are the methods of data processing; MF PR are the procedures of provision of interaction of F PR and M PR .
Consider the components of model S PR from a mathematical point of view.
Let M PR , MF PR be the basic components of the specialized prediction service S PR that implement unified Application Programming Interface (API), then the problem of prediction PR MF Ŷ Y   → will be seen as a process of identifying predictive values Ŷ based on historical data Y by performing procedures MF PR .In this context, the problem of prediction is defined as a process of identification, which consists of two stages.At the first stage, we will develop the structure of model F, i. e. determine its composition and method of connection of separate parts of the model.Taking into account the need for unification of interaction of processes of components of specialized prediction service, when choosing the structure of the model, we will come from the following requirements: -a model should be easy for setting the parameters; -a model should consider trends without the need of their removal.
At the second stage, we will define the optimal values of the model parameters based on criterion Q.This criterion will be presented as average sum of the squares of differences between the values of actual input data and values, generated by the prediction model and corresponding to the same measurement step: Next, we will define restrictions for changing the values of parameters of functions and weight coefficients of individual functions that are included into the prediction model: where i , α , i β are the boundary values of parameters.
Thus, the prediction model F in a general form will be presented as: where is the trend of time series; i f (t) is the separate component of the prediction model, which contributes to approximation of law, hidden in time series.
To calculate the optimal values of parameters of each constituent function f i (x) and weight coefficients w 1 , w 2 ,…, w n with restrictions (5), we will use the gradient method.
Taking into account the above, we will base the prediction model of the specialized service on neural network of the "Perceptron" class with one hidden layer and non-linear transfer function of neurons.Such a network is able to approximate almost any non-linear dependence, hidden in the input data [11].
As a second component of the prediction model, we will use the moving average model (MAM), which will be embedded into the neural network (NN).The outputs of neurons of hidden layer of the MM and the model will be connected to the output neuron with a linear transfer function.In this context, the output neuron will be used for determining the weight coefficients of linear combination of outputs of two models.
Then prediction model F as a part of specialized service (3) considering that PR F F , ⊆ may be represented as follows: where f j is the misaligned sigmoid function of neurons of the hidden layer of form Usually, to solve the prediction problems, the NN of direct distribution is chosen in most cases [10,11], where the input layer of NN contains some number of receptors according to the size of the "window", that is the number of values of the previous elements of the time series.As the number of neurons of the hidden layer is determined experimentally, in the hidden layer of the NN, we will define a special neuron that will perform the function of a generator of sliding displacement.This neuron will calculate the moving average of the time window.
The structure of model F will be presented in Fig. 1.
Taking into consideration the approaches to prediction [11], functionality of the specialized prediction service will be defined as totality of methods that provide the prediction process based on model F PR , which is determined by formula (4).Given the fact that in the work we specified model F (7), which is a subset of prediction models of ser-vice F PR , the method of learning prediction model M 1 will be considered as one of the methods M PR of service F PR .

Fig. 1. Structure of prediction model based on neural network with embedded model of moving average
Model training will be carried out using the method of reverse error spread with regard to the features of the committеd structure.
Further, we will define the algorithm of the method of training PR 1 M M ⊆ of prediction model F PR as a totality of the following steps for each instance of training sample: Step 1 Downloading the elements of time series into the NN window (vector of values of the time series).
Step 2. Calculation of input value of the MA model and outputs of neurons of the hidden layer.
Step 3. Calculation of the model output (output neuron).
Step 4. Calculation of error of model output.
Step 5.If an output error does not exceed the value of previously specified constant Е 0 , move on to step 9, otherwise move on to step 6.
Step 6. Calculation of errors of neurons of hidden layer and "error" of model Е З .
Step 7. Calculation of new values of weight coefficients between neurons of hidden layer, the MA model and the output neuron.
Step 8. Calculation of new values of weight coefficients between neurons of hidden layer and receptors of the time window.Move on to step 2.
Step 9.If the current example is the last, complete training, otherwise move on to step 1.
These nine steps define the training algorithm of the proposed prediction model for setting the model for the input time series.
Thus, a mathematical model of the specialized prediction service of the information system of a company will be presented by formulas ( 2)- (7).
Next, we will consider peculiarities of implementing in practice the software realization of the model, proposed in this work.

Practical aspects of prediction of arbitrary indicators of business activity
Let us examine the diagnostic operation mode of specialized service for prediction of arbitrary indicators of business activity with the help of the user interface of client application (Fig. 2).
Under this mode, a user connects to the service for the purpose of checking appropriateness of using a certain prediction model for a specific type of assigned data.In addition, a user has opportunities to evaluate visually the graphs of output and the predicted values and check appropriateness of using the prediction model based on the prediction error.
The specialized prediction service is based on an example of architecture of applications for large data processing [15].The basic functionality was created using the Shiny framework and the programming language for statistical data processing R.
The interface of the client application includes switch mode keys -"Reset", "Test" and "Train".A user specifies the width of the window of previous values of the time series of the number of neurons in the hidden layer of the neural network, and then, for training, resets them by pressing the "Reset" key.In this case, the values of all parameters of the model become random.Next, the user downloads the file with examples for model training by clicking "Browse" and selection of the appropriate file.Then, by clicking the "Train" key, the model is training and the model's parameters are adjusted, so that the model detects a pattern, hidden in the time series, and becomes able to predict the following values of a series by its previous values.After training of the model, the model is tested and a prediction is constructed by pressing the "Test" key.When testing, the section of the time series is chosen, which is not used during training and a prediction is constructed.The bar of graph representation in Fig. 2 displays graphs of actual values of the series (green line) and predicted values (red line), and also outputs the value of the mean square error.Thus, visually and based on mean square error of prediction, a user can check the performance of a specialized prediction service.

Fig. 2. Interface of the client application to a specialized forecasting service
We will note that the initial application setting is performed by modifying the config.xmlfile.In this file, the model to apply, parameters of the model, the size of the training sample, etc. are set.

Results of examining the prediction model of a specialized prediction service
For the study, the following procedure of experiments was chosen.
1. Formation of training and testing samples of the output of time series, by which the prediction will be made.
2. Selection of parameters of settings the neural network (the width of the window of the previous values of the time series and the number of neurons of hidden layer).
3. Running one iteration of training throughout the training sample.
4. Running the client application in diagnostic mode for testing and fixing average mean error, calculated by formula: where J is the number of neurons of the output layer; Consider the time series, which includes the trend and reflects intensity of the traffic.Thus, Fig. 3 displays the forecast based on normal neural network, where there is a significant error in prediction.
The proposed model assumes a much smaller prediction error (Fig. 4).
Summarizing results of the experiments, we calculated the average square error of the classical model of neural network and the proposed prediction model (Fig. 5).Fig. 5 shows that the proposed combined prediction model makes much less errors in a time series with the trend.

Discussion of results of examining a prediction model of a specialized prediction service
When forecasting arbitrary indicators of business activity in the commercial sector, it is not always possible to achieve sufficient quality of time series processing.In particular this applies to technical and economic indicators.This is due to existence in the studied time series section of a certain number of interventions (unforeseen events).Usually, the effect of a single unforeseen event does not lead to global changes of statistical characteristics of a random process.However, the sample of time series in this case turns out to be unsuitable for obtaining acceptable statistical assessment using classical methods.At the same time, existence of the general trend and its saving throughout all training sample allowed improvement of the quality of predictive assessment in case of interventions of time series due to the embedded model of moving average.
On the other hand, if some indicators of business activity will not be predicted with a satisfactory prediction size of the time window;  is the linear transfer function of neuron at the output of the model;  are the weight coefficients of the output neuron; w are the weight coefficients of neurons of the hidden layer.

5 .
d ij is the error of one of the neurons of the output layer; М is the number of examples in the training sample.Repetition of points 3 and 4 until a full network error in the training sample reaches a stable value, recorded along with values of parameters of the model.