CN106453588A - Connection release method, device and system - Google Patents
Connection release method, device and system Download PDFInfo
- Publication number
- CN106453588A CN106453588A CN201610939111.8A CN201610939111A CN106453588A CN 106453588 A CN106453588 A CN 106453588A CN 201610939111 A CN201610939111 A CN 201610939111A CN 106453588 A CN106453588 A CN 106453588A
- Authority
- CN
- China
- Prior art keywords
- ruling
- weights
- calculate node
- connection
- node
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
- H04L67/1046—Joining mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
- H04L67/1048—Departure or maintenance mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a connection release method, device and system, relating to the technical field of internet, the main goal is to solve the problem of a complex, prone to mistakes and low efficiency arbitrage process resulted from relying on the disconnection of one connection in an open connection by a third party arbitrager when disconnecting the open connection of two computing nodes in the prior art. The technical scheme comprises of when two computing nodes having an open connection in the middle, a first computing node receiving a second adjudication weight sent from a second computing node; conducting comparisons of the second adjudication weight and a personally first adjudication weight, the first adjudication weight and the second adjudication weight being respectively values generated from a first computing node and the second computing node; if the second adjudication weight being different from the first adjudication weight, then disconnecting one connection of the open connection.
Description
Technical field
Internet technical field of the present invention, more particularly to a kind of method of release connection, apparatus and system.
Background technology
Fast development with Internet technology and widely available, the mode being communicatively coupled in internet is also more next
More, for example, peer-to-peer network (Peer to Peer, P2P) connects.Each computer that so-called P2P is connected as in internet is gathered around
Have identical function, by between two nodes that P2P connected mode connects can by data interaction by way of realize calculate
Machine resource, storage and information service shared.
At present, in P2P network environment, between computer node and computer node by spontaneous set up path by way of build
Vertical communication connection, the communication connection of foundation has randomness.When two calculating not setting up correspondence in P2P network environment
Between machine node, when simultaneously to other side's transmission connection request, it is possible that set up letter for other side between computer node simultaneously
, there are two bi-directional paths between two identical computer nodes, referred to as " split connection ", and in practical application in the problem in road
In, the communication between different computer nodes only needs a channel.When computer node initiates actively to connect, all can account for
With a port and corresponding filec descriptor, and between two same computer nodes, set up the connection of repetition, can take not
Necessary port resource, additionally, when being communication path between by two computer nodes of the technical maintenances such as heartbeat inspecting, cause
The waste of a large amount of system resources.
In order to solve the above problems, in prior art, provide following technical scheme one, including:Setting up split connection
When being communicated between two computer nodes, the preferential communication being created own as connection initiator using computer node
Path, automatically disconnects split connection using connecting life cycle, if that is, computer node is as connecting initiator in the scheduled time
Any communication data (computer node connecting initiator is in idle condition within a predetermined period of time) is not sent, then in section
Close this communication path, can solve to a certain extent the port that split connection causes take and system resource a large amount of waves
Situation about taking.Although the computer node connecting initiator can monitor its whether idle condition, only initiate when connecting
When in predetermined amount of time under exceeding idle condition for the computer node of side not to other side's transmission communication data, it is right just to close
Open connection, if the time interval that the computer node connecting initiator sends communication data to other side is less than is in idle condition
Predetermined time interval, then can persistently keep split connection between above computer node.
Although it is right between computer node that the technical scheme one providing in above-mentioned prior art can solve to a certain extent
Open the problem of a large amount of wastes connecting the port occupancy causing and system resource, but, this kind of mode depends on the meter of initiator
The idle condition of calculation machine node.In order to solve the determination of technical scheme one presence, in prior art, provide following technical scheme two,
Including:When two computer nodes set up communication, request third party's arbitration, that is, in P2P network environment, determine a calculating
As arbitration node, when there is split connection when between two computer nodes, request third party arbitrates machine node, arbitrated procedure bag
Include:Computer node A and computer node B, after determination has split connection, sends request arbitration to third party's arbitration respectively
Information, determines, by third party's arbitration, wherein one communication path disconnecting between computer node A and computer node B, to solve
Unnecessary port resource is taken during split connection, and a large amount of problem wasting of system resource, but, in this kind of implementation,
The process of arbitration depends on third party's node, and in arbitrated procedure, computer node A and computer node B must be saved with third party
Point is set up and is individually connected, if computer node A or computer node B and the communication existing problems of third party's node, arbitrates
Process interrupt, may affect the communication between computer node A and computer node B then;Therefore, by asking third party secondary
The mode arbitrated procedure cut out is complicated, error-prone, and efficiency is low.
Content of the invention
In view of this, a kind of method of release connection of present invention offer, apparatus and system, main purpose is to solve now
Have in technology disconnect two calculate nodes between split connection when, need to depend on third party arbitration disconnect split connect in
Article one, connect, but, arbitrated procedure is complicated, error-prone, and the low problem of efficiency.
In a first aspect, the invention provides a kind of discharge the method connecting, including:
When there is split connection between two calculate nodes, the first calculate node receives that the second calculate node sends
Two ruling weights;
Described second ruling weights are compared with the first ruling weights of itself, described first ruling weights with described
Second ruling weights are respectively described first calculate node and the random numerical value generating of described second calculate node;
If described second ruling weights are different from described first ruling weights, disconnect a connection in split connection.
Optionally, the connection disconnecting in split connection includes:
If described first ruling weights are more than described second ruling weights, retain described first calculate node to described the
The connection that two calculate nodes are initiated, and disconnect the connection that described second calculate node is initiated to the first calculate node;
If it is determined that described first ruling weights are less than described second ruling weights, then retain described second calculate node to institute
State the connection that the first calculate node is initiated, and disconnect the connection that described first calculate node is initiated to described second calculate node.
Optionally, methods described also includes:
If it is determined that described second ruling weights are equal to described first ruling weights, then receive described second calculate node and send
The 4th ruling weights, and described 4th ruling weights and the 3rd ruling value of itself are compared, until determining the second meter
Till the ruling weights that operator node sends and the ruling weights of itself differ.
Optionally, before the first calculate node receives the second ruling weights that the second calculate node sends, methods described
Also include:
Obtain actively connects list, described actively connect the first calculate node described in list as connection initiator, use
Set up in connection request in recording described first calculate node to the second calculate node transmission, the information of the second calculate node;
Obtain by the list that is dynamically connected, described the first calculate node described in list that is dynamically connected, as connected party, is used for
The described second calculate node transmission of record reception is described to set up in connection request, the information of the second calculate node;
Respectively from described actively connect list and described by the list that is dynamically connected obtain the information of the second calculate node;
If it is determined that from described actively connect list and described by the list that is dynamically connected obtain the information one of the second calculate node
Cause it is determined that there is split connection between described first calculate node and described second calculate node.
Optionally, disconnect a connection in split connection, including:
Receive open operation command, described open operation command is used for instruction and disconnects split company by described first calculate node
A connection in connecing;
Or, send to described second calculate node and disconnect notification message, the described notification message that disconnects is used for
Indicate and a connection in split connection is disconnected by described second calculate node execution.
Optionally, by described second ruling weights and the first ruling weights of itself compare including:
Respectively described first ruling weights and described second ruling weights are parsed;
Obtain the corresponding first current ruling ID of described first ruling weights, and it is corresponding to obtain described second ruling weights
Second current ruling ID;Wherein, ruling ID is used for identifying the comparison number of times of current ruling weights;
Current with described second for described first current ruling ID ruling ID is compared;
If it is determined that described first current ruling ID ruling ID current with described second is identical, then by described first ruling weights
Compare with described second ruling weights;
If it is determined that described first current ruling ID ruling ID current with described second differs, then obtain currently maximum respectively
Ruling ID corresponding ruling weights, and compare the ruling weights after acquisition.
Second aspect, the invention provides a kind of discharge the device connecting, this device includes:
First receiving unit, during for there is split connection between two calculate nodes, the first calculate node receives the
The second ruling weights that two calculate nodes send;
Comparing unit, for the described second ruling weights and the first umpirage of itself that receive described receiving unit
Value is compared, and described first ruling weights are respectively described first calculate node and described second with described second ruling weights
The random numerical value generating of calculate node;
Switching units, for when described comparing unit compare described second ruling weights different from described first ruling weights
When, disconnect a connection in split connection.
Optionally, described switching units include:
First processing module, for when described first ruling weights are more than described second ruling weights, retaining described the
The connection that one calculate node is initiated to described second calculate node, and disconnect described second calculate node and send out to the first calculate node
The connection rising;
Second processing module, for when determining that described first ruling weights are less than described second ruling weights, retaining institute
State the connection that the second calculate node is initiated to described first calculate node, and disconnect described first calculate node to the described second meter
The connection that operator node is initiated.
Optionally, described device also includes:
When described comparing unit, second receiving unit, for determining that described second ruling weights are equal to described first umpirage
During value, receive the 4th ruling weights that described second calculate node sends;
Processing unit, for the described 4th ruling weights and the 3rd sanction of itself that receive described second receiving unit
Certainly value is compared, till determining that the ruling weights that the second calculate node sends are differed with the ruling weights of itself.
Optionally, described device also includes:
First acquisition unit, for receiving, in described first receiving unit, the second ruling weights that the second calculate node sends
Before, obtain actively connect list, described actively connect the first calculate node described in list as connection initiator, for remembering
Record described first calculate node and set up in connection request to the second calculate node transmission, the information of the second calculate node;
Second acquisition unit, for obtaining by the list that is dynamically connected, described the first calculate node described in list that is dynamically connected
As connected party, set up in connection request for the described second calculate node transmission of record reception is described, the second calculate node
Information;
3rd acquiring unit, for described actively connecting list and described the from what described first acquisition unit obtained respectively
The described information being obtained the second calculate node in the list that is dynamically connected that two acquiring units obtain;
Determining unit, for actively connecting acquisition second calculating list and the described list that is dynamically connected when determination from described
When the information of node is consistent, determine there is split connection between described first calculate node and described second calculate node.
Optionally, described switching units also include:
Receiver module, for receiving open operation command, described open operation command is used for instruction and is calculated by described first
Node disconnects a split connection in connecting;
Sending module, disconnects notification message for sending to described second calculate node, described disconnects notice
Message is used for instruction and disconnects a connection in split connection by described second calculate node execution.
Optionally, described comparing unit includes:
Parsing module, for parsing to described first ruling weights and described second ruling weights respectively;
Acquisition module, for entering to described first ruling weights and described second ruling weights respectively in described parsing module
In row resolving, obtain the corresponding first current ruling ID of described first ruling weights, and obtain described second ruling weights
Corresponding second current ruling ID;Wherein, ruling ID is used for identifying the comparison number of times of current ruling weights;
First comparing module, current ruling ID is current with described second for described first for obtaining described acquisition module
Ruling ID compares;
When described first comparing module, second comparing module, for determining that the described first current ruling ID works as with described second
When front ruling ID is identical, described first ruling weights are compared with described second ruling weights;
When described first comparing module, processing module, for determining that the described first current ruling ID currently cuts out with described second
When certainly ID differs, obtain currently maximum ruling ID corresponding ruling weights respectively, and compare the ruling weights after acquisition.
The third aspect, the present invention provides the system that a kind of release connects, including:First calculate node and second calculates section
Point;Wherein,
Described second calculate node, for existing to being connected when described first calculate node and described second calculate node
When, send the second ruling weights to described first calculate node;
Described first calculate node, for receiving the described second ruling weights that described second calculate node sends, and will
Described second ruling weights are compared with the first ruling weights of itself, when described second ruling weights and described first ruling
When weights are different, disconnect a connection in split connection;Wherein, described first ruling weights and described second ruling weights divide
Wei not described first calculate node and the random numerical value generating of described second calculate node.
Optionally, described system also includes:
Described first calculate node, is additionally operable to receive and executes open operation command, and described open operation command is used for breaking
Open a connection in split connection;
Described first calculate node, is additionally operable to disconnect notification message to described second calculate node transmission, described disconnected
Open and connect the connection that notification message is used for during instruction is connected by described second calculate node execution disconnection is split;
Described second calculate node, be additionally operable to receive described first calculate node send described in disconnect notice and disappear
Breath, and execute a connection disconnecting in split connection.
By technique scheme, what the present invention provided discharges the method connecting, apparatus and system, when two calculating of determination
When there is split connection between node, the first calculate node receives the second ruling weights that the second calculate node sends, by second
Ruling weights are compared from the first ruling weights of itself however, it is determined that the second ruling weights are different with the first ruling weights, then
Disconnect a connection in split connection, compared with prior art, the present invention has split connection in two calculate nodes of determination
In the case of, can voluntarily consult between this two calculate nodes, disconnect any bar in split connection and connect, realize two meters
Communicated by a connection between operator node, the process that this is voluntarily consulted is simple, efficient and easy to be realized such that it is able to reduce
The split consumption connecting to system resource and Internet resources.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of specification, and in order to allow the above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by the specific embodiment of the present invention.
Brief description
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are common for this area
Technical staff will be clear from understanding.Accompanying drawing is only used for illustrating the purpose of preferred embodiment, and is not considered as to the present invention
Restriction.And in whole accompanying drawing, it is denoted by the same reference numerals identical part.In the accompanying drawings:
The flow chart that Fig. 1 shows the method that a kind of release provided in an embodiment of the present invention connects;
Fig. 2 shows the schematic diagram of the split connection between a kind of two calculate nodes provided in an embodiment of the present invention;
Fig. 3 shows the schematic diagram executing ruling process between a kind of calculate node provided in an embodiment of the present invention;
Fig. 4 shows a kind of schematic diagram disconnecting a connection in split connection provided in an embodiment of the present invention;
Fig. 5 shows the composition frame chart of the device that a kind of release of the embodiment of the present invention connects;
Fig. 6 shows the composition frame chart of the device that another kind of release of the embodiment of the present invention connects;
Fig. 7 shows the composition frame chart of the system that a kind of release of the embodiment of the present invention connects.
Specific embodiment
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment it being understood, however, that may be realized in various forms the disclosure and should not be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to be able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
The embodiment of the present invention provides a kind of method that release connects, as shown in figure 1, methods described includes:
When the 101st, there is split connection between two calculate nodes, the first calculate node receives the second calculate node and sends
The second ruling weights.
The embodiment of the present invention is applied in peer-to-peer network (Peer to Peer, P2P) environment, there are multiple calculate nodes,
Those calculate nodes concrete identical function, dereliction takes second place point, and that is, all calculate nodes in P2P network environment are all in equity
Status, can directly Sharing computer resource and service between any two calculate node.
In P2P network environment, the calculate node communication set up communication path, and node between spontaneous with calculate node
There is randomness, below with any two calculate node in P2P network environment:First calculate node with the second calculate node is
Example illustrates.First calculate node, as connecting initiator, sends to the second calculate node and sets up connection request, set up first
Path between calculate node and the second calculate node;Now, the second calculate node, as connecting initiator, calculates section to first
Point sends sets up the request connecting, and sets up the path between the second calculate node and the first calculate node.Now, first calculate section
There are two communication paths after point and the second calculate node, exist split between the first calculate node and the second calculate node
Connect, and in actual applications, communication between two nodes, only need a communication path, if two identicals calculating
There are two communication paths between node, then can cause the waste of system resource.
Can be drawn by above-mentioned, the condition that two calculate nodes have split connection is:Between two calculate nodes never
Communication, and two calculate nodes send, to other side, the request setting up network service connection simultaneously, and this kind of connected mode occurs
Two calculate nodes set up communication channel to other side simultaneously, there is split connection between two calculate nodes.
It should be noted that the first calculate node here with the second calculation stages merely to convenience in description, its
Do not imply that in a P2P network environment only have two nodes, but can the multiple calculate node of the person of inclusion, and each calculate section
Point is respectively provided with identical function.
In the prior art it is assumed that in peer-to-peer network (Peer to Peer, a P2P) environment, comprising N=30 meter
Operator node, in theory, sets up N (N-1)/2=435 connection and can achieve institute in P2P network environment between two calculate nodes
Have the communication between node, but, in actual applications, the worst in the case of may produce N (N-1)=870 connection, real
The connection number that border is set up has more one times than the connection number set up in theory, establishes no between calculate node and calculate node
Connection, causes the occupancy of calculate node upper port, additionally, wasting substantial amounts of system resource and Internet resources by fearless.
In order to solve the above problems, in the embodiment of the present invention, when there is split connection between two calculate nodes of determination,
First calculate node receives the second ruling weights that the second calculate node sends, and the second calculate node receives the first calculate node and sends out
The the first ruling weights sending, wherein, ruling weights are the random numerical value generating of calculate node, and this numerical value has a numerical value model
Enclose, for example, number range is 0-65535 etc., and specifically, when setting the number range of ruling weights, number range is bigger,
The disposable successful probability of ruling is bigger, number range setting less, the successful probability of disposable ruling is less, specific this
Inventive embodiments are not construed as limiting to the number range of ruling weights.
As another kind of implementation of the embodiment of the present invention, set up split in the first calculate node and the second calculate node
After network, when the first calculate node and the second calculate node send ruling weights first, can directly be accounted for using connection initiator
Local port number, this local port number be set up transmission control protocol (Transmission Control Protocol,
When TCP) connecting, connect initiator and can take local a port at random, using this local port number as ruling weights, Neng Goujia
Fast ruling speed.This kind of explanation mode is not intended to limit the local port number that ruling weights are only capable of taking for connection initiator.
In actual applications, after the first calculate node and the second calculate node set up split connection, both of which will be to other side
Send the ruling weights of its own, so that both ruling weights are compared, that is, the first calculate node receives the second calculating
The second ruling weights that node sends, the second calculate node receives the first ruling weights that the first calculate node sends.Hereinafter, will
Taking the first calculate node as a example the process of ruling is illustrated.
102nd, described second ruling weights and the first ruling weights of itself are compared by the first calculate node.
Described first ruling weights and described second ruling weights are respectively described first calculate node and described second meter
The random numerical value generating of operator node.
Because ruling weights are substantially a numerical value, its have size point, in the first calculate node by the first umpirage
When value and the second ruling weights are compared, compare the numerical values recited of the first ruling weights and the second ruling weights.Example
Property it is assumed that the first ruling weights be 36, the second ruling weights be 50, then the first calculate node determine the first ruling weights with
Second ruling weights are different, and the first ruling weights are less than the second ruling weights, these are only exemplary citing, and the present invention is real
Apply example the specific size of ruling weights is not construed as limiting.
If 103 described second ruling weights are different from described first ruling weights, the first calculate node disconnects split company
A connection in connecing.
When the second ruling weights are different from the first ruling weights, including:Second ruling weights be more than the first ruling weights,
Second ruling weights are less than two kinds of situations of the first ruling weights, when the arbitrary comparison result in above-mentioned two situations determines, first
Calculate node actively disconnects split wherein one connection in connecting, or, the first calculate node sends to the second calculate node
Configured information, is disconnected wherein one connection in split connection by the second calculate node.
, between two calculate nodes of determination, there is split connection in the method that release provided in an embodiment of the present invention connects
When, the first calculate node receives the second ruling weights that the second calculate node sends, by the second ruling weights and itself first
Ruling weights are compared however, it is determined that the second ruling weights are different from the first ruling weights, then disconnect in split connection
Connect, compared with prior art, in the case of there is split connection in two calculate nodes of determination in the embodiment of the present invention, Ke Yi
Voluntarily consult between this two calculate nodes, disconnect any bar in split connection and connect, realize passing through between two calculate nodes
Article one, connection is communicated, and the process that this is voluntarily consulted is simple, efficient and easy to be realized such that it is able to reduce split connection to system
Resource and the consumption of Internet resources.
Further, as to the refinement of above-described embodiment and extension, disconnect in split connection in step 103 execution
Bar connects, and comprises between two calculate nodes two connections due in split connection, below, will be explained in how determining disconnected
Which bar opened in split connection connects.
The first situation:When described first ruling weights are more than described second ruling weights, disconnect described second calculating
The connection that node is initiated to the first calculate node.
Fig. 2 shows the schematic diagram of the split connection between a kind of two calculate nodes provided in an embodiment of the present invention, such as Fig. 2
Shown, the first calculate node is as connection initiator, when the second calculate node is as connected party, the first calculate node and second
The connection of calculate node is to connect I, and when the second calculate node is as connecting initiator, the first calculate node is as connected party
When, the first calculate node is to connect II with the connection of the second calculate node.
Described second ruling weights are compared with the first ruling weights of itself, when described first ruling weights are more than
During described second ruling weights, retain the connection I that described first calculate node is initiated to described second calculate node, and disconnect institute
State the connection II that the second calculate node is initiated to the first calculate node;I.e. the first calculate node corresponding ruling weights and the second meter
When operator node corresponding ruling weights have of different sizes, the calculate node retaining the relatively large side of ruling weights is actively sent out
The connection rising.
In actual applications however, it is determined that when the first ruling weights are more than described second ruling weights, retaining described second meter
The connection II that operator node is initiated to the first calculate node, disconnects what described first calculate node was initiated to described second calculate node
Connect I, specifically, the embodiment of the present invention is not construed as limiting to this.
Second situation:When determining that described first ruling weights are less than described second ruling weights, disconnect described first
The connection that calculate node is initiated to described second calculate node.
Please continue to refer to Fig. 2, described second ruling weights and the first ruling weights of itself are compared if it is determined that institute
State the first ruling weights and be less than described second ruling weights, then retain described second calculate node and send out to described first calculate node
The connection II rising, and disconnect the connection I that described first calculate node is initiated to described second calculate node.
Further, above it is stated that described first ruling weights less or greater than described second ruling weights feelings
Condition however, it is determined that described first ruling weights are equal to described second ruling weights, then receives the 4th sanction that the second calculate node sends
Certainly weights, and the 4th ruling weights are compared with the 3rd ruling weights of itself, until determining the second calculate node transmission
Ruling weights and the ruling weights of itself differ till.
Further, in the first calculate node, described second ruling weights are compared with the first ruling weights of itself
When, can adopt but be not limited in the following manner and realize, respectively described first ruling weights and described second ruling weights be entered
Row parsing, obtains the corresponding first current ruling ID of described first ruling weights, and it is corresponding to obtain described second ruling weights
Second current ruling ID;Wherein, ruling ID is used for identifying the comparison number of times of current ruling weights;By the described first current ruling ID
Ruling ID current with described second compares;If it is determined that described first current ruling ID and the described second current ruling ID phase
Same, then described first ruling weights are compared with described second ruling weights;If it is determined that described first current ruling ID with described
Second current ruling ID differs, then obtain currently maximum ruling ID corresponding ruling weights respectively, and compare the sanction after acquisition
Certainly weights.
Exemplary, Fig. 3 shows and executes showing of ruling process between a kind of calculate node provided in an embodiment of the present invention
It is intended to, as shown in figure 3, the solid line flow process shown in Fig. 3 is the flow process of the first calculate node execution, dotted portion is the second meter
The flow process of operator node execution, in P2P network environment, the first calculate node and the second calculate node are double during carrying out ruling
Side executes simultaneously, and the step of its both sides execution is consistent.For the convenience on describing, the embodiment of the present invention with the first calculate node is
Example illustrates.When the first calculate node is with the second calculate node execution first round ruling, the first calculate node generates first
Current ruling ID:1, and generate the first ruling weights:50, the first calculate node receives the second ruling that the second calculate node sends
Weights, comprise the second current ruling ID in this second ruling weights, execute the first ruling weights and second in the first calculate node
During the comparison of ruling weights, first, current with second for the first current ruling ID ruling ID is compared, it is intended that really
Whether the number of times comparing between fixed two nodes is identical, when determination the first current ruling ID (1) ruling ID (1) current with second phase
Meanwhile, then continue to compare the first ruling weights and described second ruling weights, determine the first ruling weights and described second ruling
Weights are identical, then continue executing with the second wheel ruling;And if only if determines that the first ruling weights are different from described second ruling weights
When, ruling process could be terminated.Second wheel ruling process is identical with first round ruling process, and embodiment of the present invention here is no longer entered
Row repeats one by one.
As shown in figure 4, Fig. 4 shows showing of a connection in a kind of split connection of disconnection provided in an embodiment of the present invention
It is intended to, holds as shown in Figure 3, the first calculate node determines that the 3rd ruling weights are more than the 4th ruling weights, that is, close the second calculating
Node is to the path of the first calculate node.
In actual applications, during network service, may there is the situation of network delay in two nodes, may
Lead to the inconsistent situation of the ruling ID of ruling ID and the second calculate node transmission that the first calculate node generates.It is assumed that calculating
Node generate ruling ID when, be ranked up according to my bar Digital size, the first calculate node execution ruling during, if
The ruling ID that first calculate node obtains is 2, and the ruling ID that the second calculate node receiving sends is 3, i.e. the first calculating
The ruling ID that node generates is inconsistent with the ruling ID that the second calculate node sends, and now, the first calculate node should obtain ruling
ID is 3 corresponding ruling weights, the ruling being sent with the ruling weights and the second calculate node guaranteeing the first calculate node comparison
Weights are the comparison of theory of homogeneity it is ensured that the accuracy of ruling process.
Further, the embodiment of the present invention is used for, when two calculate nodes have split connection, calculating section by two
Negotiation between point, determines wherein disconnecting in split connection, therefore, before execution ruling, first, need to determine two meters
Whether there is split connection, specific implementation process can adopt but be not limited in the following manner and realize between operator node, including:Obtain
Take and actively connect list, described actively connect the first calculate node described in list as connecting initiator, described for recording
First calculate node sends to the second calculate node to be set up in connection request, the information of the second calculate node;Obtain and be dynamically connected
List, described the first calculate node described in list that is dynamically connected, as connected party, receives described second calculating for record
Node transmission is described to set up in connection request, the information of the second calculate node;Actively connect list and described quilt from described respectively
It is dynamically connected and obtain the information of the second calculate node in list;If it is determined that from described actively connect list and described by the list that is dynamically connected
The middle information obtaining the second calculate node is unanimously it is determined that exist between described first calculate node and described second calculate node
Split connection.In actual applications, the information of described second calculate node includes but is not limited to MAC Address (Media
Access Control), Internet protocol address (Internet Protocol Address, IP), central processing unit
(Central Processing Unit, CPU) coding etc., specifically, the embodiment of the present invention is to list and the master of being dynamically connected
The information of the second calculate node of record in list that is dynamically connected is not especially limited.
Further, the first calculate node, with the second calculate node when being communicated, is transmitted counting by Transmission Control Protocol
According to, this host-host protocol have two-way can transporting, therefore, when two calculate nodes set up communication, rely on a communication connection
The data communication between different calculate nodes can be completed.If there is split connection between two calculate nodes, need to disconnect split
A connection in connection.In the specific implementation, can be disconnected by the first calculate node active, that is, the first calculate node receives
Open operation command, this open operation command is used for instruction and disconnects any one connection in split connection;Or it is also possible to by
Second calculate node disconnects, and that is, the first calculate node sends to the second calculate node and disconnects notification message, this disconnection
Connect notification message to be used for indicating that the second calculate node execution disconnects a connection in split connection.Relevant disconnection TCP connects
Implement process, refer in prior art related detailed description, embodiment of the present invention here is no longer repeated.
Further, as the realization to method shown in above-mentioned Fig. 1, another embodiment of the present invention additionally provides a kind of release
The device connecting.This device embodiment is corresponding with preceding method embodiment, and for ease of reading, this device embodiment is no longer to aforementioned
Detail content in embodiment of the method is repeated one by one, it should be understood that before the device in the present embodiment can correspond to realization
State the full content in embodiment of the method.
Further, the device that a kind of release of the embodiment of the present invention connects, as shown in figure 5, this device includes:
First receiving unit 51, during for there is split connection between two calculate nodes, the first calculate node receives
The second ruling weights that second calculate node sends;
Comparing unit 52, for the described second ruling weights and the first sanction of itself that receive described receiving unit 51
Certainly weights are compared, described first ruling weights and described second ruling weights respectively described first calculate node and described
The random numerical value generating of second calculate node;
Switching units 53, for comparing described second ruling weights and described first ruling weights when described comparing unit 52
When different, disconnect a connection in split connection.
Further, as shown in fig. 6, described switching units 53 include:
First processing module 531, for when described first ruling weights are more than described second ruling weights, retaining described
The connection that first calculate node is initiated to described second calculate node, and disconnect described second calculate node to the first calculate node
The connection initiated;
Second processing module 532, for when determining that described first ruling weights are less than described second ruling weights, retaining
The connection that described second calculate node is initiated to described first calculate node, and disconnect described first calculate node to described second
The connection that calculate node is initiated.
Further, as shown in fig. 6, described device also includes:
When described comparing unit 52, second receiving unit 54, for determining that described second ruling weights are equal to described first sanction
Certainly during weights, receive the 4th ruling weights that described second calculate node sends;
Processing unit 55, for the described 4th ruling weights that receive described second receiving unit 54 and itself the
Three ruling values are compared, until determine ruling weights and the ruling weights of itself that the second calculate node sends differ for
Only.
Further, as shown in fig. 6, described device also includes:
First acquisition unit 56, for receiving, in described first receiving unit 51, the second ruling that the second calculate node sends
Before weights, obtain actively connects list, described actively connect the first calculate node described in list as connection initiator, use
Set up in connection request in recording described first calculate node to the second calculate node transmission, the information of the second calculate node;
Second acquisition unit 57, for obtaining by the list that is dynamically connected, described the first calculating section described in list that is dynamically connected
Point, as connected party, is set up in connection request for the described second calculate node transmission of record reception is described, second calculates section
The information of point;
3rd acquiring unit 58, for actively connecting list and institute from the described of described first acquisition unit 56 acquisition respectively
State the described information being obtained the second calculate node in the list that is dynamically connected of second acquisition unit 57 acquisition;
Determining unit 59, by when determine from described actively connects list and the described list that is dynamically connected acquisition second based on
When the information of operator node is consistent, determine there is split connection between described first calculate node and described second calculate node.
Further, as shown in fig. 6, described switching units 53 also include:
Receiver module 533, for receiving open operation command, described open operation command is by indicating based on by described first
Operator node disconnects a split connection in connecting;
Sending module 534, for described second calculate node send disconnect notification message, described disconnect logical
Know that message is used for indicating and a connection in split connection is disconnected by described second calculate node execution.
Further, as shown in fig. 6, described comparing unit 52 includes:
Parsing module 521, for parsing to described first ruling weights and described second ruling weights respectively;
Acquisition module 522, in described parsing module 521 respectively to described first ruling weights and described second ruling
Weights are carried out in resolving, obtain the corresponding first current ruling ID of described first ruling weights, and obtain described second sanction
The certainly corresponding second current ruling ID of weights;Wherein, ruling ID is used for identifying the comparison number of times of current ruling weights;
First comparing module 523, the current ruling ID of described first for obtaining described acquisition module 522 and described the
Two current ruling ID compare;
Second comparing module 524, for when described first comparing module 523 determine the described first current ruling ID with described
When second current ruling ID is identical, described first ruling weights are compared with described second ruling weights;
Processing module 525, for determining the described first current ruling ID and described second when described first comparing module 523
When current ruling ID differs, obtain currently maximum ruling ID corresponding ruling weights respectively, and compare the umpirage after acquisition
Value.
Further, the embodiment of the present invention also provides the system that a kind of release connects, as shown in fig. 7, described system includes:
First calculate node 71 and the second calculate node 72;Wherein,
Described second calculate node 72, for when described first calculate node 71 and described second calculate node 72 exist right
During connecting, send the second ruling weights to described first calculate node 71;
Described first calculate node 71, for receiving the described second ruling weights that described second calculate node 72 sends,
And described second ruling weights are compared with the first ruling weights of itself, when described second ruling weights and described first
When ruling weights are different, disconnect a connection in split connection;Wherein, described first ruling weights and described second umpirage
Value is respectively the numerical value that described first calculate node 71 and described second calculate node 72 generate at random.
Further, described system also includes:
Described first calculate node 71, is additionally operable to receive and executes open operation command, described open operation command is used for
Disconnect a connection in split connection;
Described first calculate node 71, is additionally operable to disconnect notification message to the transmission of described second calculate node 72, institute
State disconnect notification message for instruction by described second calculate node 72 execute disconnect split connect in one connect;
Described second calculate node 72, be additionally operable to receive described first calculate node 71 send described in disconnect notice
Message, and execute a connection disconnecting in split connection.
The apparatus and system that release provided in an embodiment of the present invention connects, exists split between two calculate nodes of determination
During connection, first calculate node receive second calculate node send the second ruling weights, by the second ruling weights with itself
First ruling weights are compared however, it is determined that the second ruling weights are different from the first ruling weights, then disconnect in split connection
Article one, connect, compared with prior art, the embodiment of the present invention, can in the case of determining that two calculate nodes have split connection
Voluntarily to consult between this two calculate nodes, disconnect any bar in split connection and connect, realize between two calculate nodes
Communicated by a connection, the process that this is voluntarily consulted simply, efficiently and easily realizes such that it is able to the split connection of minimizing is right
System resource and the consumption of Internet resources.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion described in detail in certain embodiment
Point, may refer to the associated description of other embodiment.
It is understood that the correlated characteristic in said method and device can mutually reference.In addition, in above-described embodiment
" first ", " second " etc. be for distinguishing each embodiment, and do not represent the quality of each embodiment.
Those skilled in the art can be understood that, for convenience and simplicity of description, the system of foregoing description,
Device and the specific work process of unit, may be referred to the corresponding process in preceding method embodiment, will not be described here.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system
Structure be obvious.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use various
Programming language realizes the content of invention described herein, and the description above language-specific done is to disclose this
Bright preferred forms.
In specification mentioned herein, illustrate a large amount of details.It is to be appreciated, however, that the enforcement of the present invention
Example can be put into practice in the case of not having these details.In some instances, known method, structure are not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly it will be appreciated that in order to simplify the disclosure and help understand one or more of each inventive aspect,
Above in the description to the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
The application claims of shield more features than the feature being expressly recited in each claim.More precisely, it is such as following
Claims reflected as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
The claims following specific embodiment are thus expressly incorporated in this specific embodiment, wherein each claim itself
All as the separate embodiments of the present invention.
Those skilled in the art are appreciated that and the module in the equipment in embodiment can be carried out adaptively
Change and they are arranged in one or more equipment different from this embodiment.Can be the module in embodiment or list
Unit or assembly be combined into a module or unit or assembly, and can be divided in addition multiple submodule or subelement or
Sub-component.In addition to such feature and/or at least some of process or unit exclude each other, can adopt any
Combination is to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed
Where method or all processes of equipment or unit are combined.Unless expressly stated otherwise, this specification (includes adjoint power
Profit requires, summary and accompanying drawing) disclosed in each feature can carry out generation by the alternative features providing identical, equivalent or similar purpose
Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiment means to be in the present invention's
Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection appoint
One of meaning can in any combination mode using.
The all parts embodiment of the present invention can be realized with hardware, or to run on one or more processor
Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) are realizing denomination of invention according to embodiments of the present invention (as determined in website
The device of Hyperlink rank) in some or all parts some or all functions.The present invention be also implemented as
Execute some or all equipment or program of device (for example, computer program and the calculating of method as described herein
Machine program product).Such program realizing the present invention can store on a computer-readable medium, or can have one
Or the form of multiple signals.Such signal can be downloaded from internet website and obtain, or provides on carrier signal,
Or provided with any other form.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element listed in the claims or step.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can come real by means of the hardware including some different elements and by means of properly programmed computer
Existing.If in the unit claim listing equipment for drying, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.
Claims (10)
1. a kind of method that release connects is it is characterised in that include:
When there is split connection between two calculate nodes, the first calculate node receives the second sanction that the second calculate node sends
Certainly weights;
Described second ruling weights are compared with the first ruling weights of itself, described first ruling weights and described second
Ruling weights are respectively described first calculate node and the random numerical value generating of described second calculate node;
If described second ruling weights are different from described first ruling weights, disconnect a connection in split connection.
2. method according to claim 1 is it is characterised in that the connection disconnecting in split connection includes:
If described first ruling weights are more than described second ruling weights, retain described first calculate node to the described second meter
The connection that operator node is initiated, and disconnect the connection that described second calculate node is initiated to the first calculate node;
If it is determined that described first ruling weights are less than described second ruling weights, then retain described second calculate node to described the
The connection that one calculate node is initiated, and disconnect the connection that described first calculate node is initiated to described second calculate node.
3. method according to claim 1 is it is characterised in that methods described also includes:
If it is determined that described second ruling weights are equal to described first ruling weights, then receive that described second calculate node sends the
Four ruling weights, and described 4th ruling weights and the 3rd ruling value of itself are compared, until determining that second calculates section
Till the ruling weights that point sends and the ruling weights of itself differ.
4. method according to claim 1 is it is characterised in that receive what the second calculate node sent in the first calculate node
Before second ruling weights, methods described also includes:
Obtain actively connect list, described actively connect the first calculate node described in list as connection initiator, for remembering
Record described first calculate node and set up in connection request to the second calculate node transmission, the information of the second calculate node;
Obtain by the list that is dynamically connected, described the first calculate node described in list that is dynamically connected as connected party, for recording
Receive described second calculate node send described set up in connection request, the information of the second calculate node;
Respectively from described actively connect list and described by the list that is dynamically connected obtain the information of the second calculate node;
If it is determined that from described actively connect list and described by the list that is dynamically connected obtain the second calculate node information consistent, then
Determine there is split connection between described first calculate node and described second calculate node.
5. the method according to any one of claim 1-4 it is characterised in that disconnect split connect in one connection,
Including:
Receive open operation command, described open operation command is used for instruction and is disconnected in split connection by described first calculate node
One connection;
Or, send to described second calculate node and disconnect notification message, the described notification message that disconnects is used for indicating
A connection in split connection is disconnected by described second calculate node execution.
6. method according to claim 5 is it is characterised in that by described second ruling weights and the first umpirage of itself
Value compare including:
Respectively described first ruling weights and described second ruling weights are parsed;
Obtain the corresponding first current ruling ID of described first ruling weights, and obtain described second ruling weights corresponding second
Current ruling ID;Wherein, ruling ID is used for identifying the comparison number of times of current ruling weights;
Current with described second for described first current ruling ID ruling ID is compared;
If it is determined that described first current ruling ID ruling ID current with described second is identical, then by described first ruling weights and institute
State the second ruling weights to compare;
If it is determined that described first current ruling ID ruling ID current with described second differs, then obtain currently maximum ruling respectively
ID corresponding ruling weights, and compare the ruling weights after acquisition.
7. the device that a kind of release connects is it is characterised in that include:
First receiving unit, during for there is split connection between two calculate nodes, the first calculate node receives the second meter
The second ruling weights that operator node sends;
Comparing unit, described second ruling weights and the first ruling weights of itself for receiving described receiving unit enter
Row compares, and described first ruling weights and described second ruling weights are respectively described first calculate node and described second calculating
The random numerical value generating of node;
Switching units, for when described comparing unit compare described second ruling weights different from described first ruling weights when,
Disconnect a connection in split connection.
8. device according to claim 7 is it is characterised in that described switching units include:
First processing module, for when described first ruling weights are more than described second ruling weights, retaining described first meter
The connection that operator node is initiated to described second calculate node, and disconnect what described second calculate node was initiated to the first calculate node
Connect;
Second processing module, for when determining that described first ruling weights are less than described second ruling weights, retaining described the
The connection that two calculate nodes are initiated to described first calculate node, and disconnect described first calculate node to the described second calculating section
The connection that point is initiated.
9. device according to claim 7 is it is characterised in that described device also includes:
When described comparing unit, second receiving unit, for determining that described second ruling weights are equal to described first ruling weights
When, receive the 4th ruling weights that described second calculate node sends;
Processing unit, for the described 4th ruling weights and the 3rd ruling value of itself that receive described second receiving unit
Compare, till determining that the ruling weights that the second calculate node sends are differed with the ruling weights of itself.
10. the system that a kind of release connects is it is characterised in that described system includes:First calculate node and the second calculate node;
Wherein,
Described second calculate node, for existing to during being connected when described first calculate node and described second calculate node,
Send the second ruling weights to described first calculate node;
Described first calculate node, for receiving the described second ruling weights that described second calculate node sends, and will be described
Second ruling weights are compared with the first ruling weights of itself, when described second ruling weights and described first ruling weights
When different, disconnect a connection in split connection;Wherein, described first ruling weights and described second ruling weights are respectively
Described first calculate node and the random numerical value generating of described second calculate node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610939111.8A CN106453588B (en) | 2016-11-01 | 2016-11-01 | Discharge the method, apparatus and system of connection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610939111.8A CN106453588B (en) | 2016-11-01 | 2016-11-01 | Discharge the method, apparatus and system of connection |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106453588A true CN106453588A (en) | 2017-02-22 |
CN106453588B CN106453588B (en) | 2019-08-09 |
Family
ID=58178761
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610939111.8A Active CN106453588B (en) | 2016-11-01 | 2016-11-01 | Discharge the method, apparatus and system of connection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106453588B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101459689A (en) * | 2007-12-13 | 2009-06-17 | 阿尔卡特朗讯 | Method of establishing a connection in a peer-to-peer network with network address translation (nat) |
CN101697552A (en) * | 2009-10-16 | 2010-04-21 | 中国电信股份有限公司 | Method and system for scheduling P2P |
CN101755261A (en) * | 2007-07-20 | 2010-06-23 | 惠普开发有限公司 | Assisted peer-to-peer media streaming |
US20120185536A1 (en) * | 2004-01-23 | 2012-07-19 | Tiversa, Inc. | Method For Optimally Utilizing A Peer To Peer Network |
JP2012173995A (en) * | 2011-02-22 | 2012-09-10 | Nippon Hoso Kyokai <Nhk> | Receiving terminal and control program for the same |
-
2016
- 2016-11-01 CN CN201610939111.8A patent/CN106453588B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120185536A1 (en) * | 2004-01-23 | 2012-07-19 | Tiversa, Inc. | Method For Optimally Utilizing A Peer To Peer Network |
CN101755261A (en) * | 2007-07-20 | 2010-06-23 | 惠普开发有限公司 | Assisted peer-to-peer media streaming |
CN101459689A (en) * | 2007-12-13 | 2009-06-17 | 阿尔卡特朗讯 | Method of establishing a connection in a peer-to-peer network with network address translation (nat) |
CN101697552A (en) * | 2009-10-16 | 2010-04-21 | 中国电信股份有限公司 | Method and system for scheduling P2P |
JP2012173995A (en) * | 2011-02-22 | 2012-09-10 | Nippon Hoso Kyokai <Nhk> | Receiving terminal and control program for the same |
Non-Patent Citations (1)
Title |
---|
庄雷等: ""大规模对等网络的连接控制管理"", 《计算机应用研究》 * |
Also Published As
Publication number | Publication date |
---|---|
CN106453588B (en) | 2019-08-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11240159B2 (en) | Service link selection control method and device | |
US20220239496A1 (en) | Blockchain consensus method, device and system | |
CN111008075A (en) | Load balancing system, method, device, equipment and medium | |
CN105511954A (en) | Method and device for message processing | |
CN109076024A (en) | data control method and terminal device | |
CN110262933B (en) | Test method, test device, and storage medium | |
JP2022554384A (en) | Network data analysis method, functional entity and electronic device | |
CN105472291A (en) | Digital video recorder with multiprocessor cluster and realization method of digital video recorder | |
CN112835885B (en) | Processing method, device and system for distributed form storage | |
CN102685209B (en) | A kind of method of assisting users equipment transmitting/receiving instance message, device and equipment | |
CN106686040A (en) | Message processing method and message processing device | |
CN105718403A (en) | Expansion interface and method for data communication through same | |
CN105808476B (en) | The transmission method and device of clock-domain crossing data | |
CN104809026B (en) | A kind of method that CPU computing resources are borrowed using remote node | |
CN105227384A (en) | Method of commerce between online transaction processing system and transaction system | |
CN103997509A (en) | Service oriented architecture-based service processing method and apparatus | |
CN108881060A (en) | A kind of method and device handling communication message | |
CN110932879B (en) | Network performance test method, data processing device and storage medium | |
CN109582242B (en) | Address determination method and device for cascade memory array system and electronic equipment | |
CN106453588A (en) | Connection release method, device and system | |
US10129147B2 (en) | Network-on-chip flit transmission method and apparatus | |
CN113014610B (en) | Remote access method, device and system | |
CN106681954A (en) | Method for parameter setting based on bus and controller for robot | |
CN104731524A (en) | Method for setting capacity of buffer | |
CN106603604A (en) | Method and device of triggering transaction processing motion |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |