Keywords

1 Introduction

Traceability of agricultural product refers to retaining their traceability in circulation and will provide with relevant information on traceability for the agencies or consumers in case of need. When agricultural products are found hazardous, it can be recalled from the market in a timely manner to avoid entering the market. This is achieved by information means such as bar code (multi-dimensional), electronic tags, and identification.

Hainan is China’s largest tropical fruit producing area and winter-season vegetable base. National tropical modern agricultural base is an important development support of international tourism island, which will make Hainan become the country’s winter vegetable base, tropical fruit base, southern seed breeding base, fisheries export base, and natural rubber base. Currently, the world increasingly pays high degree of attention to food quality and safety. The USA, EU, and other developed countries and regions have enacted strict food market access standards. Many parts of the country are constantly introduced to a number of local mandatory standards to limit the polluted agricultural products entering the market. Meanwhile, controllable quality and safety traceability will be implemented to improve the market competitiveness for sales of agricultural products.

Services resource represents a set of well-defined and interoperable Web software component. The basic physical unit will be understood as Web service, namely autonomous, open, self-describing, and implementation-independent networked component [1]. Services resources provisioning means the production style, the provisioning methods, and sources structure of services resource.

The importance of services resources provisioning is mainly reflected as follows: (1) Services resource that is adequate to meet the personalized needs is material basis of services aggregation and service-based software production and (2) effective services resource provisioning approaches should be widely used to ensure smooth implementation and efficient completion of service-based software production.

The importance of services resource provisioning has become the consensus of industrialized service-oriented software development and applied to software production. And it has been partially supported by mainstream tools.Footnote 1

The starting point of current study assumed that services resource is sufficient, but actual development stage is not the case. Services resource that meets users’ needs often does not exist or cannot be run satisfactorily. As described in the literature [2], “If no services are available for some parts, the application developer can register them in the service broker directory and wait until the needed services are available.” Thus, it leads to a serious case with difficulty, complexity, and low availability of services composition.

At the same time, due to the dynamic nature of Web services and error-prone services resource provisioning environment, a variety of exceptions in services resources provisioning can occur during the execution of composing services [3]. Exceptions refer to service failure (fault), network errors, and abnormal events that are subject to resources or requirement changes. Problems are caused by lack of exception handling mechanism, such as poor performance, waste of resources, non-optimized service provider, or even the failure of process execution. Services resource provisioning mechanism must be able to take actively, i.e., they should be able to adapt to the runtime exceptions.

2 Motivation

Tracking and tracing agricultural products can greatly improve the efficiency of agricultural products’ traceability and the quality of protection through information technology, in which traceability information mainly focuses on service-oriented agricultural information network digital sampling, compression, digital anti-counterfeiting technology, and rendering technology concerns online on-demand material for traceability of agricultural products. These have a lot of underlying legacy software resources. In addition, for the existing agricultural information tracing method, information representation and content will often demonstrate independence.

Therefore, how to make coding a trace record can be achieved by manual identification and information processing automatically? Traceability information can be queried either directly through the browser or mobile phones and other reading devices to meet the network users’ (agricultural producers and consumers) immediate and effective access for information and application services in the support of services computing. The above methods and techniques will be considered in this study as the starting point and distinguished foothold for other studies. Services computing as a new software production technology for network era has been recognized by the industry. But for the ultimate goal of computing, namely on-demand service, it has not been able to achieve or rarely involves by far. It also is not effectively applied to actual work, such as Hainan agricultural areas of traceability.

Producing software as manufacture has been the dream that software engineers pursued. Recalling the history of the evolution of software development approaches, regardless of machine-oriented, process-oriented, object-oriented, or component-oriented, they are forward along the road to industrial large-scale production. Ford’s assembly line is a typical representative of major industrialized production mode, through the standardization system, to achieve large-scale production capability. In accordance with the “building blocks” to produce, assemble, and substitute the products, a large-scale, rapid, and low-cost production style can be achieved. With the amazing production capacity released from large-scale production, today, we are facing a world that has abundant material supply. In order to cope with competition of such rich world in a buyer’s market, the manufacturer’s production must be user-centric and further lead to market segmentation; customized production has become a key competitive factor. The final fusion with the users also come in—the users’ needs to become part of design and production, more flexible, convenient, and economical service for the customer.

