Adaptive differential propagation of soap messages

A method of adaptive differential propagation of Simple Object Access Protocol (SOAP) messages is provided herein. The method includes the following stages: classifying incoming SOAP messages according to at least one of: structure, content, and context thereof; selecting a corresponding template out of a plurality of templates for each classified SOAP message such that the selected template minimized a specified diff function applied to the classified SOAP message and the selected template; applying the specified diff function to the SOAP message and the selected template to yield a respective delta; and encapsulating a template identifier with the respective delta, wherein the template identifier is uniquely associated with the selected template, to yield an outgoing SOAP message.

BACKGROUND

1. Technical Field

The present invention relates to computer networks and more particularly, to propagation of messages over computer networks.

2. Discussion of the Related Art

In computer network communication, the size of SOAP (previously known as “Simple Object Access Protocol”) messages is a well-known performance bottleneck in contemporary SOA (Service-Oriented Architecture). The existing methods of differential encoding apply to message structure rather than the content and context thereof. Consequently, they do not address the issue of message classification according to message content.

Differential serialization and de-serialization of SOAP message are also known in the art. Differential serialization and de-serialization are concerned with minimizing serialization and de-serialization latency rather than reducing the size of the SOAP message.

BRIEF SUMMARY

One aspect of the invention provides a method that includes: optionally grouping some of the incoming messages into groups; classifying incoming SOAP messages into message classes according to at least one of: structure, content, and context thereof; selecting a corresponding template from a plurality of templates or from the grouped messages, for each classified SOAP message such that the selected template minimized a product of a specified diff function applied to the classified SOAP message and the selected template/message from grouped messages; applying the specified diff function to the SOAP message and the selected template to yield a respective delta; and encapsulating, in an outgoing SOAP message, a template identifier with each respective delta or a classified SOAP message, wherein the template identifier is uniquely associated with the selected template or message from a group.

Another aspect of the invention provides a method that includes receiving delta messages or SOAP messages each having a template identifier encapsulated therein; selecting a respective template from a plurality of templates according to the template identifier; applying a reconstruction function to each received delta message and the respective template to yield a reconstructed SOAP message; adding a received SOAP messages as a new template to the plurality of templates, if the template identifier indicates that the received SOAP message is a new template; and removing a particular template from the plurality of templates whenever an identifier in a message has been specified that a specified template (e.g., on the next message) has to be removed from the database.

Other aspects of the invention may include a system arranged to execute each of the aforementioned methods, a computer network comprising a plurality of the aforementioned gateways, and a computer readable program configured to execute each of the aforementioned method or a combination thereof. These, additional, and/or other aspects and/or advantages of the embodiments of the present invention are set forth in the detailed description which follows; possibly inferable from the detailed description; and/or learnable by practice of the embodiments of the present invention.

The drawings together with the following detailed description make apparent to those skilled in the art how the invention may be embodied in practice.

DETAILED DESCRIPTION

Prior to setting forth the detailed description, it may be helpful to set forth definitions of certain terms that will be used hereinafter.

The term “Extensible Markup Language” or “XML” as used herein in this application refers to a set of rules for encoding documents electronically. XML's design goals emphasize simplicity, generality, and usability over the Internet. It is a textual data format, with strong support via Unicode for the languages of the world. Although XML's design focuses on documents, it is widely used for the representation of arbitrary data structures, for example in web services.

The term “Web Services Description Language” or “WSDL” as used herein in this application refers to an XML-based language that provides a model for describing Web services. Web services are typically application programming interfaces (API) or web APIs that can be accessed over a network, such as the Internet, and executed on a remote system hosting the requested services.

The term “service-oriented architecture” or “SOA” as used herein in this application refers to a flexible set of design principles used during the phases of systems development and integration. A deployed SOA-based architecture will provide a loosely-integrated suite of services that can be used within multiple business domains. SOA also generally provides a way for consumers of services, such as web-based applications, to be aware of available SOA-based services. For example, several disparate departments within a company may develop and deploy SOA services in different implementation languages; their respective clients will benefit from a well understood, well defined interface to access them. XML is commonly used for interfacing with SOA services, though this is not required.

The term “SOAP” (previously known as “Simple Object Access Protocol”) as used herein in this application refers to a protocol for Web Services in computer networks. It relies on XML as its message format, and usually relies on other Application Layer protocols (most notably Remote Procedure Call (RPC) and HTTP) for message negotiation and transmission. SOAP can form the foundation layer of a web services protocol stack, providing a basic messaging framework upon which web services can be built. This XML based protocol consists of three parts: an envelope—which defines what is in the message and how to process it—a set of encoding rules for expressing instances of application-defined data types, and a convention for representing procedure calls and responses.

