Summary of the invention
Consider the problems referred to above that exist in the correlation technique and propose the present invention, for this reason, the present invention aims to provide the switching handling method of a kind of stream media node controller (Agent).
The stream media node controller that stream media node controller switching handling method according to the present invention is used for content distributing network switches, wherein, a plurality of stream media node controllers are arranged under the stream media node of content distributing network, and at a time have only a stream media node controller to play the scheduling effect as mainstream media's Node Controller.
This method comprises: the configuration information table and/or the table of comparisons, and wherein, information table has write down the information of each stream media node controller of content distributing network, and information comprises affiliated node, mode of operation, the Link State of stream media node controller; The table of comparisons has write down the identification information of mainstream media's Node Controller of each node of content distributing network and/or this node; Traversal information table and/or the table of comparisons, for Link State be the identification information of node under unusual mainstream media's Node Controller and/or mainstream media's Node Controller for empty node, initiate main handoff request.
The processing of initiating main handoff request by the traversal information table is specially: first timer is set, trigger each stream media node controller in the traversal information table, for being judged to be the unusual stream media node controller of link, judge whether it is mainstream media's Node Controller, if judged result is for being, then determine the node that mainstream media's Node Controller is affiliated, and a Link State selecting this node is that normal stream media node controller sends main handoff request, switches to mainstream media's Node Controller to ask it.
In said method, sending heartbeat request by each stream media node controller in information table travels through, and the 3rd timer is set, wherein, whether before the 3rd timer expiry, return heartbeat according to stream media node controller and respond and judge whether its link is normal.Based on this, the stream media node controller for continuous pre-determined number does not have heartbeat to respond behind the 3rd timer expiry determines that it is the unusual stream media node controller of link.Further, for being judged to be the unusual stream media node controller of link, that writes down in the information table is set to its link corresponding state unusually.
The processing of initiating main handoff request by the traversal table of comparisons is specially: second timer is set, trigger each node in the traversal table of comparisons, identification information for mainstream media's Node Controller is empty node, a Link State selecting this node is that normal stream media node controller sends main handoff request, switches to mainstream media's Node Controller to ask it.
In said method, when sending main handoff request, the 4th timer is set.Need to prove, carry the essential information of relevant stream media node controller in the additional information of the 3rd timer/the 4th timer, with the sign stream media node controller.
Like this, on the one hand,, then close the 4th timer, and judge whether switching is successful if the stream media node controller that is requested to switch returns handoff response before the 4th timer expiry; Under the situation of handover success, as new mainstream media's Node Controller, its mode of operation corresponding in information table is set to main mode of operation, and its sign is saved in the table of comparisons with stream media node controller; Under the situation of handoff failure, stream media node controller corresponding mode of operation in information table is set to from mode of operation, node corresponding mainstream media's Node Controller sign in the table of comparisons is set to sky under it, and reselects that the Link State of node is that normal stream media node controller sends main handoff request under it.
In addition, under the situation of handover success, further the every other Streaming Media control point of contact under the node under new mainstream media's Node Controller sends from handoff request, switches to from stream media node controller to ask it.Afterwards, for the situation of not returning handoff response or handoff failure, continue to send from handoff request; For the situation of handover success, other Streaming Media control point of contact corresponding mode of operations in information table are set to from mode of operation.
On the other hand, if the stream media node controller that is requested to switch does not return handoff response before the 4th timer expiry, then stream media node controller corresponding mode of operation in information table is set to from mode of operation, node corresponding mainstream media's Node Controller sign in the table of comparisons is set to sky under it, and reselects that the Link State of node is that normal stream media node controller sends main handoff request under it.
By the present invention, realized the hand-off process of multi-Agent among the IPTV, having arbitrated a plurality of Agent mutual exclusions under the node effectively provides the function of service, guaranteed can not occur the situation of dereliction Agent and a plurality of main Agent, make each system stably to provide various media services for the user, therefore, guarantee the stability and the later maintenance quality of system, reduced maintenance cost.
Other features and advantages of the present invention will be set forth in the following description, and, partly from specification, become apparent, perhaps understand by implementing the present invention.Purpose of the present invention and other advantages can realize and obtain by specifically noted structure in the specification of being write, claims and accompanying drawing.
Embodiment
Below in conjunction with accompanying drawing the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein only is used for description and interpretation the present invention, and be not used in qualification the present invention.
The present invention aims to provide the switching handling method of a kind of stream media node controller (Agent).
The Agent that Agent switching handling method according to the present invention is used for content distributing network (CDN) switches, wherein, as shown in Figure 1, CDN can comprise a plurality of stream media nodes (hereafter is a node), that is, a Manager may control a plurality of nodes, and a plurality of Agent can be arranged under each node, and at a time have only an Agent to play the scheduling effect as main Agent, other Agent are called standby Agent or from Agent; Because each Agent might become main Agent, so can normally provide service for what guarantee system, each Agent sets up with affiliated node all Streaming Medias down and links.
Thinking according to the method for the embodiment of the invention is roughly as follows,, safeguards (preservation) information table and the table of comparisons that is, whether initiates handoff request by the traversal decision to information table/table of comparisons, afterwards, carries out subsequent treatment according to the response results to handoff request.
Particularly, as shown in Figure 2, this method can comprise following processing:
Step S202, the configuration information table and/or the table of comparisons, wherein, information table has write down the information (essential information such as affiliated node, mode of operation, Link State, communications parameter, IP address that comprises Agent) of each Agent of CDN; The table of comparisons has write down the identification information (when certain node not during main Agent, corresponding main Agent is designated sky) of the main Agent of each node of CDN and/or this node; Wherein, the information of preserving in this information table and the table of comparisons can obtain from database synchronization after system restart;
Step S204, traversal information table and/or the table of comparisons, for Link State be the identification information of node under unusual mainstream media's Node Controller and/or mainstream media's Node Controller for empty node, initiate main handoff request.
On the one hand, in step S204, the processing of initiating main handoff request by the traversal information table is specially: first timer is set, trigger each Agent in the traversal information table, that is, send heartbeat request to each Agent according to the communications parameter of Agent in the information table, and the 3rd timer is set, if certain Agent returns the heartbeat response before the 3rd timer expiry, think that then this Agent link is normal, and the timeing closing device; If the continuous pre-determined number of certain Agent (can set in advance) does not all have the heartbeat response behind the 3rd timer expiry, think that then this Agent link is unusual;
For being judged to be the unusual Agent of link, that writes down in the information table is set to unusually with its link corresponding state, and judge whether it is main Agent, if judged result is for being, then determine the node under the main Agent, affiliated node corresponding main Agent sign in the table of comparisons is emptied, and to select a Link State of this node be that normal Agent sends main handoff request, asking it to switch to main Agent, and the 4th timer is set;
On the other hand, in step S204, the processing of initiating main handoff request by the traversal table of comparisons is specially: second timer is set, trigger each node in the traversal table of comparisons, identification information for main Agent is empty node, a Link State selecting this node is that normal Agent sends main handoff request, switches to main Agent to ask it, and the 4th timer is set.
Need to prove, first to fourth above-mentioned length of timer is flexible configuration as required, to adapt to different applied environments or optimum value to be set according to actual conditions, for the 3rd timer/the 4th timer, because for each Agent, the heartbeat timeout and the switching overtime timer that are provided with all are the 3rd timer/the 4th timers, therefore, which Agent in order to distinguish is, need in being set, the additional information of timer carry the essential information of relevant Agent, with sign or differentiation Agent.
Described above is to send handoff request and send the preceding processing procedure of handoff request.Can better understand above-mentioned processing by the detailed process flow chart shown in Fig. 3.
As shown in Figure 3, and as mentioned above, may trigger the two kinds of situations that have of Agent switching, that is, and main Agent chain rupture or not main Agent:
Situation one: main Agent chain rupture, can carry out following processing:
The first step: timer A (301) is set, timer A (promptly, above-mentioned first timer) triggering traversal is kept at the Agent information table (302) in the internal memory, comprises essential informations such as the affiliated node of Agent, communications parameter, IP address, mode of operation, Link State in this information table;
Second step: according to communications parameter, Manager initiates heartbeat request (303) to all Agent, and overtime timer C (that is above-mentioned the 3rd timer) (304) is set then;
The 3rd step: whether the Agent that judges request returns heartbeat response (305).
If return response before timer C is overtime, timeing closing device C (306) then judges preserve in mode of operation that Agent reports and the Manager internal memory whether consistent, if unanimity, then flow process end (317); If inconsistent, then Manager initiates to switch to consistent handoff request (308) to this Agent, and the timer D (316) that waits for switching result is set.
If the overtime back of continuous several times (number of times can dispose) timer C Agent does not return the heartbeat response yet, then judge this Agent chain rupture, the Link State of this Agent in the internal memory is changed to (309) unusually, whether the Agent that judges chain rupture is current main Agent (310), if not then flow process finishes (317); If, then obtain the node (314) under this Agent, seek that the normal Agent of state switches to the handoff request (315) of main Agent as main Agent to its transmission under this node, and the timer D (316) that waits for switching result is set.
Situation two, not main Agent, can carry out following processing:
The first step: timer B (311) is set, and timer B triggers the node and the main Agent table of comparisons (312) in the traversal internal memory;
Second step: whether decision node has corresponding main Agent (313) in the table of comparisons, if having, then flow process finishes (317); If do not have, then obtain the node (314) under this Agent, seek that the normal Agent of state switches to the handoff request (315) of main Agent as main Agent to its transmission under this node, and the timer D (316) that waits for switching result is set.
Based on foregoing description, the subsequent treatment of embodiment after handoff request sends that present invention will be further described.
On the one hand,, then close the 4th timer, and judge whether switching is successful if the Agent that is requested to switch returns handoff response before the 4th timer expiry; Under the situation of handover success, as new main Agent, its mode of operation corresponding in information table is set to main mode of operation, and its sign is saved in the table of comparisons with Agent; Under the situation of handoff failure, Agent corresponding mode of operation in information table is set to from mode of operation, node corresponding main Agent sign in the table of comparisons is set to sky under it, and reselects that the Link State of node is that normal Agent sends main handoff request under it.
In addition, under the situation of handover success, further the every other Streaming Media control point of contact under the node under the new main Agent sends from handoff request, switches to from Agent to ask it.Afterwards, for the situation of not returning handoff response or handoff failure, continue to send from handoff request; For the situation of handover success, other Streaming Media control point of contact corresponding mode of operations in information table are set to from mode of operation.
On the other hand, if the Agent that is requested to switch does not return handoff response before the 4th timer expiry, then Agent corresponding mode of operation in information table is set to from mode of operation, node corresponding main Agent sign in the table of comparisons is set to sky under it, and reselects that the Link State of node is that normal Agent sends main handoff request under it.
In fact, when receiving handoff response or switching result, Manager need judge that this response is to switching to the request responding of main Agent, still to switching to the request responding from Agent, and carry out subsequent treatment according to judged result, this content can be seen according to Fig. 4 and further understand.Wherein, the flow chart of Fig. 4 at length shows the above-mentioned handling process that receives after the handoff response, further describes the present invention hereinafter with reference to Fig. 4.
As shown in Figure 4, the handling process that receives after the handoff response comprises two kinds of situations equally:
Situation one: Agent returns switching result (401) before timer D (that is, the 4th above-mentioned timer) is overtime, then treatment step is as follows:
The first step: timeing closing device D (402);
Second step: judge whether the mode of operation that Agent will switch to is main Agent (403);
If will switch to from Agent, then judge the whether success (404) of the switching result that returns, if unsuccessful, then continue to send the handoff request (405) that switches to from Agent, and timer D is set waits for switching result (420) to this Agent; If handover success, the mode of operation of this Agent (406) in the Agent information table in the updating memory then, and the information (407) of this Agent in the new database more synchronously;
If will switch to main Agent, then judge the whether success (408) of the switching result return, if success, the mode of operation of this Agent (409) in the Agent information table in the updating memory then, and the synchronous information (410) of this Agent in the new database more, simultaneously (for example with this Agent identification information, numbering) is saved in the internal memory in the node and the main Agent table of comparisons (411), in order to ensure having only a main Agent under the same node, also will be under this node every other Agent sends the handoff request (412) that switches to from Agent one time;
If unsuccessful, then the mode of operation with this Agent in the internal memory is changed to from mode of operation (415), and the information (417) of this Agent in the new database more synchronously, and the main Agent with this node correspondence in the node in the internal memory and the main Agent table of comparisons empties (416) simultaneously.Seek new available main Agent (418) for this node then, switch to the handoff request (419) of main Agent, and timer D wait switching result (420) is set to its transmission.
Situation two: Agent does not return switching result (413) yet after timer D is overtime, then treatment step is as follows:
Judge whether the mode of operation that Agent will switch to is main Agent (414);
If will switch to, then continue to send the handoff request (421) that switches to from Agent, and timer D wait switching result (420) is set to this Agent from Agent.
If will switch to main Agent, then the mode of operation with this Agent in the internal memory is changed to from mode of operation (415), and the synchronous information (417) of this Agent in the new database more, the main Agent with this node correspondence in the node in the internal memory and the main Agent table of comparisons empties (416) simultaneously.Seek new available main Agent (418) for this node then, switch to the handoff request (419) of main Agent, and timer D wait switching result (420) is set to its transmission.
So far, flow process is all over.
Like this, by the present invention, guarantee the situation of dereliction Agent and how main Agent can not occur under the arbitration and identity validation of Manager, what make that whole system can be stable provides various media services for the user.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.