Application of WEB Service Composition in Intelligent Distribution

: In 2014, Premier Keqiang Li chaired a State Council executive meeting, discussed and adopted the "long-term development of the logistics industry planning", which proposed that by 2020 there will essencially establish modern logistics service system, enhancing logistics industry standards, information, intelligence, intensive level, improving the overall economic efficiency and benefit [1]. A series of modern information technologies like the Internet of things, cloud computing, big data, smart logistics, Internet plus, these promote Chinese intelligent logistics transformation [2]. The development of modern society can not work without information technology


Introduction
To achieve a proper deployment of resources in supply chain, the information sharing and data exchanging among enterprises is of great importance. But every enterprise has its own information system, which may be different even isomerize. As a result, information sharing becomes a big problem. Therefore, to correctly construct an intelligent distribution system, we choose the service-oriented architecture, which well adapts to distributed WEB service as a component model framework. By well-defined interfaces and contracts, it can link the required WEB services, establish an information exchanging, publishing and sharing system, and further realize the integration and sharing of data resource. Finally, through the organic integration of information in manufacture, warehousing and marketing, it makes delicacy management, precision marketing and cooperation among companies come into being.

Overview of WEB Service Composition
WEB service composition refers to the combination of several WEB services of single function based on business needs, thus providing a new and more powerful WEB service. As the granularity of modules is concerned, WEB service is regarded as a packaging of many small modules which can be used for external call as an integration one.
Logically, the WEB service composition is a WEB service call sequence that can meeting the different needs of users [3]. In the literature [4][5][6], the method of WEB service combination can be divided into the group driven by business process and the integration of task decomposition. In [7][8], the method of WEB service composition is divided into three kinds of semantic WEB service composition which respectively are based on workflow, based on artificial intelligence and based on other methods. Further, the WEB service composition based on workflow can be divided into service by business template, service by workflow ontology and so on. The service composition template is set to describe the business process, and generate the I/O, and QoS information of the composition program control services.
In the literature [9], it pointed out that the combination mode based on workflow decomposes business processes into some ordered functional nodes, using workflow modeling language to define combinati on frame, using a specific web service to fill function point, and then the executable combination scheme is obtained. BPEL4WS (Process Execution Business Language for Web Services) [10] has become the industry standard based on the workflow static WEB service composition, but it can not respond to changed fastly business activities [11][12]. Literature [13][14][15][16] mentioned that TSSuite of IBM, eFlow of HP company, the service composition based on the scene of Tokyo University's NTT laboratory and so on are the cases of the manual combination of services, and it isn't suitable for a large number of WEB services combination. Literature [17] holds the view that using planning algorithm of artificial intelligence to combine with. After giving initial and target state, it seek a path from the initial state to the goal state in the service set so as to complete the task of web service composition.

Overview of Petri Model
The concept of Petri net is put forward by the German scientist Carl Adam Petri in 1962. It is a structured description tool, which can describe the process's sequence, concurrent, synchronous and asynchronous in system. It also can be used to check deadlock, conflict and other situations which we do not want to happen. It has been widely used in operating system, software engineering, network protocol, formal semantics and so on. Petri net with some advantages such as a intuitive graphical expression, a formal semantic definition, supported by mathematical graph theory, is a modeling tool which suits in the way of process to describe and analyze system, and it is widely used in reengineering and optimization of business process. W. M. P. van der ALast [18][19] and others has done a lot of research in the Petri network modeling and formal analysis. Literature [20] defines the behavior of Web services as Petri nets. Iiterature [21] transforms BPEL4WS into Petri net and analyzes the feasibility of the WEB service composition. The literature [22] points out that the Petri net uses the Horn rule set to model and analyzes the Web service composition.
Petri net is composed of the place, token, transition and arc. A basic Petri net as shown in figure 1.
As shown as figure 1, black circles represent places, the black dots represent tokens, directed arrow represent arcs, rectangle frames represent transitions. Petri net place is usually expressed in resources, conditions, states, etc. The token indicates the number of resources. Arc indicates the connection between the place and the transition (consumption or generation). Transition is usually expressed in conversion or operation after meeting a certain condition, etc. Petri net structure is fixed while the token distribution is changing. The arc can only be connected to the place and the transition in the Petri net, which is not allowed to connect transition to transition or place to place. According to the direction of the arc, the input and output place can be judged. When the transition get tokens from the input place, after met certain conditions, then it consumes tokens which came from the input place, and afterwards put produced new tokens in corresponding output place, and the process calls ignition for transition. Petri net state through the tokens' distribution in place to describe, and occurrence of transition enable Petri net from the original state convert to new state. Color Petri net make data add to the token, this data is called "token color". Which differ from the basic Petri net is that it add a arc expressions with different input and output parameters.

