CN101572710B - Interprocess communication method and system - Google Patents

Interprocess communication method and system Download PDF

Info

Publication number
CN101572710B
CN101572710B CN2009100859936A CN200910085993A CN101572710B CN 101572710 B CN101572710 B CN 101572710B CN 2009100859936 A CN2009100859936 A CN 2009100859936A CN 200910085993 A CN200910085993 A CN 200910085993A CN 101572710 B CN101572710 B CN 101572710B
Authority
CN
China
Prior art keywords
server
client
ipc
module
server processes
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.)
Active
Application number
CN2009100859936A
Other languages
Chinese (zh)
Other versions
CN101572710A (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.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN2009100859936A priority Critical patent/CN101572710B/en
Publication of CN101572710A publication Critical patent/CN101572710A/en
Application granted granted Critical
Publication of CN101572710B publication Critical patent/CN101572710B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an interprocess communication method and a system, wherein the method comprises: an interprocess communication (IPC) module of a client receives an instruction of initiating the connection sent by a client process, the corresponding relationship between an identifier of a pre-recorded server process and the address of a server is searched according to the identifier of the server process contained in the instruction of initiating the connection, and the address of the server is obtained; the IPC module of the client sends a connection message to the IPC module of the server according to the address of the server to request establishing the interprocess communication between the client process and the server process. The invention is adaptable to the demands of a distributed system and can timely and high-efficiently establish interprocess communication between the client process and the server process.

Description

A kind of inter-process communication methods and system
Technical field
The present invention relates to communication technical field, particularly a kind of inter-process communication methods and system.
Background technology
The communication of interprocess communication (IPC) refer initially between each process of device interior is accompanied by the continuous development of network technology, and IPC is gradually by development and be applied to distributed apparatus.Distributed apparatus comprises a plurality of business boards that geographically separate, and all has one or more independent CPUs on each business board, and each CPU is called a node, and the program of on this node, moving is called process.Client/server model is a kind of typical IPC model, and in this model, the process of communicating pair is respectively client process and server processes.Referring to Fig. 1; Fig. 1 is the structure and the annexation sketch map of client and server in the prior art; The IPC module of client process and lower floor is formed client; The IPC module groups of server processes and lower floor becomes server, for the client process on upper strata and server processes reliable interprocess communication is provided between the IPC module of client and the IPC module of server.
In the prior art; When in Ethernet, carrying out telecommunication; Client process at first need be known the IP address information of server; Common way is that a DNS Server (domain name service server) is set in network, and client process is from the IP address that DNS Server obtains server, and client process is initiated the interprocess communication connection through client and server both sides' the server processes of IPC module in this server afterwards; As shown in Figure 2, Fig. 2 is for carrying out the sketch map of IPC between client process in the prior art and the server processes.
When the pattern of carrying out interprocess communication between above-mentioned client process and the server processes applies to distributed system, will cause in time to set up interprocess communication efficiently.Concrete reason is: first; When DNS Server is a distributed apparatus; Because distributed apparatus itself, DNSServer provide the veneer of DNS service unfixing sometime, and at any time board resetting possibly take place; Cause client process can't in time obtain the address of server, thereby can't in time set up interprocess communication; The second, initiate to set up IPC and all want long-range address of searching server before connecting because client process is each, for distributed system, it is excessive to the expense of system to search the address, thereby can't set up interprocess communication efficiently.
Summary of the invention
The present invention proposes a kind of inter-process communication methods, and this method can adapt to the needs of distributed system, between client process and server processes, in time sets up interprocess communication efficiently.
The present invention also proposes system between a kind of process, can adapt to the needs of distributed system, between client process and server processes, in time sets up interprocess communication efficiently.
Technical scheme of the present invention is achieved in that
A kind of inter-process communication methods, this method is applied to comprise the system of client and server, and wherein client comprises the IPC module of client process and client, and server comprises the IPC module of server processes and server, and this method comprises:
The IPC module of client receives the initiation link order that client process is sent; Sign according to the server processes that comprise in the said initiation link order; Search the sign of the server processes that write down in advance and the corresponding relation of server address, the address that obtains server;
The IPC module of client is sent connection message according to the address of said server to the IPC of said server module, and the interprocess communication between client process and the server processes is set up in request,
Wherein, the mode of the corresponding relation of said sign that writes down server processes in advance and server address is:
The IPC module broadcast distribution message of server, this gives out information and carries the sign of said server processes, requires to receive the relevant information of the said said server processes of IPC module records that give out information;
The IPC module of client receives said giving out information, and writes down the sign of the server processes in said the giving out information and the corresponding relation of server address.
A kind of interprocess communication system, this system comprises client and server, and wherein client comprises the IPC module of client process and client, and server comprises the IPC module of server processes and server; Wherein,
Client process is used for sending the initiation link order to the IPC of client module;
The IPC module of client, the sign of the server processes that are used for comprising according to said initiation link order is searched the sign of the server processes of record and the corresponding relation of server address in advance, the address that obtains server; According to the address of said server, send connection message to the IPC of said server module, the interprocess communication between client process and the server processes is set up in request;
The IPC module of said server is used for broadcast distribution message, and this gives out information and carries the sign of said server processes, requires to receive the relevant information of the said said server processes of IPC module records that give out information;
Then, the IPC module of said client also is used to receive said giving out information, and writes down the sign of the server processes in said the giving out information and the corresponding relation of this server address.
It is thus clear that; Inter-process communication methods and system that the present invention proposes; Receive the initiation link order of client process transmission when client ip C module after; According to the sign of the server processes that comprise in this instruction, search the sign of the server processes that write down in advance and the corresponding relation of server address, the address that obtains server; Client ip C module is sent connection message according to the address of the server that obtains to the IPC of this server module, and the interprocess communication between client process and the server processes is set up in request.Among the present invention; The mode of server address is searched and obtained to the IPC inside modules of client; Substitute client process in the prior art and obtained the mode of server address from DNS Server; Make client can obtain the address of server in time, and can not receive the influence of distributed DNS Server.Therefore, scheme of the present invention can adapt to the needs of distributed system, between client process and server processes, in time sets up interprocess communication efficiently.
Description of drawings
Fig. 1 is the structure and the annexation sketch map of client and server in the prior art;
Fig. 2 is for carrying out the sketch map of IPC between client process in the prior art and the server processes;
Fig. 3 is the illustraton of model of interprocess communication of the present invention;
Fig. 4 is the flow chart of embodiment of the invention inter-process communication methods;
The position view of Fig. 5 client process and server processes during for interprocess communication of the present invention.
Embodiment
The embodiment of the invention proposes a kind of inter-process communication methods, and referring to Fig. 3, Fig. 3 is the illustraton of model of interprocess communication of the present invention.This method does not need client process from DNS Server, to obtain the address of server; And the IPC module that only needs client is carried out internal searching (inner lookup), obtains the address of server, and afterwards, client process and server processes are set up interprocess communication.
In order to realize above-mentioned interprocess communication model; In the IPC of server module issue (publish) and cancellation issue (unpublish) mechanism are provided among the present invention; In the IPC of client module (lookup) mechanism of searching is provided; Be used to realize the address of the IPC module searches server of client, thereby set up interprocess communication between client process and the server processes.Referring to Fig. 4, Fig. 4 is the flow chart of embodiment of the invention inter-process communication methods.Comprise:
Step 401: after server processes were set up, server processes were sent to the IPC of server module and are intercepted (listen) message, started the relevant information of IPC module publisher server process.Wherein, It is existing technology in the prior art that server processes are sent listen message to the IPC of server module; In the prior art, generally speaking, send listen message and show that just server processes have carried out the preparation of setting up interprocess communication with client process; The IPC module of server will be waited for the IPC module transmission connect message of client afterwards, and interprocess communication is set up in request; But in the present embodiment; With the mechanism of listen message as the IPC module publisher server process relevant information that starts server; Certainly; Also can adopt other message that server processes are sent to the IPC of server module in the prior art, perhaps adopt the message of redetermination, as the mechanism of the IPC module publisher server process relevant information that starts server.
Step 402: IPC module broadcast distribution (publish) message of the IPC module of server all nodes in network; Carry the sign of server processes in this publish message, require the relevant information of all these server processes of IPC module records of this publish message of reception.
Step 403: after the IPC module of all nodes is received publish message in the network; Write down the sign of the server processes in this message and the corresponding relation of server address (because publish message comes from server; Therefore, the IPC module that receives this publish message can be known the address of server).
Step 404: after client process was set up, client process was sent to the IPC of client module and is initiated link order, requires the interprocess communication between foundation and server processes; The sign that comprises server processes in this initiation link order.
Step 405: the IPC module of client is according to the sign of the server processes of initiating to comprise in the link order, recorded corresponding relation in the finding step 403, the address that obtains server.
Step 406: the IPC module of client is sent connection (connect) message according to the address of the server that finds to the IPC of this server module.
After the IPC module of server was received connect message, the IPC module of IPC module, server processes and the client of server was cooperated each other, according to prior art in identical mode set up the interprocess communication between client process and the server processes.
More than introduced the process of setting up interprocess communication between client process and the server processes of setting up among the present invention, introduced server processes below and stop postrun subsequent processes.
Step 407: when server processes will stop operation, server processes were sent to the IPC of server module and are closed (close) message, started the issue of IPC module cancellation server processes relevant information.Wherein, Similar with the situation in the step 401; It also is existing technology in the prior art that server processes are sent close message to the IPC of server module, in the prior art, and generally speaking; Send close message and show that just server processes will stop operation, the IPC module of server will be waited for the interprocess communication of setting up before the IPC module request cancellation of client afterwards.In the present embodiment; With the mechanism of close message as the issue that starts IPC module cancellation server processes relevant information; Certainly; Also can adopt other message that server processes are sent to the IPC of server module in the prior art, perhaps adopt the message of redetermination, as the mechanism of the IPC module cancellation publisher server process relevant information that starts server.
Step 408: issue (unpublish) message is recalled in the IPC module broadcasting of the IPC module of server all nodes in network; Carry the sign of server processes in this unpublish message, the IPC module of the said message of requirement reception is removed the relevant information of said server processes;
Step 409: after the IPC module of all nodes is received unpublish message in the network, remove record (being the sign of the server processes of record in the step 403 and the corresponding relation of this server address) to these server processes.
Like this; When client process is sent the initiation link order to the IPC of client module once more; When requirement is set up interprocess communication with server processes,, can't find the address of this server because the IPC module of client has been removed the record to these server processes; Also just can't send connect message to the IPC module in this server, interprocess communication is set up in request.
Such scheme can shield the positional information of server processes, and is as shown in Figure 5, the position view of Fig. 5 client process and server processes during for interprocess communication of the present invention.When server processes and client process are carried out interprocess communication, can be arranged in (like P1 and the P2 of Fig. 5) on the same node, also can be arranged in (like P1 and P3 or P1 and the P4 of Fig. 5) on the different nodes; When client process was repeatedly carried out interprocess communication with server processes, the each position of server processes also can be different, and just server processes can be positioned on the different nodes.It is thus clear that; The inter-process communication methods that the present invention proposes and the location independent of server processes; Client process does not need the particular location of aware services device process, and server processes can arbitrarily distribute, and the advantage of this mode is: a plurality of server processes may operate on the different host node (node of runtime server process is called host node); All host nodes can be in active state, have realized that cpu load shares; On the contrary, on traditional distributed structure/architecture, because the position of server processes must be fixed, all usually server processes all operate on the movable host node, and other host nodes are all awaited orders, and this causes the cpu load of movable host node overweight.
In the said method; The sign of the server processes of carrying in the unpublish message of broadcasting in the publish message of broadcasting and the step 408 in the step 402 can be specially the port numbers of server; With 80 server processes is example; After 80 server processes started, the IPC module of server was broadcasted publish message, comprised the port numbers (i.e. 80 ports) of 80 server processes in this publish message; When these 80 server processes will stop operation, the IPC module of server was broadcasted unpublish message, comprised the port numbers (i.e. 80 ports) of 80 server processes in this unpublish message.
The embodiment of the invention also proposes a kind of interprocess communication system, and this system comprises client and server, and wherein client comprises the IPC module of client process and client, and server comprises the IPC module of server processes and server; Wherein,
Client process is used for sending the initiation link order to the IPC of client module;
The IPC module of client, the sign of the server processes that are used for comprising according to said initiation link order is searched the sign of the server processes of record and the corresponding relation of server address in advance, the address that obtains server; According to the address of server, send connection message to the IPC of server module, the interprocess communication between client process and the server processes is set up in request.
The IPC module of above-mentioned server is used for broadcast distribution message, and this gives out information and carries the sign of said server processes, requires to receive the relevant information of the said said server processes of IPC module records that give out information;
The IPC module of above-mentioned client can also be used to receive said giving out information, the sign of the server processes during record gives out information and the corresponding relation of this server address.
The IPC module of above-mentioned server can also be used for the broadcasting cancellation and give out information, and this cancellation gives out information and carries the sign of said server processes, and the IPC module that requires the said cancellation of reception to give out information is removed the relevant information of said server processes;
The IPC module of above-mentioned client can also be used for receiving cancellation and give out information, and removes the sign of the said server processes that write down in advance and the corresponding relation of this server address.
In the said system, server processes can be used for, and the IPC module broadcast distribution message or the broadcasting cancellation that start server give out information.
To sum up visible, issue (publish) message that server processes identify is carried by the IPC module broadcasting of server by inter-process communication methods and system that the present invention proposes; The sign of the IPC module records server processes of client and the corresponding relation of server address; Receive the initiation link order of client process transmission when client ip C module after, search recorded corresponding relation in advance, obtain the address of server according to the sign of the server processes that comprise in this instruction; Client ip C module is sent connection message according to the address of the server that obtains to the IPC of this server module, and the interprocess communication between client process and the server processes is set up in request.The mode that the IPC inside modules of the IPC module of server broadcasting publish message and client is searched server address among the present invention; Substitute client process in the prior art and obtained the mode of server address from DNS Server; Make client can obtain the address of server in time, and can not receive the influence of distributed DNS Server.Therefore, scheme of the present invention can adapt to the needs of distributed system, between client process and server processes, in time sets up interprocess communication efficiently.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.

Claims (8)

1. inter-process communication methods; This method is applied to comprise the system of client and server, and wherein client comprises the interprocess communication IPC module of client process and client, and server comprises the IPC module of server processes and server; It is characterized in that said method comprises:
The IPC module of client receives the initiation link order that client process is sent; Sign according to the server processes that comprise in the said initiation link order; Search the sign of the server processes that write down in advance and the corresponding relation of server address, the address that obtains server;
The IPC module of client is sent connection message according to the address of said server to the IPC of said server module, and the interprocess communication between client process and the server processes is set up in request,
Wherein, the mode of the corresponding relation of said sign that writes down server processes in advance and server address is:
The IPC module broadcast distribution message of server, this gives out information and carries the sign of said server processes, requires to receive the relevant information of the said said server processes of IPC module records that give out information;
The IPC module of client receives said giving out information, and writes down the sign of the server processes in said the giving out information and the corresponding relation of server address.
2. method according to claim 1 is characterized in that, said method further comprises:
The IPC module broadcasting cancellation of server gives out information, and this cancellation gives out information and carries the sign of said server processes, and the IPC module that requires the said cancellation of reception to give out information is removed the relevant information of the said server processes of record in advance;
The IPC module of client receives said cancellation and gives out information, and removes the sign of the said server processes that write down in advance and the corresponding relation of server address.
3. method according to claim 1 and 2 is characterized in that, the IPC module broadcast distribution message of said server or broadcasting cancellation give out information and started by server processes.
4. method according to claim 3 is characterized in that, the mode that said server processes start the IPC module broadcast distribution message of server is: server processes are sent to the IPC of server module and are intercepted message.
5. method according to claim 4 is characterized in that, the mode that the IPC module broadcasting cancellation of said server processes startup server gives out information is: server processes are sent close message to the IPC of server module.
6. an interprocess communication system is characterized in that, this system comprises client and server, and wherein client comprises the IPC module of client, and server comprises the IPC module of server; Wherein,
The IPC module of said client; Be used to receive the initiation link order of sending by client process; According to the sign of the server processes that comprise in the said initiation link order, search the sign of the server processes that write down in advance and the corresponding relation of server address, the address that obtains server; According to the address of said server, send connection message to the IPC of said server module, the interprocess communication between client process and the server processes is set up in request;
The IPC module of said server is used for broadcast distribution message, and this gives out information and carries the sign of said server processes, requires to receive the relevant information of the said said server processes of IPC module records that give out information;
Then, the IPC module of said client also is used to receive said giving out information, and writes down the sign of the server processes in said the giving out information and the corresponding relation of this server address.
7. system according to claim 6; It is characterized in that; The IPC module of said server; Also be used for the broadcasting cancellation and give out information, this cancellation gives out information and carries the sign of said server processes, and the IPC module that requires the said cancellation of reception to give out information is removed the relevant information of said server processes;
The IPC module of said client also is used to receive said cancellation and gives out information, and removes the sign of the said server processes that write down in advance and the corresponding relation of this server address.
8. according to claim 6 or 7 described systems, it is characterized in that said server processes are used for, the IPC module broadcast distribution message or the broadcasting cancellation that start said server give out information.
CN2009100859936A 2009-06-03 2009-06-03 Interprocess communication method and system Active CN101572710B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100859936A CN101572710B (en) 2009-06-03 2009-06-03 Interprocess communication method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100859936A CN101572710B (en) 2009-06-03 2009-06-03 Interprocess communication method and system

Publications (2)

Publication Number Publication Date
CN101572710A CN101572710A (en) 2009-11-04
CN101572710B true CN101572710B (en) 2012-06-27

Family

ID=41231947

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100859936A Active CN101572710B (en) 2009-06-03 2009-06-03 Interprocess communication method and system

Country Status (1)

Country Link
CN (1) CN101572710B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102469035B (en) * 2010-11-05 2016-01-20 腾讯科技(深圳)有限公司 The method and apparatus of striding course communication
CN102143441A (en) * 2010-07-01 2011-08-03 华为技术有限公司 Message processing method and device and application server
CN102137145B (en) * 2010-12-03 2015-03-18 华为技术有限公司 Method, device and system for managing distributed contents
CN103428270A (en) * 2013-07-09 2013-12-04 国云科技股份有限公司 Network communication method applicable to distributed-type environment
CN103595820A (en) * 2013-11-28 2014-02-19 深圳英飞拓科技股份有限公司 Embedded front-end equipment backstage control debugging method and device
CN103605577B (en) * 2013-12-04 2017-06-30 广州博冠信息科技有限公司 The resource share method and equipment of striding course
CN103699450B (en) * 2013-12-20 2017-02-15 国云科技股份有限公司 Linux adaptive component communication method
CN104881327B (en) * 2015-06-01 2018-08-24 曙光信息产业(北京)有限公司 The operation flow management method and device of cluster
CN105592045B (en) * 2015-08-24 2019-04-12 新华三技术有限公司 Service connection method and device in distributed system
CN105912410A (en) * 2015-12-15 2016-08-31 乐视网信息技术(北京)股份有限公司 Method for communication among a plurality of processes, and client
CN106293970B (en) * 2016-08-09 2019-02-15 浪潮(北京)电子信息产业有限公司 Asynchronous processing method and system between a kind of process based on IPC
CN115297162B (en) * 2022-06-27 2024-03-22 青岛海尔科技有限公司 Message sending method and device, storage medium and electronic device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1581142A (en) * 2003-08-06 2005-02-16 松下电器产业株式会社 Method, server and subscriber machine used in subscriber machine-server distribution type system
CN1866959A (en) * 2006-02-14 2006-11-22 华为技术有限公司 Method and system for realizing trivial file transfer protocol (TFTP) file transmission
CN101076791A (en) * 2003-12-22 2007-11-21 摩托罗拉公司 Dynamic special purpose processors communication network capable of providing port

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1581142A (en) * 2003-08-06 2005-02-16 松下电器产业株式会社 Method, server and subscriber machine used in subscriber machine-server distribution type system
CN101076791A (en) * 2003-12-22 2007-11-21 摩托罗拉公司 Dynamic special purpose processors communication network capable of providing port
CN1866959A (en) * 2006-02-14 2006-11-22 华为技术有限公司 Method and system for realizing trivial file transfer protocol (TFTP) file transmission

Also Published As

Publication number Publication date
CN101572710A (en) 2009-11-04

Similar Documents

Publication Publication Date Title
CN101572710B (en) Interprocess communication method and system
CN106789526B (en) method and device for connecting multiple system networks
WO2010127593A1 (en) Distributed network management system, network element management server, and data configuration management method
CN104601702B (en) Cluster remote procedure calling (PRC) method and system
US20150088995A1 (en) Method and apparatus for sharing contents using information of group change in content oriented network environment
CN111404628B (en) Time synchronization method and device
CN116566984B (en) Routing information creation method and device of k8s container cluster and electronic equipment
CN110595481A (en) Positioning and ranging system, positioning tag, positioning synchronization method and positioning determination method
US20220345872A1 (en) Method and system for controlling id identifier network mobility based on programmable switch
CN114448686B (en) Cross-network communication device and method based on micro-service
CN105337746A (en) Multicast data transmission method and apparatus
CN101437297B (en) Method, apparatus and system for processing business
CN102625162B (en) Method and system for data transmission
CN101686150A (en) Installation method of network element, network element, DHCP server and network system
US20100103905A1 (en) Method and system for service link handover
CN1972276A (en) A management method and system for protocol access
CN103200593B (en) Base station self-starting and self-starting householder method and equipment
CN101599852B (en) Communication method of a plurality of modules among single boards, single board with a plurality of software modules and communication device
CN113515392B (en) RPC calling method, device, equipment and storage medium
CN106413125A (en) Data transmission method and device
CN112866351B (en) Data interaction method, device, server and storage medium
US20220263679A1 (en) Information synchronization method, terminal and information synchronization system
CN114327556A (en) Device and method for realizing application configuration hot update based on Internet of things edge cloud cooperation
JP2009508211A (en) Independent message processing system and method transparent to endpoints
CN108989467B (en) Centralized addressing method

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.