CN105740129A - Warning method based on database trigger - Google Patents

Warning method based on database trigger Download PDF

Info

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
Application number
CN201610070066.7A
Other languages
Chinese (zh)
Inventor
韩慧
孟晓鑫
郝晓军
孙晓东
董俊
曹勇
许雄
吴若无
冯润明
许博浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
STATE KEY LABORATORY OF COMPLEX ELECTROMAGNETIC ENVIRONMENTAL EFFECTS ON ELECTRONICS & INFORMATION SYSTEM
Original Assignee
STATE KEY LABORATORY OF COMPLEX ELECTROMAGNETIC ENVIRONMENTAL EFFECTS ON ELECTRONICS & INFORMATION SYSTEM
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by STATE KEY LABORATORY OF COMPLEX ELECTROMAGNETIC ENVIRONMENTAL EFFECTS ON ELECTRONICS & INFORMATION SYSTEM filed Critical STATE KEY LABORATORY OF COMPLEX ELECTROMAGNETIC ENVIRONMENTAL EFFECTS ON ELECTRONICS & INFORMATION SYSTEM
Priority to CN201610070066.7A priority Critical patent/CN105740129A/en
Publication of CN105740129A publication Critical patent/CN105740129A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/325Display of status information by lamps or LED's
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm 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

A kind of alarm method based on database trigger
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.
CN201610070066.7A 2016-02-02 2016-02-02 Warning method based on database trigger Pending CN105740129A (en)

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)

* Cited by examiner, † Cited by third party
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 recording operation logs 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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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 recording operation logs 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)

* Cited by examiner, † Cited by third party
Title
STEVEN M.BOBROWSKI: "《Oracle7与客户/服务器计算技术从入门到精通》", 31 January 1996 *

Similar Documents

Publication Publication Date Title
US10147398B2 (en) Display control method and device
CN112328456B (en) Cluster resource monitoring system based on service discovery
CN109933633B (en) Operation and maintenance knowledge graph construction method based on time and scene dimension
CN104360878B (en) A kind of method and device of application software deployment
CN104778102A (en) Master-slave switching method and system
EP3724837A1 (en) Enhanced processing and communication of file content for analysis
CN104272235A (en) Changing animation displayed to user
CN102231161A (en) Method for synchronously verifying and monitoring databases
CN103324715A (en) Disaster recovery backup system availability detection method and device
CN102479140A (en) Computer system and hard disk state display method
CN110717130B (en) Dotting method, dotting device, dotting terminal and storage medium
CN104881256A (en) Method and device for monitoring availability of data sources
CN105740129A (en) Warning method based on database trigger
CN112181528B (en) Method and device for managing configuration file of micro-service
WO2021082868A1 (en) Data managmenet method for distributed storage system, apparatus, and electronic device
CN106301903A (en) Device, method, system and the server of a kind of Linux Real-time Alarm
CN111984723A (en) Data synchronization method and device and terminal equipment
CN110928945B (en) Data processing method and device for database and data processing system
CN107783852B (en) Dump file generation method and terminal
TWI612471B (en) Information processing device, information processing method and information processing program product
WO2019136914A1 (en) Method for automatically recording field change, application server and computer-readable storage medium
CN109144903B (en) Method for intelligently managing USB (universal serial bus) equipment by cloud terminal
CN117131130A (en) Data synchronization method, device and storage medium
CN105264825B (en) Warning system and method for processing alarm message
CN104516721A (en) Display controlling method, display controlling device and electronic equipment

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