Division and Selection of Business Logic
Intelligent distribution system links supply chain's production enterprises, storage centers, transport units and store sales enterprises together. As shown in figure 2, it is a subsystems included in the intelligent distribution system. Business division is a key step in the WEB service composition. Web service are not mostly customized services, which is the service that service provider according to their own resources released. Users have some disagreements with service providers about their demand, which leads a business to need multiple services to participate in. So the division of business is determinating the participating service functions, scope and so on. Then it divides a task into several tasks with different levels and granularity. The atomic service has a level of packaging from the bottom to the top, and in the end it is encapsulated into one or more services. After knowing the WEB service composition' hierarchy construction, when the business changed it can be replaced part or all of the services according to the situation, quickly responding to new business.
The next step is to find the corresponding WEB services to fill the business logic function unit. After each web service has a clear functional description and semantics, it's not difficult to find the corresponding service, but may appear multiple Web services which provided the same functionality, so we need to appropriate screening methods to select the most suitable web service from these similar services.
The selection of WEB services is mainly restricted by the non-functional properties of WEB services. If the area is set to local, then the WEB service with the same function provided by nonlocal area will be filtered out. In non-functional attributes, some of the indicators are described by text, and some are expressed by numerical value, so the filter services will be used in different ways. The non-functional attributes of the text description, such as the location, the vehicle's type and so on are filtered through the logical judgment sentence. The numerical attributes or text attributes which can be transformed into the numerical value can adopt the algorithm k-Nearest Neighbour (KNN), selecting k web services for users to choose from these web services with the same functions and services' non-functional attributes are closest to user' requirements. It will greatly reduce the range of choice. K-Nearest Neighbor algorithm is simple and efficient, and it is classified according to the distance between different feature values. Calculate the distance between the point and the origin of the known candidate service data set, and then sort the order according to the distance from the origin, selecting the nearest K points. The non-functional attributes raiesd by users are the target origin, then calculating the distance between different service's non functional attribute values and the origin, if the distance is close to the origin, then means it closing to the user's non-functional attributes. About the distance calculation mainly have Euclidean Distance, Minkowski Distance, Manhattan Distance, Mahalanobis Distance and so on. Calculating the distance is by the feature vector of non-functional attributes rather than a value, and it is a distance between point and origin of n-dimensional space. Therefore, the calculation method of above is the reaction of a large number of characteristic values and not a value. But the selected K candidate WEB services are very close to the needs of users. In addition to the basic functions of WEB services, there are services costs, service run time, reliability, security and other factors that affect the choice of WEB services. So the choice of similarity is only for the user to provide a range of choices, and provide alternative services when there occurs unpredictable situation.

Construction of WEB Service Composition Model
After the clear division of the business function point, filling directly if there is a specific WEB service, setting up an abstract interface if there is no ready-made WEB service, it will be filled with multiple WEB services composition. Before specificly composing of WEB services, we need to establish a portfolio model to check whether the business process can be carried out smoothly, and whether there is deadlock and other issues. Among the numerous modeling methods, this paper chooses the Petri net as the modeling tool. As a kind of formal analysis and description tool, Petri net has many kinds of flow control structure. For example, the order structure, the structure of the branch, the choice of structure, circular structure, etc. With these control flow structure, it can be convenient to check the business distance wheather synchronous or exclusion and other issues, as well as whether there are deadlock. Have a more intuitive description of the business process. Find out the unreasonable place in the design through modeling. As shown in figure 3. The elements in a number of connecting arc points need to be considered, and there may be hidden dangers because of the unreasonable design. This structure is common, such as reset, reimplementation and other process needing to repeated executed. Transition t3 changed and arrived p2, then the t2 and t4 may be executed, then there will be unexpected situation. Therefore, through the model checking can find potential risks to improve the quality of service composition.
A goods distribution process has a number of cooperative enterprises to participate in, in which the information sharing between the various enterprises is completed through the WEB service, so a cargo distribution process is also completed by a number of WEB services. We can set up petri net model as shown in figure 4. Regarding transition as a web service, output library resources as input parameters, meeting conditions to stimulate the corresponding transition means the corresponding WEB service being executed successly, and generates the corresponding output token, which is active WEB services output, as input parameters for next transition. Check the business process whether can be executed smoothly. After delivery of the order, calling the payment service, the payment process needs to call the relevant bank gateway interface services. After successfully paid, call to the logistics company which provide corresponding service, othervise we will need to repay. The logistics company call to freight service provided by railway to arrange their own delivery plan. Call on the delivery van service who by road to find the right vehicle. Goods were sent to the designated cities then call to a local courier service, and arrange door-to-door delivery plan. If people satisfied with the goods then end receipt process, instead calling replacement services. A delivery process participating parties through a number of WEB services to work together and complete a business process. The orderly execution of multiple WEB services can be combined into a package that is very rich in WEB services.

