[go: nahoru, domu]

CN105897817A - Method for communication between servers, server and communication system - Google Patents

Method for communication between servers, server and communication system Download PDF

Info

Publication number
CN105897817A
CN105897817A CN201510595717.XA CN201510595717A CN105897817A CN 105897817 A CN105897817 A CN 105897817A CN 201510595717 A CN201510595717 A CN 201510595717A CN 105897817 A CN105897817 A CN 105897817A
Authority
CN
China
Prior art keywords
server
business
client
module
processing 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.)
Pending
Application number
CN201510595717.XA
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.)
LeTV Cloud Computing Co Ltd
Original Assignee
LeTV Cloud Computing 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 LeTV Cloud Computing Co Ltd filed Critical LeTV Cloud Computing Co Ltd
Priority to CN201510595717.XA priority Critical patent/CN105897817A/en
Publication of CN105897817A publication Critical patent/CN105897817A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

An embodiment of the invention provides a method for communication between servers, a server and a communication system so as to reduce frequency of needed connection between the servers and lower connection cost when multiple times of intercommunication is needed between the servers for the same business. The embodiment of the invention provides the method for communication between the servers, and the method comprises the following steps: processing modules, needing to communicate with a second server and corresponding to all business, in a first sever respectively read connection information parameters of the second server; the processing modules, needing to communicate with the second server and corresponding to all business, in the first sever are respectively connected to the second server according to the connection information parameters; second server client ends corresponding to all business is established via the second server; the processing modules, needing to communicate with the second server and corresponding to all business, in the first sever store the client ends corresponding to the modules in local files of the modules and communicate with the second server via the client ends.

Description

