A historical alarm query method with recovery time in SCADA system
By introducing an alarm query preprocessor in the SCADA system, an alarm record with recovery time is generated, which solves the problem of difficult to display the recovery time of the abnormal status of the signal source in traditional systems, improves the analysis and investigation efficiency of the dispatcher, and improves the rail traffic stability and reliability.
Patent Information
- Application Number
- CN202311608657.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2043-11-28
AI Technical Summary
In alarm history query, it is difficult for traditional SCADA systems to intuitively display the recovery time of abnormal status of signal sources, which affects the dispatcher's analysis and troubleshooting efficiency of faults and alarm events.
By introducing an alarm query preprocessor in the SCADA system, the time when the signal source is switched to the 'normal' state is the recovery time of the 'abnormal' state, an alarm record with recovery time is generated, and stored in the database to provide query Services to help dispatchers understand the recovery of abnormal states.
It realizes intuitive display of abnormal states, improves the work efficiency of dispatchers, and improves the stability and reliability of rail transit.
Smart Images

Figure CN117874313B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rail transit, and in particular to an alarm history query function of a rail transit SCADA system. Background Art
[0002] my country is in a period of rapid development of rail transit. With the continuous expansion of the network, rail transit has become an important part of the urban public transportation system. In the rail transit SCADA system, alarm history query is an important function that can help dispatchers analyze and troubleshoot past faults and alarm events. By viewing the alarm history records, you can understand the time, duration, frequency and correlation of the fault with other events. The multiple states in a signal source are divided into "abnormal" state and "normal" state. Among these states, the dispatcher is concerned about the time when the "abnormal" state occurs and the recovery time. The traditional SCADA system lists the "normal" state of the signal source as a single alarm, which is not convenient for the dispatcher to recall some situations when the "abnormal" state of the signal source occurs. Therefore, the dispatcher hopes to add the time when the signal source switches to the "normal" state as the recovery time of the "abnormal" state to the "abnormal" state alarm, prompting the dispatcher that the abnormal state of the signal source has been restored. At this time, the alarm reflects the alarm behavior of the "normal" state alarm (alarm sound, color, etc.). This helps to improve the work efficiency of the dispatcher and improve the stability and reliability of rail transit. Summary of the invention
[0003] In view of the above-mentioned problems existing in the prior art, the purpose of the present invention is: when investigating an alarm accident, the time for switching the signal source to the "normal" state is used as the recovery time of the "abnormal" state, and is added to the "abnormal" state alarm to prompt the dispatcher that the abnormal state of the signal source has been restored, thereby helping the dispatcher to analyze and investigate past faults and alarm events.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is: a historical alarm query method with recovery time of a SCADA system comprises the following steps.
[0005] Step 1: Use the alarm query preprocessor to process the alarm records generated by the alarm objects in the SCADA system into restored alarm records and unrestored alarm records, and store them in two different data tables respectively.
[0006] The alarm record generated by the alarm object means that the SCADA system can configure an alarm for each state of the signal source. When the signal source switches state, the system generates an alarm data according to the configuration. The alarm data provides alarm history data services through the memory and file system in the alarm service program. The alarm service program stores the alarm information in the memory in reverse order in a file every two hours. Each alarm record contains: alarm object ID, alarm level, alarm description, and alarm time.
[0007] The alarm record with recovery refers to adding a "recovery time" field to the alarm record. When the signal source switches to the "abnormal" state, the "recovery time" field is empty. When the signal source switches to the "normal" state, the timestamp of switching to the "normal" state is written into the "recovery time" field of the "abnormal" state alarm of the same signal source in the list. The alarm behavior of the "normal" state prompts the dispatcher that the "abnormal" state of the signal source has been restored.
[0008] The alarm query preprocessor processes the alarm records generated by the alarm object in the SCADA system into restored alarm records and unrestored alarm records through generation rules and storage strategies, and the generation rules and storage strategies adopt the following scheme to process the data and store them in different data tables of the database;
[0009] First, define a certain alarm level as a "normal" state alarm, traverse all unprocessed alarm history files in the system (all alarm history files are not processed when the program is first executed) and the "abnormal" alarm data table (the data in this table is empty when the program is first run) to obtain all current alarm history data results, and filter out all "normal" state alarms according to the alarm level;
[0010] Next, traverse each "normal" state alarm and search for an "abnormal" state alarm with the same alarm object ID and the most recent alarm time in all results. Once found, fill the alarm time of the "normal" state alarm into the recovery time field of the "abnormal" state alarm. Delete all "normal" state alarms in the alarm history data results;
[0011] Then, the alarms with recovery time are stored in the recovery alarm data table in ascending order of time, and the unmatched "abnormal" state alarms are stored in the "abnormal" alarm data table in ascending order of time;
[0012] After that, the name and processing time of the file that has been processed will be recorded in the database. The processed files will not be processed again;
[0013] Finally, the preprocessor monitors the number of alarm history files and repeats the above process when a new alarm history file is generated.
[0014] The said storing alarm records in two different data tables means storing the restored alarm records in the restored alarm data table, each alarm record contains: alarm object ID, alarm level, alarm description, alarm time, alarm restoration time. The unrestored alarm records are stored in the "abnormal" alarm data table, each alarm record contains: alarm object ID, alarm level, alarm description, alarm time.
[0015] Step 2: Divide the query tasks of different alarm record data sources according to the user query time period.
[0016] The alarm records in the memory of the alarm service program provide historical alarm data services through the restful interface and define them as web historical data sources.
[0017] The alarm data processed by the preprocessor is defined as a DB data source, wherein the DB data source is further defined as a restored DB source and a non-restored DB source according to the type of stored alarms.
[0018] The user query time period is divided into three query tasks of different alarm record data sources. When the query start time entered by the user is less than or equal to the current time minus 2 hours, the query data source is the web source. When the query end time entered by the user is greater than the current time minus 2 hours, the query data source is the DB source. When the query start and end time entered by the user includes the current time minus 2 hours, the query data sources are the web source and the DB source.
[0019] Step 3: The alarm record query merger merges the query results of different alarm record data sources into restored alarm records and unrestored alarm records according to the rules.
[0020] The alarm record query merger combines the query results of different alarm record data sources into restored alarm records and unrestored alarm records according to the rules. The generation rules are as follows:
[0021] First, define a certain alarm level as a "normal" state alarm, traverse the web source and the unrecovered DB source to obtain all the current pending alarm history data results, define them as temporary results, and filter out all the "normal" state alarms in the temporary results according to the alarm level;
[0022] Then, traverse each "normal" state alarm and search for an "abnormal" state alarm with the same alarm object ID and the most recent alarm time in all temporary results. Once found, fill the alarm time of the "normal" state alarm into the recovery time field of the "abnormal" state alarm. Delete all "normal" state alarms in the temporary results;
[0023] Finally, the three types of alarm data, namely, the restored DB source alarm data, the alarm data with the restored time in the temporary result, and the remaining unrestored alarm data in the temporary result, are sorted in ascending order according to the alarm occurrence time and output;
[0024] The present invention has the following beneficial effects: the abnormal status and recovery information of the monitored object are intuitively displayed in front of the dispatcher, which is easy to understand, helps to improve the work efficiency of the dispatcher, and improves the stability and reliability of rail transit. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The present invention is a flow chart of a method for querying historical alarms with recovery time in a SCADA system.
[0026] Figure 2 This is a flowchart of the alarm preprocessor in step 1 of the historical alarm query method of the present invention.
[0027] Figure 3 This is a schematic diagram illustrating the division of data sources for query tasks in step 2 of the historical alarm query method of the present invention.
[0028] Figure 4 This is the workflow diagram of the alarm merger in step three of the historical alarm query method of the present invention. DETAILED DESCRIPTION
[0029] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but do not limit the scope of the present invention.
[0030] The following is combined with Figure 1 , the features and technical implementation schemes of the present invention are described.
[0031] This embodiment is deployed in B / S architecture. The server program uses C++ service process and PHP script language. The alarm preprocessor uses C++ service process. The alarm history WEB source is provided by the server C++ historical alarm REST service program; the historical data DB source is provided by the background PHP script language querying the SYBASE database. The client program and human-computer interface are developed by ExtJS.
[0032] Step 1: Use the alarm query preprocessor to process the alarm records generated by the alarm objects in the SCADA system into restored alarm records and unrestored alarm records, and store them in two different data tables respectively.
[0033] like Figure 2 As shown;
[0034] Step 11. Create an alarm history recovery data table by month. The table naming format is: AlarmCache_YYYY_MM, where "YYYY" represents the specific year and "MM" represents the specific month. The fields are: alarm object ID, alarm level, alarm description, alarm time, and alarm recovery time; create an alarm history unrecovered data table by month. The table naming format is: TempAlarm_YYYY_MM, where "YYYY" represents the specific year and "MM" represents the specific month. The bullets are: alarm object ID, alarm level, alarm description, and alarm time; create a historical file processing record table. The table name is ProcessedRaws. The fields are: file name, processing duration, and start processing time.
[0035] Step 1. Define a certain alarm level as a "normal" status alarm, traverse all unprocessed alarm history files in the system (all alarm history files are not processed when the program is first executed) and the "abnormal" alarm data table (the data in this table is empty when the program is first run) to obtain all current alarm history data results, and filter out all "normal" status alarms according to the alarm level.
[0036] Step 13. Traverse each "normal" state alarm and search for an "abnormal" state alarm with the same alarm object ID and the most recent alarm time in all results. Once found, fill the alarm time of the "normal" state alarm into the recovery time field of the "abnormal" state alarm. Delete all "normal" state alarms in the alarm history data results. Delete the "abnormal" alarms that have been restored in the TempAlarm_YYYY_MM table.
[0037] Step 14. Store the alarms with recovery time in the recovery alarm data table AlarmCache_YYYY_MM in ascending order of time, and store the unmatched "abnormal" state alarms in the "abnormal" alarm data table TempAlarm_YYYY_MM in ascending order of time.
[0038] Step 15. Record the name and processing time of the processed files in ProcessedRaws. The processed files will not be processed again.
[0039] Step 16, the preprocessor monitors the number of alarm history files, and repeats the processing of Step 12-Step 16 when a new alarm history file is generated.
[0040] Step 2: Divide the query tasks of different alarm record data sources according to the user query time period. Figure 3 As shown;
[0041] Step 21. The alarm records in the memory of the alarm service program provide historical alarm data services through the restful interface and define them as web historical data sources.
[0042] Step 22, define the alarm data processed by the preprocessor as a DB data source, wherein the DB data source is further defined as a restored DB source and an unrestored DB source according to the type of stored alarms.
[0043] Step 13. Divide the user query time period into three query tasks for different alarm record data sources. When the query start time entered by the user is less than or equal to the current time minus 2 hours, the query data source is the web source. When the query end time entered by the user is greater than the current time minus 2 hours, the query data source is the DB source. When the query start and end time entered by the user includes the current time minus 2 hours, the query data sources are the web source and the DB source.
[0044] Step 3: The alarm record query merger combines the query results of different alarm record data sources into restored alarm records and unrestored alarm records according to the rules. Figure 4 As shown;
[0045] Step 31. Define a certain alarm level as a "normal" status alarm, traverse the web source and the unrecovered DB source to obtain all current pending alarm history data results, define them as temporary results, and filter out all "normal" status alarms in the temporary results according to the alarm level.
[0046] Step 32. Traverse each "normal" state alarm and search for an "abnormal" state alarm with the same alarm object ID and the most recent alarm time in all temporary results. Once found, fill the alarm time of the "normal" state alarm into the recovery time field of the "abnormal" state alarm. Delete all "normal" state alarms in the temporary results.
[0047] Step 33. Finally, the three types of alarm data, namely, the restored DB source alarm data, the alarm data with the restoration time in the temporary result, and the remaining unrestored alarm data in the temporary result, are sorted from small to large according to the alarm occurrence time and output.
[0048] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention shall fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for querying historical alarms with recovery time in a SCADA system, characterized in that: The following steps are involved: Step 1: Use the alarm query preprocessor to process the alarm records generated by the alarm object in the SCADA system into restored alarm records and unrestored alarm records, and store them in two different data tables respectively; Step 2: Divide the query tasks of different alarm record data sources according to the user query time period; Step 3: The alarm record query merger merges the query results of different alarm record data sources into restored alarm records and unrestored alarm records according to the rules and outputs them; The alarm record with recovery refers to adding a "recovery time" field to the alarm record; when the signal source switches to the "abnormal" state, the "recovery time" field is empty; when the signal source switches to the "normal" state, the timestamp of switching to the "normal" state is written into the "recovery time" field of the "abnormal" state alarm of the same signal source in the list; The "normal" alarm behavior prompts the dispatcher that the "abnormal" state of the signal source has been restored; in step three: The alarm record query merger merges the query results of different alarm record data sources into restored alarm records and unrestored alarm records according to the rules. The generation rules are as follows: First, define a certain alarm level as a "normal" state alarm, traverse the web source and the unrecovered DB source to obtain all the current pending alarm history data results and define them as temporary results. Filter out all the "normal" state alarms in the temporary results according to the alarm level; Then, traverse each "normal" state alarm and search for an "abnormal" state alarm with the same alarm object ID and the most recent alarm time in all temporary results. Once found, fill the alarm time of the "normal" state alarm into the recovery time field of the "abnormal" state alarm, and delete all "normal" state alarms in the temporary results; Finally, the restored DB source alarm data, the alarm data with recovery time in the temporary result, and the remaining unrestored alarm data in the temporary result are sorted in ascending order according to the alarm occurrence time and output.
2. A SCADA system historical alarm query method with recovery time according to claim 1, characterized in that: In step one: The alarm record generated by the alarm object refers to the alarm configuration for each state of the signal source in the SCADA system. When the signal source switches state, the system generates an alarm data according to the configuration. The alarm data provides alarm history data services through the memory and file system in the alarm service program. The alarm service program stores the alarm information in the memory in reverse order in the file every two hours. Each alarm record contains: alarm object ID, alarm level, alarm description and alarm time.
3. A SCADA system historical alarm query method with recovery time according to claim 1, characterized in that: In step one: The alarm record with recovery refers to adding a "recovery time" field to the alarm record. When the signal source switches to the "abnormal" state, the "recovery time" field is empty. When the signal source switches to the "normal" state, the timestamp of switching to the "normal" state is written into the "recovery time" field of the "abnormal" state alarm of the same signal source in the list, and the user is prompted with the alarm behavior of the "normal" state that the "abnormal" state of the signal source has been restored.
4. A SCADA system historical alarm query method with recovery time according to claim 1, characterized in that: In step one: Storing the alarm records in two different data tables means storing the restored alarm records in the restored alarm data table, where each alarm record contains: alarm object ID, alarm level, alarm description, alarm time and alarm recovery time; storing the unrestored alarm records in the "abnormal" alarm data table, where each alarm record contains: alarm object ID, alarm level, alarm description and alarm time.
5. A SCADA system historical alarm query method with recovery time according to claim 1, characterized in that: In step one: The alarm query preprocessor processes the alarm records generated by the alarm object in the SCADA system into restored alarm records and unrestored alarm records through generation rules and storage strategies, and the generation rules and storage strategies adopt the following scheme to process the data and store them in different data tables of the database; First, define a certain alarm level as a "normal" state alarm, traverse all unprocessed alarm history files and "abnormal" alarm data tables in the system to obtain all current alarm history data results, and filter out all "normal" state alarms according to the alarm level; when the program is executed for the first time, all alarm history files are not processed, and the data in the "abnormal" alarm data table is empty when the program is run for the first time; Secondly, traverse each "normal" state alarm and search for an "abnormal" state alarm with the same alarm object ID and the most recent alarm time in all results. Once found, fill the alarm time of the "normal" state alarm into the recovery time field of the "abnormal" state alarm, and delete all "normal" state alarms in the alarm history data results; Then, the alarms with recovery time are stored in the recovery alarm data table in ascending order of time, and the unmatched "abnormal" state alarms are stored in the "abnormal" alarm data table in ascending order of time; Afterwards, the name and processing time of the file that has been processed are recorded in the database, and the processed files will not be processed again; Finally, the preprocessor monitors the number of alarm history files and repeats the above process when a new alarm history file is generated.
6. A method for querying historical alarms with recovery time in a SCADA system according to claim 1, characterized in that: In step 2: In the alarm service program, the alarm records in the memory provide historical alarm data services through the restful interface, which is defined as the web historical data source; The alarm data processed by the preprocessor is defined as a DB data source, wherein the DB data source is further defined as a restored DB source and a non-restored DB source according to the type of stored alarms.
7. A SCADA system historical alarm query method with recovery time according to claim 6, characterized in that: In step 2: The user query time period is divided into query tasks of three different alarm record data sources; when the query start time entered by the user is less than or equal to the current time minus 2 hours, the query data source is the web source; when the query end time entered by the user is greater than the current time minus 2 hours, the query data source is the DB source; when the query start and end times entered by the user include the current time minus 2 hours, the query data sources are the web source and the DB source.
