Summary of the invention
Main purpose of the present invention is to provide a kind of alarm information reporting method, system and managed device, one of to address the above problem at least.
According to an aspect of the present invention, provide a kind of alarm information reporting method, having comprised: the heartbeat that managed device receives from management station checks message, and wherein, heartbeat checks that message carries the number information of the current receiving alarm information state of indication management station; Managed device is determined the numbering of the warning information that needs are retransmitted according to the numbering of number information and the current warning information that has sent of managed device; The warning information corresponding to numbering of the warning information that managed device will be retransmitted with needs sends to management station.
Before the heartbeat inspection message of above-mentioned managed device reception from management station, the method comprises: managed device is numbering of each warning information configuration according to sending order; Managed device is carried at the numbering of warning information in this warning information and sends to management station, and at the local cache warning information.
Above-mentioned number information comprises: the maximum numbering of the current warning information that has received of management station; Managed device is according to the numbering of number information and the current alarm information that has sent of managed device, the numbering of the warning information of determine to need retransmitting comprises: managed device will number and be checked in heartbeat that warning information between the numbering of the maximum numbering of carrying in the message and the current warning information that has sent of managed device adds and wait to retransmit during the judgement warning information gathers; Managed device judges that whether wait to retransmit each warning information of judging in the warning information set is to need the warning information retransmitted.
Above-mentioned number information also comprises: do not arrive the numbering set of the warning information of management station; Managed device judges that whether wait to retransmit each warning information of judging in the warning information set is before the warning information that needs to retransmit, and method also comprises: managed device will the warning information corresponding with each numbering in the numbering set adds to wait to retransmit judges that warning information is gathered.
For a numbering of each warning information configuration the time, the method also comprises: judge whether warning information has the preorder warning information, if so, then the numbering of preorder warning information is numbered as the preorder of warning information, and the preorder numbering is carried in the warning information.
Managed device the numbering of warning information is carried at send to management station in this warning information after, the method also comprises: the maximum numbering (M) of the warning information that management station will receive before receiving alarm information compares with the first numbering (S) of the current warning information that receives, wherein: if M+1<S, then management station determines that the warning information that is numbered M+1 to S-1 does not arrive, and the numbering of M+1 to S-1 is added the numbering set of the warning information that does not arrive; If M+1=S, then in the numbering set of the warning information that does not arrive, retrieve the second numbering H of the preorder warning information that whether has the current warning information that receives, if, then that described the second numbering H is related with described the first numbering S, after warning information corresponding to described the second numbering H arrives, number (H) front according to second, the first numbering (S) after order warning information and warning information corresponding to the first numbering (S) that the second numbering (H) is corresponding join the warning information that has received, if not, then the first warning information of numbering (S) is joined the warning information that has received; If S<M, then the warning information with the first numbering (S) joins the warning information that has received.
Above-mentioned managed device is judged and waited to retransmit whether each warning information of judging in the warning information set is that the warning information that needs to retransmit comprises: managed device obtains the very first time stamp that heartbeat checks message; For waiting to retransmit each warning information of judging in the warning information set, managed device obtains this warning information of indication and sends the second timestamp of time, judge that whether the time difference of the second timestamp and very first time stamp is greater than default packet loss time threshold, if so, determine that then this warning information needs to retransmit.
The warning information that does not arrive of the numbering correspondence of the warning information that above-mentioned managed device will not arrive sends to after the management station, also comprise: managed device checks the definite warning information of standing and successfully receiving that has been managed of message according to heartbeat, deletes the warning information that being managed of managed device buffer memory stood and successfully received.
According to a further aspect in the invention, a kind of warning information reporting device is provided, be positioned at the managed device side, this device comprises: the first receiver module, the heartbeat that is used for receiving from management station checks message, wherein, heartbeat checks that message carries the number information of the current receiving alarm information state of indication management station; The first determination module is used for the numbering according to number information and the current alarm information that has sent, definite numbering that needs the warning information of repeating transmission; The first sending module, warning information corresponding to numbering that is used for the warning information that will retransmit with needs sends to management station.
Above-mentioned number information comprises: the maximum numbering of the current warning information that has received of management station; The first determination module comprises: obtain submodule, be used for number and check in heartbeat that warning information between the numbering of maximum numbering that message carries and the current warning information that has sent of managed device adds and wait to retransmit during the judgement warning information gathers; Judge submodule, be used for judging and wait to retransmit whether each warning information of judging the warning information set is the warning information that needs repeating transmission.
Above-mentioned number information also comprises: do not arrive the numbering set of the warning information of management station; Obtaining submodule also is used for will the warning information corresponding with each numbering of numbering set adding waiting to retransmit and judges that warning information is gathered.
Above-mentioned judgement submodule comprises: the first acquiring unit is used for obtaining the very first time stamp that heartbeat checks message; Second acquisition unit is used for obtaining waiting to retransmit and judges that each warning information that warning information is gathered sends the second timestamp of time; Whether judging unit is used for judging respectively the time difference of the second timestamp of waiting to retransmit each warning information of judging the warning information set and very first time stamp greater than default packet loss time threshold, and if so, then definite this warning information needs repeating transmission.
According to a further aspect in the invention, a kind of warning information reporting system is provided, comprise: management station and managed device, wherein, managed device comprises above-mentioned warning information reporting device, wherein, management station comprises: the second receiver module, be used for receiving the warning information that managed device sends, wherein, carry the numbering of this warning information in the described warning information; The second determination module is used for definite number information of indicating the current receiving alarm information state of described management station; The second sending module is used for sending heartbeat to described managed device and checks message, and wherein, described heartbeat checks carries the described number information that current heartbeat checks that the second determination module is determined described in the message transmission cycle in the message.
Above-mentioned number information comprises: the maximum numbering of the current warning information that has received of management station and the numbering set of the warning information that does not arrive management station; Also carry the numbering of the preorder warning information of warning information in the warning information; The second determination module comprises: comparison module, compare for the maximum numbering M of the warning information that will before receiving alarm information, receive and the first numbering S of the current warning information that receives, if M+1<S, determine that then the warning information that is numbered M+1 to S-1 does not arrive, trigger the numbering set that Executive Module adds the numbering of M+1 to S-1 the warning information that does not arrive; If M+1=S then triggers retrieval module; Retrieval module, be used for whether depositing current the second numbering H that receives the preorder warning information of warning information in the numbering set retrieval of the warning information that does not arrive, if, then trigger Executive Module described the second numbering H is related with described the first numbering S, after warning information corresponding to described the second numbering H arrives, number H front according to second, the first numbering S after order the second warning information corresponding to numbering H and warning information corresponding to the first numbering S are joined the warning information that has received, if not, then trigger Executive Module the first warning information of numbering S is joined the warning information that has received; If S<M then triggers Executive Module the first warning information of numbering S is joined the warning information that has received; Executive Module is used for according to the comparative result of comparison module and/or the result for retrieval of retrieval module, carries out accordingly and processes.
By the present invention, adopt management station to check the number information of carrying current heart beat cycle receiving alarm information in the message in each heartbeat, thereby so that managed device can be determined according to this number information the numbering of the warning information that needs are retransmitted, the warning information that will need again to retransmit sends to the mode of management station, solved the poor problem of promptness of determining packet loss in the prior art, and then only reached and to need a heart beat cycle namely can determine whether to send packet loss, and make managed device in time, the warning information that automatically will lose resends the effect to management station.
Embodiment
Hereinafter also describe in conjunction with the embodiments the present invention in detail with reference to accompanying drawing.Need to prove, in the situation that do not conflict, embodiment and the feature among the embodiment among the application can make up mutually.
Fig. 1 is the flow chart according to the alarm information reporting method of the embodiment of the invention, and as shown in Figure 1, the method mainly may further comprise the steps (step S102-step S106):
The heartbeat that step S102, managed device receive from management station checks message, and wherein, heartbeat checks that message carries indication in the number information of current heart beat cycle management station receiving alarm information state;
In embodiments of the present invention, for being established side by pipe, managed device can be numbering of each warning information configuration according to initial sending order between sending a warning message.
In a preferred implementation of the embodiment of the invention, for each warning information configuration numbering the time, managed device can also judge whether this warning information has the preorder warning information, if, also be carried at then with the numbering of its preorder warning information preorder numbering as this warning information, and with the preorder numbering and send to management station in the warning information.For example, the numbering of warning information can be 1 serial number for continuous a, step-length.For example, Fig. 2 is numbered the schematic diagram that configures with the preorder numbering to TRAP agreement warning information according to the preferred embodiment of the invention, as shown in Figure 2, managed device can be carried at the preorder numbering of the numbering of warning information and warning information simultaneously in this warning information as number information and send to management station.Preferably, for the ease of this warning information of subsequent retransmissions, managed device can also be when sending to management station with warning information, with this warning information at local cache.
For management station's side, management station can send heartbeat to managed device according to predefined heart beat cycle and check message, behind a new warning information that whenever receives the managed device transmission, at first this warning information is resolved, thereby obtaining comprise numbering, the preorder of carrying in this warning information numbers, obtain indicating the number information of the current receiving alarm information of management station, when sending heartbeat and check message, check the number information that is carried at the current receiving alarm information of indication management station that current heart beat cycle obtains in the message in heartbeat.
For example, heartbeat checks that message can adopt message structure schematic diagram shown in Figure 3, as shown in Figure 3, and in actual applications, in a single day management station acquires this number information, and this number information that current heart beat cycle is obtained is carried at the current heartbeat that will send and checks in the message and send to managed device.Wherein, above-mentioned number information includes but not limited to: the numbering set of the warning information of management station is numbered, do not arrived to the maximum of the paid-in warning information of current management station.
Step S104, managed device determine the numbering of the warning information that needs are retransmitted according to the numbering of above-mentioned number information and the current warning information that has sent of managed device;
In the preferred embodiment of the present invention, if above-mentioned number information includes only: the maximum numbering of the current warning information that has received of management station, then managed device will be numbered and be checked in described heartbeat that warning information between the numbering of the described maximum numbering of carrying in the message and the current warning information that has sent of managed device adds to wait to retransmit and judge in the warning information set, then judge described wait to retransmit each warning information of judging in the warning information set whether be need to repeating transmission warning information.
In another preferred embodiment of the embodiment of the invention, if above-mentioned number information also comprises the numbering set of the warning information that does not arrive described management station, then managed device also adds above-mentioned treating in the set of repeating transmission judgement warning information with the warning information corresponding with each numbering in this numbering set.
Management station can not arrived the numbering set (in the situation that carrying the preorder numbering in the warning information) of the warning information of management station in the following manner in a preferred implementation of the embodiment of the invention: (be designated as: M) the first numbering with the current warning information that receives (is designated as: S) compare the maximum numbering of the warning information that management station will receive before receiving alarm information, wherein: if M+1<S, then management station determines that the warning information that is numbered M+1 to S-1 does not arrive, and the numbering of M+1 to S-1 is added the numbering set of the warning information that does not arrive; If M+1=S, then in the numbering set of the warning information that does not arrive, retrieve the second numbering H of the preorder warning information that whether has the current warning information that receives, if, then that described the second numbering H is related with described the first numbering S, after warning information corresponding to described the second numbering H arrives, number (H) front according to second, the first numbering (S) after order warning information and warning information corresponding to the first numbering (S) that the second numbering (H) is corresponding join the warning information that has received, if not, then the first warning information of numbering (S) is joined the warning information that has received; If S<M, then the warning information with the first numbering (S) joins the warning information that has received.Adopt this execution mode, management station can check the order whether the receiving alarm sequence of information meets the demands.
For example, in actual applications, after managed device receives that heartbeat checks message, can therefrom take out the maximum serial number M of the warning information that arrives management station, simultaneously, record the serial number C of the current warning information that oneself sends, calculate (M, C] interval serial number, then merge with the numbering set that is the warning information of arrival management station, obtain the numbering set (comprising the numbering of the warning information of packet loss) (for example, the alarm numbering formation of the warning information that do not arrive can be labeled as Q) of the new warning information that does not arrive management station, thereby determine the numbering of the warning information that need to resend to management station.
For example, managed device can be labeled as Q (1) with the formation of local alarm message buffer (namely having sent to the warning information of management station), behind the alarm numbering formation Q that obtains new not arrival (being above-mentioned wait retransmitting the set of judgement warning information), the taking-up warning information corresponding with numbering among the Q obtains new local alarm message buffer formation Q (2) (Q (2) is managed device needs the further repeating transmission for the treatment of of judging to judge the warning information set) from Q (1).
In a preferred embodiment of the present invention, when heartbeat checks that message arrives, managed device can obtain the very first time stamp (this timestamp can be designated as and wait to retransmit the time that each warning information of judging in the warning information set arrives management station) that heartbeat checks message, for waiting to retransmit each warning information of judging in the warning information set, managed device can obtain this warning information of indication and send the second timestamp of time, then judge further that whether the time difference of the second timestamp and very first time stamp is greater than default packet loss time threshold, if so, determine that then this warning information needs to retransmit.
For example, the timestamp that the managed device record takes out heartbeat inspection message is T (h), take out successively each element among the Q (2), record takes out the timestamp of this alarm again, is designated as T (a), calculates t=(T (h)-T (a)), t and predefined packet loss time threshold (are designated as: G) relatively, if t>G or t=G then add re-transmit queue with the warning information among the Q (2), and delete from local cache; If t<G then continues to wait for.
Step S106, the warning information corresponding to numbering of the warning information that managed device will be retransmitted with needs sends to management station.
In embodiments of the present invention, after warning information that managed device will need to retransmit sends to management station, managed device can also check that message determines to be managed the warning information of stand and successfully receiving according to heartbeat, and the deletion managed device be buffered in this locality and be managed the successfully warning information of reception of standing.
The said method that provides by the embodiment of the invention, whether can in time detect warning information has and loses, thereby timely to the warning information of management station's retransmits lost, and, the said method that adopts this bright embodiment to provide, management station's warning information that managed device sends in restarting process also can detect, thereby has guaranteed that these warning information can not be lost.In addition, in embodiments of the present invention, whether the order that the warning information that receives can also detect in management station is consistent with the sending order of equipment end.
Fig. 4 be management station in the preferred embodiment of the present invention to the process chart of the new warning information that receives, as shown in Figure 4, this flow process mainly may further comprise the steps:
Step 1, when webmaster (management station) system starts, the maximum alarm numbering M that initialization has received, the formation of the warning information of management station is not arrived in initialization, and at this moment, formation is empty;
In embodiments of the present invention, the initialization strategy can carry out synchronously the maximum alarm numbering M of managed device and management station, current alarm in setting up the communication link process, and after finishing synchronously, initialize queue is empty.
Step 2,3, receiving alarm information, and from the warning information of TRAP agreement, parse the numbering (S) of alarm and the preorder numbering (H) of binding (configuration);
Step 4, the size of comparison S and M is if S greater than M, then continues execution in step 9; If S less than M, then continues execution in step 5;
Step 5 is put into processing queue with the new alarm that receives, and waits for the processing threads processing;
Step 6 in not arriving formation, checks whether relevant alarm of S, if relevant alarm then continues execution in step 7, otherwise continues execution in step 8;
Step 7 is put into processing queue with the associated alarm of S, waits for the processing threads processing;
Step 8 never arrives and deletes S in the formation;
Step 9 judges whether S equals M+1, if equate, then execution in step 11, otherwise, continue execution in step 10;
Step 10, each integer in open interval (M, S) is constructed the ghost warning information for numbering, and puts into and do not arrive formation;
Step 11 judges that the alarm be numbered H whether in not arriving formation, if in formation, then continues execution in step 12; Otherwise, execution in step 14;
Step 12, the warning information of newly receiving is set to not arrive the associated alarm of the alarm that is numbered H in the formation, waits for after the alarm that is numbered H arrives and handling together;
Step 13 is upgraded the maximum alarm numbering that receives, and makes M=S;
Step 14 is put into processing queue with new alarm, waits for the processing threads processing.
In embodiments of the present invention, after managed device is issued management station with TRAP agreement warning information, a copy of this alarm can be cached in the local buffer memory as transmit queue, after managed device receives heartbeat and checks message, can also upgrade buffer memory.
For example, Fig. 5 is the process chart that the heartbeat of receiving is checked message according to the managed device of the embodiment of the invention, and as shown in Figure 5, this flow process mainly may further comprise the steps:
Step 1,2,3, receive the link setup command of management station after, set up communication link, synchronous altering message data, synchronous maximum alarm numbering;
Step 4 after the link establishment success, is received the heartbeat message that management station sends;
Step 5 is resolved heartbeat and is checked the data message that carries in the message, comprises that the maximum alarm numbering (M) that has arrived, the not arrival warning information sequence that management station finds out (are designated as: [N
1..., N
k]), management station's current alarm numbering (C) of gathering the timestamp (Tm) of above-mentioned information and getting access to from managed device;
Step 6, the size of comparison C and M, if C greater than M, continues execution in step 7, otherwise, execution in step 8;
Step 7, will (M, C] integer value in interval adds and do not arrive sequence, do not arrive sequence be updated to [N1 ..., Nk ..., Nc];
Step 8 will be managed the part deletion of receiving at the station in the buffer memory that sends a warning message, method is if the numbering of this warning information is not in arriving sequence, then deletion;
Step 9 scans the buffer queue that sent a warning message, and calculates current time (Tc) and management station's heartbeat message acquisition time
TMDifference, if difference is greater than timeout threshold (being the packet loss time threshold), then retransmit.
The alarm information reporting method that adopts above-described embodiment to provide, send heartbeat by management station to managed device and check message, can in time so that managed device (warning information transmitting terminal) knows whether send packet loss, solved the poor problem of promptness, simultaneously, preorder warning information by the current warning information of receiving of retrieval in not arriving the warning information formation, the sequence consensus of the warning information that the order that has guaranteed the warning information that managed device sends and management station receive, can Active repeat thereby can reach behind the timely discovery packet loss, and avoid the effect of unnecessary repeating transmission.
Corresponding with above-mentioned alarm information reporting method, the embodiment of the invention also provides a kind of warning information reporting device, and this device is positioned at the managed device side.
Fig. 6 is that this device comprises according to the structural representation of the warning information reporting device of the embodiment of the invention: the first receiver module 10, the first determination module 20 and the first sending module 30.Wherein, the first receiver module 10, the heartbeat that be used for to receive from management station checks message, wherein, this heartbeat checks that message carries indication in the number information of current heart beat cycle management station receiving alarm information state; The first determination module 20 is connected to the first receiver module 10, is used for according to number information and the numbering that the current alarm information that has sent is set by pipe, definite numbering that needs the warning information of repeating transmission; The first sending module 30 is connected to the first determination module 20, and warning information corresponding to numbering that is used for the warning information that will retransmit with needs sends to management station.
In a preferred implementation of the embodiment of the invention, above-mentioned number information comprises: the maximum numbering of the current warning information that has received of management station; As shown in Figure 7, in this preferred implementation, the first determination module 20 can comprise: obtain submodule 22, be used for number and check in heartbeat that warning information between the numbering of described maximum numbering that message carries and the current warning information that has sent of managed device adds and wait to retransmit during the judgement warning information gathers; Judge submodule 24, and obtain submodule 22 and is connected, be used for judging above-mentioned wait to retransmit each warning information of judging the warning information set whether be need to repeating transmission warning information.Adopt this execution mode, management station can send indication to managed device easily, and handling process is fairly simple.
In another preferred implementation of the embodiment of the invention, above-mentioned number information can also comprise: do not arrive the numbering set of the warning information of described management station; Then obtain submodule 22 also for the warning information corresponding with each numbering of this numbering set added above-mentioned treating in the set of repeating transmission judgement warning information.Adopt this execution mode, managed device need can determine the warning information of repeating transmission more accurately.
In a preferred implementation of the embodiment of the invention, as shown in Figure 8, judge that submodule 24 can comprise: the first acquiring unit 242 is used for obtaining the very first time stamp that above-mentioned heartbeat checks message; Second acquisition unit 244 is used for obtaining above-mentioned each warning information of retransmitting the set of judgement warning information of waiting and sends the second timestamp of time; Judging unit 246, are connected with second acquisition unit with the first acquiring unit 242 and are connected, be used for judging respectively that whether time difference that above-mentioned the second timestamp of waiting to retransmit each warning information of judging the warning information set and the very first time stab is greater than the packet loss time threshold of presetting, if so, determine that then this warning information needs to retransmit.
By the said apparatus that the embodiment of the invention provides, managed device can get access to the warning information of losing more timely, and in time retransmits, thereby has improved the reliability that warning information sends.
Fig. 9 is the structural representation according to the warning information reporting system of the embodiment of the invention, and as shown in Figure 7, this system comprises: management station 1 and managed device 2.Wherein, managed device 2 can comprise the warning information reporting device in above-described embodiment.
As shown in figure 10, management station 1 can comprise: the second receiver module 40, the second determination module 50 and the second sending module 60.Wherein, the second receiver module 40 is used for receiving the warning information that managed device sends, and wherein, carries its numbering in this warning information; The second determination module 50 is connected to the second receiver module 40, is used for determining the number information of indication management station 2 current receiving alarm information states; The second sending module 60 is connected to the second determination module 50, is used for sending heartbeat to managed device and checks message, and wherein, described heartbeat checks and carries the described number information that the second determination module described in the current heart beat cycle is determined in the message.
In the preferred implementation of the embodiment of the invention, above-mentioned number information can comprise: the maximum numbering of the current warning information that has received of described management station.
In another preferred implementation of the embodiment of the invention, above-mentioned number information can also comprise: do not arrive the numbering set of the warning information of described management station; Also carry the numbering of the preorder warning information of described warning information in the described warning information.Then as described in Figure 11, in this preferred implementation, the second determination module 50 can comprise: comparison module 52, be used for and compare at the first numbering S of the maximum numbering M that receives the warning information that has received before the described warning information and the current described warning information that receives, if M+1<S, determine that then the warning information that is numbered M+1 to S-1 does not arrive, trigger the numbering set that Executive Module 54 adds the numbering of M+1 to S-1 the warning information that does not arrive; If M+1=S then triggers retrieval module 56; Retrieval module 56, be used for whether depositing current the second numbering H that receives the preorder warning information of described warning information in the described numbering set retrieval of the warning information that does not arrive, if, then trigger Executive Module described the second numbering H is related with described the first numbering S, after warning information corresponding to described the second numbering H arrives, number H front according to described second, described the first numbering S after order will be described warning information and described first corresponding to the second numbering H number warning information corresponding to S and join the warning information that has received, if not, then trigger described Executive Module the 54 described first described warning information of numbering S are joined the warning information that has received; If S<M then triggers Executive Module 54 the described first described warning information of numbering S is joined the warning information that has received; Executive Module 54 is used for according to the comparative result of comparison module 52 and/or the result for retrieval of retrieval module 56, carries out accordingly and processes.
The above-mentioned warning information reporting system that adopts foregoing invention embodiment to provide, send heartbeat by management station to managed device and check message, can in time so that managed device (warning information transmitting terminal) knows whether send packet loss, solved the poor problem of promptness, simultaneously, preorder warning information by the current warning information of receiving of retrieval in not arriving the warning information formation, the sequence consensus of the warning information that the order that has guaranteed the warning information that managed device sends and management station receive, can Active repeat thereby can reach behind the timely discovery packet loss, and avoid the effect of unnecessary repeating transmission.
From above description, can find out, the present invention has realized following technique effect: management station is carried at heartbeat with the number information of the warning information that receives and checks in the message and send to managed device (warning information transmitting terminal), make managed device determine the numbering of the warning information that needs are retransmitted according to number information, the warning information that will need again to retransmit sends to the mode of management station, can in time so that managed device knows whether send packet loss, solved the poor problem of promptness of determining packet loss in the prior art, simultaneously, preorder warning information by the current warning information of receiving of retrieval in not arriving the warning information formation, the sequence consensus of the warning information that the order that has guaranteed the warning information that managed device sends and management station receive, and then only reached and namely can determine whether to send packet loss by a heart beat cycle, and make managed device timely, the warning information that automatically will lose resends the effect to management station.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the storage device and be carried out by calculation element, and in some cases, can carry out step shown or that describe with the order that is different from herein, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
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 modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.