CN1870525A - Event communication device and method - Google Patents

Event communication device and method Download PDF

Info

Publication number
CN1870525A
CN1870525A CNA200510125925XA CN200510125925A CN1870525A CN 1870525 A CN1870525 A CN 1870525A CN A200510125925X A CNA200510125925X A CN A200510125925XA CN 200510125925 A CN200510125925 A CN 200510125925A CN 1870525 A CN1870525 A CN 1870525A
Authority
CN
China
Prior art keywords
event
incident
channel
type
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA200510125925XA
Other languages
Chinese (zh)
Inventor
阮伟毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNA200510125925XA priority Critical patent/CN1870525A/en
Priority to PCT/CN2006/001643 priority patent/WO2007059669A1/en
Publication of CN1870525A publication Critical patent/CN1870525A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

This invention discloses an event communication device including: an event kind object unit used in generating an object and analyzing it, an event server used in creating event channels based on the channel distribution information and storing all event channel includes, in which, the distribution information includes the corresponding relation of event channels and the kinds, an event send unit used in obtaining the object of event kind from the upper layer event sender and getting the includes of said event channel from said server and setting up the sending proxy object to be connected to the channel and sending out the packaged information, an event receiving unit used in obtaining the includes of event channel from the event server to set up a receiving proxy object and connecting it to the channel to realize the reception of information and generating an event kind object and sending it to the upper event receiver. This invention also discloses an event communication method.

Description

