Abstract:
A method and apparatus that learns and generates procedures for machine-to-machine interactions by monitoring user browser interactions with the server. Based on an action by a user of the web browser, a communication is sent from the web browser to the server, which is recorded by a macro recorder. The communication is in a first format such as HTML, which contains human-readable API documentation for a user&#39;s interactions with the server. The web browser receives a response to the communication which contains a response in the first format and a response in a second format. The second format is parsed to produce a normalized representation. The normalized representation describes the machine-readable API and the service invocation flow that can be interpreted by a particular programming language to generate service macros to invoke the services programmatically from a remote client to a server that supports the same services for machine-to-machine interaction.

Description:
RELATED U.S. PATENT APPLICATION DATA 
       [0001]    This application claims the benefit under 35 U.S.C. §119(e) of U.S. Provisional Application No. 61/350,602, filed Jun. 2, 2010, entitled “Micro browser: A Client Architecture and System to Support Dual RESTful Web Services,” which is incorporated herein in its entirety by reference. 
     
    
     TECHNICAL FIELD 
       [0002]    The system and method relates to generation of macros of communications between web browsers and servers, and in particular to generation of macros in different formats. 
       BACKGROUND 
       [0003]    Today, when a software engineer develops an application, the software engineer will typically use documentation about how a particular service works. For example, a web service may provide documentation about how to access features of the web service in the form of an Application Programming Interface (API). The software engineer will take the documentation and generate an application that accesses various services provided by the API. However, in many instances, the documentation does not always match the API. This can be due to errors that are introduced as the documentation is written. Other problems can occur when specific information about how the API work is left undocumented or there is limited documentation about specific features of the API. For instance, a function call may return an undocumented error code or an error code with limited explanation. This can lead to frustration by software engineers and service errors due to the inconsistency and incompleteness in the documentation about the actual APIs. And this is in addition to the increased time and effort to develop applications that use the APIs and are compatible to the required service flow. 
         [0004]    There are various ways that providers of services have tried to address this issue. For example, extensive testing of API and documentation can be performed. However, this leads to increased time and expense in producing the API documentation. Companies have addressed issues like these by providing customer support. This leads to increased technical support costs. What is needed is a way to easily create applications without having to write programs based on separate API documentation; this will allow applications to be easily created in less time, at less cost, and with less error. 
       SUMMARY 
       [0005]    The system and method are directed to solving these and other problems and disadvantages of the prior art. They generate procedures for machine-to-machine service invocation and interaction by monitoring the user browser interactions with the server, in which a request to start recording communication exchanges between a web browser and a server is received. Based on an action by a user of the web browser (e.g., the user clicking on a button on a web page), a communication is sent from the web browser to the server, which is recorded by a macro recorder. The communication is in a first format such as Hyper Text Markup Language (HTML). The first format may contain human-readable API documentation about the server that guides a user&#39;s interactions with the server. The web browser receives a response to the communication in which the response contains a response in the first format and also contains a response in a second format. The second format, combined with the first format, describes the machine-readable API about the server. The second format is typically in a micro format that can reside within the first format. A micro browser parses the response in the second format to produce a normalized representation of the response. The normalized representation describes the machine-readable API and the service invocation flow without the first format and can be interpreted by a particular programming language to generate service macros to invoke the services programmatically from a remote client to a server that supports the same services for machine-to-machine interaction. Normalizing the representation of the response can be, for example, converting a micro format to a computer language, such as JavaScript Object Notation (JSON), RDF, Java, C++, and the like. Based on the communication and the normalized representation of the response, a macro is created in the computer language. 
         [0006]    Other embodiments include sending the communication in the first format and the second format and the ability to start and stop recordings under user control to produce specific macros. In addition, an exemplary application development tool is described that allows a user to build applications from the recorded macros. The user can also combine macros to create more complicated macros. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]    These and other features and advantages of the system and method will become more apparent from considering the following description of an illustrative embodiment of the system and method together with the drawing, in which: 
           [0008]      FIG. 1  is a block diagram of a first illustrative system for generating a macro based on communication exchanges between a web browser and a server. 
           [0009]      FIG. 2  is a flow diagram of a method for generating a macro based on communication exchanges between a web browser and a server. 
           [0010]      FIG. 3  is a flow diagram of a method for generating a macro based on communication exchanges between a web browser and a server. 
           [0011]      FIG. 4  is a flow diagram of a method for generating a macro based on communication exchanges between a web browser and a server. 
           [0012]      FIG. 5  is a diagram of an application development tool that can create an application based on a plurality of macros. 
       
    
    
     DETAILED DESCRIPTION 
       [0013]    Some embodiments will be illustrated below in conjunction with an exemplary communication system. Although well suited for use with, e.g., a system using server(s) and/or database(s), communications devices, etc., the embodiments are not limited to use with any particular type of communication system or configuration of system elements. Those skilled in the art will recognize that the disclosed techniques may be used in any communication application in which it is desirable to provide enhanced program development services. 
         [0014]      FIG. 1  is a block diagram of a first illustrative system  100  for generating macro  113  based on communication exchanges between web browser  110  and server  130 . The first illustrative system comprises communication device  101 , network  120 , and server  130 . Communication device  101  can be any type of communication device such as a Personal Computer (PC), a telephone, a cellular telephone, a Personal Digital Assistant, a server  130 , or any device that can communicate with server  130 . Communication device  101  further comprises web browser  110 . Web browser  110  can be any web browser  110  such as Microsoft Internet Explorer®, Mozilla Firefox®, and the like. Web browser  110  can also include other types of software applications, such as distributed applications, client/server applications, database applications, email applications, and the like. Web browser  110  further comprises micro browser  111 , macro recorder  112 , and macro  113 . Micro browser  111  can be any software/hardware that can parse communications between web browser  110  and server  130 . For example, micro browser  111  can parse communications containing formats such as Hyper Text Mark Language (HTML), Extensible HTML (XHTML), Extensible Markup Language (XML), JavaScript Object Notation (JSON), Resource Description Framework (RDF), JavaScript, and/or the like. Macro recorder  112  can be any software/hardware that can record communications, such as a protocol analyzer, a communication monitoring software, and the like. Macro  113  is a software module that contains one or more instruction(s), commands, responses, codes, protocols, and the like, that can be used in developing software applications. 
         [0015]    Network  120  can be any type of network, such as the Internet, a Local Area Network (LAN), a Wide Area Network (WAN), the Public Switched Telephone Network (PSTN), a cellular network, a combination of these, and the like. Server  130  can be any type of server, such as a web server, a file server, an application server, a database server, a directory server, and the like. 
         [0016]    Micro recorder  112  receives a request to start recording one or more communication exchanges between web browser  110  and server  130 . A communication can be any type of communication in any type of protocol(s)/format(s) at any layer. The protocol/format can be, for example, any type of application layer protocol such as HTML, Extended Markup Language (XML), File Transfer Protocol (FTP), XML, and the like. The communication can include multiple protocols at multiple layers, such as HTML at the application layer and Internet Protocol at the network layer. A communication is sent from web browser  110  in a first format to server  130 . Macro recorder  112  records the communication sent from web browser  110  to server  130 . The recording can occur at one layer or at multiple protocol layers, such as at the application layer, at the presentation layer, at the network layer, and the like. Server  130  sends a response to the communication to web browser  110 . The response includes a response in the first format and a response in a second format. For example, the first format can be HTML and the second format can be a micro format. A micro format is a format that is embedded within, or sent in conjunction with, the first format that is ignored by web browser  110 . For instance, a micro format can be additional tags within the HTML tags that an HTLM parser (within web browser  110 ) cannot interpret, but micro browser  111  can interpret. In essence, web browser  110  ignores the micro format and only parses the HTML in the response while micro browser  111  parses the micro format and ignores the HTML. 
         [0017]    Micro browser  111  parses the response to produce a normalized representation of the response. A normalized representation of the response can be accomplished by converting the micro format to a different computer language. For instance, micro browser  111  can convert the micro format to XHTML, JavaScript Object Notation (JSON), Resource Description Framework (RDF), Java, C++, and the like. The above examples describe a micro format as the second format. However, a micro format is not necessarily required. The only requirement is that the first format can be interpreted/parsed by web browser  110  and the second format can be interpreted/parsed by micro browser  111 . 
         [0018]    Macro recorder  112  generates macro  113  based on the communication and the normalized representation of the response. For example, if the communication was sent in HTML and the normalized representation of the response (converted from a micro format) is in a JSON format, macro recorder  112  can convert the HTML (in the communication) to JSON and produce macro  113  in JSON. In this example, macro  113  contains JSON code of the communication and the response. One advantage is that macro  113  is in a computer language that may be more flexible and provides more features than the first format. This is done while web browser  110  and server  130  communicate in the first format (e.g., HTML). 
         [0019]      FIG. 2  is a flow diagram of a method for generating a macro  113  based on communication exchanges between web browser  110  and server  130 . Illustratively, communication device  101  and server  130  are stored-program-controlled entities, such as a computer or processor, which performs the method of  FIGS. 2-5  and the processes described herein by executing program instructions stored in a tangible computer readable storage medium, such as a memory or disk. 
         [0020]    The process begins in step  200  when a request to start recording one or more communication exchanges between web browser  110  and server  130  is received by macro recorder  112 . The request to start recording could be sent based on a user clicking on a record button in web browser  110  (i.e., a button of a browser plug-in or application running in browser  110 ). An action occurs in step  204  that initiates a communication being sent in step  206 A. For example, the action could be a user clicking on a button of a web page being displayed in browser  110 . The action of clicking on the button results in web browser  110  sending a communication in a first format in step  206 A to macro recorder  112 . For instance, the communication could be an HTML GET. The communication is recorded by macro recorder  112  and sent to server  130  in step  206 B. Macro recorder  112  may record all or part of the communication. For example, macro recorder  112  may only record the application layer of the communication. 
         [0021]    In response to the communication, server  130  sends a response in step  208 A. The response comprises a response in the first format and a response in a second format. For example, if the first format is XHTML, then the response will contain a response in XHTML and a response in the second format. Micro browser  111  receives the response in step  208 A as well as web browser  110  in step  208 B. Micro browser  111  parses the response sent in step  208 A to produce a normalized representation of the response in step  210 . This can be done in various ways. For example, depending on the second format, micro browser  111  can normalize the second format to different types of computer languages such as JSON, RDF, C++, Java, JavaScript, and the like. This way, micro browser  111  can generate different types of computer languages depending on what second format server  130  sends in the response to the communication. Macro recorder  112  generates macro  113  based on the communication sent in step  206 A and the normalized representation of the response (from step  210 ). 
         [0022]      FIG. 3  is a flow diagram of a method for generating a macro  113  based on communication exchanges between web browser  110  and server  130 . The process begins in step  200  when a request to start recording one or more communication exchanges between web browser  110  and server  130  is received by macro recorder  112 . An indication of the request to start recording can optionally be sent in steps  300 A or  300 B to server  130 . This way, server  130  will know when to start sending the second format in any responses to communications from web browser  110 . For example, a separate message can be sent in step  300 A that contains the indication of the request to start recording. The indication of the request to start recording can be sent as part of the communication sent in step  206 B. The request to start recording can also include a request to respond with a specific type of second format. An action occurs in step  204  that initiates a communication being sent in step  206 A. The communication is recorded by macro recorder  112  and sent to server  130  in step  206 B. 
         [0023]    In response to receiving the communication sent in step  206 B and, optionally, the indication of the request to start recording received in step  300 , server  130  sends a response in step  208 A. The response comprises a response in the first format and a response in the second format. The second format can be a predetermined format or can be different types of formats based on the optional request to respond with a specific type of second format. 
         [0024]    Micro browser  111  receives the response in step  208 A as well as web browser  110  in step  208 B. Micro browser  111  parses the second format in the response sent in step  208 A to produce a normalized representation of the response. The normalized representation of the response is sent to macro recorder  112  in step  210 . The normalized representation of the response can be different based on what type the second format is. For example, if the second format were type X, the normalized representation of the response can be Java code. If the second format were type Y, the normalized representation of the response can be JSON. A request to stop recording is sent to macro recorder  112  in step  302 . The request to stop recording can be generated by a user clicking on a stop recording button in a browser plug-in, an application, and the like. Based on receiving the request to stop recording, macro recorder  112  generates macro  113  in step  304 . 
         [0025]    Macro recorder  112  sends an indication of the request to stop recording to server  130  in step  306 . An action occurs in step  308  that initiates an additional communication being sent in step  310  to server  130 . For example, the action could be a user clicking on a button of a web page being displayed in web browser  110 . The action of clicking on the button results in web browser  110  sending the additional communication in the first format in step  310 . Server  130  receives the additional communication sent in step  310 . Server  130  sends a response to the additional communication to web browser  110  in step  312 ; based on receiving the indication to stop recording in step  306 , the response to the additional communication is sent in the first format, but not the second format. Web browser  110  processes the response (in the first format) sent in step  312  in a normal manner. Micro browser  111  ignores the response sent in step  312  because micro browser  111  is no longer recording communications between web browser  110  and server  130 . 
         [0026]      FIG. 4  is a flow diagram of a method for generating macro  113  based on communication exchanges between web browser  110  and server  130 . The process begins in step  400  when a request to start recording one or more communication exchanges between web browser  110  and server  130  is received by macro recorder  112 . An indication of the request to start recording can optionally be sent in steps  401 A or  401 B to server  130 . For example, a separate message can be sent in step  401 A that contains the indication of the request to start recording. The indication of the request to start recording can be sent as part of the communication sent in step  407 B. 
         [0027]    An action occurs in step  402  that initiates a communication being sent in step  404  that contains the first format. Micro browser  111  adds the second format to the communication in step  406 A. The information in the communication in the second format typically comprises information similar to the information in the first format (e.g., a micro format). The information in the second format is used by macro recorder  112  to record the communication exchanges between web browser  110  and server  130 . The communication is recorded by macro recorder  112  and sent to server  130  in step  407 B. Micro browser  111  creates and sends a normalized representation of the communication to macro recorder  112  in step  408 . 
         [0028]    In response to receiving the communication sent in step  407 B and optionally the indication of the request to start recording received in step  401 , server  130  sends a response in step  410 A. The response comprises a response in the first format and a response in the second format. Micro browser  111  receives the response in step  410 A as well as web browser  110  in step  410 B. Micro browser  111  parses the response sent in step  410 A to produce a normalized representation of the response. The normalized representation of the response is sent to macro recorder  112  in step  412 . A request to stop recording is sent to macro recorder  112  in step  414 . The request to stop recording can be generated by a user clicking on a stop recording button in a browser plug-in, an application, and the like. Based on the receiving request to stop recording, macro recorder  112  generates macro  113  in step  416 . 
         [0029]    Macro recorder  112  sends an indication of the request to stop recording to server  130  in step  418 . An action occurs in step  420  that initiates an additional communication being sent in step  422  to server  130 . For example, the action could be a user entering text to a text box in a web page that is being displayed in web browser  110 . The action of entering text in the text box in web browser  110  sends the additional communication in the first format in step  422 . Server  130  receives the additional communication sent in step  422 . Server  130  sends a response to the additional communication to web browser  110  in step  424 ; based on receiving the indication to stop recording in step  418 , the response to the additional communication is sent in the first format, but not in the second format. Web browser  110  processes the response sent in step  424  in a normal manner. Micro browser  111  ignores the response sent in step  424  because micro browser  111  is no longer recording communications between web browser  110  and server  130 . 
         [0030]      FIG. 5  is a diagram of an application development tool  500  that can create an application  510  based on a plurality of macros  113 . Application development tool  500  comprises macro icons  501 , combined macro  502 , application  510 , create application button  502 , combine macros button  503 , and run application button  504 . 
         [0031]    Once a macro  113  is recorded using the processes previously described, the recorded macros  113  can be shown as macro icon(s)  501  in application development tool  500 . A user of application development tool  500  can create application  510  from the recorded macros  113 . For example, the user can drag-and-drop the macro icons  501  to create application  510 . In this example, the user has dragged-and-dropped macros  501 A- 501 D to form application  510 . Once the application is developed by the user, the user can click on the create application button  502  to create an application  510 . The user can then run application  510  by clicking on the run application button  504 . 
         [0032]    The user can also combine macros to create a combined macro  502 . For example, the user can select macros  501 C and  501 A and click on the combine macros button  503  to create combined macro  502 . By combining macros, the user can easily develop applications  510 . Combined macros  502  can be used as building blocks to build more complex applications  510  in the same manner as an individual macro  113 . 
         [0033]    Herein, the phrases “at least one,” “one or more,” and “and/or” are open-ended expressions that are both conjunctive and disjunctive in operation. For example, each of the expressions “at least one of A, B and C,” “at least one of A, B, or C,” “one or more of A, B, and C,” “one or more of A, B, or C” and “A, B, and/or C” means A alone, B alone, C alone, A and B together, A and C together, B and C together, or A, B and C together. 
         [0034]    Herein, the term “a,” “an,” or another entity refers to one or more of that entity. As such, the terms “a” (or “an”), “one or more” and “at least one” can be used interchangeably herein. It is also to be noted that the terms “comprising,” “including,” and “having” can be used interchangeably. 
         [0035]    Of course, various changes and modifications to the illustrative embodiment described above will be apparent to those skilled in the art. These changes and modifications can be made without departing from the spirit and the scope of the system and method and without diminishing its attendant advantages. The above description and associated figures teach the best mode of the invention. The following claims specify the scope of the invention. Note that some aspects of the best mode may not fall within the scope of the invention as specified by the claims. Those skilled in the art will appreciate that the features described above can be combined in various ways to form multiple variations of the invention. As a result, the invention is not limited to the specific embodiments described above, but only by the following claims and their equivalents.