Summary of the invention
The object of this invention is to provide a kind of for closing the method and apparatus that Diameter connects.
According to a first aspect of the invention, provide a kind of in a Diameter node for close Diameter connect method, be connected by least one Diameter between a wherein said Diameter node with a 2nd Diameter node and communicate, wherein, each described Diameter connects the transmit queue that all has one to have message to be sent and one, and to have the receiving queue receiving message corresponding with it, a described Diameter node prepares at least one Diameter closed wherein and connects, wherein, the method comprises the following steps: A. starts first timer, B. disconnection request message is sent when one of following condition meets to described 2nd Diameter node, the mark that at least one Diameter to be closed described in wherein containing connects, condition one: first timer time-out, condition two: connect for Diameter to be closed described in each, the transmit queue corresponding with it is sky, C. second timer is started, D. when message is replied in described second timer time-out or the disconnection received from described 2nd Diameter node, described disconnection reply message contain described at least one mark connected to be closed, close described connection.
Preferably, further comprising the steps of before described step B: Diameter to be closed described in each to be connected, stops increasing new request message in the transmit queue corresponding with it; If the transmit queue corresponding with it is not empty, processes the request message in described transmit queue and reply message.
Preferably, after stepb and before step D, described method is further comprising the steps of: Diameter to be closed described in each is connected, if the receiving queue corresponding with it be empty, processes the request message in described receiving queue and reply message; If the transmit queue corresponding with it is not empty, process the reply message in described transmit queue.
Preferably, further comprising the steps of before steps A: to send negotiation request message to described 2nd Diameter node, wherein comprise it and support level and smooth characteristic information of closing; Reply message in response to the negotiation request from described 2nd Diameter node, judge whether described 2nd Diameter node supports level and smooth closedown; When judged result is for supporting, perform steps A.
According to a second aspect of the invention, provide a kind of in the 2nd Diameter node for close Diameter connect method, be connected by least one Diameter between wherein said 2nd Diameter node with a Diameter node and communicate, wherein, each described Diameter connects the transmit queue that all has one to have message to be sent and one, and to have the receiving queue receiving message corresponding with it, wherein, the method comprises the following steps: receive the disconnection request message from a described Diameter node, wherein contain the mark that at least one Diameter to be closed connects, start the 3rd timer, send disconnection when one of following condition meets to a described Diameter node and reply message, the mark that at least one Diameter to be closed described in wherein containing connects, condition one: the three timer expiry, condition two: connect for Diameter to be closed described in each, the transmit queue corresponding with it and receiving queue are sky.
Preferably, described method is after described reception disconnection request message step and also comprised before messages step is replied in described transmission disconnection: connect for Diameter to be closed described in each, stop increasing new request message in the transmit queue corresponding with it; If the transmit queue corresponding with it is not empty, processes the request message in described transmit queue and reply message; If the receiving queue corresponding with it is not empty, processes the request message in described receiving queue and reply message.
According to a third aspect of the present invention, provide a kind of in a Diameter node for close Diameter connect device, be connected by least one Diameter between a wherein said Diameter node with a 2nd Diameter node and communicate, wherein, each described Diameter connects the transmit queue that all has one to have message to be sent and one, and to have the receiving queue receiving message corresponding with it, a described Diameter node prepares at least one Diameter closed wherein and connects, wherein, this device comprises: the first starting drive, for starting first timer, first dispensing device, for sending disconnection request message when one of following condition meets to described 2nd Diameter node, the mark that at least one Diameter to be closed described in wherein containing connects, condition one: first timer time-out, condition two: connect for Diameter to be closed described in each, the transmit queue corresponding with it is sky, second starting drive, for starting second timer, shutoff device, for when message is replied in described second timer time-out or the disconnection received from described 2nd Diameter node, described disconnection reply message contain described at least one mark connected to be closed, close described connection.
Preferably, described device also comprises the first processing unit, for connecting for Diameter to be closed described in each before sending described disconnection request message at described first dispensing device, stops increasing new request message in the transmit queue corresponding with it; If the transmit queue corresponding with it is not empty, processes the request message in described transmit queue and reply message.
Preferably, described device also comprises the second processing unit, for after sending described disconnection request message at described first dispensing device and before described shutoff device cuts out described connection, Diameter to be closed described in each is connected, if the receiving queue corresponding with it is not empty, processes the request message in described receiving queue and reply message; If the transmit queue corresponding with it is not empty, process the reply message in described transmit queue.
Preferably, described device also comprises the 3rd processing unit, before starting first timer at described first starting drive: send negotiation request message to described 2nd Diameter node, wherein comprises it and supports level and smooth characteristic information of closing; Reply message in response to the negotiation request from described 2nd Diameter node, judge whether described 2nd Diameter node supports level and smooth closedown; When judged result is for supporting, notify that described first starting drive starts first timer.
According to a fourth aspect of the present invention, provide a kind of in the 2nd Diameter node for close Diameter connect device, be connected by least one Diameter between wherein said 2nd Diameter node with a Diameter node and communicate, wherein, each described Diameter connects the transmit queue that all has one to have message to be sent and one, and to have the receiving queue receiving message corresponding with it, wherein, this device comprises: receiving system, for receiving the disconnection request message from a described Diameter node, wherein contain the mark that at least one Diameter to be closed connects, 3rd starting drive, for starting the 3rd timer, second dispensing device, message is replied for sending disconnection when one of following condition meets to a described Diameter node, the mark that at least one Diameter to be closed described in wherein containing connects, condition one: the three timer expiry, condition two: connect for Diameter to be closed described in each, the transmit queue corresponding with it and receiving queue are sky.
Preferably, described device also comprises the 4th processing unit, for connecting for Diameter to be closed described in each after receiving described disconnection request message at described receiving system and sending described in described second dispensing device before message is replied in disconnection, stop increasing new request message in the transmit queue corresponding with it; If the transmit queue corresponding with it is not empty, processes the request message in described transmit queue and reply message; If the receiving queue corresponding with it is not empty, processes the request message in described receiving queue and reply message.
Compared with the technology connected with the existing Diameter of closedown, the present invention proposes the technology that a kind of level and smooth closedown Diameter newly connects, obviously can reduce the quantity of failed message, in the rational situation of set timer, the ideal effect without message failure can be reached, thus improve QoS and the stability of system.It can meet a lot of client particularly telecom operators after developing into 4GLTE business, when carrying out mutual core network element to use Diameter and safeguarding or break down, be subject to minimum systematic influence, make terminal use be subject to minimum service impact simultaneously.
Embodiment
First two nouns are explained:
Request message (Request): refer to the message that the side in two Diameter nodes of mutually communication initiatively initiates, normally the beginning of new affairs, completes some process action for asking the opposing party.
Reply message (Answer): refer to a side in two Diameter nodes of mutually communication after receiving the request message that the opposing party sends, take some process action, then to the message that the opposing party of initial request messages replys, the normally end of affairs.
Invention introduces the mechanism that a kind of level and smooth closedown Diameter newly connects.
Below in conjunction with accompanying drawing, the present invention is described in further detail.
Fig. 2 shows application scenarios figure according to an embodiment of the invention.Wherein, node 201 and node 202 are the Diameter node supporting Diameter.Node described here can be any network equipment, such as client computer, server etc.Node 201 and node 202 are connected by least one Diameter and communicate, and only illustrate two Diameter and connect: connect 2a and be connected 2b in figure.Preferably, described Diameter connects and can also comprise multiple sub-connection (not shown) further.
On node 201 and node 202, each Diameter connect all have a transmit queue and a receiving queue corresponding with it.As shown in the figure, connect 2a for the Diameter on node 201, transmit queue 2a11 and receiving queue 2a12 is corresponding with it; Connect 2b for the Diameter on node 201, transmit queue 2b11 and receiving queue 2b12 is corresponding with it; Connect 2a for Diameter on node 202, transmit queue 2a21 and receiving queue 2a22 is corresponding with it; Connect 2b for Diameter on node 202, transmit queue 2b21 and receiving queue 2b22 is corresponding with it.Wherein, transmit queue is for storing the message this node preparing send via this connection, and receiving queue this node has received via this connection but also untreated message for storing.
Illustrate the course of work of transmit queue and receiving queue below.
If node 201 is attempted to send a request message R1 to node 202, an available Diameter first can be selected to connect and such as to connect 2a, then, this request message R1 be added in transmit queue 2a11.Request message R1 is stored in transmit queue 2a11, until all processed complete in the message of request message R1 in this queue, then, request message R1 can be sent to node 202.Node 202 receives this request message R1 via receiving queue 2a22.Request message R1 is stored in receiving queue 2a22, until all processed complete in the message of request message R1 in this queue, node 202 just can process this request message R1.Node 202 processes this request message R1, usually can produce a reply message A1 and send to node 201.With said process similarly, node 202 can first be selected an available Diameter to connect such as to connect 2a, then, added in transmit queue 2a21 by this reply message A1.This reply message A1 is stored in transmit queue 2a21, until all processed complete in the message of this reply message A1 in this queue, then, this reply message A1 can be sent to node 201.Node 201 receives this reply message A1 via receiving queue 2a12.Reply message A1 to be stored in receiving queue 2a12, until all processed complete in the message of replying message A1 in this queue, node 201 just can process this reply message A1.
Fig. 3 shows according to an embodiment of the invention for closing the process schematic that Diameter connects.Wherein, node 201 prepare close its be connected 2a with the Diameter between node 202.This process starts from step S311.
In step S311, node 201 starts first timer.
In step S312, when first timer time-out or transmit queue 2a11 be sky, send disconnection request message to node 202, than DPR message as illustrated in the drawing, wherein contain the mark that Diameter to be closed connects, namely Diameter connects the mark of 2a.Those skilled in the art will be understood that and various ways can be adopted to connect, as by the address+port numbers of node 201 to identify Diameter.In one embodiment, the mark that multiple Diameter to be closed connects can be comprised in above-mentioned disconnection request message, even can comprise the mark that all Diameter between node 201 with node 202 are connected.In yet another embodiment, disconnection request message only comprises the mark that a Diameter to be closed connects, connect if node 201 prepares to close multiple Diameter, then connect for each Diameter to be closed, node 201 all sends a disconnection request message to node 202.
In one embodiment, node 201 also performed following steps before step S312: connect for each Diameter to be closed,
-stop increasing new request message to the transmit queue corresponding with it and transmit queue 2a11.Because now node 201 has determined that closing Diameter connects 2a, so node 201 can not outwards send new request message via this connection again.If some application program on node 201 attempts to send new request message via this connection, node 201 can be refused to increase this new request message to transmit queue 2a11, and to application program return failure information or select other can with Diameter connect and send this new request message.
If-the transmit queue corresponding with it and transmit queue 2a11 are not empty, process request message wherein and reply message.Although node 201 can not outwards send new request message via connection 2a again, still can continue process for the request message existed in transmit queue 2a11 and outwards send.For that existed in transmit queue 2a11 with the follow-up reply message newly increased, node 201 can continue process.
It is pointed out that the time interval of first timer can be set as a suitable value, can be processed complete with the message as far as possible within this time interval in transmit queue 2a11.
Below by being described in node 201 respectively to after node 202 sends disconnection request message, in the processing procedure of node 202 side and the processing procedure in node 201 side.
at node 201 to after node 202 sends disconnection request message, in node 202 side:
In step S321, after node 202 receives the disconnection request message from node 201, can start the 3rd timer, described disconnection request message contains the mark that at least one Diameter to be closed connects, and namely Diameter connects the mark of 2a.
In step S322, send disconnection when one of following condition meets to node 201 and reply message, than DPA message as illustrated in the drawing, the mark that at least one Diameter to be closed described in wherein containing connects, namely Diameter connects the mark of 2a,
Condition one: the three timer expiry,
Condition two: connect for Diameter to be closed described in each, the transmit queue corresponding with it and receiving queue are sky, namely connect 2a corresponding transmit queue 2a21 and receiving queue 2a22 with Diameter and are sky.
Those skilled in the art will be understood that above-mentioned disconnection reply message be with above-mentioned disconnection request message one to one.。
In one embodiment, after node 202 receives described disconnection request message and before message is replied in the described disconnection of transmission, node 202 also can perform following steps: connect for each Diameter to be closed,
-stop increasing new request message to the transmit queue corresponding with it and transmit queue 2a21.Because now node 202 has learnt that Diameter connects 2a and is about to be closed, so node 202 can not outwards send new request message via this connection again.If some application program on node 202 attempts to send new request message via this connection, node 202 can be refused to increase this new request message to transmit queue 2a21, and to application program return failure information or select other can with Diameter connect and send this new request message.
If-the transmit queue corresponding with it and transmit queue 2a21 are not empty, process request message wherein and reply message.Although node 202 can not outwards send new request message via connection 2a again, still can continue process for the request message existed in transmit queue 2a21 and outwards send.For that existed in transmit queue 2a21 with the follow-up reply message newly increased, node 202 can continue process.
If-the receiving queue corresponding with it and receiving queue 2a22 are not empty, process request message wherein and reply message.For existed in receiving queue 2a22 with the follow-up request message newly increased and reply message, node 202 can continue process.
It is pointed out that the time interval of the 3rd timer can be set as a suitable value, can be processed complete with the message as far as possible within this time interval in transmit queue 2a21 and receiving queue 2a22.
at node 201 to after node 202 sends disconnection request message, in node 201 side:
In step S313, node 201 starts second timer.
In step S314, when described second timer time-out or node 201 receive the disconnection reply message sent from node 202, ratio DPA message as illustrated in the drawing, the mark that described in described disconnection reply message contains, at least one Diameter to be closed connects, namely Diameter connects the mark of 2a, closes described connection.So far, the Diameter between node 201 and node 202 connects 2a and is smoothly closed.
In one embodiment, after node 201 sends disconnection request message and node 201 close described Diameter connect before, node 201 also can perform following steps: connect for each Diameter to be closed,
-if to connect corresponding receiving queue and receiving queue 2a11 with Diameter described to be closed be not empty, process request message wherein and reply message.For existed in receiving queue 2a11 with the follow-up request message newly increased and reply message, node 201 can continue process.
-if to connect corresponding transmit queue and transmit queue 2a12 with Diameter described to be closed be not empty, process reply message wherein.For that existed in receiving queue 2a12 with the follow-up reply message newly increased, node 201 can continue process.
It is pointed out that the time interval of second timer can be set as a suitable value, can be processed complete with the message as far as possible in the transmit queue 2a21 and receiving queue 2a22 of this time interval interior nodes 202 side.
Can find out, adopt method of the present invention, when node 201 closes Diameter connection 2a, the residue message in the transmit queue 2a21 of the transmit queue 2a11 of node 201 side and receiving queue 2a12 and node 201 side and receiving queue 2a22 is seldom or ideally empty.Because node 201 and node 202 cooperate mutually, both sides all participate in controlling, and failure quantity is obviously reduced, and substantially can realize the object of smoothly closing Diameter connection.
Because the method needs the support of both sides, if a side cannot support this mechanism, then the opposing party also cannot complete separately this process.
In yet another embodiment, before step S311, node 201 and node 202 also can perform following steps:
-node 201 sends negotiation request message to node 202, wherein contains it and supports level and smooth characteristic information of closing;
After-node 202 receives this negotiation request message, can send to node 201 request of negotiation and reply message, wherein contain it and whether support level and smooth characteristic information of closing;
-node 201 is replied message decision node 202 according to the negotiation request received and whether is supported level and smooth closedown;
If-above-mentioned judged result is for supporting, node 201 can perform step S311.
By above-mentioned negotiation mechanism, node 201 can be made to learn, and whether node 202 supports level and smooth closedown.If node 202 does not support level and smooth closedown, then adopt method of the prior art to close connection; If node 202 supports level and smooth closedown, then adopt method of the present invention.
Fig. 4 show according to an embodiment of the invention in Diameter node 201 for close Diameter connect device schematic diagram.This device 400 comprises: the first starting drive 401, first dispensing device 402, second starting drive 403 and shutoff device 404.
The course of work of this device is described in detail below in conjunction with Fig. 2 and Fig. 3.Node 201 prepares to close it and is connected 2a with the Diameter between node 202.
First, the first starting drive 401 starts first timer.
Then, when first timer time-out or transmit queue 2a11 be sky, the first dispensing device 402 sends disconnection request message to node 202, than DPR message as illustrated in the drawing, wherein contain the mark that Diameter to be closed connects, namely Diameter connects the mark of 2a.Those skilled in the art will be understood that and various ways can be adopted to connect, as by the address+port numbers of node 201 to identify Diameter.In one embodiment, the mark that multiple Diameter to be closed connects can be comprised in above-mentioned disconnection request message, even can comprise the mark that all Diameter between node 201 with node 202 are connected.In yet another embodiment, disconnection request message only comprises the mark that a Diameter to be closed connects, connect if node 201 prepares to close multiple Diameter, then connect for each Diameter to be closed, node 201 all sends a disconnection request message to node 202.
In one embodiment, device 400 also comprises the first processing unit (not shown).This first processing unit is used for performing following steps before the first dispensing device 402 sends disconnection request message: connect for each Diameter to be closed,
-stop increasing new request message to the transmit queue corresponding with it and transmit queue 2a11.Because now node 201 has determined that closing Diameter connects 2a, so node 201 can not outwards send new request message via this connection again.If some application program on node 201 attempts to send new request message via this connection, first processing unit can be refused to increase this new request message to transmit queue 2a11, and to application program return failure information or select other can with Diameter connect and send this new request message.
If-the transmit queue corresponding with it and transmit queue 2a11 are not empty, process request message wherein and reply message.Although node 201 can not outwards send new request message via connection 2a again, still can continue process for request message first processing unit existed in transmit queue 2a11 and outwards send.For that existed in transmit queue 2a11 with the follow-up reply message newly increased, the first processing unit can continue process.
It is pointed out that the time interval of first timer can be set as a suitable value, can be processed complete with the message as far as possible within this time interval in transmit queue 2a11.
At the first dispensing device 402 to after node 202 sends disconnection request message, the second starting drive 403 starts second timer.
Then, when described second timer time-out or when receiving the disconnection reply message sent from node 202, ratio DPA message as illustrated in the drawing, the mark that described in described disconnection reply message contains, at least one Diameter to be closed connects, namely Diameter connects the mark of 2a, and shutoff device 404 cuts out described connection.So far, the Diameter between node 201 and node 202 connects 2a and is smoothly closed.
In one embodiment, device 400 also comprises the second processing unit (not shown).After the first dispensing device 402 sends disconnection request message and shutoff device 404 close described Diameter connect before, the second processing unit also can perform following steps: connect for each Diameter to be closed,
-if to connect corresponding receiving queue and receiving queue 2a11 with Diameter described to be closed be not empty, process request message wherein and reply message.For existed in receiving queue 2a11 with the follow-up request message newly increased and reply message, the second processing unit can continue process.
-if to connect corresponding transmit queue and transmit queue 2a12 with Diameter described to be closed be not empty, process reply message wherein.For that existed in receiving queue 2a12 with the follow-up reply message newly increased, the second processing unit can continue process.
It is pointed out that the time interval of second timer can be set as a suitable value, can be processed complete with the message as far as possible in the transmit queue 2a21 and receiving queue 2a22 of this time interval interior nodes 202 side.
In yet another embodiment, device 400 also comprises the 3rd processing unit (not shown).Before the first starting drive 401 starts first timer, the 3rd processing unit also can perform following steps:
-send negotiation request message to node 202, wherein contain it and support level and smooth characteristic information of closing;
-whether support level and smooth closedown according to the negotiation request reply message decision node 202 received from node 202;
If-above-mentioned judged result, for supporting, notifies that the first starting drive 401 starts first timer.
Fig. 5 show according to an embodiment of the invention in Diameter node 202 for close Diameter connect device schematic diagram.This device 500 comprises: receiving system 501, the 3rd starting drive 502 and the second dispensing device 503.
The course of work of this device is described in detail below in conjunction with Fig. 2 and Fig. 3.
First, receiving system 501 receives the disconnection request message from node 201, and described disconnection request message contains the mark that at least one Diameter to be closed connects, and namely Diameter connects the mark of 2a.
Then, the 3rd starting drive 502 can start the 3rd timer.
Then, when one of following condition meets, the second dispensing device 503 sends disconnection to node 201 and replys message, than DPA message as illustrated in the drawing, and the mark that at least one Diameter to be closed described in wherein containing connects, namely Diameter connects the mark of 2a
Condition one: the three timer expiry,
Condition two: connect for Diameter to be closed described in each, the transmit queue corresponding with it and receiving queue are sky, namely connect 2a corresponding transmit queue 2a21 and receiving queue 2a22 with Diameter and are sky.
Those skilled in the art will be understood that above-mentioned disconnection reply message be with above-mentioned disconnection request message one to one.。
In one embodiment, device 500 also comprises the 4th processing unit (not shown).Send described disconnection at the second dispensing device 503 and reply before message after receiving system 501 receives described disconnection request message, the 4th processing unit also can perform following steps: connect for each Diameter to be closed,
-stop increasing new request message to the transmit queue corresponding with it and transmit queue 2a21.Because now node 202 has learnt that Diameter connects 2a and is about to be closed, so node 202 can not outwards send new request message via this connection again.If some application program on node 202 attempts to send new request message via this connection, 4th processing unit can be refused to increase this new request message to transmit queue 2a21, and to application program return failure information or select other can with Diameter connect and send this new request message.
If-the transmit queue corresponding with it and transmit queue 2a21 are not empty, process request message wherein and reply message.Although node 202 can not outwards send new request message via connection 2a again, still can continue process for the request message existed in transmit queue 2a21 the 4th processing unit and outwards send.For that existed in transmit queue 2a21 with the follow-up reply message newly increased, the 4th processing unit can continue process.
If-the receiving queue corresponding with it and receiving queue 2a22 are not empty, process request message wherein and reply message.For existed in receiving queue 2a22 with the follow-up request message newly increased and reply message, the 4th processing unit can continue process.
It is pointed out that the time interval of the 3rd timer can be set as a suitable value, can be processed complete with the message as far as possible within this time interval in transmit queue 2a21 and receiving queue 2a22.
It should be noted that the present invention can be implemented in the assembly of software and/or software restraint, such as, application-specific integrated circuit (ASIC) (ASIC), general object computer or any other similar hardware device can be adopted to realize.In one embodiment, software program of the present invention can perform to realize step mentioned above or function by processor.Similarly, software program of the present invention (comprising relevant data structure) can be stored in computer readable recording medium storing program for performing, such as, and RAM memory, magnetic or CD-ROM driver or floppy disc and similar devices.In addition, steps more of the present invention or function can adopt hardware to realize, such as, as coordinating with processor thus performing the circuit of each step or function.
In addition, a part of the present invention can be applied to computer program, such as computer program instructions, when it is performed by computer, by the operation of this computer, can call or provide according to method of the present invention and/or technical scheme.And call the program command of method of the present invention, may be stored in fixing or moveable recording medium, and/or be transmitted by the data flow in broadcast or other signal bearing medias, and/or be stored in the working storage of the computer equipment run according to described program command.At this, comprise a device according to one embodiment of present invention, this device comprises the memory for storing computer program instructions and the processor for execution of program instructions, wherein, when this computer program instructions is performed by this processor, trigger this plant running based on the aforementioned method according to multiple embodiment of the present invention and/or technical scheme.
To those skilled in the art, obviously the invention is not restricted to the details of above-mentioned one exemplary embodiment, and when not deviating from spirit of the present invention or essential characteristic, the present invention can be realized in other specific forms.Therefore, no matter from which point, all should embodiment be regarded as exemplary, and be nonrestrictive, scope of the present invention is limited by claims instead of above-mentioned explanation, and all changes be therefore intended in the implication of the equivalency by dropping on claim and scope are included in the present invention.Any Reference numeral in claim should be considered as the claim involved by limiting.In addition, obviously " comprising " one word do not get rid of other unit or step, odd number does not get rid of plural number.Multiple unit of stating in device claim or device also can be realized by software or hardware by a unit or device.First, second word such as grade is used for representing title, and does not represent any specific order.