Previously we have designed conceptual model with large-scale customization for networked software [4], and this model also assumes that services resource is rich enough, in which the shaded part refers to individual needs of stakeholders. If personalized services resource does not exist and also cannot be achieved through value-added services composition, then it will relate to explore the issue of customized production which captured individual needs of service based on component resources. How to associate the back-end services resource with individual needs fragment of production model? How to embody on-demand customization requirements of service component resources and on-the-fly production? These issues are directions and concerns of this chapter focusing on active customized provisioning of services resource.

Customized services refer to supplying suitable and satisfactory value of experience according to their own needs of consumers. Service-based software development is distinguished into mass customization and personalized services resource customization. Mass customization combines the advantages of two production modes of custom manufacturing and mass production to meet individual needs of customers. At the same time, it retains lower production costs and shorter delivery time. But personalized customization of services resource aims at capturing unfound individual needs to customized production for abounding service component library resources and improving services resource provisioning style from service provider-centric mode to consumer requirements-driven production. The two styles complement each other to improve service quality of experience for stakeholders together.

Regarding the traditional service-oriented architecture (SOA) [5], services resource provisioning strategy is based on service providers’ priority. Service providers produce services resource and publish these services’ description information in service registries. Service requesters (consumers) can establish dynamic binding association with real services by querying service registries. Traditional SOA does not furnish the consumers with publishing-related information functions for services production. Consumers can only retrieve, find, and match provided services resource of service providers in the registry according to the needs of application, and the process is essentially a passive selection.

Institute of Scientific Technical Information of Chinese Academy of Tropical Agricultural sciences has developed quality security traceability platform for Hainan tropical agricultural product. But, considering user needs with service-oriented perspective to meet, service-based methods and techniques have not been effectively addressed and reasonably applied for Hainan agricultural traceability. An urgent need is to use the latest services computing and requirements engineering methods for conducting interdisciplinary and innovative research in depth to promote their levels of networked service.

This chapter is a research about agricultural product traceability system with services resource provisioning and focuses on services resource personalized active customized production approach.

3 Customization Model for Services Resource

Definition 1

(Customization of Services Resource)

Given service requesters set \( R = \{ R_{1} ,R_{2} , \ldots ,R_{n} \} \) and service providers set \( P = \{ P_{1} ,P_{2} , \ldots ,P_{m} \} \), for customization requirements \( {\text{CReq}}_{i} \) from \( R_{i} \in R\;(1 \le i \le n) \), if there exists \( P_{j} \in P\;(1 \le j \le m) \) which can complete services resource production and publishing within the specified time parameters T, we call service provider \( P_{j} \) in response to services resource customization of service requester \( R_{i} \).

Definition 2

(Customized Matching Degree)

For customized matching degree of services resource, \( C_{\text{match}} = {\text{SemanticMatch}}_{P \to R} *e^{{ - \tfrac{|t - T|}{T}}} \), where semantic matching degree \( {\text{SemanticMatch}}_{P \to R} \) denotes semantic matching degree between service semantics of provider’s customization production and requirements semantic of requester, t represents customization completion time of provider, and T is the required customization time of requester.

Definition 3

(Custom Preferred Provider)

Given the current services resource customization matrix \( RP_{\text{Matrix}} \), custom requesters and providers pair off and implement assignment operating. We call the provider the related requester’s custom preferred provider if there exists a provider which corresponds to arrive at the sum of the maximum matching result.

The mathematical models for solving custom preferred provider of services resource are described as follows:

$$ \max\, C = \sum\limits_{i = 1}^{n} \sum\limits_{j = 1}^{m} RP_{ij} *x_{ij} $$
(1)
$$ s.t.\left\{ {\begin{array}{*{20}l} {x_{ij} = 0,1;} \hfill & {i = 1,2, \ldots ,n,\;j = 1,2, \ldots ,m} \hfill \\ {\sum\nolimits_{i = 1}^{n} x_{ij} = 1;} \hfill & {j = 1,2, \ldots ,m} \hfill \\ {\sum\nolimits_{j = 1}^{m} x_{ij} = 1;} \hfill & {i = 1,2, \ldots ,n} \hfill \\ \end{array} } \right. . $$
(2)

This is similar to combinatorial optimization assignment problem, with reference to the Hungarian algorithm [6]. Its related conditions of the original algorithm are improved, such as the solved total minimum are transformed to maximum (the custom matching degree, higher the better). Meanwhile, tag matrix is designed. The improved method is more efficient than original algorithm, easy to operate and implement. The time complexity of Custom Preferred Provider selection algorithm is \( O\left( {n^{3} } \right) \).

For the services resource custom provider selection, if the total custom matching degree is not required to reach a maximum just based on past selection chance to predict next selection, it is very suitable for the use of random Markov prediction method. A comprehensive forecast of the event, to be able to point out not only the incident with all possible outcomes, but also the probability of each outcome, must be given with current state of the probability to predict the best choice. This could be based on historical statistical data to build a custom provider state transition probability matrix \( T_{RP} \), in which rows of the matrix correspond to the requester and columns correspond to the custom provider. \( P_{ij} \) denotes selection probability between requester i and custom j in current state.

Definition 4

(Prediction Selection of Custom Provider)

Given custom providers state transition probability matrix T RP and the completed service customization selection state, the next service customization selection state can be found according to Markov process without aftereffect and Bayesian conditional probability formula, in which the provider corresponding to maximum probability for each requester is the service custom provider prediction selection.

Custom provider prediction model under the random Markov chain is described below.

$$ \pi_{j} (k) = \sum\limits_{i = 1}^{n} {\pi_{j} } (k - 1)P_{ij} \quad \left( {j = 1,2, \cdots ,n} \right) $$
(3)

where the state probability \( \pi_{j} (k ) \) indicates the probability of custom provider j in the moment (period) k under the known initial state (k = 0) to pass state transfer with k times, and \( \sum\nolimits_{j = 1}^{n} {\pi_{j} (k) = 1} . \)

4 Active Customized Production for Services Resource Provisioning

Requirements sign ontology (RSO) [7] is semantic description of overall business process including requirements-induced services resource (components) and control structure, and it also denotes knowledge about business workflow to guide services resource identifying and complete services aggregation.

For unable matched services, requirements-driven active customization will be used to complete custom produce for service providers during services aggregating. The main difference is to be able to identify (business) process and services resource between service-oriented requirements engineering and the traditional requirements engineering. We have designed the metadescription of networked software (see [7]), in which stakeholders are composed of participants playing different roles whose required goals will be achieved by the business process. As a software agent, services resource is the constituent element of business process.

On the one hand, the framework will guide how to organize domain ontology to create asset model; on the other hand, domain ontology depicts concepts and its semantic associations to support semantics for asset modeling that is characterized by ontology description (OWL or OWL-S format). It will facilitate the semantic reasoning in the SODR asset repository.

4.1 Atom-Based Information Publishing

Experimental platform mainly adopts Apache AbderaFootnote 2 to generate Atom message and publishing protocol. Semantics in RSO are expressed in an OWL-S format. We can list the corresponding relationships between every item of entry in Atom format and service semantics in RSO.

The transformation algorithm from semantic description of QR two-dimensional code (XML) to Atom is shown in Algorithm 1.

4.2 QR Two-Dimensional Code

Automatic identification technology refers to non-keyboard data input technology, like programmable logic controller (PLC), computer, or other microprocessor apparatus, including sound image recognition, bar code, radio frequency identification (RFID), biometric identification, and magnetic stripe card technology, in which bar code and RFID technology are used widely in automatic identification.

Traditional traceability systems utilize one-dimensional bar code to identify agricultural products. Through the bar code technology applied in agricultural products, the bar code is classified as product information and vendor information and then, respectively, query product information and vendor information based on product code and manufacturer code. Bar codes have input speed, high reliability, large amount of collected information, and economic advantages and are easy to produce, so bar code technology is suitable for use as an information carrier for traceability systems of agricultural supply chain. For example, in March 2010, Institute of Scientific Technical Information of Chinese Academy of Tropical Agricultural sciences has established quality security traceability platform for Hainan tropical agricultural product.

However, due to the one-dimensional bar code encoding limits, accommodation of bar code information is extremely limited. Meanwhile, fault tolerance of bar code is poor, they can no longer be properly read after defacement, destruction, or deformation. The most important thing is that code can be identified only through a specific reader and then check the relevant product information from database. It is passive and very troublesome. Therefore, agricultural traceability system based on one-dimensional bar code has not solved the problem for the safety of agricultural products. We are eager to provide an agricultural product traceability system with the facility of easy reading and quickly getting the products information.

To facilitate the derived application of products traceability, RESTful Web services address will be designed for two-dimension agricultural metadata code. Through the client program, corresponding HTTP request (GetPutPostDelete) is sent to the target URI. Client applications can process the traceability information (mainly XML format) to achieve the purpose of further application (Fig. 1).

Fig. 1
figure 1

RESTful Web service process for Agricultural Traceability

4.3 Agricultural Product Traceability Service Design with Services Resource Active Provisioning

Based on the Abdera library, thinfeeder,Footnote 3 an open source RSS reader, can be revised to display Atom and subscribe the services or traceability information of agricultural product coded by QR two-dimension code. Also, adding notify function to thinfeeder, aggregator can get customized services data (WSDL or OWL-S file location, service endpoint URI, etc.) to facilitate rerunning aggregation flow after completing the feedbacks of customized service queue.

Prototype of user requirements-driven services engineering is developed as a series of requirements-conducted services platform that has realized the main features, where requirements asset modeling for domain, service registration, requirements capture, and analysis modules has launched a number of versions. The main part of prototype adopts language written in Java and PHP using Apache as a Web server and MySQL database as a background. The whole system is based on the J2EE specification to achieve distributing operations with multi-user network environment and also solve the issue of heterogeneity. The platform uses a distributed SOA as a background system architecture, and the whole system is divided into three parts, namely requirements semantic acquisition module, service aggregation module, and services resource customized modules. Among them, requirements semantic export and service operation governance are packaged as RESTful interface to provide the modules of service aggregation and services resource customization for calling.

Regarding the experiment carrier for services resource provisioning, we select the Hainan agricultural product online traceability service system as application field. In a service-oriented agricultural traceability domain, stakeholders facing the domain user have rich and diverse individual needs, which led to a variety of customization requirements. Meanwhile, numerous legacy software about information processing of agricultural products exists to meet empirical demands of the project with active services resource provisioning.

How better to achieve real-time and on-demand digital service for Hainan online agricultural product traceability system under the Internet with customization-based resource provisioning ecological chain extension? The issue is the focus for empirical carrier research.

The preliminary overall application architecture is shown in Fig. 2. Specific functional requirements of services resource active provisioning can be acquired through full communication with stakeholders. Preliminary functional requirements of CASE tool are shown in Table 1.

Fig. 2
figure 2

Architecture for agricultural traceability service system

Table 1 Functional requirements of CASE tool for services resource active provisioning

Figure 3 shows agricultural traceability service system with B/S structure, and we have developed an app program of cell phone that is application for agricultural product traceability service based on Android platform, which can generate and parse QR two-dimensional code for agricultural product traceability and complete online inquiries combined with server to achieve the mobile client-side access service simultaneously.

Fig. 3
figure 3

Agricultural traceability service with B/S

5 Conclusions

Service-oriented approaches are gaining more and more attention since they claim to provide new and flexible ways of supporting the activities in an organization. The chapter has established software architecture with personalized active custom for services resource that will select unsatisfactory requirements fragment of customers to dynamically generate custom needs in the running of the services composition. By means of custom preferred provider selection approach designated to push the customization requirements, service providers complete the services resource production and customized products evaluation just in time, and the process will effectively prevent failure of services aggregation and services resource provisioning exceptions from occurring. Service computing architecture of traceability with Atom protocol will be chosen to meet the heterogeneous multi-client and lightweight requirements. Active and adaptive production for services information provisioning will be explored, and its application architecture in the domain of agricultural product traceability will also be designed.