CN105740129A - Warning method based on database trigger - Google Patents
Warning method based on database trigger Download PDFInfo
- Publication number
- CN105740129A CN105740129A CN201610070066.7A CN201610070066A CN105740129A CN 105740129 A CN105740129 A CN 105740129A CN 201610070066 A CN201610070066 A CN 201610070066A CN 105740129 A CN105740129 A CN 105740129A
- Authority
- CN
- China
- Prior art keywords
- alarm
- warning
- state value
- display
- trigger
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000003068 static effect Effects 0.000 claims abstract description 12
- 238000012790 confirmation Methods 0.000 claims abstract description 4
- 230000004397 blinking Effects 0.000 claims description 7
- 238000003780 insertion Methods 0.000 claims description 4
- 230000037431 insertion Effects 0.000 claims description 4
- 238000012856 packing Methods 0.000 claims description 3
- 238000011161 development Methods 0.000 abstract description 2
- 238000013461 design Methods 0.000 description 7
- 239000012141 concentrate Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/32—Monitoring with visual or acoustical indication of the functioning of the machine
- G06F11/324—Display of status information
- G06F11/325—Display of status information by lamps or LED's
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/32—Monitoring with visual or acoustical indication of the functioning of the machine
- G06F11/324—Display of status information
- G06F11/327—Alarm or error message display
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention belongs to the technical field of database system application and warning devices, and discloses a warning method based on a database trigger. A database (trigger) technology is adopted to execute comparison when a list where a state value is positioned is inserted and updated each time, and a warning library list is automatically updated after warning is judged. The warning method comprises a warning generation method, a warning display method and a warning operation method, wherein the warning generation method is characterized in that the state value a is compared with a warning threshold value b after the state value a is changed after the state value a is operated; the warning display method adopts a timing polling mechanism to query a warning library at each set time interval t; and the warning operation method confirms that warning is converted into static confirmation. The warning method is suitable for a majority of warning occasions and carries out uninterrupted refresh display on warning information, and therefore, an operator is more sensitive to the warning which is newly generated. The development difficulty of a foreground application system is lowered, a data nonsynchronous phenomenon brought by the failure in report and the repeated report of a multi-task distribution system is avoided, and the consistency and the accuracy of the warning information are improved.
Description
Technical field
The invention belongs to Database Systems application and alarm device technical field, particularly relate to a kind of alarm method based on database trigger.
Background technology
In the system that all kinds of requirement of real-times are higher, mostly relating to alarm function, the Obj State value a namely paid close attention to exceedes during setting threshold value b (a, b can be monodromes, it is also possible to be a class value), reports to the police at the main interface of system.
This process produces three crucial ins and outs problems.One is how to produce warning information.General way is, when this Obj State value is carried out a series of feature operation by user, immediately according to the state value after operation compared with threshold value, it is determined that after alarm, write alarm storehouse in main system immediately, thus obtaining warning information.This comparatively agrees with for single task system or to the system that this state value operation occasion is comparatively single, but to multiple task distributive system or operation occasion more when, its exploitation complexity will be greatly increased, simultaneously because the time reading a, b value is different, there will be the asynchronous problem of data, cause alarm by mistake or do not alert.
Two is how display alarm information.Generally having two ways, a kind of mode is instant playback, gives main system messaging display alarm information immediately while main system write alarm storehouse;Another way time display, sets fixed time interval t(and is generally hundreds of millisecond) poll alarm storehouse, it has been found that display in main system after having alarm.Alarm blinking red lamp occurs mostly in alarm device, and plays alarm sound.
Three is how to operate warning information.Relatively conventional way is, after producing new warning information, to click alarm icon display alarm information list, clicks alarm device after confirming and stops flashing and alarm sound; alarm device is with the normal bright display of static alarm red light; until state normally returns normally, alarm red light extinguishes, and green light lights.
Summary of the invention
For above-mentioned technical problem, the present invention provides a kind of alarm method based on database trigger.
The method can be substantially reduced the complexity of exploitation, and keeps the accurate synchronization of data.System foreground adopts timing separate threads to be polled inquiry, it is achieved alarm display, the operation of warning information is identical with common practice.
In order to realize foregoing invention purpose, the present invention adopts the following technical scheme that
A kind of alarm method based on database trigger, adopt database trigger (Trigger) technology, perform when state value place table being inserted, updated every time to compare, it is determined that after alarm, automatically update alarm storehouse table, including: alarm produces, alarm shows and alarm operation method
1), alarm producing method: after system is changed after state value a is operated, compared with alarm threshold b, after being judged to alarm, further judge whether this alarm exists, as being absent from, then write new alarm, otherwise do not deal with;When being judged to normal, still need to judge whether this alarm exists, work as existence, then alarm is made zero, when being absent from, be left intact;
2), alarm display packing: adopt automatic regular polling mechanism, every the interval t query warning storehouse set, as alarm quantity N=0, then show normal condition: red light goes out, green light Chang Liang;Work as N > 0, it is divided into two kinds of situations: a kind of for N includes newly generated alarm quantity n > 0, now need to carry out dynamically alarm display at main interface to remind operator: blinking red lamp, play alerting tone;Another kind is n=0, represents that alarm before this is all firmly established, currently without new alarm;Now only need to alert with static state display: red light is often bright;
3), alarm operation method: during newly generated alarm Dynamic Announce, alarm Dynamic Announce always alerts N and newly generated alarm quantity n more than zero, and blinking red lamp plays alerting tone;Operator carries out recalling display interface and confirming alarm, transfers static confirmation to;Alarm static state display N > 0, n=0, red light Chang Liang, stop alerting tone.
A kind of alarm method based on database trigger, described alarm produces to adopt the database trigger based on quantity of state, is after after alarm object information table performing insertion, updates, it is determined whether alarm;When have newly alert time, warning information table writes new record, whole process obtain warning information time completed by data base itself.
A kind of alarm method based on database trigger, specifically comprising the following steps that of described alarm producing method
(1), have changed state value a compared with threshold alarm threshold value b, carry out alarm and judge;State value a is the current stock sum of equipment, and threshold alarm threshold value b is stock's lower limit;
As a >=b time, without departing from thresholding;Do not produce alarm
When a < during b, produces alarm beyond thresholding;
(2), after being judged to alarm, further judge whether this alarm exists,
As being absent from, then write new alarm, otherwise do not deal with;
(3), when being judged to normal, still need to judge whether this alarm exists, work as existence, then alarm is made zero, when being absent from, be left intact.
Owing to adopting technique scheme, the present invention has following superiority:
A kind of alarm method based on database trigger, produces flow process in alarm and is applicable to great majority alarm occasion.Flow for displaying adopts automatic regular polling mechanism, it is possible to concentrate and warning information uninterruptedly refreshes display, adopts the mode that Dynamic Announce combines with static state display in addition so that operator is more sensitive to newly generated alarm.
The present invention alerts the flip-flop design based on quantity of state of generation information, adopts database trigger technology, is automatically performed by data base when obtaining warning information.Its advantage is the reduction of the development difficulty of foreground application system, it is to avoid multiple task distributive system is failed to report, repeated to report the data brought asynchronous, improves concordance and the accuracy of warning information.
Accompanying drawing explanation
Fig. 1 produces flow chart based on the alarm of database trigger.
Fig. 2 is based on the alarm flow for displaying figure of database trigger.
Fig. 3 is based on the alarm operation flow chart of database trigger.
Detailed description of the invention
Below in conjunction with accompanying drawing, the present invention will be further described.
As shown in Figure 1, 2, 3, a kind of alarm method based on database trigger, adopt database trigger (Trigger) technology, perform when state value place table being inserted, updated every time to compare, alarm storehouse table is automatically updated after judging alarm, including: alarm generation, alarm display and alarm operation method;
1), alarm producing method: after system is changed after state value a is operated, compared with alarm threshold b, after being judged to alarm, further judge whether this alarm exists, as being absent from, then write new alarm, otherwise do not deal with;When being judged to normal, still need to judge whether this alarm exists, work as existence, then alarm is made zero, when being absent from, be left intact;
2), alarm display packing: adopt automatic regular polling mechanism, every the interval t query warning storehouse set, as alarm quantity N=0, then show normal condition: red light goes out, green light Chang Liang;Work as N > 0, it is divided into two kinds of situations: a kind of for N includes newly generated alarm quantity n > 0, now need to carry out dynamically alarm display at main interface to remind operator: blinking red lamp, play alerting tone;Another kind is n=0, represents that alarm before this is all firmly established, currently without new alarm;Now only need to alert with static state display: red light is often bright;
3), alarm operation method: during newly generated alarm Dynamic Announce, alarm Dynamic Announce always alerts N and newly generated alarm quantity n more than zero, and blinking red lamp plays alerting tone;Operator carries out recalling display interface and confirming alarm, transfers static confirmation to;Alarm static state display N > 0, n=0, red light Chang Liang, stop alerting tone.
Described alarm produces to adopt the database trigger based on quantity of state, is after after alarm object information table performing insertion, updates, it is determined whether alarm;When have newly alert time, warning information table writes new record, whole process obtain warning information time completed by data base itself.
Specifically comprising the following steps that of described alarm producing method
(1), have changed state value a compared with threshold alarm threshold value b, carry out alarm and judge;State value a is the current stock sum of equipment, and threshold alarm threshold value b is stock's lower limit;
As a >=b time, without departing from thresholding;Do not produce alarm
When a < during b, produces alarm beyond thresholding;
(2), after being judged to alarm, further judge whether this alarm exists,
As being absent from, then write new alarm, otherwise do not deal with;
(3), when being judged to normal, still need to judge whether this alarm exists, work as existence, then alarm is made zero, when being absent from, be left intact.
For ease of describing, for by dress depositary management, monitored object table is that warning information table is bzfw_warninginfo is example by dress information table bzfw_bzinfo.State value a is the current stock sum of equipment, and threshold value b is stock's lower limit, when a < during b, produces alarm.
The alarm partial design of following equipment information table is as follows:
Table 1 equipment information table alarm partial design
Wherein alert end time, acknowledged alarm time and affirmant's id field and allow for sky (NULL).Above table designs in SQLserver, it is possible to adopt similar designs in the data bases such as Oracle, mySQL.
Flip-flop design is the core of alarm module design, produces flow process for alarm, and after when equipment information table bzinfo performing insertion, updating (after), it is determined whether alarm, key code is as follows:
Designing according to flow for displaying, need to set up poll thread, timing query warning information table in host process, obtain total alarm N and newly generated alarm quantity n, pass to main frame by message mechanism afterwards, main frame is according to which kind of display mode is the value of N and n determine.It should be noted that in poll thread, same database connection object can not be shared with system main frame otherwise easily occur inquiry vernier conflict causing system break.
Claims (3)
1. the alarm method based on database trigger, it is characterized in that: adopt database trigger (Trigger) technology, perform when state value place table being inserted, updated every time to compare, alarm storehouse table is automatically updated after judging alarm, including: alarm produces, alarm shows and alarm operation method
1), alarm producing method: after system is changed after state value a is operated, compared with alarm threshold b, after being judged to alarm, further judge whether this alarm exists, as being absent from, then write new alarm, otherwise do not deal with;When being judged to normal, still need to judge whether this alarm exists, work as existence, then alarm is made zero, when being absent from, be left intact;
2), alarm display packing: adopt automatic regular polling mechanism, every the interval t query warning storehouse set, as alarm quantity N=0, then show normal condition: red light goes out, green light Chang Liang;Work as N > 0, it is divided into two kinds of situations: a kind of for N includes newly generated alarm quantity n > 0, now need to carry out dynamically alarm display at main interface to remind operator: blinking red lamp, play alerting tone;Another kind is n=0, represents that alarm before this is all firmly established, currently without new alarm;Now only need to alert with static state display: red light is often bright;
3), alarm operation method: during newly generated alarm Dynamic Announce, alarm Dynamic Announce always alerts N and newly generated alarm quantity n more than zero, and blinking red lamp plays alerting tone;Operator carries out recalling display interface and confirming alarm, transfers static confirmation to;Alarm static state display N > 0, n=0, red light Chang Liang, stop alerting tone.
2. based on an alarm method for database trigger, it is characterized in that: described alarm produces to adopt the database trigger based on quantity of state, be after after alarm object information table being performed insertion, updates, it is determined whether alarm;When have newly alert time, warning information table writes new record, whole process obtain warning information time completed by data base itself.
3. based on an alarm method for database trigger, it is characterized in that: specifically comprising the following steps that of described alarm producing method
(1), have changed state value a compared with threshold alarm threshold value b, carry out alarm and judge;State value a is the current stock sum of equipment, and threshold alarm threshold value b is stock's lower limit;
As a >=b time, without departing from thresholding;Do not produce alarm
When a < during b, produces alarm beyond thresholding;
(2), after being judged to alarm, further judge whether this alarm exists,
As being absent from, then write new alarm, otherwise do not deal with;
(3), when being judged to normal, still need to judge whether this alarm exists, work as existence, then alarm is made zero, when being absent from, be left intact.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610070066.7A CN105740129A (en) | 2016-02-02 | 2016-02-02 | Warning method based on database trigger |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610070066.7A CN105740129A (en) | 2016-02-02 | 2016-02-02 | Warning method based on database trigger |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105740129A true CN105740129A (en) | 2016-07-06 |
Family
ID=56242030
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610070066.7A Pending CN105740129A (en) | 2016-02-02 | 2016-02-02 | Warning method based on database trigger |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105740129A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5838891A (en) * | 1995-03-22 | 1998-11-17 | Mitsubishi Denki Kabushiki Kaisha | Data storage system and storage managing method |
CN104391865A (en) * | 2014-10-24 | 2015-03-04 | 浪潮软件股份有限公司 | Method for realizing operation log recording based on trigger principle |
CN104462078A (en) * | 2013-09-12 | 2015-03-25 | 方正信息产业控股有限公司 | XML (extensive markup language) database trigger implementing method and device and XML database |
CN104598531A (en) * | 2014-12-25 | 2015-05-06 | 广东电子工业研究院有限公司 | Incremental data migration method among heterogeneous relational databases based on trigger |
-
2016
- 2016-02-02 CN CN201610070066.7A patent/CN105740129A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5838891A (en) * | 1995-03-22 | 1998-11-17 | Mitsubishi Denki Kabushiki Kaisha | Data storage system and storage managing method |
CN104462078A (en) * | 2013-09-12 | 2015-03-25 | 方正信息产业控股有限公司 | XML (extensive markup language) database trigger implementing method and device and XML database |
CN104391865A (en) * | 2014-10-24 | 2015-03-04 | 浪潮软件股份有限公司 | Method for realizing operation log recording based on trigger principle |
CN104598531A (en) * | 2014-12-25 | 2015-05-06 | 广东电子工业研究院有限公司 | Incremental data migration method among heterogeneous relational databases based on trigger |
Non-Patent Citations (1)
Title |
---|
STEVEN M.BOBROWSKI: "《Oracle7与客户/服务器计算技术从入门到精通》", 31 January 1996 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP4060942A1 (en) | Configuration anomaly detection method, server and storage medium | |
US10147398B2 (en) | Display control method and device | |
CN105183860B (en) | Method of data synchronization and system | |
CN112328456B (en) | Cluster resource monitoring system based on service discovery | |
WO2019118150A1 (en) | Enhanced processing and communication of file content for analysis | |
CN104765843B (en) | A kind of Graphic Interface Control method for electric power real-time monitoring system | |
CN104516966A (en) | High-availability solving method and device of database cluster | |
CN104272235A (en) | Changing animation displayed to user | |
CN102231161A (en) | Method for synchronously verifying and monitoring databases | |
CN111767296A (en) | Method, apparatus, electronic device, and readable storage medium for synchronizing data | |
CN106909429A (en) | A kind of synchronous upgrade method and device | |
CN105786462A (en) | Boot method | |
CN110717130A (en) | Dotting method, dotting device, dotting terminal and storage medium | |
CN105740129A (en) | Warning method based on database trigger | |
CN107168822B (en) | Oracle streams exception recovery system and method | |
EP3519966B1 (en) | Non-coupled software lockstep | |
WO2021082868A1 (en) | Data managmenet method for distributed storage system, apparatus, and electronic device | |
US20110029582A1 (en) | Method and device for storing data belonging to an alarm or event message containing multiple attributes | |
CN112181528A (en) | Management method and device for configuration file of micro-service | |
CN104821967A (en) | Push message display method and device | |
CN111984723A (en) | Data synchronization method and device and terminal equipment | |
CN107450992B (en) | Method, storage medium, device and system for synchronous communication between title bar and popup bar | |
CN107797782A (en) | Alarm display device and method | |
CN105264825B (en) | Warning system and method for processing alarm message | |
CN115904575A (en) | Multi-terminal plotting method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160706 |
|
RJ01 | Rejection of invention patent application after publication |