Communication means, server and communication system between server
Technical field
The present embodiments relate to technical field of the computer network, particularly relate to the communication party between server Method, server and communication system.
Background technology
Zookeeper is a kind of distributed, application program coordination service of increasing income.It can provide Configuring maintenance, distributed synchronization, group service etc. service.It can also preserve the configuration information of service, In the service of High Availabitity, can be read out configuration information at any time, amendment etc. operates.
The concrete application scenarios of Zookeeper is as follows: in cloud platform services, on Servers-all all Dispose with a network web services, these servers are mounted with that zookeeper services, constitute One cluster, these web services use zookeeper carry out the storage of some simple information and make With waiting service, be equivalent to the web services on all of server and have a zookeeper information.
But, in cloud platform, for the web services of High Availabitity structure, some web services are starting When be directly connected to zookeeper, so, when web services and zookeeper communicate, web Service is without reconnecting zookeeper, thus avoids the expense connecting zookeeper.But, this side Formula relies on zookeeper when web services starts, and there is coupling between web services and zookeeper Shortcoming, easily on web services start produce impact.
If web services is independent of zookeeper, at web services and zookeeper when of startup When needing to communicate, web services is connected on zookeeper, when web services after sign off Disconnect with described zookeeper.So, web services will be connected when communicating with zookeeper every time Zookeeper, so that the expense that web services connects zookeeper increases.
In sum, in prior art, if relying on zookeeper, then web when starting web services The shortcoming that there is coupling between service and zookeeper;If being independent of when starting web services Zookeeper, then, when web services communicates with zookeeper every time, will reconnect zookeeper, The expense connected is too big, meanwhile, the business that web services processes is many when, is frequently connecting A lot of zookeeper clients can be caused during zookeeper to connect.
Summary of the invention
Communication means, server and communication system between the server that the embodiment of the present invention provides, in order to For same business between server, when needs are repeatedly in communication with each other, reduce and need between server The connection number of times carried out, reduces and connects expense.
Communication means between a kind of server that the embodiment of the present invention provides, including:
First server needs the processing module corresponding with each business of second server communication, point Do not read the link information parameter of described second server;
Described first server needs the place corresponding with each business that described second server communicates Reason module, according to described link information parameter, is connected respectively to described second server, this second take Business device is the client that each business sets up a second server;
Described first server needs the process mould corresponding with each business that described second server communicates Block, is saved in client corresponding for this module in the local file of this module, and by this client with Described second server communicates.
Communication means between a kind of server that the embodiment of the present invention provides, including:
Second server determines needs the process mould corresponding with each business in described first server Block communicates;
Described second server needs to lead to described second server with described first server respectively Each processing module of letter is attached, and is that each business sets up a client at this second server End;
Described second server is by the client corresponding with described each business, respectively with described first clothes Business device need the processing module corresponding with each business that described second server communicates to communicate.
A kind of server that the embodiment of the present invention provides, including:
Need the processing module corresponding with each business of another server communication, be used for reading another clothes The link information parameter of business device;And, according to described link information parameter, it is connected to another server, It is that each business sets up a client by another server;And, client corresponding for this module is protected Exist in the local file of this module, and communicated with another server by this client.
A kind of server that the embodiment of the present invention provides, including:
Determine module, corresponding with each business in another server for determining that this server needs Processing module communicates;
Perform module, for needing each business pair with this server communication in another server described The processing module answered is attached, and is that each business sets up a client at this server;And, Communicate with another server described needs each processing module with this server communication.
A kind of communication system that the embodiment of the present invention provides, including above two server.
Communication means, server and communication system between the server that the embodiment of the present invention provides, first Server needs the processing module corresponding with each business of second server communication, reads described respectively The link information parameter of second server, so that, when first server needs to lead to second server Just being connected with second server during letter, described first server is independent of described second server when starting, The coupling needing to rely on another kind of server when solving a kind of startup of server in prior art and produce Shortcoming.Secondly, described first server needs each business pair communicated with described second server The processing module answered, according to described link information parameter, is connected respectively to described second server, by this Two servers are the client that each business sets up a second server, described first server needs with The processing module corresponding to each business of described second server communication, protects client corresponding for this module Exist in the local file of this module, and communicated with described second server by this client, from And make, when the processing module corresponding to the same business in first server needs and second service again During communication, this processing module in described first server without being attached with described second server again, The client of the direct described second server corresponding by this processing module can be with described second server Communicate, it is to avoid prior art repeatedly exists same service needed when being in communication with each other between server, Need between server repeatedly to connect, cause connecting the problem that expense is big.Carried by the embodiment of the present invention The method of confession, needs each business communicated with described second server corresponding in described first server Processing module only need to once initialize with described second server and be connected, and effectively controls first service Device connects the quantity of the client of second server.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to reality Execute the required accompanying drawing used during example describes to be briefly described, it should be apparent that, in describing below Accompanying drawing is some embodiments of the present invention, for those of ordinary skill in the art, is not paying creation Property work on the premise of, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
The schematic flow sheet of the communication means between a kind of server that Fig. 1 provides for the embodiment of the present invention;
The flow process signal that communication means between the another kind of server that Fig. 2 provides for the embodiment of the present invention is real Figure;
The structural representation of a kind of server that Fig. 3 provides for the embodiment of the present invention;
The structural representation of the another kind of server that Fig. 4 provides for the embodiment of the present invention.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with this Accompanying drawing in bright embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention, Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on Embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise The every other embodiment obtained, broadly falls into the scope of protection of the invention.
In first server side, see Fig. 1, leading between a kind of server that the embodiment of the present invention provides Letter method, including:
S101, first server need the processing module corresponding with each business of second server communication, Read the link information parameter of described second server respectively;
S102, described first server need each business communicated with described second server corresponding Processing module, according to described link information parameter, is connected respectively to described second server, this second take Business device is the client that each business sets up a second server;
S103, described first server need each business communicated with described second server corresponding Processing module, is saved in client corresponding for this module in the local file of this module, and by this visitor Family end communicates with described second server.
Wherein, first server is pre-configured with the link information parameter of second server to be connected, and The link information parameter of described second server is saved in the local profile of this first server, So that when first server needs to communicate with second server, by the in reading local profile The link information parameter of two servers, it is possible to be connected to described second server.
It is preferred that the link information parameter of described second server specifically includes the ground of described second server Location and the port of described second server.
Communication means, server and communication system between the server that the embodiment of the present invention provides, first Server needs the processing module corresponding with each business of second server communication, reads described respectively The link information parameter of second server.So that, when first server needs to lead to second server Just being connected with second server during letter, described first server is independent of described second server when starting, The coupling needing to rely on another kind of server when solving a kind of startup of server in prior art and produce Shortcoming.Described first server needs the place corresponding with each business that described second server communicates Reason module, according to described link information parameter, is connected respectively to described second server, by this second service Device is the client that each business sets up a second server, needs and described in described first server The processing module that each business of two server communications is corresponding, is saved in this by client corresponding for this module In the local file of module, and communicated with described second server by this client.So that, When the processing module corresponding to the same business in first server needs to communicate with second service again, This processing module in described first server, without being attached with described second server, is directly led to again The client crossing described second server corresponding to this processing module can be led to described second server Letter, it is to avoid repeatedly there is same service needed in prior art between server when being in communication with each other, server Between need repeatedly to connect, cause connecting the big problem of expense.The side provided by the embodiment of the present invention Method, needs the process mould corresponding with each business that described second server communicates in described first server Block only need to once initialize with described second server and be connected, and effectively controls first server and connects The quantity of the client of second server.
It is preferred that the communication means between a kind of server of embodiment of the present invention offer, also include: institute State the logic judgment module in first server, when the place determining that in this first server, arbitrary business is corresponding When reason client corresponding to module lost efficacy, indicate corresponding processing module again with described second server It is attached, this second server is that this business re-establishes a client.
Thus, it is ensured that present in first server all business all can with second server proper communication, Ensure that the quality of communication between server.
Accordingly, in second server side, see Fig. 2, a kind of service that the embodiment of the present invention provides Communication means between device, including:
S201, second server determine needs the place corresponding with each business in described first server Reason module communication;
S202, described second server need and described second service with described first server respectively Each processing module of device communication is attached, and is that each business sets up one at this second server Client;
S203, described second server are by the client corresponding with described each business, respectively with described First server need the processing module corresponding with each business that described second server communicates lead to Letter.
Second server determines needs the processing module corresponding with each business in described first server to lead to Letter, can be process corresponding to each business in described second server receives described first server During the connection request message that module sends, described second server determines in needs and described first server Processing module communication corresponding to each business.
Wherein, described connection request message can be the process that the only one business in first server is corresponding Module sends, it is also possible to be the processing module transmission of the correspondence respectively of the multiple business in first server. As long as communicating it is to say, first server there are service needed with described second server, Processing module corresponding to these business just sends described connection request message to described second module.
Described second server respectively with described first server needs communicate with described second server When each processing module is attached, it is that each business sets up a client at this second server.From And, can make first server to need and the most corresponding client of each business of second server communication End, this client is available for this business and uses for a long time.
By above-mentioned discussion, the embodiment of the present invention, first server communicates with second server Time, can be in the way of being discussed as being employing derived class list example.Wherein, single example is that a kind of conventional software sets Meter pattern, it is possible to a class only one of which example in guarantee system, thus conveniently example number is controlled also Economize on resources.The embodiment of the present invention, by the way of derived class list example so that every in first server One business can the client of a corresponding second server, and this client can be permanent for this business Use, effectively control the quantity of the client that first server is connected with second server.
First server described in the embodiment of the present invention, such as, can be web server;Second server, Can be such as zookeeper.
Below with first server as web server, as a example by second server is zookeeper, be given The explanation of one specific embodiment.
In order to discuss conveniently, it is assumed that described web server has 5 business, 5 business the most corresponding 5 Individual processing module.Above-mentioned 5 business are called A business, B business, C business, D industry by us Business and E business, the processing module corresponding to 5 business be called module 1, module 2, module 3, Module 4 and module 5.
When web server starts, it is not attached with zookeeper.In the follow-up a certain moment, If A business, B business and C service needed in web server communicate with zookeeper, Now, module 1, module 2 and module 3 are protected in reading the local profile of web server respectively The address of the zookeeper deposited and port information parameter.Then, described module 1, module 2 and module 3 Address according to described zookeeper and port information parameter, be connected respectively on described zookeeper, It is that described A business, B business and C business set up a zookeeper respectively by described zookeeper Client, referred to as client 1, client 2 and client 3.Described module 1, module 2 and module Client 1, client 2 and client 3 are saved in respective local file by 3 respectively, and by visitor Family end 1, client 2 and client 3 communicate with described zookeeper.Here, a client A corresponding business is a single example, and namely client 1 corresponding A business is a single example, client The corresponding B business of end 2 is a single example, and the corresponding C business of client 3 is a single example, by the most of the same trade or business Business uses different single examples, realizes the communication of described web server and zookeeper.
When in following instant, described module 1, module 2 and module 3 arbitrary module need repeatedly with During zookeeper communication, described each module, without being attached with described zookeeper, is led to respectively again again Cross the client that each module is corresponding, can communicate with zookeeper.This is mainly by above-mentioned mould Client 1, client 2 and client 3 are saved in respective by block 1, module 2 and module 3 respectively Ground file realizes, say, that, it is achieved that the succession of single example, each client can be for a long time Business in the module that this client is corresponding services for a long time.
It should be noted that described module 1, module 2, module 3, module 4 and module 5 can be same Time need to communicate with zookeeper, it is also possible to be to communicate with zookeeper needing the most in the same time respectively, It is not limited to above-mentioned situation.
By the method described in the present embodiment, web server needs not rely on zookeeper when starting, when Web server exists service needed when communicating with zookeeper, each needs in described web server Zookeeper it is connected respectively with the module corresponding to the business of zookeeper communication, and by described Zookeeper is the client that described each business sets up a correspondence respectively, and this client can be corresponding business Permanent service, thus avoid the expense that web server frequently connects zookeeper.
With said method corresponding device is described below.
In first server side, see Fig. 3, a kind of server that the embodiment of the present invention provides, including:
Need the processing module 11 corresponding with each business of another server communication, be used for reading another clothes The link information parameter of business device;And, according to described link information parameter, it is connected to another server, It is that each business sets up a client by another server;And, client corresponding for this module is preserved In the local file of this module, and communicated with another server by this client;
Logic judgment module 12, for when determining that the processing module that in this server, arbitrary business is corresponding is right When the client of another server answered lost efficacy, corresponding processing module is indicated again to service with described another Device is attached, another server described be that this business re-establishes a client.
Wherein it is desired to the number of the processing module corresponding with each business of another server communication can be One, it is also possible to for multiple.It is to say, described server there are several business, just to having Several processing modules, the number of the processing module in described server is not limited by the embodiment of the present invention.
It is preferred that the link information parameter of another server described specifically includes: another server described Address and the port of another server described.
Correspondingly, in second server side, see Fig. 4, a kind of server that the embodiment of the present invention provides, Including:
Determine module 21, corresponding with each business in another server for determining that this server needs Processing module communication;
Perform module 22, for needing each business with this server communication in another server described Corresponding processing module is attached, and is that each business sets up a client at this server;And, Communicate with another server described needs each processing module with this server communication.
Described determine module 21 determine this server need corresponding with each business in another server Processing module communicates, and can be when this determines that each business that module 21 receives in another server is corresponding Processing module send connection request message time, described determine module 21 determine this server need and another The processing module communication that each business in server is corresponding.
A kind of communication system that the embodiment of the present invention provides, including two kinds described in above-mentioned Fig. 3 and Fig. 4 Server, the two server can be found in the above-mentioned description to two kinds of servers, do not repeats them here.
In the embodiment of the present invention, hardware processor (hardware processor) can be passed through and realize State related function module.
Device embodiment described above is only schematically, wherein said illustrates as separating component Unit can be or may not be physically separate, the parts shown as unit can be or Person may not be physical location, i.e. may be located at a place, or can also be distributed to multiple network On unit.Some or all of module therein can be selected according to the actual needs to realize the present embodiment The purpose of scheme.Those of ordinary skill in the art are not in the case of paying performing creative labour, the most permissible Understand and implement.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive each reality The mode of executing can add the mode of required general hardware platform by software and realize, naturally it is also possible to by firmly Part.Based on such understanding, the portion that prior art is contributed by technique scheme the most in other words Dividing and can embody with the form of software product, this computer software product can be stored in computer can Read in storage medium, such as ROM/RAM, magnetic disc, CD etc., including some instructions with so that one Computer equipment (can be personal computer, server, or the network equipment etc.) performs each to be implemented The method described in some part of example or embodiment.
Last it is noted that above example is only in order to illustrate technical scheme, rather than to it Limit;Although the present invention being described in detail with reference to previous embodiment, the ordinary skill of this area Personnel it is understood that the technical scheme described in foregoing embodiments still can be modified by it, or Person carries out equivalent to wherein portion of techniques feature;And these amendments or replacement, do not make corresponding skill The essence of art scheme departs from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (9)