Design of Intelligent Distribution System
Intelligent distribution system takes the logistics service as the main clue, and shares the information of the cooperative enterprise on the supply chain. Through the high quality of distribution services to promote the efficient operation of production of enterprises, warehousing centers and the store, through effective communication and cooperation between each other, reducing the cost of the supply chain and creating a profit at the same time. As a result, the information system is mainly connected with other external information, requiring a loose coupling structure and a fully adapted interface layer to apply to different systems and data formats.
Because the system mainly uses the information provided by the external enterprise information system, then realizing the information sharing. Here adopt hierarchical design, as shown in figure 5. The underlying resource service layer, is the WEB services issued by various enterprises. Set network communication protocol in there through the communication layer, so that the service can be accessed smoothly in the network. Service registration layer, is mainly for the WEB services to repackage and increase the semantic information. Ontology base is the necessary foundation of semantics, registered and published after adding semantics. Because the format of the data provided by each system is not uniform, a suitable interface layer is needed to convert and translate the data. The business layer is used for the identification and screening services, as well as through the establishment of a business model to verify the feasibility of the WEB service composition scheme, in which expert system is the key to the computer automatic synthesis into WEB services. The neural network is applied to the knowledge base of traditional expert system, so that the expert system has the ability to learn and adapt to the changes. Business process flexibility is modifiing combinational logic aimed at computer, to reduce the coupling between modules and be in line with the business process.
Processed data is visited by application layer's program through the adapter layer. Neural network expert system is the key module of WEB service composition, and the business rule and neural network are all in this part. Associate the event database with the neural network knowledge base by inference engine. It determines the reasoning by means of a large number of knowledge provided by the field experts, simulating human experts to solve the problem. The neural network is a method of knowledge representation, changing the strips of rules into the network weights and threshold, making the knowledge base having the ability to learn and update. Using two kinds of intelligent technologies including neural network and expert system to make up for the shortcomings of a single expert system. WEB service based on the neural network expert system's inference rules to compose, so that the Web service composition also has the ability to dynamically adjust, and can adapt to more business environment. Firstly submit the issue and then retrieve the knowledge base to see weather there have knowledge rules relevant to submitted issues. If there is no matched rule, return to the user to submit again. If there have, then comparing rules' preceding paragraph, by searching corresponding preceding rules database to found out inference rules which meet the conditions, reasoning corresponding consequent results. After solved the problem and then give the corresponding consequent results to complete the task. Before use the neural network should make sample training, and adjust the network structure neuron's number, weights and threshold. The neural network store the experience obtained from the training data in the entire network. Training is the process of continuous feedback and adjustment, when the output indicators meet the requirements then use the actual data to test the effectiveness of learning, seeing whether the accuracy rate is in the desired range or not.
Facade mode makes the internal and external communication of the subsystem must pass through the object interface, without which can not access the contents of the subsystem. The interface can reduce the coupling of the system, and can carry out a constrained access subsystem. Because the distribution system need access a lot of system modules, it makes use of the model to reduce the inter system's interdependence and improve security.
By constructing order sequence, determine the atomic WEB services composition's sequences of steps. The order is stored in ArrayList. One case is that each atomic WEB service is executed in corresponding order. The output of the previous WEB service is used as the input of next WEB service, and the whole sequence is executed to obtain a result. All participating WEB services are encapsulated into a WEB service. There is a tree structure, the order of the building from the bottom of the leaf node to start, gradually rised, and ultimately build a root node. The builder pattern can better control the assembly process sequence, and the method of setSequence allows customers themselves setting an execution order. Director class command the order of each event.
The strategy pattern defines a series of algorithms that perform similar work, but they are implemented differently. Due to the transportation process is similar, and use different vehicles, loading different items, needing different time, different in the way and need different business models. There are different payment methods in payment, but the payment process is similar. In the WEB service composition process can facilitate the formation of different strategies, aggregation working in with the context.
Response event class diagram defines a one to multi dependency relationship, so multiple observers monitor a subject object, when the subject object changes, informing all observers, making observer have corresponding reaction. When a number of WEB services need to be performed in combination, they are the observers, observing whether an event occurs. If it happens, they will be notified and the next step is to be made.

Summary
In this article, the intelligent distribution system is designed, and the technology of WEB service is chosen as the bridge of information sharing. Designed a system architecture aimed at business needs and supply chain environment, giving full consideration to the characteristics of distributed architecture, and the function of most business is provided by WEB service according to the specific process of implementation, and these WEB service are provided by other units. Theoretical methods of web service composition were verified by the instance. Through a concrete system check the WEB service composition based on neural network weather can play a role in the actual production, and design some modules of distributed systems.