A method, device, medium and product for processing high-concurrency alarms of fire equipment
By extracting alarm features, generating standardized queues in parallel processing, and identifying hidden dangers with sliding time windows, the problem of response speed and stability of fire cloud platform in high concurrent alarm message processing is solved, and fast and accurate alarm information processing is achieved.
Patent Information
- Application Number
- CN202410597689.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-05-14
AI Technical Summary
When fire cloud platforms handle massive high-concurrent alarm messages, how to ensure real-time, accurate, fast response and stable response has become an urgent problem.
By extracting alarm features from alarm information, a standardized queue is generated, and parallel processing includes compressed storage, index creation and hidden danger identification, using sliding time windows to identify hidden dangers, reducing data processing volume, and improving alarm information processing speed.
The extraction and standardized processing of effective data significantly improve the response speed to alarm information, reduce the data processing volume, and improve the processing speed and system stability.
Smart Images

Figure CN118585491B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of fire information processing on a cloud server, and in particular to a method, device, medium and product for processing high-concurrency alarms of fire equipment. Background Art
[0002] Firefighting equipment is connected to the cloud server through the Internet of Things for unified management (referred to as the Firefighting Cloud Platform). The Firefighting Cloud Platform uses cloud computing, the Internet of Things, big data and other technologies to provide real-time monitoring, data analysis, hidden danger identification and early warning functions, which greatly improves the efficiency of firefighting monitoring. After the firefighting equipment alarms, the alarm message is uploaded to the Firefighting Cloud Platform in real time, and the Firefighting Cloud Platform processes the alarm message and issues an early warning.
[0003] However, as the market demand for fire cloud platforms increases, fire cloud platforms need to process massive amounts of high-concurrency alarm messages. How to ensure real-time accuracy, rapid response and stability needs to be solved urgently. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device, medium and product for processing high-concurrency alarms of fire-fighting equipment, which can quickly process alarm information.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A method for processing high-concurrency alarms of fire-fighting equipment, the method comprising:
[0007] Extract corresponding alarm features from each alarm information;
[0008] According to each of the alarm characteristics, valid data is determined and a corresponding standardized queue is generated;
[0009] The following steps are processed in parallel for each normalized queue:
[0010] Compressing and storing the standardized queue and creating an index;
[0011] Using a sliding time window, identifying hidden dangers in the standardized queue;
[0012] According to each of the alarm characteristics, valid data is determined and a corresponding standardized queue is generated, specifically including:
[0013] For each alarm feature, determine whether the alarm information is an event or a state according to the switch value in the alarm feature; if the alarm information is an event, keep the device represented by the device identifier in the alarm feature unchanged, and the alarm feature is invalid data; if the alarm information is a state, generate a corresponding cancellation event to obtain an extended alarm feature, and the extended alarm feature is valid data;
[0014] Loading a data point model of the device represented by the device identifier, performing a simulation test according to the data point model to extract a simulated analog value, if the simulated analog value does not change within a sampling period, the alarm feature is invalid data, otherwise the alarm feature is valid data;
[0015] Generate corresponding standardized queues according to each valid data.
[0016] A computer device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned method for processing high-concurrency alarms of fire-fighting equipment.
[0017] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for processing high-concurrency alarms of fire-fighting equipment.
[0018] A computer program product includes a computer program, which implements the above-mentioned fire-fighting equipment high-concurrency alarm processing method when executed by a processor.
[0019] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0020] The high-concurrency alarm processing method for fire-fighting equipment of the present invention determines valid data from each alarm information, reduces the amount of data processing, and can improve the response speed to the alarm information; by standardizing the valid data, and compressing, storing, indexing and identifying hidden dangers of the parallel processing standardized queue, the processing speed of the alarm information is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 A flow chart of a method for processing high concurrent alarms of fire fighting equipment provided in Example 1 of the present invention;
[0023] Figure 2 Schematic diagram of the generation process of the standardized queue Figure 1 ;
[0024] Figure 3 Schematic diagram of the generation process of the standardized queue Figure 2 ;
[0025] Figure 4Schematic diagram of the process of compressing storage and creating indexes for standardized queues Figure 1 ;
[0026] Figure 5 Schematic diagram of the process of compressing storage and creating indexes for standardized queues Figure 2 ;
[0027] Figure 6 Illustration of the hidden danger identification process Figure 1 ;
[0028] Figure 7 Illustration of the hidden danger identification process Figure 2 ;
[0029] Figure 8 Schematic diagram of an embodiment of a sliding time window. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The purpose of the present invention is to provide a method, device, medium and product for processing high-concurrency alarms of fire equipment, aiming to improve the processing speed of alarm information.
[0032] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] Example 1
[0034] like Figure 1 As shown, the fire fighting equipment high concurrent alarm processing method of the present invention includes:
[0035] Step 100: extracting corresponding alarm features from each alarm information;
[0036] Step 200: Determine valid data according to each of the alarm characteristics, and generate a corresponding standardized queue;
[0037] The following steps are processed in parallel for each normalized queue:
[0038] Step 300: compress and store the standardized queue and create an index;
[0039] Step 400: Using a sliding time window, identify hidden dangers in the standardized queue.
[0040] Wherein, in step 100, corresponding alarm features are extracted from each alarm information, specifically including:
[0041] Step 110: For each alarm information, the alarm information is parsed to obtain message information.
[0042] Specifically, the alarm message is parsed into a JSON string to obtain message information, and further verify whether the message format is correct.
[0043] Step 120: extracting alarm features from the message information.
[0044] The alarm characteristics include device identification, installation location, occurrence time, event type, analog value and switch value. The device represented by the device identification includes at least one of a direct connection device, a gateway device and a sub-device, and the sub-device includes at least one of a host, a loop, a field component and a multi-line tray. The present invention can realize device identification verification, and automatic registration and update of the installation location of the sub-device.
[0045] The event type includes at least one of fire alarm, early warning, linkage, fault, feedback, supervision, and shielding; the analog value includes at least one of signal strength, battery power, liquid level, temperature, and gas concentration; and the switch value represents the alarm information as an event or status.
[0046] The present invention generates a sequence number for each alarm message, matches the sequence number with the alarm message and stores it, and the sequence number can be used to implement data link tracking and log analysis.
[0047] like Figure 2 and Figure 3 As shown, in step 200, valid data is determined according to each of the alarm features, and a corresponding standardized queue is generated, which specifically includes:
[0048] Step 210: For each alarm feature, determine whether the alarm information is an event or a status based on the switch quantity in the alarm feature; if the alarm information is an event, the device represented by the device identifier in the alarm feature is maintained as unchanged, and the alarm feature is invalid data; if the alarm information is a status, a corresponding revocation event is generated to obtain an extended alarm feature, and the extended alarm feature is valid data.
[0049] Since different types of equipment have different ways of identifying their status, the equipment status identifications are uniformly coded through a preset status mapping table.
[0050] Step 220: Load the data point model of the device represented by the device identifier, perform simulation testing based on the data point model to extract the simulated analog value, if the simulated analog value does not change within the sampling period, the alarm feature is invalid data, otherwise the alarm feature is valid data.
[0051] Step 230: Generate corresponding standardized queues according to each valid data.
[0052] In addition, in order to facilitate data link tracking and log analysis, the fire-fighting equipment high-concurrency alarm processing method of the present invention also includes generating a serial number corresponding to each valid data and matching and storing it.
[0053] Furthermore, before determining valid data according to each of the alarm characteristics, the fire-fighting equipment high-concurrency alarm processing method of the present invention further includes:
[0054] According to the device identification of the alarm feature, determining whether the device represented by the device identification has been registered by querying the first-level cache, the second-level cache and the database in sequence;
[0055] If it is not registered and the device is a sub-device, it is automatically registered and the installation location is updated, and the registration information is synchronously updated to the first-level cache and the second-level cache, and the alarm feature is updated.
[0056] According to the device identifier, the device represented by the device identifier is determined, and further it is determined whether the device has been registered. First, the first-level cache is queried; the first-level cache is a cache in the application memory, which stores the most commonly used and frequently accessed data (for example, the number of accesses is 100 times / day, but it is not limited to this and can be adjusted according to actual needs), which can reduce the number of accesses to external resources such as databases and has a fast reading response speed. If the first-level cache is not found, the second-level cache is queried; the second-level cache is a distributed shared cache, which can reduce the number of database accesses. Compared with the first-level cache, it stores more data and has a longer life cycle, but the reading speed is slower than the first-level cache. If the second-level cache is not found, the database is queried. If it is not found in the database, it is determined to be unregistered.
[0057] If it is not registered and is a secondary sub-device, it will be automatically registered and the installation location will be updated. During registration, the primary cache and secondary cache must be updated synchronously to maintain the consistency of the cache and database.
[0058] like Figure 4 and Figure 5 As shown, in step 300, the standardized queue is compressed and stored and an index is created, which specifically includes:
[0059] Step 310: Encode and compress the standardized queue to obtain compressed data points. Specifically, the switch quantity is encoded and compressed, and the unified encoding uses a 2-byte unsigned short type to replace int or string. The occurrence time is uniformly represented by an 8-byte unsigned long to represent the timestamp seconds. After unified encoding, it can be restored to a string without loss.
[0060] Step 320: Put the compressed data points into a buffer pool, merge the valid data according to the same device identifier, and retain the compressed data points corresponding to the latest valid data.
[0061] Specifically, according to the same device identification, the analog values are merged, and the compressed data point corresponding to the latest analog value is retained; for example, the analog values of the same type of sensors are merged, and only the latest value is retained.
[0062] Merge duplicate alarms and device states with the same device ID in the buffer pool, and only retain the compressed data points corresponding to the latest data.
[0063] Step 330: Generate an index based on each compressed data point and write it to disk in batches.
[0064] After compression and merging, the data is written to the buffer pool. When the buffer pool is full or exceeds the refresh cycle or before the program is closed, the data is written to the disk in batches to reduce disk IO and improve concurrency performance.
[0065] After writing to disk, the event type index, event index, and organization index are updated and maintained synchronously to avoid full disk scanning when querying data, so as to quickly respond to queries. At the same time, data is continuously aggregated according to preset aggregation rules to quickly respond to statistical queries, where the preset aggregation rules can be aligned to the time by hour, day, month, or year, and the number of alarms and the trend of analog quantity changes (maximum, minimum, and average) are counted.
[0066] Frequent changes in equipment status will lead to frequent additions and deletions of data. The high-concurrency alarm processing method for fire-fighting equipment of the present invention also includes: adding a flag bit to the compressed data point, and using the flag bit to identify whether the data of the current compressed data point is valid, thereby effectively avoiding index reconstruction, reducing the number of index splits, and avoiding wasting disk IO.
[0067] In addition, as time goes by, the data scale continues to increase, the storage cost is getting higher and higher, but the data value is already low, so the fire equipment high-concurrency alarm processing method of the present invention also includes regularly archiving cold data, packaging and compressing and storing OSS (Operation Support Systems), which reduces storage costs and improves access efficiency, and can be manually restored if necessary in the future.
[0068] like Figure 6As shown, in step 400, the sliding time window is used to identify hidden dangers in the standardized queue, specifically including:
[0069] Step 410: using a sliding time window, intercepting the standardized queue to obtain a plurality of interception information.
[0070] Step 420: Count the total number of sliding time window alarms of the devices corresponding to the different device identifiers in each intercepted information.
[0071] Step 430: According to the total number of sliding time window alarms of each device and the alarm number threshold of the corresponding device, identify whether the corresponding device is a hidden danger. When the corresponding device is identified as a hidden danger, mark the device as a hidden danger, generate hidden danger information, write the hidden danger message into the hidden danger notification queue, record the hidden danger log, and store it.
[0072] like Figure 7 and Figure 8 As shown in the figure, a sliding time window of 1 hour is used, and each sliding time window is divided into 6 slots (the time window size and the number of slots can be set and adjusted by the user). Each slot expires after 1 hour from the start time. Each slot has a counter, which stores the number of alarms that occurred within the start and end time range of this slot. Create a sliding time window alarm counter, the value of which is the sum of valid slot alarms. When a slot expires, the total number of alarms in this slot is automatically subtracted.
[0073] The size of the sliding time window can be modified by the user, and the rules for field components, loops, and hosts can be set separately. After the user modifies, the hidden danger identification rules must be updated synchronously to prevent dirty data from being generated. In the case of a large sliding time window span and high alarm concurrency, the sliding time window can be adjusted to ensure statistical accuracy as much as possible while avoiding a large amount of resource consumption.
[0074] Example 2
[0075] A computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for processing high-concurrency alarms of fire-fighting equipment in Example 1.
[0076] Example 3
[0077] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method for processing high-concurrency alarms of fire-fighting equipment in Example 1.
[0078] Example 4
[0079] A computer program product includes a computer program, which, when executed by a processor, implements the method for processing high-concurrency alarms of fire-fighting equipment in embodiment 1.
[0080] Example 5
[0081] A computer device, which may be a database. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the high-concurrency alarm processing method for fire equipment in Example 1 is implemented.
[0082] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0083] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present invention may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided by the present invention may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0084] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0085] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for processing high-concurrency alarms of fire-fighting equipment, characterized in that: The processing method comprises: Extract corresponding alarm features from each alarm information; According to each of the alarm characteristics, valid data is determined and a corresponding standardized queue is generated; The following steps are processed in parallel for each normalized queue: Compressing and storing the standardized queue and creating an index; Using a sliding time window, identifying hidden dangers in the standardized queue; According to each of the alarm characteristics, valid data is determined and a corresponding standardized queue is generated, specifically including: For each alarm feature, determine whether the alarm information is an event or a state according to the switch value in the alarm feature; if the alarm information is an event, keep the device represented by the device identifier in the alarm feature unchanged, and the alarm feature is invalid data; if the alarm information is a state, generate a corresponding cancellation event to obtain an extended alarm feature, and the extended alarm feature is valid data; Loading a data point model of the device represented by the device identifier, performing a simulation test according to the data point model to extract a simulated analog value, if the simulated analog value does not change within a sampling period, the alarm feature is invalid data, otherwise the alarm feature is valid data; Generate corresponding standardized queues according to each valid data.
2. The method for processing high concurrent alarms of fire fighting equipment according to claim 1, characterized in that: Extract corresponding alarm features from each alarm information, including: For each alarm information, the alarm information is parsed to obtain message information; Alarm features are extracted from the message information; the alarm features include device identification, installation location, occurrence time, event type, analog value and switch quantity; the device represented by the device identification includes at least one of a directly connected device, a gateway device, and a sub-device; the sub-device includes at least one of a host, a loop, a field component, and a multi-line disk; the event type includes at least one of a fire alarm, a pre-warning, a linkage, a fault, feedback, supervision, and shielding.
3. The method for processing high concurrent alarms of fire fighting equipment according to claim 2, characterized in that: The analog value includes: at least one of signal strength, battery power, liquid level, temperature, and gas concentration, and the switch value represents the alarm information as an event or a state.
4. The method for processing high concurrent alarms of fire fighting equipment according to claim 2, characterized in that: Before determining valid data according to each of the alarm features, the processing method further includes: According to the device identification of the alarm feature, determining whether the device represented by the device identification has been registered by querying the first-level cache, the second-level cache and the database in sequence; If it is not registered and the device is a sub-device, it is automatically registered and the installation location is updated, and the registration information is synchronously updated to the first-level cache and the second-level cache, and the alarm feature is updated.
5. The method for processing high-concurrency alarms of fire-fighting equipment according to claim 1, characterized in that: The processing method also includes: Generate and store a serial number corresponding to each valid data.
6. The method for processing high concurrent alarms of fire fighting equipment according to claim 1, characterized in that: The standardized queue is compressed and stored and an index is created, specifically including: Encoding and compressing the standardized queue to obtain compressed data points; Put the compressed data points into a buffer pool, merge the valid data according to the same device identifier, and retain the compressed data points corresponding to the latest valid data; Generate an index based on each compressed data point and write it to disk in batches.
7. The method for processing high concurrent alarms of fire fighting equipment according to claim 1, characterized in that: The use of the sliding time window to identify hidden dangers in the standardized queue specifically includes: Using a sliding time window, intercepting the standardized queue to obtain a plurality of interception information; Count the total number of sliding time window alarms of the devices corresponding to different device identifiers in each intercepted information; According to the total number of sliding time window alarms of each device and the alarm number threshold of the corresponding device, identify whether the corresponding device is a hidden danger. When the corresponding device is identified as a hidden danger, the device is marked as a hidden danger, and hidden danger information is generated. The hidden danger message is written into the hidden danger notification queue, and the hidden danger log is recorded and stored.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for processing high-concurrency alarms of fire-fighting equipment as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for processing high-concurrency alarms of fire-fighting equipment described in any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for processing high-concurrency alarms of fire-fighting equipment described in any one of claims 1 to 7 is implemented.
