CN100544369C - A kind of message based distributed system and method for communicating therein - Google Patents

A kind of message based distributed system and method for communicating therein Download PDF

Info

Publication number
CN100544369C
CN100544369C CNB2006100759879A CN200610075987A CN100544369C CN 100544369 C CN100544369 C CN 100544369C CN B2006100759879 A CNB2006100759879 A CN B2006100759879A CN 200610075987 A CN200610075987 A CN 200610075987A CN 100544369 C CN100544369 C CN 100544369C
Authority
CN
China
Prior art keywords
service
access point
message
service access
module
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.)
Expired - Fee Related
Application number
CNB2006100759879A
Other languages
Chinese (zh)
Other versions
CN1984149A (en
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 CNB2006100759879A priority Critical patent/CN100544369C/en
Publication of CN1984149A publication Critical patent/CN1984149A/en
Application granted granted Critical
Publication of CN100544369C publication Critical patent/CN100544369C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The method that the present invention proposes a kind of message based distributed system and communicate therein, described system comprises at least one node, described node comprises that at least one finishes the module of specific function, described module comprises: at least one Service Access Point, be used to receive service request information, and finish required service according to described service request information; Message sender is used for service request information is sent to purpose Service Access Point request required service.Utilize the present invention, send the unified message sender that uses of message, accept the unified service point access unit that uses of message, the user need not be concerned about specifying information, the access service point identification that only need know the opposite end just can be finished the communication under distributed environment, simplify development difficulty, improved the reliability and the expandability of system.

Description

A kind of message based distributed system and method for communicating therein
Technical field
The present invention relates to network communication field, relate in particular to a kind of message based distributed system, and the method for in described system, utilizing message communicating.
Background technology
Along with IP (Internet Protocol, Internet protocol) the extensive extension and the bandwidth of network constantly increase, network provides bigger ability, by network to system's deployment that distributes, improved the performance and the flexibility of system greatly, the distributed software system framework is the essential characteristic of current a lot of systems.Distributed as a system-level framework, though have different considerations for different systems, but primary demand is arranged all, be distributed calling, specifically, client and service end can be distributed in the IP network, and the program of client and service end needn't be used identical translation and compiling environment and running environment, can use java (a kind of computer language) to write as client, service end is used C++ (a kind of computer language) language compilation, client may operate in the environment based on the Windows of the CPU of Intel (Intel) (central processing unit) (" form " operating system that MS produces), and service end operates on the SUN Solaris (operating system that U.S. Sun Company, Inc. produces).
Realize that the distributed several The key factor that need to consider of calling comprise: communication pattern, object parsing, coded system etc.
Communication pattern:
Each module of system for more complicated is that service end provides service, also is the service that client is used other modules simultaneously, and communication pattern is at a concrete scene, and following pattern is arranged:
Remote procedure call-client sends request to service end, wait-for-response, i.e. synchronous communication then.
Message transmission-client computer sends a request, does not expect a response.
Asynchronous readjustment-client computer is called service with one of above-mentioned dual mode, and both sides exchange the role, adjusts back, and this pattern can be with any structure in the aforementioned dual mode.
Object is resolved:
Because the distributed deployment of system module, no longer on a process even machine, the title that communication object must be arranged before calling, this title should be in logic more independently, keep unique in the system,, after deployment changes, needing not avoid update routine, therefore generally need a name service that the name resolution service is provided with the physical resource binding.As CORBA (Common Object RequestBroker Architecture, Common Object Request Broker Architecture) use name (passing through name server) that the object location is provided, DCOM (Distributed Component Obiect Model, DCOM) the using system registration provides name service, J2EE (J2EE is the platform of an opening, measured develop and field) uses JNDI (JNDI, Java Naming and DirectoryInterface, Java name and directory interface) name Service is provided.
Coded system:
Communicating pair is owing to not necessarily use identical programming language and have identical CPU, so sample that understands differently to syllable sequence, as Java all is BigEndian (holding pattern, high priority, forward word preface, network word preface, UNIX word preface greatly), C Plus Plus is LittleEndian (little endian mode, preferential, the reverse word preface of low level, INTEL word preface, NT word preface) on Intel, is BigEndian on PowerPC (a kind of personal desktop computer); Except syllable sequence, it is also inconsistent that the internal memory of structure objects is arranged (Layout).The distributed both sides of calling need a kind of coded system of unanimity, coded system such as ASN.1 (Abstract Syntax Normal dot 1 commonly used, a kind of use digital coding standard more widely) and CDR (Common Data Representation, common data is represented, the digital coding mode of using among the CORBA).
In the prior art, CORBA is very ripe a kind of distributed development technology.As shown in Figure 1, can be summarized as usually based on the CORBA development procedure:
1. with the API (API) of IDL (Interface Difinition Language is used to describe the language of interface among the CORBA) document definition client (Client) and service end (Server);
2. the compiling idl file generates Client Agent (stub) code, service end skeleton (skeleton) code;
3. on the basis of agency and skeleton, realize service end and client respectively.
Wherein, ORB (Object Remote Broker) Core is the object remote agent core of CORBA the inside among the figure.
Yet, in the above-mentioned existing following shortcoming that exists in the technology of CORBA as distributed development:
1. use complexity, learning cost height.Directly use the CORBA exploitation, need the knowledge of study a lot, concerning most C++ programmer, compare difficulty.
2.CORBA support the method for calling of similar C++, realize that general OO (Object Oriented, OO) systematic comparison is convenient, but, need a large amount of message of concurrent processing, therefore for some fields, usually do not need complicated OO modeling, but need asynchronous pass-along message and notice.
3. only support single coded system.When using the CORBA technology, at user definition after the IDL structure, use the CDR coding automatically, and, have other coded system for some implant systems, as ASN.1, at this moment need between IDL and other coded systems, change.
4. the size of code of Sheng Chenging is big, and the internal memory and the hard drive space that take are big.For the application on some non-servers, as embedded board, memory span is limited, uses the IDL defining interface to cause a large amount of codes, and these codes will be compiled in the system, cause file destination very big.
5. HA (high availability) and LB telecommunications requirements such as (load balances) can't supported.When using the CORBA technology, directly use the IDL defining interface, because each IDL direct compilation becomes code (comprising encoding and decoding/communication process), these codes are dispersed in system everywhere, and these codes also are that the user can not revise, the user can't unify in a place to handle, and the contour availability requirement of HA, LB system can handle at some points, as inlet or outlet.
Summary of the invention
The purpose of this invention is to provide a kind of message based distributed system, this system can reduce the difficulty of distributed development.The invention allows for a kind of method of in described system, utilizing message to communicate.For this reason, the invention provides following technical scheme:
A kind of message based distributed system, described system comprises at least one node, and described node comprises that at least one finishes the module of specific function, and described module comprises: at least one Service Access Point and message sender; Described Service Access Point is the external interface of module, and each described Service Access Point has unique service access point identity in described system, and described Service Access Point is used to receive service request information, and finishes required service according to described service request information; Described reception service request information is specially: the service request information that receives disparate modules in this node; Perhaps, receive the service request information of module in other nodes; Described message sender is used for service request information is sent to the purpose Service Access Point, the request required service.
Described Service Access Point has unique service access point identity in described system; The sign that comprises the purpose Service Access Point in the described message.
Described message sender comprises:
The synchronization message transmitter is used for synchronization message is sent to the purpose Service Access Point, asks required service, and service result is returned to the sender;
The asynchronous message transmitter is used for asynchronous message is sent to the purpose Service Access Point, the request required service, but not responsible service result is returned to the sender.
Described Service Access Point comprises: at least one service execution unit, finish required service according to service request information; Message sink and scheduling unit receive service request information, and are distributed to corresponding service execution unit.
Described message sink and scheduling unit specifically comprise: synchronization message receives and scheduling unit, receives the synchronization message of service requester, calls corresponding service execution unit and finishes required service, and service result is returned to service requester.
Asynchronous message receives and scheduling unit, receive the synchronization message of service requester, and be distributed to corresponding service execution unit, treat that described service execution unit is finished service after, create new information, service result is placed in the described new information sends to service requester by message sender.
Described node also comprises name server, is used to provide name Service; Described Service Access Point is registered to described name server with the sign and the reference address of this Service Access Point; Described message sender obtains the reference address of purpose Service Access Point according to the purpose Service Access Point Indicator in the message from name server, and message is sent to the purpose Service Access Point.
Described message comprises message header and message body, comprises the Service Access Point Indicator that sends described message in the described message header at least, and the Service Access Point Indicator that receives described message, and described message body includes the data of service needs.
Described Service Access Point Indicator number is made up of node number, module No. and Service Access Point.
Described module also is provided with a backup module.
Described module also comprises the Service Access Point list memory, is used for storing all Service Access Points of described module.
Described module also comprises a Service Access Point administrative unit, is used for managing all Service Access Points in the described module.
The present invention also provides a kind of method of utilizing message to communicate in distributed system, communicate in distributed system by Service Access Point, described Service Access Point is the external interface of module, each described Service Access Point has unique service access point identity in described system, described Service Access Point comprises first Service Access Point and second Service Access Point, being used for first Service Access Point serves to the second Service Access Point request, described first Service Access Point and described second Service Access Point are respectively in the module of different nodes, perhaps, described first Service Access Point and described second Service Access Point said method comprising the steps of in the disparate modules of same node:
1) described first Service Access Point sends message by message sender to described second Service Access Point;
2) described second Service Access Point receives message, carries out required service;
3) described second Service Access Point returns service result.
Described message is synchronization message, described step 2) be specially: described second Service Access Point receives message, calls the respective service performance element, finishes required service.
Described message is asynchronous message, described step 2) be specially: described second Service Access Point sends to corresponding service execution unit with described message, and described service execution unit is finished required service.
Described step 3) is specially: described second Service Access Point is created new message, and service result is put into described new information, sends to described first Service Access Point by message sender.
Described message comprises message header and message body, comprises the Service Access Point Indicator that sends described message in the described message header at least, and the Service Access Point Indicator that receives described message, and described message body includes the data of service needs.
Described Service Access Point is by the Service Access Point Indicator unique identification, and described Service Access Point Indicator number is made up of node number, module No. and Service Access Point.
Described module also is provided with a backup module, described step 1) is specially: described first Service Access Point is served to the second Service Access Point request by message sender, and described message sender sends the message of the described service of request respectively to described second Service Access Point that is positioned at all modules; Described step 3) is specially: described second Service Access Point that is positioned at non-backup module returns service result.
Because system of the present invention has adopted the hierarchy of node-module-Service Access Point, send the unified message sender that uses of message, receive the unified service point access unit that uses of message, the user need not be concerned about the specifying information of system, the access service point identification that only need know the opposite end just can be finished the communication under distributed environment, simplified the step of distributed development, reduced the difficulty of distributed development, improved the reliability of system, improved the expandability of system, for example can support unified message logging, realize the HA scheme by unified Message Processing.
Description of drawings
Fig. 1 is based on the common development procedure schematic diagram of CORBA;
Fig. 2 is the structural representation of system described in the present invention;
Fig. 3 is the flow chart of node cascade process;
Fig. 4 is host node and one the name Service structural representation during from the node cascade;
Fig. 5 is the directory tree schematic diagram of the name Service seen on the host node after the cascade;
Fig. 6 is a directory tree schematic diagram of seeing name Service after the cascade from node;
Fig. 7 is the structural representation according to node in the preferred embodiment of the invention;
Fig. 8 is a structural representation of realizing a module instance with C Plus Plus;
Fig. 9 is the synchronization call schematic flow sheet;
Figure 10 is the asynchronous call schematic flow sheet;
Figure 11 is the schematic diagram that native system is used in the HA scheme.
Embodiment
The invention will be further described below in conjunction with the drawings and specific embodiments, but not as a limitation of the invention.
Fig. 2 is the structural representation according to the distributed system of the preferred embodiment of the invention.As shown in Figure 2, in system, be distributed with a plurality of nodes, in node, comprise a plurality of modules of finishing specific function.
Node of the present invention be distributed in the wide area network or local area network (LAN) in.In Fig. 2, node 1 is a host node, and other nodes are from node, and host node logically defines, for example can be according to actual needs one of them independently node be arranged to host node, all the other nodes are arranged to from node.Unite by the mode of cascade from node and host node, this will be described in detail below this paper.Each node all has one unique " node number ", to distinguish mutually with other nodes.Each node all comprises a name server module, and all are registered to from node on the name server module of host node, visits by the cascade of name server module between node.This will be described in detail below.
Fig. 3 has described the process that is cascaded to the service of host node name from the name Service of node.
As shown in Figure 3, before cascade, all have only a root node Node0 (node 0) under the name server of all nodes, cascade process can be summarized as:
Step 101: the node Nodel (node 1) that below the root of host node name service, creates a directory, and be connected to oneself Node0;
Step 102: the node Node2 (node 2) that below the root of host node name service, creates a directory, and be connected to first Node0 from node;
Step 103:, be connected on the root of host node at the node Primary (master catalogue node) that under the root of namespace node service, creates a directory;
102,103 liang of the repeating steps step increases new for node, increases successively from node number, as Node3, Node4, Node5.......
Fig. 4 is the structural representation of host node and one name Service during from the node cascade.
Those skilled in the art should be appreciated that and creates the specific implementation process how node, directory node and these nodes pass through name server module gang by top description and known general knowledge, therefore, here repeats no more.
After Fig. 5 is cascade, the schematic diagram of the name Service directory tree of seeing from the name Service of host node.In Fig. 6, the root (Root) of host node name service catalogue tree is meaningful identical Node0 and Nodel down, being all module name catalogues of host node under the Nodel, is the catalogue (will describe in detail SAP hereinafter) of all Service Access Points of this module (SAP) below the module name catalogue.The catalogue of other nodes is connected under the root of host node name service catalogue tree, and its structure is identical with Nodel, as the Node2 among the figure, Node3.
After Fig. 6 is cascade, the schematic diagram of the name Service directory tree of seeing in the name Service from node.Should under the Root catalogue of node, a Node0 be arranged, under the Node0 these all module name catalogues from node, be the catalogue of all SAP of this module below the module name catalogue.Should also have a Primary node down from the root of node, below the Primary node, connect host node and other roots from node.
Fig. 7 is the structural representation of node according to the preferred embodiment of the present invention.Among the figure, 1, Service Access Point, 2 message senders.As Fig. 7 and shown in Figure 2, this preferred embodiment in, comprise a name server and a plurality of module of finishing specific function in each node.Each module all comprises a message sender 2 and at least one Service Access Point 1.
In this embodiment, message sender comprises synchronization message transmitter and asynchronous message transmitter.SAP then comprises at least one service execution unit and message sink and scheduling unit.Message sink and scheduling unit comprise that synchronization message receives and scheduling unit.
SAP is the external interface of module, and a SAP sign unique in system is all arranged.The SAP sign is to its outside that conducts interviews sign.SAP sign can be an overall hierarchical address unique in the system, and specifically, hierarchical address comprises node number, module No., SAP number.All SAP of module are registered on the name server of node corresponding with it by SAP.For example, in Fig. 6, each module with and the SAP that comprises all hang over below the corresponding N ode0.In addition, on the name Service module, also write down reality and wanted reference address (as physical address).When concrete visit, for example when visit by the hierarchical address of name Service according to service SAP, draw its actual access address, visit according to the actual access address then.
In module, the SAP sign generally is kept at ad-hoc location, and for example in an embodiment of the invention, the SAP sign is kept in the SAP list memory of a special use in the module.When system's initial start, module can be visited the SAP list memory, and according to the record in the SAP memory, the SAP that writes down is carried out initialization.Module can be nullified these SAP according to the record in the SAP memory when closing.Certainly, the present invention is not limited thereto, it should be appreciated by those skilled in the art also to have many other storage meanss.
The synchronization message transmitter sends synchronization message to purpose SAP, asks required service, and service result is returned to the sender.The asynchronous message transmitter sends asynchronous message to purpose SAP, the request required service, but not responsible service result is returned to the sender.The synchronization message receiving element receives the synchronization message of service requester, calls corresponding service execution unit and finishes required service, and service result is returned to service requester.Asynchronous message receives and scheduling unit, receive the synchronization message of service requester, and be distributed to corresponding service execution unit, treat that described service execution unit is finished service after, create a new message, service result is placed in the new message sends to service requester by message sender.
Described Service Access Point has unique overall hierarchical address and all is registered to the name server module with its overall hierarchical address in described system, message sender sends message according to the overall hierarchical address that is registered on the name server to Service Access Point.Owing to adopted overall hierarchical address, the module in the different nodes also can conduct interviews mutually by above-mentioned identical mode.
In this embodiment, synchronization message and asynchronous message all comprise message header and message body, comprise address, service end address and service end module SAP number of client modules in the message header at least, and message body then encapsulates calls data.
Hereinafter, for convenience of description, the module that sends message is called client modules, the module of accepting message is called the service end module.Each module both can be a client modules, also can be the service end module.
When carrying out synchronization call, the message sender of client modules (being by the synchronization message transmitter specifically) sends synchronization message to the SAP of service end module.The service end module by its SAP that has (specifically, be to receive and the synchronous reception and the scheduling unit of scheduling unit) receive this synchronization message, and received synchronization message sent to corresponding performance element, performance element is finished the function corresponding operation according to the particular content in the message body of the synchronization message that receives, and the result that will operate turns back to client modules.The result who here returns is received by the reception of the SAP of client modules and scheduling unit.When carrying out asynchronous call, the message sender of client modules (specifically, be by the asynchronous message transmitter) send asynchronous message to the SAP of service end module, equally, the service end module receives by its asynchronous message that has and scheduling unit receives this asynchronous message, and received asynchronous message sent to corresponding performance element, this performance element is finished the function corresponding operation according to the particular content in the asynchronous message body that receives.But the service end module can't be given client modules return result after finishing corresponding operation.But the SAP of service end can obtain the client source address from the asynchronous message that receives, and it is preserved.Afterwards, the SAP of client can create new message, and the service result of service end module is put into new message, according to the source address of this client, to the result of client modules return when needing arbitrarily.Here, employed data can be binary data in invoked procedure, and can use the various coded systems in the distributed development, for example use CDR or ASN.1 coded system.
In addition, each module can also comprise the unit of a management SAP, is used for finishing the management function of the general character of some all SAP.
In another one preferred implementation of the present invention, in node, can also be provided with a backup module, backup module is identical with original module, and the module No. of backup module is identical with this module also.In this embodiment, above-mentioned hierarchical address also can comprise one " interior number of group ", is used to distinguish original module and backup module.
A kind of method of utilizing message to communicate in the distributed system that above-mentioned execution mode is described according to the present invention is described below.
At first, the module (being called first module here) of one (being called first node here) in the above-mentioned node sends message by the message sender corresponding with it to a module (being called second module here) of another one node (being called Section Point here).Second module receives this message by the SAP corresponding with it, and is that synchronization message or asynchronous message are carried out corresponding operating according to the message of being accepted.When wherein the message that sends to second module in first module is synchronization message, second module is to the first module return result, when the message that sends to second module in first module is asynchronous message, second module is carried out corresponding operating according to described message, but, and only preserve the address of first module not to the first module return result.In needs, second module can be according to the address of first module that comprises to the first module return result.Can be for concrete operating process with reference to description above.
Though enumerated the method that communicates between two modules between two nodes here, those skilled in the art should be realized that two disparate modules in same node also can carry out above-mentioned identical operations.In addition, carried out detailed argumentation during the distributed system of having described the preferred embodiment for the present invention in front for the concrete principle and the details of aforesaid operations, therefore, here repeated no more.
In order to make those skilled in the art more intactly understand the present invention, be programmed for the details that example is described the module that realizes the preferred embodiment for the present invention in detail with C Plus Plus below.
In order to make those skilled in the art more easily understand the present invention, will be programmed for example illustrates embodiment of the present invention with the form of software realization a example with C Plus Plus below.Fig. 8 is a structural representation of realizing the example of a module with the C Plus Plus programming.In the drawings, the class title of iMAP_Lem_Module representation module, iMAP_Msg_Utility represents the class title of message sender, and iMAP_Sap_Cache_Mgr and Sap_Entry represent the class title of Service Access Point cache manager and the class title of service access point tabulation respectively.In addition, iMAP_Lem_Sap_Impl and iMAP_Admin_Sap_Impl represent the class title of Service Access Point realization base class and the class title that the management service access point is realized respectively.Line among the figure has been represented the call relation between all kinds of.The title that English among the figure calls when being visit does not have special implication, can substitute with other English name yet.
Wherein, each module can realize that as previously mentioned, each module all has one unique " module No. " by including process, dynamic base or other forms of unit, is used for distinguishing mutually with other modules of intranodal.These modules are finished the initialization of the module overall situation and the initialization of SAP as the container of SAP.Module bodies sends message by message sender to the SAP of other modules and visits other modules.As mentioned above, the Service Access Point cache manager is used by message sender.The Service Access Point tabulation is used for storing all SAP addresses of this module, and the Service Access Point tabulation is initialised when module initialization.The management service access point is realized class, can finish the management function of the general character of some all SAP.
SAP derives from from iMAP_Lem_Sap_Impl.SAP provides the entity of module external interface, and SAP has one unique " SAP number ", distinguishes mutually with other SAP of this module.SAP realizes a corba interface, and is registered to name server, uses [node number] [module No.] [SAP number] to be used as the outside sign (name) of this SAP.
The corba interface that SAP realizes is a general interface, and the SAP of application layer generally can provide a plurality of functions, and each function realizes with a member function.The application definition member function defines a distribution ID (branch signaling) simultaneously.IMAP_Lem_Sap_Imp1 searches and calls the distribution member function by distribution ID.Member function uses macrodefinition.
Above-mentioned module class and SAP class have encapsulated the exploitation of service end, and message sender provides the use of client, and client uses this class object to send synchronously or asynchronous message.
The function that obtains the iMAP_Msg_Utility example is all arranged in module class and the SAP class.The key of message sender is SAP cache manager iMAP_Sap_Cache_Mgr, and such provides the buffer memory of the CORBA object of SAP.The core of this class is the buffer memory array of a SAP.
Be not difficult to find out from foregoing, technical scheme in this example has been simplified the step of distributed development, reduced the difficulty of distributed development, because iMAP_Lem_Module has encapsulated the establishment of CORBA object and registration, cancellation, as long as the user is absorbed in the realization of SAP; SAP is a common C++ class, derives from from iMAP_Lem_Sap_Impl, and the user only need define the branch signaling and realize member function, and does not need definition and realize any corba interface.And sending the unified iMAP_Msg_Utility of use of message class, the user also need not be concerned about the CORBA object and the name server of opposite end, only need know the SAP sign of opposite end.
Scheme in this example provides better extendibility and reliability, because transmission message is unified among the iMAP_Msg_Utility and realizes, message acceptance is unified among the iMAP_Lem_Sap_Imp1, message has unified message header, can carry out some unified processing to message, carry out some AOP (AspectOriented Programing, Aspect Oriented Programming), as: unified log.Because message is unified inlet, outlet and message header, can unify to write down running log.
In addition, if directly use the CORBA exploitation, to IDL of each interface definition, be compiled into stub (agency) and skeleton (skeleton) then, these size of codes are very big, a simple interface may compile out the above code of 1000 row, cause system very huge, in the present embodiment, have only a predefined corba interface of system, newly-increased function realizes the service logic of oneself by user's derived class, there is not extra code, the size of system can be controlled, and owing to memory-limited system, can realize good distributed nature in some Embedded systems by scheme provided by the invention.
In the above-mentioned example, can use ORB (CORBA the inside object remote agent) to carry out the communication carrier of bottom, but ORB not necessarily also can use the carrying of other modes as communication in system of the present invention.Include but not limited to: ACE Reactor/EventHandler (ACE Reactor, Adaptive Communication Envionment Reactor/EventHandler, adaptive communications environment reaction device/event handler; Be a Design Mode of ACE the inside, to Socket-be a kind of C++ encapsulation of socket, ACE is the cover code of increasing income.); ICE (Internet CommunicationEnvironment, Internet traffic environment also are cover codes of increasing income, and are the simple versions of CORBA); Socket (socket is the most widely used cover DLL (dynamic link library) at IP communication) etc. can realize system of the present invention.
Fig. 9 represents the process of a synchronization call of this programme.Describe the synchronization call process of one embodiment of the present invention in detail below with reference to Fig. 8 and Fig. 9, its step is as follows:
Step 901:Client (client, i.e. caller) uses message sender (iMAP_Msg_Utility) to send synchronization message (interface function that Send_sync_msg, message sender provide);
Step 902:iMAP_Msg_Utility carries out synchronization call (the bottom corba interface calls for InvokeSync, synchronization call) to the iMAP_Lem_Servant (waiing upon the clothes class) of Server (service end);
Step 903:iMAP_Lem_Servant carries out synchronization call to iMAP_Lem_Sap_Imp1, and (iMAP_Lem_Servant reality and iMAP_Lem_Sap_Imp1 can be classes, being divided into two only is a kind of decoupling method of realizing, can regard one as, the former only plays agency's effect);
Step 904:iMAP_Lem_Sap_Imp1 searches distribution function (find_map, the distribution function is a member function of Service Access Point class) in mapping, Service Access Point finds the distribution function according to the branch signaling in the message header;
Step 905:iMAP_Lem_Sap_Imp1 carries out the distribution function;
Step 906:iMAP_Lem_Sap_Imp1 synchronization call finishes, and this output parameter that calls and return value are returned to iMAP_Lem_Servant;
Step 907:iMAP_Lem_Servant synchronization call finishes, and this output parameter that calls and return value are returned to iMAP_Msg_Utility (being the output parameter and the return value of Send_sync_msg function);
Step 908:iMAP_Msg_Utility synchronization message finishes, and Client obtains to call the result.
Figure 10 has represented the process instance of an asynchronous call of this programme, describes the asynchronous call process of one embodiment of the present invention in detail below with reference to Fig. 8 and Figure 10, and its step is as follows:
Step 1001:Client (client, i.e. caller) uses message sender (iMAP_Msg_Utility) to send asynchronous message (interface function that send_async_msg, message sender provide);
Step 1002:iMAP_Msg_Utility carries out asynchronous call (the bottom corba interface calls for InvokeAsync, asynchronous call) to the iMAP_Lem_Servant (waiing upon the clothes class) of Server (service end);
Step 1003:iMAP_Lem_Servant carries out asynchronous call to iMAP_Lem_Sap_Imp1;
Step 1004:iMAP_Lem_Sap_Imp1 searches the distribution function in mapping;
Step 1005:iMAP_Lem_Sap_Imp1 does not carry out the distribution function, puts formation into calling packing.Packing is put the formation process into and is: the message header of the distribution function pointer that finds, asynchronous call and message body are placed on a data structure the inside, then this structure are put into a formation;
Step 1006:iMAP_Lem_Sap_Imp1 asynchronous call finishes, and return results (not having this output parameter that calls and return value) is returned to iMAP_Lem_Servant;
Step 1007:iMAP_Lem_Servant asynchronous call finishes, and return results (not having this output parameter that calls and return value) is returned to iMAP_Msg_Utility;
Step 1008:iMAP_Msg_Utility asynchronous message finishes, and return results is returned to Client.
Step 1009:iMAP_Lem_Sap_Imp1 askes above-mentioned formation by Svc (thread function) opinion, if formation is not empty, then take out the content (distribution function pointer, message header, message body) of formation, by the distribution function pointer, carry out this distribution function, message header, message body are imported into as the distribution function parameters during execution.
Step 1010:Svc (thread function) obtains the result that the distribution function is carried out in the step 1009, and the result comprises two parts: function return value, function output parameter.
Step 1011:Svc uses the asynchronous function (send_async_msg) of the iMAP_Msg_Utility of Server (service end) to send result's (return value is filled out in message header, and output parameter is as message body) to Client; Client end reality also is the result at the realization the inside of iMAP_Lem_Sap_Imp1 treatment step 1011.
Also need to stipulate a particular value herein: if return null value (DISP_VOID) such as the number of sending a letter, expression does not need Svc function execution in step 1011 again, and it is specifically defined as one to return null value, and other return values of distribution function can not be used this value.
After the iMAP_Lem_Sap_Imp1 of Client was receiving the message that the iMAP_Msg_Utility of Server sends, the distribution function of the iMAP_Lem_Sap_Imp1 of Client end can return null value, thereby the message of avoiding forming an endless loop sends.
Figure 11 represents a kind of application example on HA of this programme.As shown in FIG., in the HA mode, module has two running examples, and one is main (Active), and one is to be equipped with (Standby), and the node number of these two examples, module No. are all the same, but two " interior number of group " is different, as, one is 0 one is 1.For caller, he only sees node number, module No., SAP number, so HA is transparent for caller.Caller number is passed to message sender to destination node number, module No., SAP, the latter when calling in the inquiry these two examples state, if find that one is main, one is to be equipped with, then example sends simultaneously to advocating peace fully (promptly calling the CORBA function of the SAP of example fully of advocating peace simultaneously), realizes copy function (Duplication function) like this.
This is a kind of mechanism that realizes two-node cluster hot backup, also is called concurrent choosing and receives.All send to active and standby object when promptly sending, but after the active and standby object handles, have only main return messages to send (will cause confusion) if two message all sends, and the message that is equipped with does not send, as dotted portion among the figure, realize selection function (selection function) like this.
So, can guarantee in active and standby object that if having one in the dust, another one can also interruptedly not handled.Such as working as main object in the dust, the object that at this moment originally was equipped with has become main object, can send message, and original main object has become object fully.
As a whole active and standby, an input and an output are arranged all the time.Input and output comprise any content, and when respective file, input is exactly to read file, and output is exactly written document; When correspondence database, input is exactly inquiry, and output is exactly that additions and deletions change.
Above-described embodiment, the present invention embodiment a kind of more preferably just, common variation and replacement that those skilled in the art carries out in the scheme scope of the technology of the present invention all should be included in protection scope of the present invention.

Claims (18)

1. a message based distributed system is characterized in that, described system comprises at least one node, and described node comprises that at least one finishes the module of specific function, and described module comprises:
At least one Service Access Point and message sender;
Described Service Access Point is the external interface of module, and each described Service Access Point has unique service access point identity in described system, and described Service Access Point is used to receive service request information, and finishes required service according to described service request information; Described reception service request information is specially: the service request information that receives disparate modules in this node; Perhaps, receive the service request information of module in other nodes;
Described message sender is used for service request information is sent to the purpose Service Access Point, the request required service.
2. the system as claimed in claim 1 is characterized in that, described Service Access Point has unique service access point identity in described system; The sign that comprises the purpose Service Access Point in the described message.
3. the system as claimed in claim 1 is characterized in that, described message sender comprises:
The synchronization message transmitter is used for synchronization message is sent to the purpose Service Access Point, asks required service, and service result is returned to the sender;
The asynchronous message transmitter is used for asynchronous message is sent to the purpose Service Access Point, the request required service, but not responsible service result is returned to the sender.
4. the system as claimed in claim 1 is characterized in that, described Service Access Point comprises:
At least one service execution unit is finished required service according to service request information;
Message sink and scheduling unit receive service request information, and are distributed to corresponding service execution unit.
5. system as claimed in claim 4 is characterized in that, described message sink and scheduling unit specifically comprise:
Synchronization message receives and scheduling unit, receives the synchronization message of service requester, calls corresponding service execution unit and finishes required service, and service result is returned to service requester;
Asynchronous message receives and scheduling unit, receive the asynchronous message of service requester, and be distributed to corresponding service execution unit, treat that described service execution unit is finished service after, create new information, service result is placed in the described new information sends to service requester by message sender.
6. system as claimed in claim 2 is characterized in that described node also comprises name server, is used to provide name Service; Described Service Access Point is registered to described name server with the sign and the reference address of this Service Access Point; Described message sender obtains the reference address of purpose Service Access Point according to the purpose Service Access Point Indicator in the message from name server, and message is sent to the purpose Service Access Point.
7. system as claimed in claim 2, it is characterized in that described message comprises message header and message body, comprise the Service Access Point Indicator that sends described message in the described message header at least, and the Service Access Point Indicator that receives described message, described message body includes the data of service needs.
8. system as claimed in claim 2 is characterized in that, described Service Access Point Indicator number is made up of node number, module No. and Service Access Point.
9. the system as claimed in claim 1 is characterized in that, described module also is provided with a backup module.
10. the system as claimed in claim 1 is characterized in that, described module also comprises the Service Access Point list memory, is used for storing all Service Access Points of described module.
11. the system as claimed in claim 1 is characterized in that, described module also comprises a Service Access Point administrative unit, is used for managing all Service Access Points in the described module.
12. method of in distributed system, utilizing message to communicate, communicate in distributed system by Service Access Point, described Service Access Point is the external interface of module, each described Service Access Point has unique service access point identity in described system, described Service Access Point comprises first Service Access Point and second Service Access Point, described method is used for first Service Access Point and serves to the second Service Access Point request, described first Service Access Point and described second Service Access Point are respectively in the module of different nodes, perhaps, described first Service Access Point and described second Service Access Point are in the disparate modules of same node, it is characterized in that, said method comprising the steps of:
1) described first Service Access Point sends message by message sender to described second Service Access Point;
2) described second Service Access Point receives message, carries out required service;
3) described second Service Access Point returns service result.
13. method as claimed in claim 12 is characterized in that, described message is synchronization message, described step 2) be specially:
Described second Service Access Point receives message, calls the respective service performance element, finishes required service.
14. method as claimed in claim 12 is characterized in that, described message is asynchronous message, described step 2) be specially:
Described second Service Access Point sends to corresponding service execution unit with described message, and described service execution unit is finished required service.
15. method as claimed in claim 14 is characterized in that, described step 3) is specially:
Described second Service Access Point is created new message, and service result is put into described new information, sends to described first Service Access Point by message sender.
16. method as claimed in claim 12, it is characterized in that described message comprises message header and message body, comprise the Service Access Point Indicator that sends described message in the described message header at least, and the Service Access Point Indicator that receives described message, described message body includes the data of service needs.
17. method as claimed in claim 12 is characterized in that, described Service Access Point is by the Service Access Point Indicator unique identification, and described Service Access Point Indicator number is made up of node number, module No. and Service Access Point.
18. method as claimed in claim 12 is characterized in that, described module also is provided with a backup module, and described step 1) is specially:
Described first Service Access Point is served to the second Service Access Point request by message sender, and described message sender sends the message of the described service of request respectively to described second Service Access Point that is positioned at all modules;
Described step 3) is specially:
Described second Service Access Point that is positioned at non-backup module returns service result.
CNB2006100759879A 2006-04-27 2006-04-27 A kind of message based distributed system and method for communicating therein Expired - Fee Related CN100544369C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100759879A CN100544369C (en) 2006-04-27 2006-04-27 A kind of message based distributed system and method for communicating therein

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100759879A CN100544369C (en) 2006-04-27 2006-04-27 A kind of message based distributed system and method for communicating therein

Publications (2)

Publication Number Publication Date
CN1984149A CN1984149A (en) 2007-06-20
CN100544369C true CN100544369C (en) 2009-09-23

Family

ID=38166375

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100759879A Expired - Fee Related CN100544369C (en) 2006-04-27 2006-04-27 A kind of message based distributed system and method for communicating therein

Country Status (1)

Country Link
CN (1) CN100544369C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088489B (en) * 2010-12-31 2013-05-22 北京理工大学 Distributed data synchronizing system and method
CN104063293B (en) * 2014-07-04 2017-06-27 华为技术有限公司 A kind of data back up method and stream calculation system
CN106161564B (en) * 2015-04-23 2019-09-10 珀金埃尔默企业管理(上海)有限公司 A kind of agent framework service system and method
CN116501713B (en) * 2023-06-26 2023-09-22 成都谐盈科技有限公司 Method for realizing distributed file system

Also Published As

Publication number Publication date
CN1984149A (en) 2007-06-20

Similar Documents

Publication Publication Date Title
US5778228A (en) Method and system for transferring remote procedure calls and responses over a network
US5594921A (en) Authentication of users with dynamically configurable protocol stack
US6633923B1 (en) Method and system for dynamic configuration of interceptors in a client-server environment
AU780753B2 (en) Client-server computing software architecture
US8650320B1 (en) Integration server supporting multiple receiving channels
US6173313B1 (en) Methodology for hosting distributed objects at a predetermined node in a distributed system
CA2110243C (en) Apparatus and methods for making a portion of a first name space available as a portion of a second name space
EP0412232B1 (en) Apparatus and method for providing high performance communication between software processes
US8010967B2 (en) Method and system for dynamic configuration of interceptors in a client-server environment
KR100293795B1 (en) Distributed Database System and Data Entity Access Methods
EP0735471A2 (en) Method and apparatus for interpreting exceptions in a distributed object system
Schill et al. DC++: distributed object-oriented system support on top of OSF DCE
US7650609B2 (en) Multi-environment document management system access
Pavlou et al. The OSIMIS platform: Making OSI management simple
CN112286628B (en) System for unifying nanotube Kubernetes heterogeneous applications and operation method
KR20030074801A (en) Method and System for Incorporating legacy applications into a distributed data processing environment
CN100544369C (en) A kind of message based distributed system and method for communicating therein
US20060200800A1 (en) Aggregation of non blocking state machines on enterprise java bean platform
US20060294493A1 (en) Non blocking persistent state machines on enterprise java bean platform
CN103684904A (en) Tri-networks integration network monitoring system based on IP
Festor et al. Integration of WBEM-based Management Agents in the OSI Framework
EP0983547A2 (en) Operational analysis of software-controlled systems
US6898792B1 (en) Foreign object definition information repository
Pavlou Using distributed object technologies in telecommunications network management
Siegel An overview of CORBA 3

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090923

Termination date: 20170427