1. the communication means between a server, it is characterised in that the method includes:
First server needs the processing module corresponding with each business of second server communication, point Do not read the link information parameter of described second server;
Described first server needs the place corresponding with each business that described second server communicates Reason module, according to described link information parameter, is connected respectively to described second server, this second take Business device is the client that each business sets up a second server;
Described first server needs the place corresponding with each business that described second server communicates Reason module, is saved in client corresponding for this module in the local file of this module, and by this visitor Family end communicates with described second server.
Method the most according to claim 1, it is characterised in that the company of described second server Connect information parameter to specifically include: the address of described second server and the port of described second server.
Method the most according to claim 1, it is characterised in that the method also includes:
Logic judgment module in described first server, when determining arbitrary business in this first server When the corresponding client corresponding to processing module lost efficacy, indicate corresponding processing module again with described Second server is attached, this second server be that this business re-establishes a client.
4. the communication means between a server, it is characterised in that the method includes:
Second server determines needs the process mould corresponding with each business in described first server Block communicates;
Described second server needs to lead to described second server with described first server respectively Each processing module of letter is attached, and is that each business sets up a client at this second server End;
Described second server is by the client corresponding with described each business, respectively with described first Server need the processing module corresponding with each business that described second server communicates lead to Letter.
5. a server, it is characterised in that this server includes:
Need the processing module corresponding with each business of another server communication, be used for reading another clothes The link information parameter of business device;And, according to described link information parameter, it is connected to another server, It is that each business sets up a client by another server;And, client corresponding for this module is protected Exist in the local file of this module, and communicated with another server by this client.
Server the most according to claim 5, it is characterised in that another server described Link information parameter specifically includes: the address of another server described and the end of another server described Mouthful.
Server the most according to claim 5, it is characterised in that this server also includes:
Logic judgment module, for when determining that the processing module that in this server, arbitrary business is corresponding is right When the client of another server answered lost efficacy, corresponding processing module is indicated again to take with described another Business device is attached, another server described be that this business re-establishes a client.
8. a server, it is characterised in that this server includes:
Determine module, corresponding with each business in another server for determining that this server needs Processing module communicates;
Perform module, for needing each business with this server communication in another server described Corresponding processing module is attached, and is that each business sets up a client at this server;With And, need each processing module with this server communication to communicate in another server described.
9. a communication system, it is characterised in that this system includes claim 5-7 arbitrary claim institute The server stated, and the server described in claim 8.
CN201510595717.XA 2015-09-17 2015-09-17 Method for communication between servers, server and communication system Pending CN105897817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510595717.XA CN105897817A (en) 2015-09-17 2015-09-17 Method for communication between servers, server and communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510595717.XA CN105897817A (en) 2015-09-17 2015-09-17 Method for communication between servers, server and communication system

