Summary of the invention
The shortcoming of prior art in view of the above, WebSocket in a kind of network management system is the object of the present invention is to provide to push the method and system of warning information, NM server carries out buffer memory to needing the warning information sent, by needing the warning information number pushed in monitoring unit interval sheet, dynamic conditioning WebSocket pushes the size of the timeslice window of warning information, warning information in timeslice window is merged into an alarm information and be sent to client, thus the real-time that alarm information pushes can be ensured, can network throughput be reduced again.
For achieving the above object and other relevant objects, the invention provides WebSocket in a kind of network management system and push the method for warning information, comprise the following steps: arrange WebSocket push warning information unit interval sheet and maximum time sheet size; Using unit interval sheet as current time sheet window, the warning information that the equipment received current time sheet window NM server reports carries out buffer memory, and at the end of current time sheet window, the warning information of buffer memory is merged into an information and push to client by WebSocket; The number of the warning information that monitoring current time sheet window pushes, the number of the warning information that unit of account timeslice pushes; If the number of the warning information that unit interval sheet pushes is less than predetermined threshold value lower limit, then reduce the size of current time sheet window; If the number of the warning information that unit interval sheet pushes is greater than the predetermined threshold value upper limit, then increase the size of current time sheet window; If the number of the warning information that unit interval sheet pushes is between predetermined threshold value lower limit and the predetermined threshold value upper limit, then keep the size of current time sheet window constant.
In one embodiment of the invention, when reducing the size of current time sheet window, current time sheet window is reduced the size of a unit interval sheet.
In one embodiment of the invention, when reducing the size of current time sheet window, if the current time gate mouth after reducing is less than or equal to unit interval sheet, then using unit interval sheet as current time sheet window.
In one embodiment of the invention, when increasing the size of current time sheet window, current time sheet window is increased the size of a unit interval sheet.
In one embodiment of the invention, when increasing the size of current time sheet window, if the current time sheet window after increasing is more than or equal to maximum time sheet, then using maximum time sheet as current time sheet window.
Meanwhile, the present invention also provides WebSocket in a kind of network management system to push the system of warning information, it is characterized in that: comprise and arrange module, buffer memory pushing module, monitoring calculation module and adjusting module;
Described arrange module for arrange WebSocket push warning information unit interval sheet and maximum time sheet size;
Described buffer memory pushing module is used for unit interval sheet as current time sheet window, the warning information that the equipment received current time sheet window NM server reports carries out buffer memory, and at the end of current time sheet window, the warning information of buffer memory is merged into an information and push to client by WebSocket;
The number of warning information of described monitoring calculation module for monitoring current time sheet window and pushing, the number of the warning information that unit of account timeslice pushes;
The number that described adjusting module is used for the warning information pushed at unit interval sheet to be less than under predetermined threshold value in limited time, reduces the size of current time sheet window; The number of the warning information pushed at unit interval sheet to be greater than in predetermined threshold value in limited time, increases the size of current time sheet window; The number of the warning information pushed at unit interval sheet, between predetermined threshold value lower limit and the predetermined threshold value upper limit, keeps the size of current time sheet window constant.
In one embodiment of the invention, when reducing the size of current time sheet window, current time sheet window is reduced the size of a unit interval sheet.
In one embodiment of the invention, when reducing the size of current time sheet window, if the current time gate mouth after reducing is less than or equal to unit interval sheet, then using unit interval sheet as current time sheet window.
In one embodiment of the invention, when increasing the size of current time sheet window, current time sheet window is increased the size of a unit interval sheet.
In one embodiment of the invention, when increasing the size of current time sheet window, if the current time sheet window after increasing is more than or equal to maximum time sheet, then using maximum time sheet as current time sheet window.
As mentioned above, in network management system of the present invention, WebSocket pushes the method and system of warning information, has following beneficial effect:
(1) when unit interval sheet propelling movement warning information amount is larger, the current time sheet window pushed is increased;
(2) when unit interval sheet propelling movement warning information amount is smaller, the current time sheet window of less propelling movement;
(3) many warning information are incorporated in a piece of news are pushed by WebSocket, decrease the communication pressure of server/customer end, ensure that the real-time that alarm information pushes.
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this specification can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this specification also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.It should be noted that, when not conflicting, the feature in following examples and embodiment can combine mutually.
It should be noted that, the diagram provided in following examples only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
In network management system of the present invention, the method and system of WebSocket propelling movement warning information carry out buffer memory to needing the warning information pushed, and are sent to client together after being merged by the warning information in timeslice window; Monitor the number of the alarm information pushed in unit interval sheet simultaneously, if the number of alarm information exceedes predetermined threshold value in unit interval sheet, then increase the size of timeslice window; If the number of warning information is less than predetermined threshold value in unit interval sheet, then reduce the size of timeslice window.
With reference to Fig. 2, in network management system of the present invention, the method for WebSocket propelling movement warning information comprises the following steps:
Step S1, arrange WebSocket push warning information unit interval sheet and maximum time sheet size.
Wherein, unit interval sheet is the minimum interval of WebSocket propelling movement needed for warning information.Sheet was WebSocket and pushed the maximum time interval that limits of warning information maximum time.Setting unit interval sheet be T0, maximum time sheet be TP.Preferably, sheet is the integral multiple of unit timeslice maximum time.
Step S2, using unit interval sheet as current time sheet window, the warning information that the equipment received current time sheet window NM server reports carries out buffer memory, and at the end of current time sheet window, the warning information of buffer memory is merged into an information and push to client by WebSocket.
With prior art, NM server once pushes difference for the every bar warning information received, the warning information buffer memory on NM server first received by current time sheet window in the present invention.If current time sheet window is TK.
The number of the warning information that step S3, monitoring current time sheet window push, the number of the warning information that unit of account timeslice pushes.
Particularly, if the number of warning information that current time sheet window pushes is m, then the number n=m*T0/TK of warning information that pushes of unit interval sheet.
If the number of the warning information that step S4 unit interval sheet pushes is less than predetermined threshold value lower limit, then reduce the size of current time sheet window; If the number of the warning information that unit interval sheet pushes is greater than the predetermined threshold value upper limit, then increase the size of current time sheet window; If the number of the warning information that unit interval sheet pushes is between predetermined threshold value lower limit and the predetermined threshold value upper limit, then keep the size of current time sheet window constant.
Preferably, when reducing the size of current time sheet window, current time sheet window is reduced the size of a unit interval sheet.More preferably, if reduce after current time gate mouth be less than or equal to unit interval sheet, then using unit interval sheet as current time sheet window.
Preferably, when increasing the size of current time sheet window, current time sheet window is increased the size of a unit interval sheet.More preferably, if increase after current time sheet window be more than or equal to maximum time sheet, then using maximum time sheet as current time sheet window.
As shown in Figure 3, when after the method adopting WebSocket propelling movement warning information in network management system of the present invention, warning information 1 is sent at T1 timeslice window, warning information 2 and 3 is sent at T2 timeslice window, warning information 4,5,6 and 7 is sent at T3 timeslice window, by that analogy, warning information m is sent at Tm timeslice window.By such warning information method for pushing, can ensure the real-time that alarm information pushes can reduce network throughput again.
With reference to Fig. 4, the system that in network management system of the present invention, WebSocket pushes warning information comprises and arranges module 1, buffer memory pushing module 2, monitoring calculation module 3 and adjusting module 4.
Arrange module 1 for arrange WebSocket push warning information unit interval sheet and maximum time sheet size.
Wherein, unit interval sheet is the minimum interval of WebSocket propelling movement needed for warning information.Sheet was WebSocket and pushed the maximum time interval that limits of warning information maximum time.Setting unit interval sheet be T0, maximum time sheet be TP.Preferably, sheet is the integral multiple of unit timeslice maximum time.
Buffer memory pushing module 2 with module 1 be set be connected, for using unit interval sheet as current time sheet window, the warning information that the equipment received current time sheet window NM server reports carries out buffer memory, and at the end of current time sheet window, the warning information of buffer memory is merged into an information and push to client by WebSocket.
With prior art, NM server once pushes difference for the every bar warning information received, the warning information buffer memory on NM server first received by current time sheet window in the present invention.If current time sheet window is TK.
Monitoring calculation module 3 is connected with buffer memory pushing module 2, for monitoring the number of the warning information that current time sheet window pushes, and the number of the warning information that unit of account timeslice pushes.
Particularly, if the number of warning information that current time sheet window pushes is m, then the number n=m*T0/TK of warning information that pushes of unit interval sheet.
Adjusting module 4 with module 1 be set be connected with monitoring calculation module 3, to be less than under predetermined threshold value in limited time for the number of the warning information pushed at unit interval sheet, to reduce the size of current time sheet window; The number of the warning information pushed at unit interval sheet to be greater than in predetermined threshold value in limited time, increases the size of current time sheet window; The number of the warning information pushed at unit interval sheet, between predetermined threshold value lower limit and the predetermined threshold value upper limit, keeps the size of current time sheet window constant.
Preferably, when reducing the size of current time sheet window, current time sheet window is reduced the size of a unit interval sheet.More preferably, if reduce after current time gate mouth be less than or equal to unit interval sheet, then using unit interval sheet as current time sheet window.
Preferably, when increasing the size of current time sheet window, current time sheet window is increased the size of a unit interval sheet.More preferably, if increase after current time sheet window be more than or equal to maximum time sheet, then using maximum time sheet as current time sheet window.
In sum, in network management system of the present invention, WebSocket pushes the method and system of warning information when unit interval sheet propelling movement warning information amount is larger, increases the current time sheet window pushed; When unit interval sheet propelling movement warning information amount is smaller, the current time sheet window of less propelling movement; Many warning information are incorporated in a piece of news and are pushed by WebSocket, decrease the communication pressure of server/customer end, ensure that the real-time that alarm information pushes.So the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.