Embodiments of the present invention provide a reduction in the volume of SOAP traffic by transmitting data that appears in a sequence of SOAP messages only once. This approach is referred to hereinafter as differential propagation. Advantageously, as will be shown below, differential propagation of SOAP messages in more effective in avoiding bottleneck situations in comparison to other XML compression methods specifically in contemporary SOA environments which transfer flows of messages with similar structure and content.

FIG. 1is a high level schematic block diagram illustrating an aspect of a system consistent with an embodiment of the invention. The system may be, for example implemented as a gateway within a computer network. It is understood however, that the system may be also implemented in other manners as well, such as any form of client. Transmitter100includes the following elements: a classification engine120configured to classify incoming SOAP messages110into message classes; a grouping module160configured to group at least some of the incoming messages into groups (not shown). These groups are generated in order to find some similarity within the messages of each group (usually to temporal, location or context proximity of the messages sent in a specified timeframe). Transmitter100may further include a template selection module130configured to select a corresponding template from either a repository of templates140or from any of the groups generated by grouping module160for each classified SOAP message such that the selected template minimized a product of a specified diff function applied to the classified SOAP message and the selected template or message from a group. Transmitter100further includes a diff module150configured to apply the specified diff function to the SOAP message and the selected template/message from a group to yield a respective delta. Then, the delta is delivered to a transmitting module180configured to include, in an outgoing SOAP message, a template identifier with each respective delta or a classified SOAP message, wherein the template identifier is uniquely associated with the respective selected template or include alternatively an indication that the specific message is a new template (e.g., a message of a group or an incoming message that was made a template).

The grouping may be executed on at least some of the incoming messages wherein whenever a group grows beyond a specified threshold, or kept over a specified period of time it is de-grouped and messages are back to the flow of the gateway. The groups are generated so that similarities between subsequent messaged may be identified and used to generate, using diff module150smaller deltas that could have been generated using any of the templates from templates repository140. Thus, one of the messages of the group becomes its template and any message of the group may be diffed with that message. Alternatively, the diffing may be performed based on one message of the group and then iteratively with subsequent messages to yield several deltas representing all the messages of that group. These detltas may be encapsulated in a single message for transmitting.

Advantageously, the aforementioned grouping technique improves the diffing in a number of ways. First, it effectively increases the number of available template messages and thus generating smaller deltas. Second it exploits the fact that in many cases time-proximity of messages reflects on their content similarity. Third, it reduces the number of message-processing interrupts. Finally, grouping potentially results in more data being transmitted in a single network packet (message) and thus it has the same positive performance effect as transport-level batching.

The classification engine120may classify incoming SOAP messages according to various parameters and/or information such as a structure, content, and/or a context of the message.

The template selection module130selects a template for each classified SOAP message. This selection is based on the results of an application of a specified diff function applied to the SOAP message and the selected template. In more detail, the module selects the template for a SOAP message that yields a minimized product of application to the SOAP message and template.

Optionally, within each of the groups generated by grouping module160, the Dif module may be applied to any two messages of group of messages in order to yield a smaller delta. This is done instead of the diffing applied to a message and a template from the template repository. The motivation behind this process is that messages associated with the same source, timeslot, context etc, tend to exhibit similar data so that a delta generated by applying the diff module may yield smaller deltas than can be achieved using standard templates from the template repository. Such “intra-group” diffing of messages may be used effectively to generate several smaller deltas that may be used in total for reconstructing the entire groups of messages. Thus, one messages of the group may be used as a template while diffing is performed either based on the selected message of the group or by diffing iteratively each message with a consecutive message on the group.

The aforementioned diff function may be any existing diff function that on applying yields a comparison between two data entities. Specifically, a message m that is about to be transmitted by the gateway A to the gateway B is compared with a template message t known to both gateway A and gateway B. Subsequently, gateway A transmits (only) the difference between m and t, henceforth delta (m,t), to B. Upon receiving delta (m,t), gateway B reconstructs the original message m by applying the received difference to the template message t.

In operation, the various modules of the gateway100respectively classify an incoming SOAP message into one of plural message classes; select one of a plurality of templates for the classified SOAP message; apply the specified diff function to the classified SOAP message and the selected template to yield a delta; and include, with the respective delta or classified SOAP message, in an outgoing SOAP message.

It is understood that the aforementioned logic implemented on gateway100may be implemented, with the necessary changes, on a single client running one or more applications sending SOAP messages. Similarly, it may be implemented in other network architectures and is not limited in scope to the aforementioned gateway embodiment.