Publications (1)

Publication Number Publication Date
CN105897817A true CN105897817A (en) 2016-08-24

Family

ID=57002771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510595717.XA Pending CN105897817A (en) 2015-09-17 2015-09-17 Method for communication between servers, server and communication system

Country Status (1)

Country Link
CN (1) CN105897817A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101772218A (en) * 2008-12-30 2010-07-07 上海茂碧信息科技有限公司 Mobile phone communication method and system adopting same
CN103500111A (en) * 2013-10-11 2014-01-08 北京奇虎科技有限公司 Information configuration method and device based on zookeeper
US20140222957A1 (en) * 2013-02-04 2014-08-07 Oracle International Corporation Java api for programming web real-time communication applications
WO2014209075A1 (en) * 2013-06-27 2014-12-31 Seo Jeong Hoan Multi-connection system and method for service using internet protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101772218A (en) * 2008-12-30 2010-07-07 上海茂碧信息科技有限公司 Mobile phone communication method and system adopting same
US20140222957A1 (en) * 2013-02-04 2014-08-07 Oracle International Corporation Java api for programming web real-time communication applications
WO2014209075A1 (en) * 2013-06-27 2014-12-31 Seo Jeong Hoan Multi-connection system and method for service using internet protocol
CN103500111A (en) * 2013-10-11 2014-01-08 北京奇虎科技有限公司 Information configuration method and device based on zookeeper

