A Research Agenda for AgentBased Service-Oriented Architectures Prof. Michael N. Huhns Center for Information Technology University of South Carolina Technology Themes for the Next 50 Years Computation and bandwidth to burn (for data mining and simulation) Sensory transformation, when “things start to think” Lightweight infrastructure Small world: nanotechnology + MEMs + biosystems Extending biology 5/31/2016 2:52:58 AM © Michael N. Huhns 2 Highlights Why should anyone care about Web services, especially Semantic Web services? Services provide higher-level abstractions for organizing applications in large-scale, open environments, resulting in improved productivity for developers and improved quality for the applications Expose business functionality (conventional Web services) Enable programming in the large Enable new applications to be offered dynamically and on-demand through composition (Semantic Web services soon; agent-based SWS eventually) Produce robust applications (agent-based Semantic Web services) 5/31/2016 2:52:58 AM © Michael N. Huhns 3 If even Dilbert knows about Web services… …so should you! 5/31/2016 2:52:58 AM © Michael N. Huhns 4 Requirements Imposed by a ServiceOriented Architecture Loose coupling Implementation neutrality Flexible configurability Long lifetime Granularity Teams The old abstraction for computing involved individual computations The new abstraction for computing involves interactions among computations Must capture patterns of semantic and pragmatic constraints governing service compositions 5/31/2016 2:52:58 AM © Michael N. Huhns 5 Great Benefits, But Will SOAs Really Take Off? Stage Quantity Representation Use Cost Resultant Apps Now Few, on intranets Syntactic (WSDL) Manual $0 Built quickly, but brittle and static II Many via Internet Keyword semantics Manual composition Fee for use, set off-line Robust apps via substitution of services Rich semantics of function Automatic discovery & invocation III IV Active services 5/31/2016 2:52:58 AM Semantics of behavior Dynamic apps Autonomous negotiation © Michael N. Huhns Robust, selforganized teams 6 Example of Current SOA Success Amazon.com: Converted monolithic application into 100’s of services Applications for customer service, selling, Amazon’s Web pages, and hosted applications invoke the services as needed Enables unanticipated 3rd-party applications: Shopping with a camera phone (uses reviewing service, comparable product service, and current price service) An AJAX/S3 Wiki (uses the simple storage service for code and data) The Great Baconizer (uses recommendation service, i.e., “whoever bought A also bought B”) [see next page] 5/31/2016 2:52:58 AM © Michael N. Huhns 7 “The Great Baconizer” For example, the connection between the book “Surely You're Joking, Mr. Feynman!" and the DVD “Real Genius“ (11 hops): “Surely You're Joking, Mr. Feynman!" -- R. Feynman “Genius: The Life and Science of Richard Feynman," -- J. Gleick ::: “Weird Science“ (DVD) -- John Hughes “Top Secret!" (DVD) -- Val Kilmer “Real Genius" (DVD) -- Val Kilmer 5/31/2016 2:52:58 AM © Michael N. Huhns 8 A Source for Research Ideas: What Are the Limitations of the WS Triangle? Consider each vertex and edge: Service Broker Publish or announce (WSDL) Service Provider Not well-known 5/31/2016 2:52:58 AM Registry; well-known Find or discover (UDDI) Bind or invoke (SOAP) © Michael N. Huhns Service Requestor 9 Needed Enhancements For advertising and publishing, services must be described with greater precision and structure A registry must be able to certify providers, so it can endorse them A requestor must be able to trust a registry, which involves reputation and incentives A registry must be able to understand the needs of a requestor A requestor and provider must conduct longlived flexible transactions, must establish SLA, must monitor compliance with SLA 5/31/2016 2:52:58 AM © Michael N. Huhns 10 Additional Limitations A Web service knows only about itself — not about its users, clients, or customers Web services are not designed to use and reconcile ontologies among each other or with their clients Web services are passive until invoked; they can’t provide alerts or updates when new information becomes available Web services do not cooperate with each other or self-organize, although they can be composed by external systems 5/31/2016 2:52:58 AM © Michael N. Huhns 11 Web Services Will Become Agents Current Web services have a database or a programmatic basis. Both are unsatisfactory… 5/31/2016 2:52:58 AM © Michael N. Huhns 12 Simple B2C Web Service Example Suppose you want to sell cameras over the Web, debit a credit card, and guarantee next-day delivery SellCamera Web Service Your application must Internet record a sale in a sales database Sales Inventory debit the credit card Shipping send an order to the shipping department receive an OK from the shipping department for next-day delivery update an inventory database 5/31/2016 2:52:58 AM © Michael N. Huhns 13 “Traditional” B2C Problems What if the order is shipped, but the debit fails? What if the debit succeeds, but the order was never entered or shipped? 5/31/2016 2:52:58 AM © Michael N. Huhns 14 Database Approach A traditional database approach works only for a closed environment: Transaction processing (TP) monitors (such as IBM’s CICS, Transarc’s Encina, BEA System’s Tuxedo) can ensure that all or none of the steps are completed, and that systems eventually reach a consistent state But what if the user’s modem is disconnected right after he clicks on OK? Did the order succeed? What if the line went dead before the acknowledgement arrives? Will the user order again? The TP monitor cannot get the user, or the user’s agent, into a consistent state! 5/31/2016 2:52:58 AM © Michael N. Huhns 15 Approach for Open Environment Server application could send email about credit problems, or detect duplicate transactions Downloaded applet could synchronize with server after broken connection was restored, and recover transaction; applet could communicate using http, or directly with server objects via CORBA/IIOP or RMI If there are too many orders to process synchronously, they could be put in a message queue, managed by a Message Oriented Middleware server (which guarantees message delivery or failure notification), and customers would be notified by email when the transaction is complete Server could use 2PC, IF the user’s agent understands that protocol The server behaves like an agent! 5/31/2016 2:52:58 AM © Michael N. Huhns 16 Programming Basis for Web Services Under a programming approach, software is partitioned into composable services, which are invoked by an application using, for example, RMI Suppose application A invokes A service B, but B is busy and delegates the request to service C. When service C sends a response to A, A fails because it expected a response from B 5/31/2016 2:52:58 AM © Michael N. Huhns B delegate request C response 17 Trends… First Generation Web Hardware: Connect all PCs Software: Create a Web page for everybody and everything Use Google to get information, e.g., population of China How do we get correct information? There is a power in consensus that is not being exploited! 5/31/2016 2:52:58 AM © Michael N. Huhns 18 Correct Grammar from Google Is the correct phrase “in the West Coast” or “on the West Coast” or “at the West Coast”? In Google, the first yields 0.6M hits, the second 10.2M hits, and the third 0.2M hits 5/31/2016 2:52:58 AM © Michael N. Huhns 19 Trends… Second Generation Web Hardware: Connect all devices, sensors, objects, (and PCs) Software: Create a Web service for each Use Semantic Web (OWL-S) to glue behaviors into a composite; this is programming-in-the-large (or SOC) How do we get our desired aggregate behavior? 5/31/2016 2:52:58 AM © Michael N. Huhns 20 Engineering a SOC System Goal Subgoal AI planning leads to a declarative description of what is desired… Subgoal Subgoal Subgoal Subgoal Subgoal Subgoal Subgoal Subgoal Discovering, Matching, Planning, Composing Repository/Directory of Services WebService1 AI planning leads to a procedural description of how to achieve what is desired… WebService2 ... WebServiceN Discovering, Matching, Planning, Composing Task4 Task2 Task6 Task5 Task1 Task7 Task3 5/31/2016 2:52:58 AM © Michael N. Huhns 21 Composed Web Services Currency Converter Web Service Stock Quote Web Service 1. WSDL “IBM” 3. WSDL “$100” 2. “$100” 4. “¥800” Client Application 5/31/2016 2:52:58 AM © Michael N. Huhns 22 WSDL-P: Next-Generation Composition Stock Quote Web Service 2. WSDL-P “$100” + OWL-S Currency Converter Web Service 1. WSDL-P “IBM”+ OWL-S 3. “¥800” Client Application An OWL-S (or BPEL4WS) description of the workflow is communicated through the services 5/31/2016 2:52:58 AM © Michael N. Huhns 23 Complementary Features Service-Oriented Multiagent-Based Computing Computing Encapsulation Encapsulation Autonomy Autonomy Distribution Distribution Interaction via Interaction via messaging messaging Mutual understanding Proactivity Ontologies for objects Negotiation ability and processes 5/31/2016 2:52:58 AM © Michael N. Huhns 24 Service Interaction Process 5/31/2016 2:52:58 AM © Michael N. Huhns 25 Use Cases for Engagement Simple query-reply protocol: Simple request-reply protocol: Requestor: "Please provide your service for me.“ Requestor: "Will you provide your service for me?“ Provider: "OK.“ Requestor: "Will you provide your service for me?“ Provider: "No.“ Negotiate commitment protocol: Requestor: "Will you provide your service for me?“ Provider: "Only if you pay me ten dollars.“ Requestor: "I will pay you five dollars if you provide your service by 5:00 pm.“ Provider: "OK.“ Results: an explicit contract for the service, and commitments by the parties to satisfy the terms of the contract. 5/31/2016 2:52:58 AM © Michael N. Huhns 26 Engagement: Commitment Protocol 5/31/2016 2:52:58 AM © Michael N. Huhns 27 Trends… Third Generation Web Hardware: Now that everything is connected… Software: Create an agent to wrap and represent every Web page and Web service Use ??? to create new behaviors dynamically and form a new consensus about each; e.g., who programs the lights at a highway intersection? How do we get consistent and correct behavior? 5/31/2016 2:52:58 AM © Michael N. Huhns 28 Coherence and Commitments Coherence is how well a system behaves as a unit. It requires some form of organization, typically hierarchical Social commitments among agents are a means to achieve coherence. An agent’s commitment to another agent or to its society Is unidirectional Arises within a well-defined scope or context Is revocable with restrictions Enables coordination through the ordering and occurrence of actions by the agents 5/31/2016 2:52:58 AM © Michael N. Huhns 29 Commitments for Contracts Commitments capture contracts. Importantly, commitments are Public (unlike beliefs and intentions) Can be used as the basis for compliance Contracts apply between parties, in a context Other approaches: Are single-agent focused, e.g., deontic logic Don’t handle organizational aspects of contracts Don’t accommodate manipulation of contracts 5/31/2016 2:52:58 AM © Michael N. Huhns 30 Manipulating Commitments Operations on commitments: Create Discharge (satisfy) Cancel Release (eliminate) Delegate (change debtor) Assign (change creditor) Metacommitments constrain the manipulation of commitments 5/31/2016 2:52:58 AM © Michael N. Huhns 31 Commitment Protocols Protocols enable open systems to be constructed Interaction protocols expressed in terms of Participants’ commitments Actions for performing operations on commitments (to create and manipulate them) Constraints on the above, e.g., captured in temporal logic Examples: escrow, payment, RosettaNet (107 request-response PIPs) 5/31/2016 2:52:58 AM © Michael N. Huhns 32 Compliance with Protocols In an open environment, agents are contributed by different vendors and serve different interests How can an application check if the agents comply with specified protocols? Coordination aspects: traditional techniques Commitment aspects: representations of the agents’ commitments in temporal logic Commitment protocols are specified in terms of Main roles and sphere of commitment Roles essential for coordination Domain-specific propositions and actions 5/31/2016 2:52:58 AM © Michael N. Huhns 33 Verifying Compliance with Commitment Protocols Specification models based on potential causality commitments based on branching-time TL Run-time Verification respects design autonomy uses TL model-checking local verification based on observed messages 5/31/2016 2:52:58 AM © Michael N. Huhns 34 The Power of Consensus… For Accurate Services Numerous Web services are being deployed and many of them have similar, but not identical behavior. For example, you might have a software application that needs accurate and timely stock quotations, but one stock service might provide more frequent but less accurate results than another. How do we get consensus behavior? 5/31/2016 2:52:58 AM © Michael N. Huhns 35 Long-Term Research Objectives Robust software constructed out of large numbers of agents with redundant functionality Consensus software for societal systems Anyone can publish information as Web pages Anyone should be able to contribute to the behavior of societal systems, such as for power distribution, traffic control, telecommunications regulation, etc. Large-scale ethical and philosophical agent societies 5/31/2016 2:52:58 AM © Michael N. Huhns 36 Robustness through Multiple Viewpoints Errors will always be in complex systems Errors can be detected and corrected through redundancy Hypothesis: agents are the right level of granularity and abstraction for adding redundancy Agents can vote, present different viewpoints, cover for agents that misbehave, provide checks and balances 5/31/2016 2:52:58 AM © Michael N. Huhns 37 Redundancy Is the Basis for Robustness CREDIT REPORT AGENCY CREDIT REPORT AGENCY Receive application Collect applicant’s info Verify applicant’s info CREDIT REPORT AGENCY Obtain applicant’s credit score [Credit score>600] Approve credit [Credit score<=600] Deny credit 5/31/2016 2:52:58 AM © Michael N. Huhns 38 Advanced Composition Suppose an application needs simply to sort some data items, and suppose there are 5 Web sites that offer sorting services described by their input data types, output date type, time complexity, space complexity, and quality: Sort1 Application One is faster ? Sort2 One handles more data types ? ? ? One is often busy Sort3 Sort5 Sort4 One returns a stream of results, another a batch One costs less 5/31/2016 2:52:58 AM © Michael N. Huhns 39 Advanced Composition Possible approaches (cont.) Application invokes services randomly until one succeeds Application ranks services and invokes them in order until one succeeds Application invokes all services and reconciles the results Application contracts with one service after requesting bids Services self-organize into a team of sorting services and route requests to the best one The last two require that the services behave like agents The last two are scalable and robust 5/31/2016 2:52:58 AM © Michael N. Huhns 40 Agent-Based N-Version Robustness Each agent would have to know its role in this system as well as: Something about its own algorithm, such as its time/space complexity, and input/output data structures Something about other agents, such as their time and space complexity and reliability How to negotiate How to communicate How to compare results How to manage reputations and trust 5/31/2016 2:52:58 AM © Michael N. Huhns 41 Architecture for Agent-Based N-Version Robustness Single Task Choose Algorithm based on: (1) data type, (2) time & space constraints Algorithm #1 Algorithm #2 Algorithm #N Compare Results and Select Best Single Result 5/31/2016 2:52:58 AM © Michael N. Huhns 42 Experimental Results We asked 25 students to each write sorting and list-reversing algorithms Each algorithm was converted to an agent, with a wrapper written in Jade The results show that 5/31/2016 2:52:58 AM The same wrapper can be used for algorithms in different domains More agents (algorithms) produce better results than any one alone © Michael N. Huhns 43 Summary Multiagent System Properties Benefits for System Development Autonomous, objective-oriented behavior; agent-oriented decomposition Autonomous, active functionality that adapts to the users’ needs; reuse of whole subsystems and flexible interactions Dynamic composition and customization Scalability Interaction abstractions; statistical or probabilistic protocols Friction-free software; open systems; interactions among heterogeneous systems; move from sophisticated and learned e-commerce protocols to dynamic selection of protocols Multiple viewpoints, negotiation, and collaboration Robustness and reliability Social abstractions High-level modeling abstractions 5/31/2016 2:52:58 AM © Michael N. Huhns 44 Advertisement for a Textbook… Munindar Singh and Michael Huhns: “Service-Oriented Computing: Semantics, Processes, Agents,” John Wiley & Sons, Inc., 2005. 5/31/2016 2:52:58 AM © Michael N. Huhns 45