FIG. 2is a high level flowchart diagram illustrating an aspect of a method consistent with an embodiment of the invention. Method200includes: classifying incoming SOAP messages into message classes according to at least one of: structure, content, and context thereof210; (optionally) grouping some of the incoming messages into groups220; selecting a corresponding template from either (i) a plurality of templates, or as (ii) a message from one of the groups, for each classified SOAP message such that the selected template minimizes a product of a specified diff function applied to the classified SOAP message and the selected template230; (optionally) updating the plurality of templates240; applying the specified diff function to the SOAP message and the selected template or the message from the group to yield a respective delta250; and encapsulating for transmitting, in an outgoing SOAP message, a template identifier with each respective delta or a classified SOAP message, wherein the template identifier is uniquely associated with the selected template260.

Consistent with an embodiment of the invention, classification engine120or classifying110may be executed at run time based on structure (format), context (from where, to where, and when a given message goes), and content of a given message. Each message class has at least one template message. Initially, messages are divided into classes based on the Web Services Description Language (WSDL) message definition. At run time, the existing classes may be divided or merged.

Consistent with an embodiment of the invention, an entire message can be transmitted (rather than its delta). This is most likely to occur in the beginning of system operation, when there are no available template messages. It can also happen if the system determines that there is no significant gain from differential propagation.

Consistent with an embodiment of the invention, message classification may be implemented by clustering techniques. Specifically, the message classes may be defined over a specified messages space. A class may be defined by the following message parameters, being exemplary dimensions of the messages space: (i) source address (ii) destination address, (iii) existence or content of a SOAP header, (iv) existence or content of a SOAP body construct, or (v) any combination of the previous parameters. For example, all messages originating at a certain set of clients may be defined to be a separate class. In classifying, classification engine120may apply known clustering techniques over the messages space to associate a specific message to a predefined cluster, thus facilitating the classification process.

Consistent with some embodiments of the invention, the trigger for dividing a class may be a delta size exceeding the average or a certain limit. Periodically, the classification engine compares messages belonging to different classes. If the delta is small enough, the classes become candidates for merging. This option is further verified by comparing addition messages belonging to these classes.

The average size and the average frequency of messages that pertain to the same WSDL message definition and the same class are monitored. If the average message size is small while the average frequency is low, then no differential propagation techniques are applied. If the average frequency is below a certain threshold, the grouping technique is not performed in order to prevent increase in message latency as a result of delaying the message in waiting for additional similar messages to arrive

Consistent with an embodiment of the invention, existing diff techniques may be employed. However, to achieve a more compact representation of the delta message there is provided a technique for building a canonical mapping between XML construct names and binary labels. The canonical mapping is derived from the message description found in WSDL, which is known to both the Transmitter and the Receiver. When serializing the delta, the source substitutes construct names with the corresponding binary labels. In addition, if the difference message is itself an XML document, its size can be reduced using the same binary encoding method.

Consistent with an embodiment of the invention, the average size and the average frequency of messages associated with the same WSDL message definition and the same class are monitored. If the average message size is below a specified first value while the average frequency is below a specified second value, then no differential propagation techniques are applied. If the average frequency is below a certain threshold, the grouping technique is not performed in order to prevent increase in message latency as a result of delaying the message in waiting for additional similar messages to arrive. Advantageously, these embodiments allow improving both the compression rates and further reduce the computational intensity thus reducing CPU usage.

FIG. 3is a high level schematic block diagram illustrating embodiment of the invention implemented as a Receiver300. Receiver300includes a receiving module320; a template determining module330in operative association with a templates repository340; and a message reconstruction module350.

In operation, receiving module320is configured to receive deltas s or SOAP messages having a template identifier encapsulated therein. Template determining module330may be configured to select a respective template from a plurality of templates stored on templates repository340according to the template identifier. Message reconstruction module350may be configured to apply a reconstruction function to each received deltas message and the respective template to yield a reconstructed SOAP message.

In addition to the aforementioned operation of Receiver300and consistent with the embodiments of the invention, Receiver300is configured to add a received SOAP messages as a new template to the plurality of templates, whenever the template identifier on the received SOAP message indicates that the received SOAP message is a new template. Similarly, it removes a particular template from the plurality of templates in response to an explicit request of the sender (e.g., Transmitter100) by identifying, for example, a next message as a template that should be removed. Thus, template repository340in receiver300is being constantly updated so that it complies with template repository140in transmitter100.

FIG. 4is a high level flowchart diagram illustrating a method consistent with an embodiment of the invention; Method400provides a method that includes receiving deltas or SOAP messages having a template identifier encapsulated therein410; determining a respective template from a plurality of templates according to the template identifier420associated with any given received message; applying a reconstruction function to each received deltas and the respective template to yield a reconstructed SOAP message430; in case that a received message is a group of deltas, repeating the reconstructing for each message in a group440. Alternatively, a message can be reconstructed using another grouped message rather than via a template. Finally, method400is finalized with delivering the reconstructed messages450.

In addition to the aforementioned operation of method400and consistent with embodiments of the invention, method400further includes the step of adding a received SOAP message as a new template to the plurality of templates, if the template identifier indicates that the received SOAP message is a new template; Similarly, method400includes the step of removing a particular template from the plurality of templates in response to an explicit request of the sender by identifying, for example, a next message as a template that should be removed. These two steps are essential for updating the repository of templates in the receiver (e.g., Receiver300) and for verifying that the templates on the receiver comply with the templates used in the sender (e.g., transmitter100).

Consistent with an embodiment of the invention, there is provided a further improvement for producing compact deltas. As explained above, any existing diff technique may be employed for comparing XML messages (applying a diff function250) and later reconstructing them based on the delta (reconstructing430). Non limiting examples may be: xmldiff, diffxml, 4xupdate, and the like. However, since the deltas produced by most utilities contain the names of the original message constructs and the names of their attributes, there is provided a replacing thereof with short binary labels in order to reduce the delta size. The XML schema of the SOAP message is known to both the sender (Transmitter100) and the receiver (Receiver300) as defined in WSDL definition. Therefore, both sides can determine the exact set of constructs and attributes that can appear in the message. The mapping of construct and attribute names to binary labels may be produced as follows: the construct names are sorted alphabetically. An index is assigned to each name according to its place in the sorted list. The value of the index serves as the binary label. The same algorithm is applied to the attribute names. For simpler message types a single byte is sufficient to hold the binary labels. More complex types may require two bytes. Note, however that both sides can determine the required label size. If the delta message is also an XML document, the same technique may be applied to the delta constructs and attributes.

FIG. 5is a high level dataflow diagram illustrating a comprehensive view of the aforementioned differential propagation mechanism of SOAP messages, showing propagation of template IDs along with respective deltas in a computer network. As detailed above, sender510conveys message mito template selection511. In template selection511, a new template IDimay be added to template pool512. Diff selection513may, in cooperation with template pool512generate a delta (diff) diassociated with newly created new template IDiand a reference template IDj. The delta and the template IDs are combined in combine514where, in case a specific template is discarded in template pool512, the ID of the discarded template, such as IDkis added to the combined message that is transmitted by transmit515into the communication link530.

Upon receiving the transmitted messages in receive525, messages are reconstructed in message reconstruction523in cooperation with template pool522. A discard template ID in the message such as IDkleads to template retirement524which updates template pool522by removing the template associated with IDkfrom template pool522, while new template ID in the incoming message such as IDileads in template selection521to adding a new template to template pool522. Finally, the reconstructed message is conveyed to recipient520.

On a different perspective, embodiments of the invention enable to provide a sender (gateway A) with the means for adaptive choice of the template message t for a given message m and in (ii) providing the receiver (gateway B) with means to determine the template message that was used to produce the received difference. Both features are implemented by attaching compact metadata to the (application) messages transmitted by the source to the destination. The metadata indicates that the current message will be used as a template message in the future and specifies its logical name. In order to reconstruct the original message from the received delta, the destination must be able to identify the template message and ensure it is cached. In addition it should be able to discard template messages that are no longer used by the source.

The above functionality is implemented by attaching metadata to the messages sent by the source and propagated over the network as illustrated, for example, inFIG. 5. The metadata (template ID) can be encapsulated in a dedicated SOAP header or the preamble of a delta construct.

The following are exemplary template ID that may be used in embodiments of the inventions. In order to indicate that a certain message (or delta) is a template, the source attaches a NEW_TEMPLATE construct to it. The construct contains the ID of the template, which is an integer that is derived from the counter of template messages on the sender side. Each delta produced using a template message contains the ID of the latter. When the source decides to discard a template message it attaches the TEMPLATE_DISCARDED construct to the next message or delta transmitted to the destination. This construct contains the ID of the discarded message. If the destination is unable to cache the new template message due to space limitations, it sends a notification message to the source. If possible, the destination should discard the template only after the notification is acknowledged by the source.

Advantageously, embodiments of the present invention may be applied effectively to the federated enterprise service buses market. Given two autonomous domains interconnected by a low-bandwidth link, service requestors in one domain invoke Web Services hosted by service providers in the other domain. In order to reduce the bandwidth utilization of the inter-domain link, implementation of the current invention can be incorporated in the gateway proxies located in both domains. This approach allows (domain-wide) classification of all outgoing SOAP messages which potentially achieves more compact differential representation. In addition, it makes differential propagation transparent to service requestors and service providers.

Any publications, including patents, patent applications and articles, referenced or mentioned in this specification are herein incorporated in their entirety into the specification, to the same extent as if each individual publication was specifically and individually indicated to be incorporated herein. In addition, citation or identification of any reference in the description of some embodiments of the invention shall not be construed as an admission that such reference is available as prior art to the present invention.