Similar Documents

Publication Publication Date Title
US10148556B2 (en) Link aggregation group (LAG) support on a software-defined network (SDN)
CN105867837A (en) Method, equipment and system for updating configurations of clients in distributed high-speed cache systems
CN104079630A (en) Business server side load balancing method, client side, server side and system
CN109711999A (en) Go out single method and device, computer equipment, storage medium based on halfpace
CN108900384A (en) Network flow monitoring method, apparatus and system, computer readable storage medium
CN102316043B (en) Port virtualization method, switch and communication system
CN105939267B (en) Outband management method and device
CN101901163B (en) Method and device for distributing messages
CN105429946A (en) System and method of preventing forging IP address based on SDN virtual switch
CN110933015B (en) Data transmission method, device and system
CN102511146A (en) Implementation method for session board controller pool and session board controller
CN104243360B (en) The collocation method and device of a kind of conversion link
CN105245588A (en) Separation processing method of web service port
CN109753782B (en) Adaptive processing method and device for cloud security resource pool
CN107493254B (en) TCP message forwarding method, device and system
CN110620706A (en) Processing method and equipment
CN109168185B (en) Network scanning method and device based on network name space
CN110380930B (en) Test method, test device, server and computer storage medium
CN105897817A (en) Method for communication between servers, server and communication system
CN103765837B (en) The message processing method of multi-CPU and system, crosspoint, veneer
CN109981437A (en) A kind of multiple data centers interoperability methods and relevant device based on VPC
CN109936462A (en) Disaster recovery method and device
CN103563305A (en) System and method for providing push service to reduce network load
CN113450097A (en) Transaction processing system and method across old system and new system
CN107454021B (en) Communication method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160824