A kind of event communication device and method
Technical field
The present invention relates to the Event Service technology of network system, particularly relate to a kind of event communication device and method.
Background technology
Along with the development of information technology, increasing information realizes transmission by network.For example based on Common Object Request Broker Architecture (CORBA, in the network management system of network Common Object Request Broker Architecture), between each module of backstage and between the AM/BAM a large amount of transmission of messages are arranged, usually by the forwarding of finishing message based on the event server of CORBA notice (Notification) service.
A side who sends message is called the Event senders, and a side who receives message is called the incident recipient.In the prior art, based on the transmission of the event communication method of the Event Service system of CORBA Notification service and to receive the process of message as follows:
1) creates event channel
Obtain the Notification service object and quote, the interface that calls Notification service calls the interface of described event channel manager then and creates event channel with the object reference of the event channel manager that obtains the Notification service.The number of the event channel of being created is decided as the case may be.
2) send the object reference of this event channel
The information of the event channel that the event channel manager is created (as the object reference of passage) leaves in the passage concordance list, and the object reference of described event channel is offered Event senders and the incident recipient who needs to use described event channel by name service or other approach.
3) Event senders sends incident
The Event senders sends the event channel partition strategy that incident needs to know before system, needs just to know which event channel the own event type that is sent should send on, and will know the object reference that how to obtain this event channel.
After obtaining event channel, the Event senders is mapped to the message structure that will send in the general purpose event structure, select sending mode (push pattern or pull pattern, and single event sending mode or eventful sending mode), and create incident transmitter (ProxySupplier) object of a Notification service according to this sending mode, call the object reference of event channel, described ProxySupplier object is connected to event channel, finally calls the ProxySupplier interface message that will send is sent.
4) the incident recipient receives incident
Need know the event channel partition strategy of system when incident recipient receives incident equally, need just to know which event channel the event type that oneself needs receives sends on, and will know the object reference that how to obtain this event channel.
After obtaining event channel, incident recipient also wants selective reception pattern (push pattern or pull pattern, and single event receiving mode or eventful receiving mode), and create incident receiver (ProxyConsumer) object of Notification service according to this receiving mode, the interface that calls event channel is connected to the ProxyConsumer object on the event channel, receives message by this event channel.
Incident recipient after receiving message, taking-up information and being filled in the message structure of oneself from the general purpose event structure.
So far finish based on the transmission and the receiving course of the message of Notification service.
As shown in Figure 1, be the schematic diagram that COBRA Notification is provided by the extendible general purpose event structure (StructuredEvent) that provides.
Described StructuredEvent comprises following field:
Fixed length message header (Fixed Header): be used to show the zone or the field of type, title and the initiated event of incident, described Fixed Header further comprises:
Domain name (Domain_name) is used for zone or field that identified event is initiated,
Event type title (Type_name) is used for the type of identified event,
Incident title (Event_name) is used for the title of identified event;
Variable message header (Variable Header): be used to deposit extra Event Description information, this field is an extended field, and described Variable Header further comprises:
Variable message header field name (VH_name),
Variable message header field contents (VH_value);
Variable length messages body (Filterable Body): being used to deposit the details of message, is the main body of message, and described Filterable Body further comprises:
Message body field name (Name),
Message body field contents (Value);
The expansion of incident body (Remaining Body): fill in voluntarily as required by using.
For a message event, described variable message header field name and variable message header field contents are a plurality of to having; A plurality of for message body field name and message body field contents equally to also having.
Simultaneously, the Notification service allows the user to create a plurality of event channels as required, dissimilar incidents is sent on different passages, user program calls the interface of Notification service and creates an event channel, then the object reference of this event channel being served to be distributed to by certain mode such as CORBA name needs to use the program of this passage to comprise Event senders and event subscription person, and event subscription person can be connected on the specific passage as required.
The defective of the prior art is: because general purpose event structure StructuredEvent is used in CORBA Notification service, so the Event senders need be mapped to its message structure in the incident body of StructuredEvent structure; Incident recipient need taking-up information be filled in the message structure of oneself from the StructuredEvent structure, uses comparatively inconvenient.
When using multichannel to send incident, the incident that incident recipient can't receive as required finds corresponding event channel, the Event senders also can't directly be connected to the event channel of correspondence according to the event type of the message that will send, can only obtain quoting of event channel from name service or other approach according to the mode of making an appointment, and the connection procedure more complicated.
In sum, Event senders and incident recipient directly use the process of Notification complicated and loaded down with trivial details, and binding is tightr, and revising the event channel allocation strategy if desired then needs to revise application code.
Summary of the invention
The technical problem that the present invention solves provides a kind of event communication device and method, can simplify the complexity that the Notification service is used, and improves the portable and compatible of system.
For this reason, the technical scheme of technical solution problem of the present invention is: a kind of event communication device is provided, comprises:
The event type object unit, be used to generate the event type object and resolve the event type object, described event type object comprises message carrier and message header access part, wherein message carrier is used for depositing message to be sent with the general purpose event structure, and described message header access partly is used for according to the message header of event type filling general purpose event structure or from the message header information extraction;
Event server is used for creating event channel and preserving all event channels and quote according to channel allocation information, and described channel allocation information comprises the corresponding relation of event channel and event type;
The incident transmitting element, be used for the transmission incident, comprise from the Event senders on upper strata and obtain the event type object, obtain quoting of event channel from this event server according to event type information, the establishment incident sends agent object and is connected to described event channel, and the message that encapsulates is sent;
The incident receiving element, be used for the reception incident, comprise according to the event type information of importing into and obtain quoting of event channel from this event server, the establishment incident receives agent object and is connected on the event channel, realize the reception of message, generate the event type object and send the incident recipient on upper strata to according to wherein event structure body.
Preferably, described incident transmitting element comprises: incident transmission types selected cell, and being used to select transmission types is to send one by one or send in batches; The event schema selected cell, being used for preference pattern is push pattern or pull pattern; The single event transmitter is used to realize the transmission of single incident; Criticize the incident transmitter, be used to realize the transmission of batch event.
Preferably, described incident transmitting element also comprises event channel type selecting unit, and being used for selecting is CORBA Notification channel type, still self-defined channel type.
Preferably, described single event transmitter comprises: the event type object interface is used to receive the event type object; The event channel acquiring unit is used for obtaining quoting of event channel according to event type information from this event server; Incident sends and acts on behalf of creating unit, is used to create CORBA Notification incident and sends agent object.
Preferably, described incident receiving element comprises: incident type of receipt selected cell, and being used for the selective reception type is to receive one by one or receive in batches; The event schema judging unit, being used for judgment model is push pattern or puu pattern; The event subscription unit is used for receiving event subscription information from the incident recipient on upper strata, and according to the reception of event subscription information realization event; The event transmission unit is used for according to the incident generation event type object that receives and offers the upper strata handling.
Preferably, described incident receiving element also comprises event channel type judging unit, and being used to determine is CORBA Notification channel type, still self-defined channel type.
Preferably, described event subscription unit comprises: the subscription information receiving element, be used to receive event subscription information, and comprise event type information and event filtering condition; The event channel acquiring unit is used for obtaining quoting of event channel according to event type information from this event server; Incident receives and acts on behalf of creating unit, is used to create CORBA Notification incident and receives agent object.
The present invention also provides a kind of event communication method, comprises step:
1) create event channel according to channel allocation information and preserve all event channels and quote, described channel allocation information comprises the corresponding relation of event channel and event type;
2) Event senders generates the event type object; Described event type object comprises message carrier and message header access part, wherein message carrier is used for depositing message to be sent with the general purpose event structure, described message header access part is used for according to the message header of event type filling general purpose event structure or from the message header information extraction;
3) encapsulation message to be sent is the general purpose event structure; The incident transmitting element obtains quoting of event channel according to event type, and the establishment incident sends agent object and is connected to event channel, the transmission of realization event;
4) the incident receiving element receives event type information, according to quoting of event type information acquisition event channel; The establishment incident receives agent object and is connected to event channel, the reception of realization event; Generate the event type object according to the incident that receives;
5) the incident recipient is from the message content of this event type object acquisition transmission.
Preferably, described step 3) also comprises obtain the address of opposite end according to event type when channel type is self-defined passage; With message to be sent form packing according to the incident recipient; Connect with the opposite end; Connect the transmission of realization event based on this; Described step 4) also comprises when passage is self-defined passage, generates the event type object according to the packet that receives.
Preferably, described step 2) described general purpose event structure is meant the StructuredEvent structure that CORBA Notification service is used.
Preferably, described event type object also comprises message body access part, is used for according to the message body of event type filling general purpose event structure or from the message body information extraction; The encapsulation of described step 3) specifically partly realizes by message header access part and/or message body access; Obtaining specifically of described step 5) partly realizes by message header access part and/or message body access.
With respect to prior art, the invention has the beneficial effects as follows: at first, owing to generate the event type object among the present invention, can realize the automatic filling and the extraction of the message header of general purpose event structure, promptly realize encapsulation to the general purpose event structure, and create event channel by event server, obtaining and operation such as be connected by incident transmitting element and incident receiving element realization event passage, promptly the upper strata is encapsulated these operations, thereby reduced Event senders and incident recipient's use complexity, the portable and compatible of system can be improved simultaneously, the incident sending mode can also be under the situation that does not change upper procedure, revised.
In addition, in preferred version of the present invention, can realize the processing that sends and receive according to the type of passage, therefore, the present invention not only can be applicable to the Notification pattern of COBRA, can also be applied to non-COBRA, the event communication mechanism of structure conventional system.
Description of drawings
Fig. 1 is the schematic diagram that COBRA Notification is provided by the extendible general purpose event structure that provides;
Fig. 2 is the block diagram of event communication device of the present invention;
Fig. 3 is the block diagram of incident transmitting element shown in Figure 2;
Fig. 4 is the block diagram of single event transmitter shown in Figure 3;
Fig. 5 is the block diagram of incident receiving element shown in Figure 2;
Fig. 6 is the block diagram of event subscription unit shown in Figure 5;
Fig. 7 is the block diagram of the event communication device of embodiments of the invention;
Fig. 8 be message header access part in the embodiments of the invention and message body access partly with the schematic diagram of the corresponding relation of general purpose event structure;
Fig. 9 is the flow chart that the incident in the embodiments of the invention sends;
Figure 10 is the flow chart of the event subscription in the embodiments of the invention;
Figure 11 is the flow chart that the incident in the embodiments of the invention receives;
Figure 12 is the flow chart of event communication method of the present invention.
Embodiment
Seeing also Fig. 2, is the block diagram of event communication device of the present invention.
This event communication device comprises event type object unit 100, event server 200 and incident transmitting element 300, incident receiving element 400.
Wherein, this event type object unit 100 can be positioned at the Event senders 800 and the incident recipient 900 on upper strata, is respectively applied for to generate the event type object and resolve the event type object.Certainly, described event type object unit 100 also can lay respectively in incident transmitting element 200 and the incident transmitting element 300; Perhaps lay respectively between Event senders 800 and the incident transmitting element 200, between incident recipient 900 and the incident receiving element 300.
The event type object that described event type object unit 100 generates comprises message carrier, is used for depositing message to be sent with the general purpose event structure; Message header access part is used for according to the message header of event type filling general purpose event structure or from the message header information extraction.
This event server 200 is used for according to channel allocation information establishment event channel and preserves all event channels and quote, and described channel allocation information comprises the corresponding relation of event channel and event type;
Incident transmitting element 300 is used for the transmission incident, comprise from the Event senders 800 on upper strata and obtain the event type object, obtain quoting of event channel according to event type information from event server 200, the Notification incident of creating a standard sends agent object and is connected to described event channel, and the message that encapsulates is sent.
Incident receiving element 400 is used for the reception incident, comprise according to the event type information of importing into and obtain quoting of event channel from event server 200, the Notification incident of creating a standard receives agent object and is connected on the event channel, realize the reception of message, generate the event type object and send the incident recipient 900 on upper strata to according to wherein event structure body.
See also Fig. 3, described incident transmitting element 300 comprises:
Incident transmission types selected cell 310, being used to select transmission types is to send one by one or send in batches;
Event schema selected cell 320, being used for preference pattern is push pattern or pull pattern;
Single event transmitter 330 is used to realize the transmission of single incident;
Criticize incident transmitter 340, be used to realize the transmission of batch event.
In addition, described incident transmitting element 300 also comprises event channel type selecting unit 350, and being used for selecting is the Notification channel type, still self-defined channel type (detailed aftermentioned).
See also Fig. 4, this single event transmitter 330 comprises: event type object interface 331 is used to receive the event type object; Event channel acquiring unit 332 is used for obtaining quoting of event channel according to event type information from event server 200; Incident sends and acts on behalf of creating unit 333, and the Notification incident that is used for creating a standard sends agent object.
See also Fig. 5, described incident receiving element 400 comprises:
Incident type of receipt selected cell 410, being used for the selective reception type is to receive one by one or receive in batches;
Event schema judging unit 420, being used for judgment model is push pattern or pull pattern;
Event subscription unit 430 is used for receiving event subscription information from the incident recipient on upper strata, and according to the reception of event subscription information realization event;
Event transmission unit 440 is used for according to the incident generation event type object that receives and offers the upper strata handling.
In addition, described incident receiving element 400 also comprises event channel type judging unit 450, and being used to determine is the Notification channel type, still self-defined channel type (detailed aftermentioned).
See also Fig. 6, this event subscription unit 430 comprises: subscription information receiving element 431, be used to receive event subscription information, and comprise event type information and event filtering condition; Event channel acquiring unit 432 is used for obtaining quoting of event channel according to event type information from event server 200; Incident receives and acts on behalf of creating unit 433, and the Notification incident that is used for creating a standard receives agent object.
For the ease of to further understanding of the present invention, be that example is described the present invention with event communication below based on CORBA Notification service realization.
Please refer to Fig. 7, is the block diagram of the event communication device of present embodiment.
Wherein, incident transmitting element 300 is that an incident sends proxy class Supplier Proxy; Incident receiving element 400 is that an incident receives proxy class Consumer Proxy.
The general purpose event structure StructuredEvent that service is adopted based on CORBA Notification, the event type object that the event type object unit 100 in the present embodiment generates adopts an incident base class (EventBase) to realize.Wherein, message carrier is the member variable of EventBase, and the type of described member variable is exactly StructuredEvent.The message header access partly is the some access functions that define among the EventBase.Several access functions are used for the content of field of the represented message of member variable among the access EventBase, play the effect of interface.
User-defined concrete event type is all inherited from EventBase, message field of every increase, then in derived class, add corresponding access function, be responsible in the incident body that value with specific field is filled into inner StructuredEvent or from the incident body, take out the field value of appointment, the statement of this part function and realization are all similar, can use predefined macro to realize, as stating a grand event field and an access function thereof that is used to state a short type of DECLARE_EVENT_ATTRIBUTE_SHORT, and state that the grand function that provides of and IMPLEMENT_EVENT_ATTRIBUTE_SHORT realizes that defining an event type does not so just need extra coding work.
With reference to figure 8, be the corresponding relation figure of some access functions and StructuredEvent structure in certain User Defined event class of described succession EventBase.Wherein,
Obtain domain information (getDomain): the domain information that from incident, obtains incident;
Domain information (setDomain) is set: the domain information field in the incident is set;
Obtain event type (getType): from incident, obtain event type information;
Event type (setType) is set: the event type field in the incident is set;
Obtain incident title (getEventName): the incident name information of from incident, obtaining;
Incident title (setEventName) is set: the event name field in the incident is set;
First obtains function (get_name_1): obtain a field information in the incident body, this field is the User Defined field;
First is provided with function (set_name_1): a field information in the incident body is set, and this field is the User Defined field;
Second obtains function (get_name_2): obtain another field information in the incident body, this field is the User Defined field;
Second is provided with function (set_name_2): another field information in the incident body is set, and this field is the User Defined field.
Do not use the variable message header part of StructuredEvent and the expansion of incident body in this example.
The number of access function will determine that in general for corresponding two access functions of a field of message, one of them is used for obtaining the content of this field according to the number of the field of transmission message, and another is used for being provided with the content of this field.
In addition, the encapsulation of described message carrier also can realize that this does not give unnecessary details by a plurality of access functions.
The event server 200 of present embodiment is responsible for creating event channel according to pre-configured channel allocation information in Notification, channel allocation information comprises that needs are created several event channels and each passage is respectively applied for which event type of transmission, and passage establishment back event server 200 portion is within it preserved all passage object references.
Event server 200 also provides the interface that obtains corresponding event channel object reference according to event type.Event type is defined voluntarily by the user, is a character string, has illustrated that in configuration file which passage is the incident of this type should send from, so event server 200 can find corresponding passage and quotes.Event type can leave the event header part of StructuredEvent in, also can leave the ad-hoc location of incident body in, and the implementor can determine according to actual conditions.The user can dispose a plurality of event types and use same event channel, also can dispose a kind of event type and send on a plurality of event channels.
Suppose to have three event channels, one is the general purpose event passage, and one is the alarm event passage, and one is the performance event passage.Event server 200 can be provided with passage one as the general purpose event passage, transmits two kinds of event types, and these two kinds of event types are respectively alarm module general purpose event and performance module general purpose event; Passage two transmits the incident of alarm event type as the alarm event passage; Passage three is as performance event passage, the incident of conveying function event type.Then corresponding channel arrangement file is as follows:
<Channel name=" 1 " 〉; Passage one
<Partition name=" Common " 〉; The general purpose event passage
<param name=" EventType "〉AlarmCommon</param 〉; Alarm type
<param?name="EventName">AlarmCommon1</param>
</Partition>
<Partition name=" Common " 〉; The general purpose event passage
<param name=" EventType "〉PerformCommon</param 〉; Type of performance
<param?name="EventName">PerformCommon1</param>
</Partition>
</Channel>
<Channel name=" 2 " 〉; Passage two
<Partition name=" Alarm " 〉; The alarm event passage
<param name=" EventType "〉Alarm</param 〉; Alarm type
<param?name="EventName">AlarmEvent</param>
</Partition>
</Channel>
<Channel name=" 3 " 〉; Passage three
<Partition name=" Perform " 〉; The performance event passage
<param name=" EventType "〉Perform</param 〉; Type of performance
<param?name="EventName">PerformEvent</param>
</Partition>
</Channel>
Described configuration file is the configuration file of the event channel of CORBA Notification service, promptly uses the event channel of CORBA Notification service to send and receive message.Event communication device of the present invention can also use self-defining event channel, and the information that the configuration file of so self-defining event channel comprises can be the address of Event senders and incident recipient place system.
The incident transmitting element 300 of present embodiment adopts an incident to send proxy class Supplier Proxy and realizes.With C++ is example, and the concrete example of described Supplier Proxy is as follows:
class?Supplier?Proxy
{
public:
SupplierProxy(
EventClientType?clientType,
// incident transmission types: 1) SINGLE_EVENT sends one by one, 2) LIST_OF_EVENT sends in batches,
EventClientMode?clientMode,
// event schema: 1) push 2) pull
ConnectionMode?mode
// channel type: indication is with the type of the event channel of use, 1) USING_NOTIFY: use the event channel of CORBANotification service, 2) and PUSH_DIRECTLY: use self-defining event channel;
virtual~EventSupplierProxy();
Int doPushEvent (EventBase﹠amp; Event); // this function is used to send a single incident
Int addEvent (EventBase﹠amp; Event); // be used for adding an incident to buffer memory,
Intflush (); // be used for all incidents of current cache are sent
}
Incident sends proxy class SupplierProxy a doPushEvent interface externally is provided, and this interface is used for the transmission incident, to external shield mutual between inner and the Notification service, comprise that event channel searches, connect and transmission.The user only need generate a SupplierProxy class example, calls its doPushEvent interface, imports incident to be sent into and gets final product.
SupplierProxy inside comprises a standard Notification ProxySupplier, i.e. incident transmitter, and this incident transmitter is used to connect event channel and the transmission incident of Notification.
In the doPushEvent of SupplierProxy interface inside, from event server, obtain corresponding event channel object reference according to the event type that imports into, the StructuredEvent that takes out then in the User Defined incident sends on the respective channel.
See also Fig. 9, the processing procedure of doPushEvent is described in detail in detail below.
Step 401, the value of taking-up event type field from incident to be sent;
Step 402 is taken out channel type;
Step 403 judges whether described channel type is PUSH_DIRECTLY;
If not, promptly described channel type is USING_NOTIFY, then carries out following steps:
Step 404 is obtained the event channel object reference of corresponding event type to be sent from event server 200;
Step 405 is created the object of the incident transmitter (Notification ProxySupplier) of corresponding CORBA Notification service according to incident transmission types and event schema;
Step 406 is connected to Notification ProxySupplier object on the event channel,
Step 407 sends incident by Notification ProxySupplier object;
If promptly described channel type is PUSH_DIRECTLY, then carries out following step:
Step 408 is obtained the address information of the goal systems (incident recipient) of corresponding event type to be sent from event server;
Step 409 is dressed up the form that goal systems (incident recipient) requires with message groups to be sent;
Step 410, same goal systems (incident recipient) connect;
Step 411, the connection of passing through to be set up sends message.
The incident receiving element 5 of present embodiment adopts an incident to receive proxy class Consumer Proxy and realizes.With C++ is example, and the concrete example of Consumer Proxy is as follows:
class?ConsumerProxy
{
public:
ConsumerProxy(
EventClientType?clientType,
// incident type of receipt: 1) the SINGLE_EVENT single event receives 2) LIST_OF_EVENT: batch incident receives
EventClientMode?clientMode,
// event schema: 1) push 2) pull
ConnectionMode?mode,
// channel type: indication is with the channel type that uses, 1) USING_NOTIFY: use the event channel of Corba Notification service, 2) PUSH_DIRECTLY: use self-defining event channel);
virtual?ConsumerProxy();
int?subscribe(
Const char*EventType, //EventType is corresponding to the EventType in the configuration file
Std::list<string〉﹠amp; EventNameList, //EventNameList is a character string sequence, can comprise a plurality of EventName
Const char*constraint, //constraint is the filtercondition of conformance with standard Notification filtercondition grammer); //subscribe function is used for the subscription incident
virtual?void?pushEvent(
EventBase?event
)=0;
; //pushEvent need be realized by upper layer application, is used to handle the incident that receives
Incident receives proxy class ConsumerProxy a subscribe interface and a pushEvent Virtual Function is provided, and the user needs heavily loaded pushEvent function, handles the incident that receives in this function.
The subscribe function is used for the subscription incident, comprises event type information and event filtering condition in its input parameter, and event type information comprises each field information in the fixed length message header, comprises domain name, event type and incident title.The grammer of event filtering condition is according to the CORBA Notifcation service definition of standard.
It is the incident receiver that ConsumerProxy inside comprises a standard N otification ProxyConsumer, this incident receiver is used to connect the event channel of Notification, calls the pushEvent function of ConsumerProxy after the incident of receiving.
In subscribe function inside, at first from event server, obtain corresponding event channel object reference, then the Notification ProxyConsumer of inside is connected to event channel and calls the corresponding interface filtercondition is set according to the event type information of input.
As shown in figure 10, the handling process of event subscription is as follows:
Step 501 is taken out quoting of event channel according to event type to be received from event server 200;
Step 502 is taken out channel type;
Step 503 judges that whether described channel type is for being PUSH_DIRECTLY;
If not, promptly channel type is USING_NOTIFY, then carries out following step:
Step 504 is created the object of the incident receiver (Notification ProxyConsumer) of corresponding CORBA according to incident type of receipt and event schema;
Step 505 is connected to the object of Notification ProxyConsumer on the event channel;
Step 506 is set to the event channel that has connected with the filtercondition of incident to be received;
If promptly described channel type is PUSH_DIRECTLY, then carries out following steps:
Step 507 is from the address of event server 200 taking-up goal systems;
Step 508, (Event senders) connects with goal systems;
Step 509 requires to send event subscription requests according to goal systems (Event senders);
Step 510 judges whether goal systems (Event senders) is supported to filter;
If judged result is for supporting that then execution in step 512, and filtercondition is sent on the goal systems (Event senders);
If judged result is not for supporting that then execution in step 511), filtercondition is preserved.
As shown in figure 11, the handling process of incident reception is as follows:
Step 610, the decision event source; Carry out the corresponding subsequent process according to Event origin;
If arrive, then carry out following step from the Notification passage:
Step 620 is used the inner customized event form EventBase of Notification StructuredEvent structure that receives;
Step 630, the PushEvent function that calls the upper layer application realization imports customized event into;
Step 640 in PushEvent function inside, uses the access function of customized event to obtain event information;
If arrive, then carry out following step from the PUSH_DIRECT passage:
Step 650 if peer-to-peer system is not carried out event filtering, is then carried out filter operation in this locality;
Step 660 is used the inner customized event form EventBase of packet structure that receives; Enter step 630 subsequently.
Seeing also Figure 12, is the flow chart of event communication method of the present invention.
Event type is inherited and formed to step 110;
Step 120 is created event channel and is preserved quoting of event channel;
Step 130, the Event senders generates the event type object;
Step 140, encapsulating message to be sent is the general purpose event structure; The incident transmitting element obtains quoting of event channel according to event type; The transmission of realization event;
Wherein, also comprise the judgement channel type, if Notification, then establishment incident sends agent object and is connected to event channel; If self-defined channel type, then obtain the address of opposite end and connect according to event type;
Step 150, the incident receiving element receives event type information, according to quoting of event type information acquisition event channel;
Step 160, the reception of realization event; Generate the event type object according to the incident that receives;
Wherein, also comprise the judgement channel type, if Notification, then establishment incident receives agent object and is connected to event channel; If self-defined channel type then generates the event type object according to the packet that receives;
Step 170, the message content that incident recipient sends from this event type object acquisition.
In the present embodiment, adopt method of the present invention after, the use step on upper strata is as follows:
Inherit and define the event type of oneself from EventBase;
The Event senders generates a SupplierProxy object, the example of a described event structure of message establishing to be sent also uses some access units to fill each field in the message carrier unit, and the doPushEvent that calls SupplierProxy then sends message;
Incident recipient generates a ConsumerProxy object, calls subscribe and subscribes to the event type of being concerned about, when having message to arrive, the PushEvent that calls ConsumerProxy handles the message that receives.
And the internal processes of the event communication device of present embodiment can be described below:
Reading configuration file information when event server starts is created the event channel of specified quantity as required, all event channels is quoted be kept at inner buffer then;
When the Event senders sends incident, generate a self-defining event type object, fill each field value after, generate a SupplierProxy object, the doPushEvent function that calls this object then sends incident.
In doPushEvent function inside, from the event type object that imports into, take out event type information, the interface that calls event server obtains the event channel object reference, create respective numbers (according to concrete configuration, a kind of event type may send on a plurality of passages) Notification ProxySupplier object and be connected on these event channels, from the event type object that imports into, take out standard StructuredEvent structure then and the interface by ProxySupplier sends incident;
Incident recipient generates a ConsumerProxy object, call its subscribe interface and subscribe to incident, in subscribe function inside, according to the event type tabulation of importing into, the interface that calls event server obtains all event channel object references relevant with these event types, create the Notification ProxyConsumer object of respective numbers then and be connected on these event channels, filtercondition is set simultaneously.When having incident to arrive on certain event channel, ConsumerProxy is inner to be received these incidents and constructs an EventBase object, the event structure body that receives is put into the pushEvent function of this object and invoke user heavy duty, by the user program code incident is handled in this function inside.
In addition, the present invention is applicable to that (interface that initiatively calls the Event senders by event channel under the pull pattern needs the incident that sends to obtain, and incident recipient then is that the interface that initiatively calls event channel obtains incident for the push of Notification service and pull pattern; Under the push pattern, the incident that the Event senders initiatively calls the interface of event channel will be needed to send is imported into, the interface that is initiatively called the incident recipient by event channel sends to the incident recipient with incident), be applicable to the single event send mode of Notification simultaneously and criticize the event sending party formula that (the single event send mode once only sends an incident, criticize the event sending party formula and once send a sequence of events, wherein may comprise one or more incidents).
In sum, the present invention encapsulates the general purpose event form that Notification uses, simultaneously establishment, the object reference that upper layer module has been encapsulated Notification Service events passage obtain, operation such as passage connection, reduce the complexity of using, improve the portable and compatible of system simultaneously, system integration function flexibly is provided.
In one embodiment of the present of invention, packaged type to the Notification service comprises that the StructuredEvent with general is packaged into the object class of concrete programming language, the proxy class that provides incident to send and receive simultaneously, simplify the complexity that the Notification service is used, improved the flexibility ratio of using.Example herein is based on C++, but encapsulation mode provided by the present invention is applicable to C++ and Java simultaneously.
Present embodiment is based on the Notification pattern of CORBA, but this encapsulation mode can be applied to non-CORBA system, is used to construct the event communication mechanism of conventional system.
In a word, by the present invention, the good encapsulation of Notification service having carried out to the use of Event Service system bottom, not only reduced the complexity that upper layer module uses Notification to serve, and can reduce the difficulty that system transplants in the CORBA of different vendor realizes, realize striding the characteristic that CORBA realizes more easily.
Simultaneously, owing to upper layer application has been shielded the realization details of bottom, therefore the Event Service system can change the incident sending mode under the situation that does not influence upper layer application: because after through encapsulation, upper level applications in fact not understanding incident is to send or send by batch event schema by the single event pattern, using the Push pattern still is the Pull pattern, uses separate event passage or and the shared event channel of other incidents.Therefore can make amendment (using the mode of configuration file to revise) at the Event Service system bottom to satisfy different application scenarioss, and upper layer application can not change, as can be according to the situation of practical application, two passages that the incident flow is little merge, originally all event types that send in these two passages the insides are incorporated in the passage send, equally, can the passage that the incident flow is big be divided into two or morely, the event type that sends in same passage the inside originally be distributed in the different event channels go.
And, can not use the Notification service incident of carrying out to send where necessary and the event sending party formula such as direct the uses TCP that use other instead connects transmission.Because the incident of top service receives and incident sends the interface interchange that does not in fact all directly relate to the Notification service, what use all is the interface that the internal event service is provided, and that is to say upper layer application and the incident of not knowing sends reception by what mode.Like this, suppose that custom system need carry out event communication with outside non-CORBA system, then can serve bottom at internal event makes amendment, dopushEvent inside at SupplierProxy, submit to the event content of transmission to take out the user, be assembled into the event format of peer-to-peer system requirement, set up TCP with peer-to-peer system and connect, connect by TCP then incident is issued the other side; Equally, also can connect the incident that the reception external system sends, be reassembled into the internal event form, call the pushEvent interface of ConsumerProxy then incident is passed to upper layer application by TCP.Can provide system integration function flexibly like this and not need the upper strata should do too many change.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (11)

1. an event communication device is characterized in that, comprising:
The event type object unit, be used to generate the event type object and resolve the event type object, described event type object comprises message carrier and message header access part, wherein message carrier is used for depositing message to be sent with the general purpose event structure, and described message header access partly is used for according to the message header of event type filling general purpose event structure or from the message header information extraction;
Event server is used for creating event channel and preserving all event channels and quote according to channel allocation information, and described channel allocation information comprises the corresponding relation of event channel and event type;
The incident transmitting element, be used for the transmission incident, comprise from the Event senders on upper strata and obtain the event type object, obtain quoting of event channel from this event server according to event type information, the establishment incident sends agent object and is connected to described event channel, and the message that encapsulates is sent;
The incident receiving element, be used for the reception incident, comprise according to the event type information of importing into and obtain quoting of event channel from this event server, the establishment incident receives agent object and is connected on the event channel, realize the reception of message, generate the event type object and send the incident recipient on upper strata to according to wherein event structure body.
2. event communication device according to claim 1 is characterized in that, described incident transmitting element comprises: incident transmission types selected cell, and being used to select transmission types is to send one by one or send in batches; The event schema selected cell, being used for preference pattern is push pattern or pull pattern; The single event transmitter is used to realize the transmission of single incident; Criticize the incident transmitter, be used to realize the transmission of batch event.
3. event communication device according to claim 2 is characterized in that, described incident transmitting element also comprises event channel type selecting unit, and being used for selecting is CORBA Notification channel type, still self-defined channel type.
4. event communication device according to claim 2 is characterized in that, described single event transmitter comprises: the event type object interface is used to receive the event type object; The event channel acquiring unit is used for obtaining quoting of event channel according to event type information from this event server; Incident sends and acts on behalf of creating unit, is used to create CORBA Notification incident and sends agent object.
5. event communication device according to claim 1 is characterized in that, described incident receiving element comprises: incident type of receipt selected cell, and being used for the selective reception type is to receive one by one or receive in batches; The event schema judging unit, being used for judgment model is push pattern or pull pattern; The event subscription unit is used for receiving event subscription information from the incident recipient on upper strata, and according to the reception of event subscription information realization event; The event transmission unit is used for according to the incident generation event type object that receives and offers the upper strata handling.
6. event communication device according to claim 5 is characterized in that, described incident receiving element also comprises event channel type judging unit, and being used to determine is CORBA Notification channel type, still self-defined channel type.
7. event communication device according to claim 5 is characterized in that, described event subscription unit comprises: the subscription information receiving element, be used to receive event subscription information, and comprise event type information and event filtering condition; The event channel acquiring unit is used for obtaining quoting of event channel according to event type information from this event server; Incident receives and acts on behalf of creating unit, is used to create CORBA Notification incident and receives agent object.
8. an event communication method is characterized in that, comprises step:
1) create event channel according to channel allocation information and preserve all event channels and quote, described channel allocation information comprises the corresponding relation of event channel and event type;
2) Event senders generates the event type object; Described event type object comprises message carrier and message header access part, wherein message carrier is used for depositing message to be sent with the general purpose event structure, described message header access part is used for according to the message header of event type filling general purpose event structure or from the message header information extraction;
3) encapsulation message to be sent is the general purpose event structure; The incident transmitting element obtains quoting of event channel according to event type, and the establishment incident sends agent object and is connected to event channel, the transmission of realization event;
4) the incident receiving element receives event type information, according to quoting of event type information acquisition event channel; The establishment incident receives agent object and is connected to event channel, the reception of realization event; Generate the event type object according to the incident that receives;
5) the incident recipient is from the message content of this event type object acquisition transmission.
9. event communication method according to claim 8 is characterized in that, described step 3) also comprises obtains the address of opposite end according to event type when channel type is self-defined passage; With message to be sent form packing according to the incident recipient; Connect with the opposite end; Connect the transmission of realization event based on this; Described step 4) also comprises when passage is self-defined passage, generates the event type object according to the packet that receives.
10. according to Claim 8 or 9 described event communication methods, it is characterized in that described step 2) described general purpose event structure is meant the StructuredEvent structure that CORBA Notification service is used.
11. according to Claim 8 or 9 described event communication methods, it is characterized in that described event type object also comprises message body access part, be used for filling the message body of general purpose event structure or from the message body information extraction according to event type; The encapsulation of described step 3) specifically partly realizes by message header access part and/or message body access; Obtaining specifically of described step 5) partly realizes by message header access part and/or message body access.
CNA200510125925XA 2005-11-25 2005-11-25 Event communication device and method Pending CN1870525A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CNA200510125925XA CN1870525A (en) 2005-11-25 2005-11-25 Event communication device and method
PCT/CN2006/001643 WO2007059669A1 (en) 2005-11-25 2006-07-11 An apparatus of event communication and the method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA200510125925XA CN1870525A (en) 2005-11-25 2005-11-25 Event communication device and method

