Monitor central station event alarm storage method, index method and computer equipment
By saving the event alarm data in the monitor central station event alarm storage method in time segments and building a time-ordered table jump index, the problems of low read and write performance and high resource consumption in the existing technology are solved, and the high Performance event alarm data storage and reading.
Patent Information
- Application Number
- CN202411518252.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-18
AI Technical Summary
In the case of more monitor equipment access, the reading and writing performance problems cannot support long monitoring time and time-consuming merging of duplicate data. In addition, large distributed database systems consume a lot of resources, complex installation and maintenance, and The problem of slow reading speed.
A monitor central station event alarm storage method is adopted, by saving event alarm data in time segments in event alarm data file, and building time-order table jump index in the file to support high-performance writing and reading Event alarm data.
Under the low system resource consumption, relatively high write and read performance and low read delay are guaranteed, and time-disorder writing is supported, reducing the amount of data written and read, and improving disk usage rate and disk data read and write efficiency.
Smart Images

Figure CN119480055A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to a monitoring instrument central station event alarm storage method, indexing method and computer equipment. Background Art
[0002] When the monitor is monitoring the patient's vital signs in real time, it will generate event alarms based on the set physiological alarm thresholds. It will also analyze the vital signs in real time to generate other event alarms. Doctors and nurses can also manually add and modify event alarms later. In addition, there will be frequent reading, viewing and statistical analysis needs during the monitoring process. This process requires efficient and low-latency reading of a large amount of event alarm data. Directly writing files cannot quickly locate and read by time range and there is a lot of duplicate data. If a traditional database is used directly to save event alarm data, there will be performance problems in reading and writing when there are many connected monitor devices, and it cannot support longer monitoring time and it is time-consuming to merge duplicate data. If a large distributed database system is used to save monitoring data, there will be problems such as high resource consumption, installation and maintenance assignment, and slow reading speed. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a monitoring instrument central station event alarm storage method, indexing method and computer equipment, which store event alarm data in event alarm data files by time segments, and construct a time-ordered jump table index in the event alarm data file to support high-performance writing and reading of event alarm data, support time-unordered writing, and ensure relatively high writing and reading performance and low reading delay under low system resource consumption.
[0004] The present invention adopts the following technical solution:
[0005] In a first aspect, a method for storing event alarms of a central station of a monitor includes:
[0006] The event alarm data structure construction step defines that the event alarm data file uses a fixed size and is saved in time segments. The file name of each event alarm data file is the time of the first event alarm data. The data structure of each event alarm data file includes an index segment and a data segment; the index segment includes a number of index information, each index information includes a timestamp and an offset value of the event alarm data in the file, and one index information is added every first preset time when writing data; the data segment includes a number of groups of event alarm data, each group of event alarm data includes a length and compressed data content; each group of event alarm data is merged by multiple event alarm data within a second preset time; wherein, the timestamp of each index uses the minimum occurrence time of the group of event alarm data written when adding the index information; the first preset time is greater than the second preset time;
[0007] The event alarm data writing step receives the event alarm data reported by the monitor, extracts the event alarm data and writes it according to the event alarm data structure.
[0008] Preferably, the process of writing event alarm data specifically includes:
[0009] S21, reading the data after merging the duplicate event alarm data in the cache;
[0010] S22, merging and compressing multiple event alarm data within a second preset time into a group;
[0011] S23, determine whether the minimum event of the current group is less than the timestamp in the last index information; if not, proceed to S24, if yes, proceed to S25;
[0012] S24, appending the group of event alarm data to the end of the event alarm data file, and determining whether the time of the last index information exceeds a first preset value, and if so, adding new index information to point to the group of event alarm data;
[0013] S25, appending the group of event alarm data to the end of the event alarm data file, adding new index information to point to the group of event alarm data, re-arranging in chronological order and rewriting the index information.
[0014] Preferably, the method for merging duplicate event alarm data in a cache specifically includes:
[0015] The latest alarm status and related information of whether it is saved to the data file are cached in the memory. When the event alarm data of the next second is received, the alarm type and the alarm generation time are compared with the memory cache information to find the same event alarm information. If found, determine whether it has been written. If it has been written, ignore it directly. If not found, it is considered to be a new event alarm that needs to be written. At the same time, determine whether the cached event alarm is still being sent. If it is not being sent, it is considered that the event alarm has ended and another event alarm data needs to be written for recording.
[0016] Preferably, the first preset time is 4 hours, and the second preset time is 15 minutes.
[0017] Preferably, the sizes of the index segment and the data segment are fixed.
[0018] In a second aspect, a monitor central station event alarm indexing method is based on the monitor central station event alarm storage method, comprising:
[0019] S31, finding the event alarm data file to be read according to the query time range;
[0020] S32, sequentially read the index information of each event alarm data file, find the range of event alarm data to be read in the file, and then read the event alarm data in sequence;
[0021] S33, decompressing the read event alarm data, and determining again whether the event alarm data is within the time range to be read, if so, outputting the event alarm data; if not, discarding the data;
[0022] S34, determining whether the current event alarm data file has been read completely, if not, continuing to read the next set of event alarm data in the current event alarm data file; if yes, sequentially reading other event alarm data files until all event alarm data files that need to be read have been read completely.
[0023] In a third aspect, a computer device comprises at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the monitor central station event alarm storage method and / or the monitor central station event alarm indexing method.
[0024] In a fourth aspect, a computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute to implement the monitor central station event alarm storage method and / or the monitor central station event alarm indexing method.
[0025] The present invention has the following beneficial effects:
[0026] (1) After the present invention completes deduplication and compression in the memory of the event alarm data uploaded by the monitor, the event alarm data is stored in the event alarm data file by time segment, and a time-ordered jump table index is constructed in the event alarm data file to support high-performance writing and reading of event alarm data, support time-disordered writing, and ensure relatively high writing and reading performance and low reading delay under low system resource consumption;
[0027] (2) The present invention caches previously sent event alarm information in the memory to determine whether it is repeated, only writes the data file at the beginning and end, and calculates and restores the intermediate process data when reading, which can reduce the amount of data written and read;
[0028] (3) Since the alarm frequency of most monitors is not high, the present invention adds one index information every first preset time when writing data to ensure indexing efficiency. At the same time, the performance loss of traversal search is small. After the entire file is full, the index information every first preset time can also make the index data size within an acceptable range.
[0029] (4) Since the amount of a single event alarm data is very small, the present invention combines multiple event alarm data within the second preset time into a group of event alarm data to reduce the number of reading and writing times, thereby improving disk usage and disk data reading and writing efficiency.
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of 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 creative work. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flow chart of a method for storing event alarms of a central station of a monitor according to an embodiment of the present invention;
[0032] Figure 2 A schematic diagram of a data structure design of an event alarm data file according to an embodiment of the present invention;
[0033] Figure 3 A detailed flow chart of writing event alarm data according to an embodiment of the present invention;
[0034] Figure 4 A detailed flow chart of event alarm data reading according to an embodiment of the present invention;
[0035] Figure 5 A schematic diagram of a processing method of an indexing algorithm for event alarm data according to an embodiment of the present invention;
[0036] Figure 6 Schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments, and all other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making creative work are within the scope of protection of the present invention.
[0038] In the description of the present invention, it should be noted that the terms "comprises", "includes" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0039] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, step identifiers S101, S102, S103, etc. are only used for convenient expression and do not represent the execution order. The corresponding execution order can be adjusted as needed.
[0040] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0041] See also Figure 1 As shown, the present invention discloses a monitoring instrument central station event alarm storage method, comprising the following steps.
[0042] S1, event alarm data structure construction step, defines that the event alarm data file uses a fixed size and is saved in time segments, the file name of each event alarm data file is the time of the first event alarm data, and the data structure of each event alarm data file includes an index segment and a data segment; the index segment includes a number of index information, each index information includes a timestamp and an offset value of the event alarm data in the file, and one index information is added every first preset time when writing data; the data segment includes a number of groups of event alarm data, each group of event alarm data includes a length and compressed data content; each group of event alarm data is merged by multiple event alarm data within a second preset time; wherein, the timestamp of each index uses the minimum occurrence time of the group of event alarm data written when the index information is added; the first preset time is greater than the second preset time.
[0043] See also Figure 2As shown, in this embodiment, the event alarm data file is saved in time segments using a fixed size. The file name of each event alarm data file is the time of the first event alarm data. Each event alarm data file reserves a fixed-size portion to store time-ordered jump table index information. Each index consists of a timestamp and an offset value of the event alarm data in the file, which is fixed at 16 bytes. When writing data, one index information is added every 4 hours. The event alarm data is compressed using the length + data method and appended to the file.
[0044] It should be noted that the reason why the first preset time is set to 4 hours in this embodiment is that the frequency of most monitor alarms is not high, and 4 hours can ensure indexing efficiency. At the same time, when most query requests are queried by time, the performance loss of traversal search after the minimum index of 4 hours is small, and after the entire file is full, the index information every 4 hours can also keep the index data size within an acceptable range. In specific implementation, the first preset time can be set as needed, and the present invention does not limit it.
[0045] S2, an event alarm data writing step, receiving the event alarm data reported by the monitor, extracting the event alarm data and writing it according to the event alarm data structure.
[0046] In this embodiment, before the event alarm data is written to the disk, it is merged and repeated in the memory cache.
[0047] Specifically, the central station will receive event alarm data sent by the monitor every second. If all event alarm data files are written each time, there will be a large amount of duplicate information and a large amount of disk space will be occupied. Therefore, the event alarm information sent previously will be cached in the memory to determine whether it is repeated. The data file is only written at the beginning and end. The intermediate process data will be calculated and restored when reading (the monitor sends data once a second, and all the current alarm information will be sent every second. This alarm information is not different every second, but the alarm of the same problem continues for a period of time, and the same alarm is sent every second. For example: a high heart rate alarm, the patient generally has a high heart rate for a period of time. The monitor sends this information every second, and a large amount of redundant data is saved every second), thereby reducing the amount of data written and read.
[0048] The specific process of merging duplicate processing is to cache the latest alarm status and related information such as whether it is saved to the data file in the memory. When the event alarm data of the next second is received, the alarm type and alarm generation time related information are compared with the memory cache information to find the same event alarm information. If it has been found, it is necessary to determine whether it has been written. If it has been written, it is ignored directly. If not found, it is considered to be a new event alarm that should be written to the data file. At the same time, it is also necessary to determine whether the cached event alarm is still being sent. If it is not being sent, it is considered that the event alarm has ended, and another event alarm data record is written to end.
[0049] See also Figure 3 As shown, the writing process after merging duplicates will be described in detail as follows.
[0050] After the central station receives the event alarm data sent by the monitor and merges and completes it repeatedly, it merges the event alarms that need to be written into a group of 15 minutes according to the event occurrence time and writes them into the data file as one event alarm data. The minimum event alarm occurrence time in the entire group is used as the time of the event alarm data to ensure that each event alarm data written to the data file is within the time range of an index. In this way, all the alarm data contained in a data record written into the data file can fall within the 4-hour time range contained in the same index, so that when reading specific alarm data through the index, the reading range can be reduced to improve performance, and the number of writes can be reduced to improve the compression rate. It is then compressed and appended to the file. Then determine whether the minimum event alarm data time is less than the latest index time. If the data time is less than the latest index time, add a separate index for the data and re-arrange and rewrite the index to ensure time order (the minimum time of all alarms in a single data of the written data file. The data time in this place is the time of the data written to the disk this time. The latest index time is the maximum time of the index data written to the data file. The alarm generation time may be disordered. This may be due to the fact that some alarms require a lot of calculations or the monitor re-transmits. Because the alarm generation time is disordered, the index data generated to write to the data file may also be disordered. The index with disordered time cannot use efficient search algorithms such as binary search algorithms, so it cannot be quickly located based on the query time. Therefore, it is necessary to write the data file to generate the index when receiving the disordered alarm data, and then re-arrange and rewrite the index to ensure time order). At this time, the added index only covers the data, but because the disordered writing is rare, the added index will not cause a significant decrease in write and read performance. If the data time is not less than the latest index time, determine again whether the latest index time has exceeded 4 hours. If it has exceeded 4 hours, add a new index entry to point to the data, otherwise it ends.
[0051] It should be noted that the second preset time is set to 15 minutes in this embodiment because the amount of single alarm data is very small. If the alarms within a short time range are not combined into a record written into the data file, the number of reads and writes will be greatly increased, resulting in a large number of random reads and writes, while the disk usage rate will also be reduced and a large number of invalid disk data will be read and written. In specific implementation, the second preset time can be set as needed, and the present invention does not limit it.
[0052] For further information, see Figure 4 As shown, the present invention also discloses a monitor central station event alarm indexing method, based on the monitor central station event alarm storage method, comprising:
[0053] S31, finding the event alarm data file to be read according to the query time range;
[0054] S32, sequentially read the index information of each event alarm data file, find the range of event alarm data to be read in the file, and then read the event alarm data in sequence;
[0055] S33, decompressing the read event alarm data, and determining again whether the event alarm data is within the time range to be read, if so, outputting the event alarm data; if not, discarding the data;
[0056] S34, determining whether the current event alarm data file has been read completely, if not, continuing to read the next set of event alarm data in the current event alarm data file; if yes, sequentially reading other event alarm data files until all event alarm data files that need to be read have been read completely.
[0057] From the event alarm data structure, we can know that the event alarm data file will reserve a fixed length in the data file to establish a time-ordered skip table index. Each index contains two values: the data time and the data offset value in the file. The length is fixed at 16 bytes. Each index covers a 4-hour time range. Figure 4As shown in the figure, since some alarms require a lot of calculations or retransmission by the monitor, the event alarm may be generated out of order in time, so the index data generated and written into the data file may also be out of order in time. The index out of order in time cannot use efficient search algorithms such as binary search algorithms, so it cannot be quickly located according to the query time. Therefore, it is necessary to write the data file to generate the index when receiving the out-of-order event alarm data, and then re-arrange and rewrite the index to ensure the time-ordered index data, that is, it is necessary to re-arrange and re-write the index when it is not written in time order to ensure order, and the event alarm data is always appended to the file without guaranteeing order. At the same time, in this index structure, if the monitor reports event alarms at a low frequency, most of the data will be associated with the index. If the reporting frequency is high, a single index can cover more data, and it can be highly efficient when reading according to the time range. When writing out of order, the index needs to be re-arranged and re-written, but because the amount of index data is small, the re-arrangement and re-writing is relatively fast. Event alarm data with a large amount of data is always written in sequence to ensure high write performance.
[0058] From above, see Figure 5 As shown, when the event alarm data is subsequently read by time range, the data file to be read is first found through the read time range, and then the index information of each event alarm data file is read sequentially to find the range of the data to be read in the file, and then the event alarm data is read sequentially. Because each index covers event alarms within a time period, the read data time needs to be decompressed after reading the data to determine again whether the event alarm is within the time range to be read. Data that is not within the time range needs to be discarded, and then the entire group is extracted, merged, and sorted to complete the historical data reading. Because the index sequential storage length is fixed and the data volume is small, the scanning index efficiency is high. At the same time, the range of the read file is reduced through the skip table index, thereby ensuring the efficiency of reading historical data by time range.
[0059] See also Figure 6 As shown, the present invention also discloses a computer device, including at least one processor 602; and a memory 601 communicatively connected to the at least one processor 602; wherein the memory 601 stores a computer program executable by the at least one processor 602, and the computer program is executed by the at least one processor 602 so that the at least one processor 602 can execute the monitor central station event alarm storage method and / or the monitor central station event alarm indexing method.
[0060] The computer device may be a personal computer (PC), a laptop or a smart phone, or an all-in-one computer, a handheld computer, a tablet computer (pad), a smart TV player terminal, a vehicle-mounted terminal or a portable device. The operating system of a computer device on the PC side, such as an all-in-one computer, may include but is not limited to Linux system, Unix system, Windows series system (such as Windows XP, Windows 7, etc.), Mac OS X system (operating system of Apple computer), etc. The operating system of a computer device on the mobile side, such as a smart phone, may include but is not limited to Android system, IOS (operating system of Apple mobile phone), Window system, etc.
[0061] Furthermore, this embodiment also discloses a computer-readable storage medium, which stores a computer program, and the computer program enables a computer to execute to implement the monitor central station event alarm storage method and / or the monitor central station event alarm indexing method.
[0062] The above is only a preferred specific implementation of the present invention; however, the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and its improved conception within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for storing event alarms of a central station of a monitor, characterized in that: include: S1, event alarm data structure construction step, defines that the event alarm data file uses a fixed size and is saved in time segments, the file name of each event alarm data file is the time of the first event alarm data, and the data structure of each event alarm data file includes an index segment and a data segment; the index segment includes a number of index information, each index information includes a timestamp and an offset value of the event alarm data in the file, and one index information is added every first preset time when writing data; the data segment includes a number of groups of event alarm data, each group of event alarm data includes a length and compressed data content; each group of event alarm data is merged by multiple event alarm data within a second preset time; wherein, the timestamp of each index uses the minimum occurrence time of the group of event alarm data written when adding the index information; the first preset time is greater than the second preset time; S2, an event alarm data writing step, receiving the event alarm data reported by the monitor, extracting the event alarm data and writing it according to the event alarm data structure.
2. The event alarm storage method of the monitor central station according to claim 1, characterized in that: The process of writing event alarm data includes: S21, reading the data after merging the duplicate event alarm data in the cache; S22, merging and compressing multiple event alarm data within a second preset time into a group; S23, determine whether the minimum event of the current group is less than the timestamp in the last index information; if not, proceed to S24, if yes, proceed to S25; S24, appending the group of event alarm data to the end of the event alarm data file, and determining whether the time of the last index information exceeds a first preset value, and if so, adding new index information to point to the group of event alarm data; S25, appending the group of event alarm data to the end of the event alarm data file, adding new index information to point to the group of event alarm data, re-arranging in chronological order and rewriting the index information.
3. The event alarm storage method of the monitor central station according to claim 2, characterized in that: The method for merging duplicate event alarm data in a cache specifically includes: The latest alarm status and related information of whether it is saved to the data file are cached in the memory. When the event alarm data of the next second is received, the alarm type and the alarm generation time are compared with the memory cache information to find the same event alarm information. If found, determine whether it has been written. If it has been written, ignore it directly. If not found, it is considered to be a new event alarm that needs to be written. At the same time, determine whether the cached event alarm is still being sent. If it is not being sent, it is considered that the event alarm has ended and another event alarm data needs to be written for recording.
4. The event alarm storage method of the monitor central station according to claim 1, characterized in that: The first preset time is 4 hours, and the second preset time is 15 minutes.
5. The event alarm storage method of the monitor central station according to claim 1, characterized in that: The sizes of the index segment and the data segment are fixed.
6. A method for indexing event alarms of a central station of a monitor, characterized in that: The method for storing event alarms of a central station of a monitor according to any one of claims 1 to 5 comprises: S31, finding the event alarm data file to be read according to the query time range; S32, sequentially read the index information of each event alarm data file, find the range of event alarm data to be read in the file, and then read the event alarm data in sequence; S33, decompressing the read event alarm data, and determining again whether the event alarm data is within the time range to be read, if so, outputting the event alarm data; if not, discarding the data; S34, determining whether the current event alarm data file has been read completely, if not, continuing to read the next set of event alarm data in the current event alarm data file; if yes, sequentially reading other event alarm data files until all event alarm data files that need to be read have been read completely.
7. A computer device, characterized in that: It comprises at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the monitor central station event alarm storage method described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program enables a computer to execute to implement the event alarm storage method of a central station of a monitor according to any one of claims 1 to 5.
9. A computer device, characterized in that: It comprises at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the monitor central station event alarm indexing method described in claim 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program enables a computer to execute to implement the event alarm indexing method of the central station of a monitor as claimed in claim 6.