CN108023755A - A kind of P2P dispatch servers hot spare method and device - Google Patents

A kind of P2P dispatch servers hot spare method and device Download PDF

Info

Publication number
CN108023755A
CN108023755A CN201610972267.6A CN201610972267A CN108023755A CN 108023755 A CN108023755 A CN 108023755A CN 201610972267 A CN201610972267 A CN 201610972267A CN 108023755 A CN108023755 A CN 108023755A
Authority
CN
China
Prior art keywords
equipment
client
information
sent
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610972267.6A
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.)
Shenzhen Excellent Friends Bullock Media Development Co
Original Assignee
Shenzhen Excellent Friends Bullock Media Development Co
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 Shenzhen Excellent Friends Bullock Media Development Co filed Critical Shenzhen Excellent Friends Bullock Media Development Co
Priority to CN201610972267.6A priority Critical patent/CN108023755A/en
Publication of CN108023755A publication Critical patent/CN108023755A/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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements

Landscapes

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

Abstract

The invention discloses a kind of P2P dispatch servers hot spare method and device, and to solve the problems, such as that master/slave device switching efficiency is relatively low, this method includes:The parsing of first client plays the address of the first equipment and the address of the second equipment included in string, and using the first equipment as host apparatus, the second equipment is as stand-by equipment;First client sends logging request to the first equipment, and receives the login success message of the first device replied;First client sends heartbeat message to the first equipment and the second equipment.

Description

A kind of P2P dispatch servers hot spare method and device
Technical field
The present invention relates to the communications field, more particularly to a kind of P2P dispatch servers hot spare method and device.
Background technology
In current network application, in order to avoid causing the risk of network interruption because of Single Point of Faliure, it is necessary to holding equipment Between two-node cluster hot backup, i.e. a host apparatus and alternate device form one hot standby group.When host apparatus breaks down, The work of host apparatus is taken over by alternate device, ensures the normal operation of every business.
In existing P2P dispatch servers hot reserve scheme, when system starts, realized by way of full dose is synchronous primary The data of equipment to alternate device are synchronous;After full dose synchronously completes, during the modification that the configuration parameter to host apparatus is made, pass through The mode of increment synchronization realizes that the data of host apparatus to alternate device are synchronous, improves the real-time of data synchronization, ensure that The service operation state of equipment and the consistent of the information such as parameter is configured before and after master/slave device switching.
But when full dose is synchronous, each fully synchronized P2P topological relations data volume is bigger.And switched by host apparatus To after stand-by equipment, the reason because network burrows, stand-by equipment is needed by Message forwarding module to client push message, if The not Message forwarding module, then before changing in client awareness apparatus address, stand-by equipment can not active push message To client, cause master/slave device switching efficiency relatively low.In addition, in normal course of operation, stand-by equipment does not carry for client For service, in idle state, the wasting of resources of stand-by equipment is caused.
The content of the invention
The object of the present invention is to provide a kind of P2P dispatch servers hot spare method and device, to solve master/slave device switching The problem of less efficient.
The purpose of the present invention is what is be achieved through the following technical solutions:
First aspect, a kind of P2P dispatch servers hot spare method, including:
The parsing of first client plays the address of the first equipment and the address of the second equipment included in string, by described first Equipment is as host apparatus, and second equipment is as stand-by equipment;
First client sends logging request to first equipment, and receives the login of first device replied Success message;
First client sends heartbeat message to first equipment and second equipment.
Alternatively, after first client sends heartbeat message to first equipment and second equipment, Further include:
First client receive disconnecting instruction message and do not receive first equipment heartbeat response disappear During breath, first device fails are determined, logging request is sent to second equipment, and receive second equipment and return Multiple login success message;
Alternatively, first client receives disconnecting instruction message and receives the heartbeat response of first equipment During message, determine that first equipment does not break down, without sending logging request to second equipment;
Wherein, the disconnecting instruction message is second equipment when determining with the first equipment disconnecting Send.
Second aspect, a kind of P2P dispatch servers hot spare method, including:
When first equipment determines the first equipment described in the first client Successful login, the letter of first client is recorded Breath, and the information of first client is sent to the second equipment;And receive the second client that second equipment is sent The information at end, preserves the information of second client and marks the logging device of second client to be set for described second It is standby;
First equipment receives the heartbeat message that first client and second client are sent;
Wherein, the information of second client is to determine the second client Successful login institute in second equipment State what is sent after the second equipment.
Alternatively, the heartbeat message that first client and second client are sent is received in first equipment Afterwards, further include:
After second client is logged off from second equipment, first equipment receives described second and sets The exit message for second client that preparation is sent;
When first equipment determines the information of local preservation second client, by the information of second client Delete.
Alternatively, the information of first client is sent to before the second equipment in first equipment, further included:
After first equipment and second equipment establish connection, first equipment is by each client of local log-on The information at end is sent to second equipment, and it is each to receive being logged in second equipment for the second equipment transmission The information of client.
Alternatively, further include:
First equipment preserves and sends the information of each client of local log-on to the process of second equipment The client-side information of middle new login and the client-side information exited;
First equipment by the client-side information of the new login of preservation and described exits after determining to be sent completely Client-side information send to second equipment.
Alternatively, the heartbeat message that first client and second client are sent is received in first equipment Afterwards, further include:
When first equipment is determined with the second equipment disconnecting, disconnecting is sent to second client Instruction message.
First equipment receives the logging request that second client is sent;
First equipment is set the logging device of second client by second equipment change for described first It is standby, and reply login success message to second client.
Alternatively, after first equipment sends login success message to second client, further include:
When first equipment determines that the connection for exceeding preset duration and second equipment does not recover, it is by logging device The information deletion of the client of second equipment;
Alternatively, when first equipment determines with the connection of second equipment to recover in preset duration, by described the The synchronizing information of all clients preserved in one equipment is to second equipment.
Alternatively, first equipment belongs to same hot standby group with second equipment, and the method further includes:
First equipment is according to other hot standby group informations, by the synchronizing information of each client itself preserved to described In other hot standby group corresponding at least one equipment;
Wherein, each hot standby group information includes, corresponding hot standby group of the corresponding IP address of at least one equipment and Port numbers.
Alternatively, each hot standby group information further includes:The client historical average mesh logged in this hot standby group.
Alternatively, the synchronizing information of each client preserved itself in first equipment is to described other hot standby group After in corresponding at least one equipment, further include:
First equipment receives itself preservation that other hot standby group corresponding at least one equipment is each replied Client-side information;
First equipment receives the forwarding request that burrows that the 3rd client is sent, and the forwarding request that burrows includes described The IP address and port numbers of first client, the 3rd client are logged in the 3rd equipment, the 3rd equipment for it is described its Any one in his hot standby group of corresponding at least one equipment;
First equipment burrows according to forwards request to send the request that burrows to first client, described to burrow Request includes the IP address and port numbers of the 3rd client.
The third aspect, a kind of hot standby device of P2P dispatch servers, including:
Resolution unit, for parsing the address of the first equipment and the address of the second equipment that play and included in string, by described in First equipment is as host apparatus, and second equipment is as stand-by equipment;
Transmit-Receive Unit, for sending logging request to first equipment, and receives the login of first device replied Success message;
And send heartbeat message to first equipment and second equipment.
Alternatively, described device, further includes:
Accident analysis unit, is used for
After heartbeat message is sent to first equipment and second equipment, received by the Transmit-Receive Unit Disconnecting instruction message and when not receiving the heartbeat response message of first equipment, determine first equipment occur therefore Barrier, logging request is sent by the Transmit-Receive Unit to second equipment, and receive the login of second device replied into Work(message;
Alternatively, rung by the heartbeat that the Transmit-Receive Unit receives disconnecting instruction message and receives first equipment When answering message, determine that first equipment does not break down, without sending logging request to second equipment;
Wherein, the disconnecting instruction message is second equipment when determining with the first equipment disconnecting Send.
Fourth aspect, a kind of hot standby device of P2P dispatch servers, including:
Processing unit, during for determining the first equipment described in the first client Successful login, records first client Information, and the information of first client is sent to the second equipment by Transmit-Receive Unit;It is and single by the transmitting-receiving Member receives the information for the second client that second equipment is sent, and preserves the information of second client and marks described the The logging device of two clients is second equipment;
The Transmit-Receive Unit, is additionally operable to receive the heartbeat message that first client and second client are sent;
Wherein, the information of second client is to determine the second client Successful login institute in second equipment State what is sent after the second equipment.
Alternatively, the processing unit, is additionally operable to:
After the heartbeat message that first client and second client are sent is received, when second client After logging off from second equipment, described second is directed to by what Transmit-Receive Unit reception second equipment was sent The exit message of client;
When determining the information of local preservation second client, by the information deletion of second client.
Alternatively, the processing unit, is additionally operable to:
Sent by the information of first client to before the second equipment, after establishing connection with second equipment, The information of each client of local log-on is sent to second equipment by the Transmit-Receive Unit, and receives described second The information for each client logged in second equipment that equipment is sent.
Alternatively, the processing unit, is additionally operable to:
Preserve the visitor of new login during the information of each client of local log-on is sent to second equipment Family client information and the client-side information exited;
After determining to be sent completely, by the client-side information of the new login of preservation and the client-side information exited Sent by the Transmit-Receive Unit to second equipment.
Alternatively, the processing unit, is additionally operable to:
After the heartbeat message that first client and second client are sent is received, determine and described second During equipment disconnecting, disconnecting instruction message is sent to second client by the Transmit-Receive Unit.
The logging request of the second client transmission is received by the Transmit-Receive Unit;
By second equipment change it is first equipment by the logging device of second client, and to described Two clients reply login success message by the Transmit-Receive Unit.
Alternatively, the processing unit, is additionally operable to:
After login success message is sent to second client, determine more than preset duration and second equipment When connection does not recover, the information deletion by logging device for the client of second equipment;
Alternatively, when determining with the connection of second equipment to recover in preset duration, will be preserved in first equipment The information of all clients second equipment is synchronized to by the Transmit-Receive Unit.
Alternatively, the processing unit, is additionally operable to:
Described device belongs to same hot standby group with second equipment, and according to other hot standby group informations, itself is preserved The information of each client is synchronized in other hot standby group corresponding at least one equipment by the Transmit-Receive Unit;
Wherein, each hot standby group information includes, corresponding hot standby group of the corresponding IP address of at least one equipment and Port numbers.
Alternatively, each hot standby group information further includes:The client historical average mesh logged in this hot standby group.
Alternatively, the processing unit, is additionally operable to:
The each client for preserving itself synchronizing information to other hot standby group corresponding at least one equipment In after, pass through the Transmit-Receive Unit itself preserving of receiving that other hot standby group corresponding at least one equipment each replys Client-side information;
The forwarding request that burrows of the 3rd client transmission is received by the Transmit-Receive Unit, the forwarding request that burrows includes The IP address and port numbers of first client, the 3rd client are logged in the 3rd equipment, and the 3rd equipment is institute State any one in other hot standby group corresponding at least one equipment;
The request that burrows is sent to first client by the Transmit-Receive Unit according to the forwarding request that burrows, it is described The request that burrows includes the IP address and port numbers of the 3rd client.
Compared in the prior art, client only sends heartbeat message after host apparatus is logged in host apparatus, without Heartbeat message is sent to stand-by equipment, is caused after host apparatus failure, perceiving host apparatus failure in client transfers to log in Before stand-by equipment, stand-by equipment can not communicate with client.In embodiments of the present invention, two equipment in hot standby group Position is identical, and function is identical, there is client login, and the client logged on either device is both needed to send heartbeat to two equipment Message, therefore, when some client determines host apparatus failure, stand-by equipment can send out disconnecting to the client and disappear Breath, actively communicates with the client, improves the switching efficiency of master/slave device.
Brief description of the drawings
Fig. 1 is the general introduction flow chart of client-side P2P dispatch server hot spare methods in the embodiment of the present invention;
Fig. 2 is the hot standby process schematic between P2P dispatch servers in the embodiment of the present invention;
Fig. 3 is the general introduction flow chart of equipment side P2P dispatch server hot spare methods in the embodiment of the present invention;
Fig. 4 is the hot standby process schematic between hot standby group of difference in the embodiment of the present invention;
Fig. 5 is that client network in the embodiment of the present invention between different hot standby groups burrows flow chart;
Fig. 6 is one of structure diagram of the hot standby device of P2P dispatch servers in the embodiment of the present invention;
Fig. 7 is the second structural representation of the hot standby device of P2P dispatch servers in the embodiment of the present invention.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, is not whole embodiments.
Signified equipment is P2P dispatch servers (tracker) in the embodiment of the present invention, and client is P2P clients (P2Pclient)
Refering to shown in Fig. 1 and Fig. 2, the embodiment of the present invention provides a kind of P2P dispatch servers hot spare method, including:
Step 100:The parsing of first client plays the address of the first equipment and the address of the second equipment included in string, will First equipment is as host apparatus, and the second equipment is as stand-by equipment.
Specifically, the first client sequentially parses the address for playing the first equipment included in string and the second equipment Address, determine when first parsing the address of the first equipment, set the first equipment as host apparatus, the second equipment as spare It is standby.Wherein, the first equipment and the second equipment are one hot standby group, and the address of the first equipment and the address of the second equipment are playing string In order it is random.
It should be understood that the order due to the address of the first equipment with the address of the second equipment in string is played is random, because This, only to be illustrated exemplified by parsing the address of the first equipment first in the present embodiment.When the first client parses first During the address of the second equipment, then using the second equipment as host apparatus.It follows that the second equipment can also have client to step on Record, it is identical with the first equipment status not in idle state, reduce the wasting of resources.
Step 110:First client sends logging request to the first equipment, and receives logining successfully for the first device replied Message.
That is the first client sends logging request to host apparatus, and Successful login is to host apparatus.
Step 120:First client sends heartbeat message to the first equipment and the second equipment.
After first the first equipment of client Successful login, the first client sends heartbeat to the first equipment and the second equipment Message, to the two equipment timing feedbacks state of itself.Further, since the first client logs on the first device, First equipment is the host apparatus of the first client, and therefore, the first client sends other requests to the first equipment, without to Second equipment is sent.Here other requests can be to log in inquiry etc..
In the prior art, client is after host apparatus is logged in, and only sends heartbeat message to host apparatus, without to spare Equipment sends heartbeat message, causes after host apparatus failure, and perceiving host apparatus failure in client transfers to log in spare set Before standby, stand-by equipment can not communicate with client.And in the embodiment of the present invention, two equipment status phases in hot standby group Together, function is identical, there is client login, and the client logged on either device is both needed to disappear to two equipment transmission heartbeats Breath, therefore, when some client determines host apparatus failure, stand-by equipment can send out disconnecting message to the client, Actively communicate with the client, improve the switching efficiency of master/slave device.
Specifically, after the first client sends heartbeat message to the first equipment and the second equipment, the first client termination When receiving disconnecting instruction message and not receiving the heartbeat response message of the first equipment, the first device fails are determined, even It is that the second equipment is being determined with being sent during the first equipment disconnecting to connect and interrupt instruction message.First client is to the second equipment Logging request is sent, and receives the login success message of the second device replied.
It should be clear that working as the first client receives disconnecting instruction message, but receive the heartbeat response message of the first equipment When, show the disconnecting of the first equipment and the second equipment, the connection of the first equipment and the first client is normal, at this time the first visitor Family end from the first equipment without switching to the second equipment.
Refering to shown in Fig. 2 and Fig. 3, the embodiment of the present invention provides a kind of P2P dispatch servers hot spare method, this method bag Include:
Step 300:When first equipment determines first client the first equipment of Successful login, the letter of the first client is recorded Breath, and the information of the first client is sent to the second equipment;And the information for the second client that the second equipment is sent is received, The logging device for preserving the information of the second client and the second client of mark is the second equipment.
Step 310:First equipment receives the heartbeat message that the first client and the second client are sent.
Wherein, the information of the second client is sent after the second equipment determines second the second equipment of client Successful login 's.
Alternatively, the first equipment and the second equipment are one hot standby group, above method describe the first equipment and are set with second The standby increment synchronization process for being directed to client.When any appliance has client login, to the synchronous client of another equipment Information and the logging device for marking the client, and two equipment can receive the heartbeat message of the client.
Similarly, after the second client is logged off from the second equipment, the first equipment receives the pin that the second equipment is sent To the exit message of the second client.When first equipment determines the information of the second client of local preservation, by the second client Information deletion.
In addition, the information of the first client is sent to before the second equipment in the first equipment, i.e. the first equipment and second After equipment establishes connection, the first equipment needs synchronous with the second equipment progress full dose.First equipment is by each visitor of local log-on The information at family end is sent to the second equipment, and receives the letter for each client logged on the second device that the second equipment is sent Breath.
Further, the embodiment of the present invention is additionally contemplates that the first equipment is preserved the information of each client of local log-on Send to during the second equipment, have new client and log on to the first equipment, or there is client to log off first Equipment, the client-side information that the first equipment preserves the client-side information of new login and exits at this time, after the completion of waiting transmission process, The client-side information of the new login of preservation and the client-side information exited are sent to the second equipment.Therefore, it is possible to be effectively ensured First equipment is consistent with the client-side information that the second equipment preserves.
After the heartbeat message that the first equipment receives that the first client and the second client are sent, the first equipment determine with During the second equipment disconnecting, disconnecting instruction message is sent to the second client.Sent out in the first equipment to the second client After sending disconnecting instruction message, if the second client does not receive the heartbeat response message of the second equipment at the same time, set to first Preparation send logging request.After first equipment receives logging request, it is by the second equipment change by the logging device of the second client First equipment, and reply login success message to the second client.
Alternatively, when the first equipment determines that the connection for exceeding preset duration and the second equipment does not recover, it is by logging device The information deletion of the client of second equipment.At this time, the first equipment can connect and compose new hot standby group with other equipment.
Alternatively, when the first equipment determines with the connection of the second equipment to recover in preset duration, will be preserved in the first equipment All clients synchronizing information to the second equipment.
In addition, each client-side information that itself is preserved is synchronized to other by the first equipment according to other hot standby group informations In hot standby group of corresponding at least one equipment.
Wherein, each hot standby group information includes, corresponding hot standby group of the corresponding IP address of at least one equipment and Port numbers.
Alternatively, each hot standby group information further includes:The client historical average mesh logged in this hot standby group.
In addition, for less hot standby group of the client historical average mesh of login, other hot standby group informations can be to step on Multiple hot standby group more of information of the client average number of record, ensure that less hot standby group of client average number have compared with More clients is supported as data sharing.
For example, refering to described in Fig. 4, the configuration information of A groups includes the information of B groups and C groups, and therefore, two in A groups set The all clients information that standby two equipment from the timing to B groups that can be in two equipment and C groups of synchronously locally preserve, and connect Receive the client-side information that equipment locally preserves in the B groups that two equipment of two equipment in B groups into A groups are sent, Yi Jijie Receive the client-side information that equipment locally preserves in the C groups that two equipment of two equipment in C groups into A groups are sent.Therefore, exist The client that A groups, B groups, C groups log in has more clients to be supported as data sharing.
In addition, the synchronizing information for each client for preserving itself in the first equipment to other hot standby group it is corresponding at least After in one equipment, the first equipment receives the client itself preserved that other hot standby group corresponding at least one equipment is each replied Client information;
At this time, when the first equipment receives the forwarding request that burrows of the 3rd client transmission, the first equipment turns according to burrowing Hair request sends the request that burrows to the first client, and the request that burrows includes the IP address and port numbers of the 3rd client.
The forwarding request that burrows includes the IP address and port numbers of the first client, and the 3rd client is logged in the 3rd equipment, 3rd equipment is any one in other hot standby group corresponding at least one equipment.
Therefore, network can be carried out by the equipment of login between client to burrow, referring particularly to shown in Fig. 5.
S501:P2pclientA sends reciprocity (peer) node request of inquiry to trackerA, and p2pclientA exists Logged on trackerA.
S502:TrackerA inquires p2pclientB, and inquire p2pclientB logins by related screening rule Tracker be trackerB, by the ip2 addresses of the ip addresses ip1 of p2pclientB and port numbers port1 and trackerB P2pclientA is returned to port port2.
TrackerA adheres to different hot standby groups separately from trackerB, both have been completed the synchronization of client-side information, because This, trackerA can inquire p2pclientB by related screening rule, and by the ip addresses ip1 of p2pclientB and The ip2 addresses of port numbers port1 and trackerB and port port2 return to p2pclientA.
S503:After p2pclientA receives the response message of trackerA, ip addresses ip1 and the end of p2pclientB are parsed The ip2 addresses of slogan port1 and trackerB and port port2.
S504:P2pclientA using ip2 and port2 as with p2pclientB establish connection use with burrowing server Location, the forwarding request that burrows is sent to trackerB, and sends data packet to p2pclientB at the same time.
S505:After trackerB receives the forwarding request that burrows of p2pclientA, parsed from request bag The ip addresses ip1 and port numbers port1 of p2pclientB, and send the request bag that burrows to p2pclientB.
Meanwhile the ip addresses ip3 of p2pclientA and port numbers port3 are write the request bag that burrows by trackerB.By The synchronous of client-side information is had been completed in trackerA and trackerB, and therefore, trackerB can be inquired The ip addresses ip3 and port numbers port3 of p2pclientA.
S506:After p2pclientB receives the request bag that burrows of trackerB transmissions, parsed from the request bag that burrows The ip addresses ip3 and port numbers port3 of p2pclientA, and send data packet to p2pclientA.
Since p2pclientA has been transmitted across data packet to p2pclientB, in p2pclientB to p2pclientA When sending data packet, p2pclientA can receive the data packet of p2pclientB transmissions, p2pclientA and p2pclientB Between network burrow success.
Therefore, it can carry out network by the equipment of login by the above method, between client burrow, improve network The efficiency to burrow.
As shown in fig.6, the embodiment of the present invention additionally provides a kind of hot standby device of P2P dispatch servers, including:
Resolution unit 60, for parsing the address of the first equipment and the address of the second equipment that play and included in string, by institute The first equipment is stated as host apparatus, second equipment is as stand-by equipment;
Transmit-Receive Unit 61, for sending logging request to first equipment, and receives stepping on for first device replied Record success message;
And send heartbeat message to first equipment and second equipment.
Alternatively, described device, further includes:
Accident analysis unit 62, is used for
After heartbeat message is sent to first equipment and second equipment, received by the Transmit-Receive Unit 61 When not receiving to disconnecting instruction message and the heartbeat response message of first equipment, determine that event occurs for first equipment Barrier, logging request is sent by the Transmit-Receive Unit 61 to second equipment, and receives the login of second device replied Success message;
Alternatively, disconnecting instruction message is received by the Transmit-Receive Unit 61 and receives the heartbeat of first equipment During response message, determine that first equipment does not break down, without sending logging request to second equipment;
Wherein, the disconnecting instruction message is second equipment when determining with the first equipment disconnecting Send.
As shown in fig.7, the embodiment of the present invention additionally provides a kind of hot standby device of P2P dispatch servers, including:
Processing unit 70, during for determining the first equipment described in the first client Successful login, records first client The information at end, and the information of first client is sent to the second equipment by Transmit-Receive Unit 71;And pass through the receipts Bill member 71 receives the information for the second client that second equipment is sent, and preserves the information and mark of second client The logging device of second client is second equipment;
The Transmit-Receive Unit 71, is additionally operable to receive the heartbeat letter that first client and second client are sent Breath;
Wherein, the information of second client is to determine the second client Successful login institute in second equipment State what is sent after the second equipment.
Alternatively, the processing unit 70, is additionally operable to:
After the heartbeat message that first client and second client are sent is received, when second client After logging off from second equipment, by the Transmit-Receive Unit 71 receive that second equipment sends for described the The exit message of two clients;
When determining the information of local preservation second client, by the information deletion of second client.
Alternatively, the processing unit 70, is additionally operable to:
Sent by the information of first client to before the second equipment, after establishing connection with second equipment, The information of each client of local log-on is sent to second equipment by the Transmit-Receive Unit 71, and receives described The information for each client logged in second equipment that two equipment are sent.
Alternatively, the processing unit 70, is additionally operable to:
Preserve the visitor of new login during the information of each client of local log-on is sent to second equipment Family client information and the client-side information exited;
After determining to be sent completely, by the client-side information of the new login of preservation and the client-side information exited Sent by the Transmit-Receive Unit 71 to second equipment.
Alternatively, the processing unit 70, is additionally operable to:
After the heartbeat message that first client and second client are sent is received, determine and described second During equipment disconnecting, disconnecting instruction message is sent to second client by the Transmit-Receive Unit 71.
The logging request of the second client transmission is received by the Transmit-Receive Unit 71;
By second equipment change it is first equipment by the logging device of second client, and to described Two clients reply login success message by the Transmit-Receive Unit 71.
Alternatively, the processing unit 70, is additionally operable to:
After login success message is sent to second client, determine more than preset duration and second equipment When connection does not recover, the information deletion by logging device for the client of second equipment;
Alternatively, when determining with the connection of second equipment to recover in preset duration, will be preserved in first equipment The information of all clients second equipment is synchronized to by the Transmit-Receive Unit.
Alternatively, the processing unit 70, is additionally operable to:
Described device belongs to same hot standby group with second equipment, and according to other hot standby group informations, itself is preserved The information of each client is synchronized in other hot standby group corresponding at least one equipment by the Transmit-Receive Unit 71;
Wherein, each hot standby group information includes, corresponding hot standby group of the corresponding IP address of at least one equipment and Port numbers.
Alternatively, each hot standby group information further includes:The client historical average mesh logged in this hot standby group.
Alternatively, the processing unit 70, is additionally operable to:
The each client for preserving itself synchronizing information to other hot standby group corresponding at least one equipment In after, itself preserved by what the Transmit-Receive Unit 71 received that other hot standby group corresponding at least one equipment each replys Client-side information;
The forwarding request that burrows of the 3rd client transmission, the forwarding request bag that burrows are received by the Transmit-Receive Unit 71 The IP address and port numbers of first client are included, the 3rd client is logged in the 3rd equipment, and the 3rd equipment is Any one in other hot standby group corresponding at least one equipment, first client is stepped in first equipment Record;
The request that burrows, institute are sent to first client by the Transmit-Receive Unit 71 according to the forwarding request that burrows Stating the request that burrows includes the IP address and port numbers of the 3rd client.
In conclusion compared in the prior art, client only sends heartbeat after host apparatus is logged in host apparatus Message, without sending heartbeat message to stand-by equipment, causes after host apparatus failure, and host apparatus failure is perceived in client Then before logging in stand-by equipment, stand-by equipment can not communicate with client.In embodiments of the present invention, two in hot standby group A equipment status is identical, and function is identical, there is client login, and the client logged on either device is both needed to two equipment Heartbeat message is sent, therefore, when some client determines host apparatus failure, stand-by equipment can be sent out to the client and connect Interrupt message, actively communicates with the client, improves the switching efficiency of master/slave device.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram The combination of flow and/or square frame in journey and/or square frame and flowchart and/or the block diagram.These computer programs can be provided The processors of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices, which produces, to be used in fact The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or The instruction performed on other programmable devices is provided and is used for realization in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a square frame or multiple square frames.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation Property concept, then can make these embodiments other change and modification.So appended claims be intended to be construed to include it is excellent Select embodiment and fall into all change and modification of the scope of the invention.
Obviously, those skilled in the art can carry out the embodiment of the present invention various modification and variations without departing from this hair The spirit and scope of bright embodiment.In this way, if these modifications and variations of the embodiment of the present invention belong to the claims in the present invention And its within the scope of equivalent technologies, then the present invention is also intended to comprising including these modification and variations.

Claims (22)

  1. A kind of 1. P2P dispatch servers hot spare method, it is characterised in that including:
    The parsing of first client plays the address of the first equipment and the address of the second equipment included in string, by first equipment As host apparatus, second equipment is as stand-by equipment;
    First client sends logging request to first equipment, and receives logining successfully for first device replied Message;
    First client sends heartbeat message to first equipment and second equipment.
  2. 2. the method as described in claim 1, it is characterised in that in first client to first equipment and described After two equipment send heartbeat message, further include:
    When first client receives disconnecting instruction message and does not receive the heartbeat response message of first equipment, Determine first device fails, send logging request to second equipment, and receive second device replied Login success message;
    Alternatively, first client receives disconnecting instruction message and receives the heartbeat response message of first equipment When, determine that first equipment does not break down, without sending logging request to second equipment;
    Wherein, the disconnecting instruction message is that second equipment is being determined with being sent during the first equipment disconnecting 's.
  3. A kind of 3. P2P dispatch servers hot spare method, it is characterised in that including:
    When first equipment determines the first equipment described in the first client Successful login, the information of first client is recorded, and The information of first client is sent to the second equipment;And receive the letter for the second client that second equipment is sent Breath, the information of preservation second client and the logging device for marking second client are second equipment;
    First equipment receives the heartbeat message that first client and second client are sent;
    Wherein, the information of second client is to be determined in second equipment described in the second client Successful login Sent after two equipment.
  4. 4. method as claimed in claim 3, it is characterised in that receive first client and described in first equipment After the heartbeat message that second client is sent, further include:
    After second client is logged off from second equipment, first equipment receives the second equipment hair The exit message for second client sent;
    When first equipment determines the information of local preservation second client, the information of second client is deleted Remove.
  5. 5. the method as described in claim 3 or 4, it is characterised in that in first equipment by the letter of first client Breath is sent to before the second equipment, is further included:
    After first equipment and second equipment establish connection, first equipment is by each client of local log-on Information is sent to second equipment, and receives each client logged in second equipment that second equipment is sent The information at end.
  6. 6. method as claimed in claim 5, it is characterised in that further include:
    The first equipment preservation is new during the information of each client of local log-on is sent to second equipment The client-side information of login and the client-side information exited;
    First equipment is after determining to be sent completely, by the client-side information of the new login of preservation and the visitor exited Family client information is sent to second equipment.
  7. 7. the method as described in claim 3-6 is any, it is characterised in that receive first client in first equipment After the heartbeat message sent with second client, further include:
    When first equipment is determined with the second equipment disconnecting, disconnecting instruction is sent to second client Message.
    First equipment receives the logging request that second client is sent;
    The logging device of second client is first equipment by second equipment change by first equipment, and Login success message is replied to second client.
  8. 8. the method for claim 7, it is characterised in that send and log in second client in first equipment After success message, further include:
    It is described by logging device when first equipment determines that the connection for exceeding preset duration and second equipment does not recover The information deletion of the client of second equipment;
    Alternatively, when first equipment determines with the connection of second equipment to recover in preset duration, described first is set The synchronizing information of all clients of standby middle preservation is to second equipment.
  9. 9. method as claimed in claim 3, it is characterised in that first equipment belongs to same hot standby with second equipment Group, the method further include:
    First equipment according to other hot standby group informations, by the synchronizing information of each client itself preserved to it is described other In hot standby group of corresponding at least one equipment;
    Wherein, each hot standby group information includes, corresponding hot standby group of the corresponding IP address of at least one equipment and port Number.
  10. 10. method as claimed in claim 9, it is characterised in that each hot standby group information further includes:Logged in this hot standby group Client historical average mesh.
  11. 11. the method as described in claim 9 or 10, it is characterised in that in each visitor that first equipment preserves itself After the synchronizing information at family end is into other hot standby group corresponding at least one equipment, further include:
    First equipment receives the client itself preserved that other hot standby group corresponding at least one equipment is each replied Client information;
    First equipment receives the forwarding request that burrows that the 3rd client is sent, and the forwarding request that burrows includes described first The IP address and port numbers of client, the 3rd client are logged in the 3rd equipment, and the 3rd equipment is other described heat Standby any one organized in corresponding at least one equipment;
    First equipment burrows according to forwards request to send the request that burrows, the request that burrows to first client Include the IP address and port numbers of the 3rd client.
  12. A kind of 12. hot standby device of P2P dispatch servers, it is characterised in that including:
    Resolution unit, for parsing the address of the first equipment and the address of the second equipment that play and included in string, by described first Equipment is as host apparatus, and second equipment is as stand-by equipment;
    Transmit-Receive Unit, for sending logging request to first equipment, and receives logining successfully for first device replied Message;
    And send heartbeat message to first equipment and second equipment.
  13. 13. device as claimed in claim 12, it is characterised in that described device, further includes:
    Accident analysis unit, is used for
    After heartbeat message is sent to first equipment and second equipment, connection is received by the Transmit-Receive Unit When interrupting instruction message and not receiving the heartbeat response message of first equipment, first device fails are determined, lead to Cross the Transmit-Receive Unit and send logging request to second equipment, and receive the logining successfully for the second device replied and disappear Breath;
    Alternatively, disappeared by the heartbeat response that the Transmit-Receive Unit receives disconnecting instruction message and receives first equipment During breath, determine that first equipment does not break down, without sending logging request to second equipment;
    Wherein, the disconnecting instruction message is that second equipment is being determined with being sent during the first equipment disconnecting 's.
  14. A kind of 14. hot standby device of P2P dispatch servers, it is characterised in that including:
    Processing unit, during for determining the first equipment described in the first client Successful login, records the letter of first client Breath, and the information of first client is sent to the second equipment by Transmit-Receive Unit;And connect by the Transmit-Receive Unit The information for the second client that second equipment is sent is received, the information of second client is preserved and marks second visitor The logging device at family end is second equipment;
    The Transmit-Receive Unit, is additionally operable to receive the heartbeat message that first client and second client are sent;
    Wherein, the information of second client is to be determined in second equipment described in the second client Successful login Sent after two equipment.
  15. 15. device as claimed in claim 14, it is characterised in that the processing unit, is additionally operable to:
    After the heartbeat message that first client and second client are sent is received, when second client is from institute State after logging off in the second equipment, second client is directed to by what Transmit-Receive Unit reception second equipment was sent The exit message at end;
    When determining the information of local preservation second client, by the information deletion of second client.
  16. 16. the device as described in claims 14 or 15, it is characterised in that the processing unit, is additionally operable to:
    Sent by the information of first client to before the second equipment, after establishing connection with second equipment, incite somebody to action this The information for each client that ground logs in is sent to second equipment by the Transmit-Receive Unit, and receives second equipment The information of each client logged in second equipment sent.
  17. 17. device as claimed in claim 16, it is characterised in that the processing unit, is additionally operable to:
    Preserve the client of new login during the information of each client of local log-on is sent to second equipment Information and the client-side information exited;
    After determining to be sent completely, the client-side information of the new login of preservation and the client-side information exited are passed through The Transmit-Receive Unit is sent to second equipment.
  18. 18. the device as described in claim 14-17 is any, it is characterised in that the processing unit, is additionally operable to:
    After the heartbeat message that first client and second client are sent is received, determine and second equipment During disconnecting, disconnecting instruction message is sent to second client by the Transmit-Receive Unit.
    The logging request of the second client transmission is received by the Transmit-Receive Unit;
    By second equipment change it is first equipment by the logging device of second client, and to the described second visitor Family end login success message is replied by the Transmit-Receive Unit.
  19. 19. device as claimed in claim 18, it is characterised in that the processing unit, is additionally operable to:
    After login success message is sent to second client, the connection with second equipment more than preset duration is determined When not recovering, the information deletion by logging device for the client of second equipment;
    Alternatively, when determining with the connection of second equipment to recover in preset duration, the institute that will be preserved in first equipment The information for having client is synchronized to second equipment by the Transmit-Receive Unit.
  20. 20. device as claimed in claim 14, it is characterised in that the processing unit, is additionally operable to:
    Described device belongs to same hot standby group with second equipment, according to other hot standby group informations, itself is preserved each The information of client is synchronized in other hot standby group corresponding at least one equipment by the Transmit-Receive Unit;
    Wherein, each hot standby group information includes, corresponding hot standby group of the corresponding IP address of at least one equipment and port Number.
  21. 21. device as claimed in claim 20, it is characterised in that each hot standby group information further includes:Logged in this hot standby group Client historical average mesh.
  22. 22. the device as described in claim 20 or 21, it is characterised in that the processing unit, is additionally operable to:
    The each client for preserving itself synchronizing information into other hot standby group corresponding at least one equipment after, The client for itself preservation that other hot standby group corresponding at least one equipment is each replied is received by the Transmit-Receive Unit Client information;
    The forwarding request that burrows of the 3rd client transmission is received by the Transmit-Receive Unit, the forwarding request that burrows is including described The IP address and port numbers of first client, the 3rd client are logged in the 3rd equipment, the 3rd equipment for it is described its Any one in his hot standby group of corresponding at least one equipment;
    The request that burrows is sent to first client by the Transmit-Receive Unit according to the forwarding request that burrows, it is described to burrow Request includes the IP address and port numbers of the 3rd client.
CN201610972267.6A 2016-10-31 2016-10-31 A kind of P2P dispatch servers hot spare method and device Pending CN108023755A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610972267.6A CN108023755A (en) 2016-10-31 2016-10-31 A kind of P2P dispatch servers hot spare method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610972267.6A CN108023755A (en) 2016-10-31 2016-10-31 A kind of P2P dispatch servers hot spare method and device

Publications (1)

Publication Number Publication Date
CN108023755A true CN108023755A (en) 2018-05-11

Family

ID=62084495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610972267.6A Pending CN108023755A (en) 2016-10-31 2016-10-31 A kind of P2P dispatch servers hot spare method and device

Country Status (1)

Country Link
CN (1) CN108023755A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117311A (en) * 2018-08-22 2019-01-01 郑州云海信息技术有限公司 A kind of fault recovery method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080005290A1 (en) * 2006-05-19 2008-01-03 Nokia Corporation Terminal reachability
CN102082733A (en) * 2011-02-25 2011-06-01 杭州华三通信技术有限公司 Portal system and access method thereof
CN102142981A (en) * 2010-11-01 2011-08-03 华为技术有限公司 Method and system for processing terminal disconnection and broadband remote access server
CN102263663A (en) * 2011-08-09 2011-11-30 北京佳讯飞鸿电气股份有限公司 Double-network management server data maintenance method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080005290A1 (en) * 2006-05-19 2008-01-03 Nokia Corporation Terminal reachability
CN102142981A (en) * 2010-11-01 2011-08-03 华为技术有限公司 Method and system for processing terminal disconnection and broadband remote access server
CN102082733A (en) * 2011-02-25 2011-06-01 杭州华三通信技术有限公司 Portal system and access method thereof
CN102263663A (en) * 2011-08-09 2011-11-30 北京佳讯飞鸿电气股份有限公司 Double-network management server data maintenance method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117311A (en) * 2018-08-22 2019-01-01 郑州云海信息技术有限公司 A kind of fault recovery method and device

Similar Documents

Publication Publication Date Title
CN103812823B (en) Configuration information is migrated during live migration of virtual machine method, equipment and system
CN106911728B (en) The choosing method and device of host node in distributed system
US7363449B2 (en) Software agent-based architecture for data relocation
CN103916311B (en) A kind of information transmission and control method, Apparatus and system
CN104509033B (en) Shared keep-alive and fault detection mechanism in distributed network
CN104144098B (en) Information push method, system and push server equipment
JP2008544684A (en) User log information management method and system using location servers belonging to a plurality of groups
CN105763440B (en) A kind of method and apparatus of message forwarding
CN105991412B (en) Information push method and device
CN104092746B (en) A kind of O&M auditing system and the network load balancing method in its system
CN103516587B (en) Instant communication client terminal disconnection reconnection method and device
CN103795762A (en) Reverse agent test system and method
CN106713497A (en) Server-side message push device and method and message push system
JP2018506237A (en) Management of traffic control in the network to reduce DDOS
CN103716230B (en) Message sending method, device and server
CN106059936B (en) The method and device of cloud system Multicast File
Imtiaz et al. Churn in the bitcoin network
CN106341249A (en) Redundant port switching method and device
US20150006622A1 (en) Web contents transmission method and apparatus
CN105893429A (en) Method and system for optimizing WEB cache
CN103428070B (en) instant group communication method, session management server and client
US10680930B2 (en) Method and apparatus for communication in virtual network
CN104243473B (en) A kind of method and device of data transmission
CN100446567C (en) Apparatus and method for realizing P2P stream broadcasting in information family appliances
CN108023755A (en) A kind of P2P dispatch servers hot spare method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for 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: 20180511