Publications (1)

Publication Number Publication Date
CN1870525A true CN1870525A (en) 2006-11-29

Family

ID=37444082

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA200510125925XA Pending CN1870525A (en) 2005-11-25 2005-11-25 Event communication device and method

Country Status (2)

Country Link
CN (1) CN1870525A (en)
WO (1) WO2007059669A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106557375A (en) * 2016-11-21 2017-04-05 桂林远望智能通信科技有限公司 Communication system and method between a kind of encapsulation class

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6912718B1 (en) * 1999-03-25 2005-06-28 International Business Machines Corporation Event notification channel between supplier and consumer objects in object oriented programming system with proxy consumer objects to maintain uninterrupted event transmission during consumer object off line maintenance
EP1119135A3 (en) * 2000-01-13 2001-09-12 Agilent Technologies Inc. a Delaware Corporation Apparatus and method for a push service

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106557375A (en) * 2016-11-21 2017-04-05 桂林远望智能通信科技有限公司 Communication system and method between a kind of encapsulation class
CN106557375B (en) * 2016-11-21 2020-05-12 桂林远望智能通信科技有限公司 Communication system and method between encapsulation classes

Also Published As

Publication number Publication date
WO2007059669A1 (en) 2007-05-31

Similar Documents

Publication Publication Date Title
CN1142489C (en) Information handling method and information handling apparatus, and memory medium for storing server control program
CN1149492C (en) Remote control method, server and recording medium
CN1711784A (en) System and method for sending SMS and text messages
CN1277180C (en) Apparatus and method for adapting audio signal
CN1637710A (en) Method and system for scheduling invocation of web service in data processing basic structure
CN101056208A (en) Service tracking method, network device, O&amp;M controller, and service request device
CN1859332A (en) System, device and method for synchronously processing e-mail using data
CN101051937A (en) User&#39;s power managing method and system based on XML
CN1901490A (en) Method, apparatus, and program product for providing web service
CN1192098A (en) Distributed network computing system and information exchanging device and method for said system
CN101060464A (en) Address translator, message processing method and net system
CN101068243A (en) Interactive system for processing gateway level and service layer information and transmitting and receiving method
CN1716922A (en) Method and system for mobile device messaging
CN101075890A (en) Method and system for realizing group session experience quality
CN1248127C (en) Transmitting person mobile device, receiving person mobile device, information communication system, information communication method and server appts. thereof
CN1859392A (en) Service addressing method, system and its application
CN1265597C (en) Local proxy server
CN101040543A (en) Method for transmitting application-specific registration or de-registration data and system, server and communication terminal therefor
CN101047705A (en) Report process method, server for customer agent file information and its customer terminal
CN1645819A (en) Rapid and convenient communication network managing method
CN1778126A (en) Method and system for inserting a multimedia message multiple element into a multimedia message
CN1835508A (en) Method of converting and controlling separated network information exchange inside of net
CN1219389C (en) Service controlling network and controlling method thereof
CN1828532A (en) Method for transforming operation procedure to executing language
CN1625882A (en) Method of negotiation to digital item adaptation (dia)

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication