Summary of the invention
The features and advantages of the present invention are partly stated in the following description, or can be apparent from this description, or learn by putting into practice the present invention.
For overcoming the problem of prior art, the invention provides a kind of network alarm and concentrate method for pushing, the method comprises: by front end receiver to pending alert information carry out concentrate gather; Carry out unified code identification to each alert information according to source to form pending alert list and enter cache memory section and store; Traversal high-speed cache judges whether alert information meets predetermined alert and push rule, when meeting, according to predetermined alert push rule alert information formed current connect the pending list of client of dealing with emergencies and dangerous situations and be pushed to the client of dealing with emergencies and dangerous situations that connects of specifying carry out subsequent treatment, described predetermined alert pushes the alert of rale store in described cache memory section and pushes in list of rules, and described predetermined alert propelling movement rule comprises to be determined alert information to be sent to specifically to connect client of dealing with emergencies and dangerous situations according to alert classification; The described client of dealing with emergencies and dangerous situations that connects of specifying obtains alert details according to the code identification of described alert information, and the described alert information being acquired alert details is locked in described cache memory section; Described specify connect after client of dealing with emergencies and dangerous situations carries out renewal rewards theory to the described alert information being acquired alert details, unlock.
Wherein, alert information comprises following one of them or combination in any: alert ID, receiving host machine numbering, alarm host machine numbering, alarm code, time of fire alarming.
Further, unified code identification comprises following one of them or combination in any: alert ID, receiving host machine numbering, alarm host machine numbering.
Further, concentrate gather also comprise to alert information newly-increased, delete or renewal rewards theory.
Further, when alert information have newly-increased, upgrade or deletion action cause alert data to change time, by alert pushing module by change after alert information according to predetermined alert push rule be pushed to specify connect client of dealing with emergencies and dangerous situations.
Further, pushing according to predetermined alert before rule is pushed to connecing of specifying client of dealing with emergencies and dangerous situations carries out subsequent treatment, connecing client of dealing with emergencies and dangerous situations and first by logging in after authentication, and will press the initial pending alert list of alert propelling movement Rule.
Further, when described alert information have newly-increased, upgrade or deletion action cause alert data to change time, described in connect client of dealing with emergencies and dangerous situations according to the particular message be pushed to, do corresponding data and interface renewal.
Preferably, after pushing rule according to predetermined alert client of dealing with emergencies and dangerous situations carries out subsequent treatment to connecing of specifying by alert information pushing, also comprise: by described alert information deletion from the pending alert list of high-speed buffer.
Present invention also offers a kind of network alarm and concentrate pusher, this device comprises: alert information concentrates summarizing module, for by front end receiver to alert information by the unified write of receive a crime report server calls the corresponding interface or function after carry out concentrating and gather; Coding module, for carrying out unified code identification to each alert according to source and form pending alert list; Memory module, for opening up cache memory section, stores pending alert list and alert propelling movement list of rules; Alert pushing module, judge whether alert information meets predetermined alert and push rule for traveling through high-speed cache, when meeting, according to predetermined alert push rule alert formed current connect the pending list of client of dealing with emergencies and dangerous situations and be pushed to the client of dealing with emergencies and dangerous situations that connects of specifying carry out subsequent treatment, described predetermined alert pushes rule and comprises and determines alert information to be sent to specifically to connect client of dealing with emergencies and dangerous situations according to alert classification; The described client of dealing with emergencies and dangerous situations that connects of specifying obtains alert details according to the code identification of described alert information, and the described alert information being acquired alert details is locked in described cache memory section; Described specify connect after client of dealing with emergencies and dangerous situations carries out renewal rewards theory to the described alert information being acquired alert details, unlock.
Further, described the corresponding interface is Rest, WebService or http interface.
Further, memory module, except storing pending alert list, also stores alert and pushes list of rules.
Realized by the technology of technical solution of the present invention, compared with the existing technology, at least possesses following advantage: by the rule of alert forwarding flexibly, classify according to alert information source, improve alert forwarding speed significantly, effective utilization connects the resource of client of dealing with emergencies and dangerous situations, and improves the speed of dealing with emergencies and dangerous situations, and can realize processing warning concurrent greatly in time.
By reading instructions, those of ordinary skill in the art will understand the characteristic sum content of these technical schemes better.
Embodiment
Below in conjunction with accompanying drawing, specific embodiment of the invention is described in further detail.
Please refer to Fig. 1, overall technological scheme of the present invention is: by front end receiver to new alert information concentrate summarizing module to carry out concentrating and gather by server calls REST interface of receiving a crime report unified write alert information, and according to source, unified code identification is carried out to each alert information form pending alert list and enter cache memory section and store, be pushed to the client of dealing with emergencies and dangerous situations that connects of specifying according to predetermined alert propelling movement rule by alert pushing module and carry out subsequent treatment, until after this alert information processing, delete from the pending alert list of high-speed buffer.Generally speaking, to connect deal with emergencies and dangerous situations relevant data or resource all can stored in the cache memory section in receiving host machine, as pending alert list and alert push rale store, connect client of dealing with emergencies and dangerous situations and can be 1-N, as long as logged in by authentication, and after pressing the initial pending alert list of alert propelling movement Rule, can process.
Be further described cache memory section below, cache memory section is the storage space opened up specially.
1) the alert information associated data object defined declaration of cache memory section:
In general, unified code identification comprises following one of them or combination in any: alert ID, receiving host machine numbering, alarm host machine numbering, but, than more preferably, should be alert ID+ receiving host machine numbering, or alert ID+ alarm host machine numbering.
2) data buffer storage defined declaration:
3) data buffer storage initializing declaration:
High-speed cache adopts TreeMap (orderly key-value pair) object to store, and in order to improve new alert acquisition speed, pushing rule, the value of the key name in TreeMap be defined as in conjunction with alert:
[alarm answering machine chief editor number] _ [alarm host machine numbering] _ alert ID
In order to allow those skilled in the art fully understand better, special with following table for illustrating.
Upgrade interface specification about data acquisition, the interface of open data acquisition and renewal, converge each server and connect the data that client of dealing with emergencies and dangerous situations transmits of receiving a crime report in real time, data buffer storage is upgraded.
Push rule declaration about alert, alert pushes rule and mainly refers to and determine to be sent to according to alert source or the classification of alert the mode specifically connecing client of dealing with emergencies and dangerous situations, and is generally systemic presupposition, also can adjusts renewal in real time according to the specific demand of concrete business.Alert once have newly-increased, upgrade, the operation such as to remove and cause pending alert data to change, will by alert by push rule be pushed to specify connect client of dealing with emergencies and dangerous situations.Following table is the example that alert pushes rule:
Realize about technical scheme specific procedure:
A) server end is based on J2EE (Java 2Platform, Enterprise Edition, i.e. Java 2 Platform Enterprise Edition) realize, data-interface adopts Rest (Representational State Transfer, the transfer of declarative state) mode provides service, and connects client of dealing with emergencies and dangerous situations and communicated by Socket, and so-called socket is usually also referred to as " socket ", for describing IP address and port, it is the handle of a communication chain.Application program sends request or response network request by " socket " to network usually;
B) generation of new alert calls by alert receipt module the write that Rest interface completes new alert;
C) connect client of dealing with emergencies and dangerous situations can cross and call acquisition and the process that Rest interface completes alert.
Alert obtains and update notification treatment step:
1) connect client logs of dealing with emergencies and dangerous situations, what obtain current login connects client id of dealing with emergencies and dangerous situations, and by getAlarmList interface, pushes Rule originally connect the pending alert list of client of dealing with emergencies and dangerous situations according to the alert of definition;
2) if pending alert have newly-increased, upgrade, when removing, connect client of dealing with emergencies and dangerous situations and do corresponding interface according to the message be pushed to and upgrade.
Connect when dealing with emergencies and dangerous situations client first login, obtain pending alert list by Rest, WebService or http interface, Fig. 2 is the schematic diagram that mode by traveling through high-speed cache obtains pending alert list, as can be seen from the figure, mainly comprises the steps:
101, first acquisition connects client id of dealing with emergencies and dangerous situations; 102, key is undertaken splitting into array by underscore; If the alarm host machine that the receiving host machine of 103 arrays [1] correspondence is corresponding with array [2] meets the current alert connecing client id of dealing with emergencies and dangerous situations and pushes rule; If yes then enter 104, join current connecing in the pending list of client of dealing with emergencies and dangerous situations, otherwise continue traversal high-speed cache; 105, current connecing in the pending list of client of dealing with emergencies and dangerous situations is returned.
When there being new alert to produce, server of receiving a crime report calls REST interface and carries out alert write after receiving alert, and idiographic flow as shown in Figure 3, mainly comprises following several step:
201, receiving host machine numbering corresponding to new alert, alarm host machine numbering and other attribute informations of alert are obtained.
202, produce key according to receiving host machine numbering, alarm host machine numbering, alert ID, put into high-speed cache.
203, number to push rule to find from alert according to receiving host machine numbering and alarm host machine and corresponding connect client id of dealing with emergencies and dangerous situations.
204, sending message informing corresponding connecing client of dealing with emergencies and dangerous situations by SOCKET and have new alert, upgrading pending list by connecing client of dealing with emergencies and dangerous situations.
When needs upgrade alert, connect and deal with emergencies and dangerous situations client when processing alert, call REST interface and alert data are upgraded, notify that connecing client of dealing with emergencies and dangerous situations accordingly upgrades simultaneously.In order to ensure that the pending alert of synchronization can only be connect by one client of dealing with emergencies and dangerous situations and open, and carrying out Data Update, needing single to judge whether alert locks, if locked, can not open, must wait for that alert unlocks opening to receive a crime report.Further, can Fig. 4 be consulted, specifically comprise the steps:
301, according to pending alert key, call REST interface and obtain alert details.
302, judge whether be 1 to alert locking attribute if putting, then represent in this way and connect by other client-side lock of dealing with emergencies and dangerous situations, if locked, then can not upgrade.Otherwise enter step 303.
303, lock alert, the locking attribute of the object of key corresponding in high-speed cache is set to 1.Enter step 304.
304, send message informing corresponding connecing client alert of dealing with emergencies and dangerous situations by SOCKET to be locked.Enter step 305.
305, upgrade alert, close list of receiving a crime report, the locking attribute of the object of key corresponding in high-speed cache is set to 0, unlocks, enter step 306
306, sending message informing corresponding connecing client of dealing with emergencies and dangerous situations by SOCKET has alert to upgrade, and upgrades pending list by connecing client of dealing with emergencies and dangerous situations.
When pending alert list is after being disposed, need the alert this be disposed from this list to delete, idiographic flow refers to Fig. 5, comprises the steps:
401, according to pending alert key, call REST interface and remove alert.
402, judge whether be 1 to alert locking attribute if putting, then represent in this way and connect by other client-side lock of dealing with emergencies and dangerous situations, if locked, then can not remove, otherwise enter step 403.
403, upgrade alert, close list of receiving a crime report, remove alert, remove from high-speed cache.
404, sending message informing corresponding connecing client of dealing with emergencies and dangerous situations by SOCKET has alert to upgrade, and upgrades pending list by connecing client of dealing with emergencies and dangerous situations.
Pusher is concentrated corresponding to the network alarm realizing the inventive method, as shown in Figure 6, this alert concentrates pusher 5 and several to connect to deal with emergencies and dangerous situations client 1 end to be connected, this device comprises: alert information concentrates summarizing module 501, for by front end receiver to alert information by the unified write of receive a crime report server calls REST interface or specific function after carry out concentrating and gather; Coding module 502, for carrying out unified code identification to each alert according to source and form pending alert list; Memory module 503, for opening up cache memory section, stores pending alert list and alert propelling movement list of rules; Alert pushing module 504, carries out subsequent treatment for alert being pushed to the client of dealing with emergencies and dangerous situations that connects of specifying according to predetermined alert propelling movement rule.Similarly, memory module, except storing pending alert list, also stores alert and pushes list of rules.
Above with reference to the accompanying drawings of the preferred embodiments of the present invention, those skilled in the art do not depart from the scope and spirit of the present invention, and multiple flexible program can be had to realize the present invention.For example, to illustrate as the part of an embodiment or the feature that describes can be used for another embodiment to obtain another embodiment.These are only the better feasible embodiment of the present invention, not thereby limit to interest field of the present invention that the equivalence change that all utilizations instructions of the present invention and accompanying drawing content are done all is contained within interest field of the present invention.