Electrocardiogram file recording method, device and equipment supporting power-off continuous storage and medium

By calculating and replenishing the data of the power-off time after the dynamic ECG detector is powered on, the problem of data incompleteness caused by abnormal power failure in the dynamic ECG system is solved, and the integrity and accuracy of the ECG file are achieved.

CN119970051AActive Publication Date: 2025-05-13CONTEC MEDICAL SYST
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311507723.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2025-05-13
Estimated Expiration
2043-11-13

AI Technical Summary

Technical Problem

When the dynamic electrocardiogram system collects electrocardiogram data, abnormal power loss caused by user movement or battery replacement leads to incomplete ECG data, which affects the accurate drawing of the electrocardiogram.

Method used

By obtaining the current real-time time after the dynamic ECG detector is powered on, determine the sector number of the last effective data storage and the time to start writing, calculate the power outage time, and use the preset ECG waveform data to fill in the disk space corresponding to the target power outage time to obtain a complete ECG data record file.

Benefits of technology

It is realized that after the dynamic ECG detector is abnormally powered off, it can record and supplement the dynamic ECG data before power off when powered on again, ensuring the integrity of the ECG file and avoiding data loss and image errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119970051A_ABST
    Figure CN119970051A_ABST
Patent Text Reader

Abstract

The invention discloses an electrocardiogram file recording method, device and equipment supporting power-off continuous storage and a medium, and relates to the technical field of electrocardiogram data storage.The electrocardiogram file recording method comprises the steps that when a dynamic electrocardiogram detector is powered off and then powered on again, the current power-on real-time time is obtained, determining the sector number corresponding to the last effective dynamic electrocardiogram data storage sector and the corresponding power-on real-time time when the effective dynamic electrocardiogram data starts to be written, and obtaining the previous sector number and the target power-on real-time time; according to the preset sampling time and the previous sector number, the stored effective dynamic electrocardiogram data duration during power failure is determined, the power failure duration of the previous effective dynamic electrocardiogram data storage sector is determined according to the target power-on real-time time, the current power-on real-time time and the effective dynamic electrocardiogram data duration, and the target power failure duration is obtained; and performing data vacancy on a disk space corresponding to the target power-down duration in the last effective dynamic electrocardiogram data storage sector by using preset electrocardiogram waveform data to obtain a complete electrocardiogram data recording file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electrocardiogram data storage, and in particular to an electrocardiogram file recording method, device, equipment and medium supporting power-off continuity. Background Art

[0002] The dynamic electrocardiogram system consists of an electrocardiogram recording box and a processing end, which is used to continuously record and analyze the changes in the electrocardiogram of the heart during human activity and rest over a period of time. The electrocardiogram recording box collects and stores the user's electrocardiogram data over a period of time through electrodes placed on the user's body surface. After the electrocardiogram data collection is completed, the electrocardiogram data is transmitted to the processing end through SD (Secure Digital Memory Card) card and USB (Universal Serial Bus) data line transmission, etc. The processing end reads and automatically analyzes the electrocardiogram data to complete the drawing of the electrocardiogram.

[0003] Since the dynamic electrocardiogram system requires the user to wear the electrocardiogram recording box in real time when using the electrocardiogram recording box to collect electrocardiogram data, it is possible that the electrocardiogram recording box battery may have poor contact for a short time due to the user's movement, resulting in abnormal power failure. In addition, in order to facilitate user use, the electrocardiogram recording box is generally powered by alkaline batteries that are easy to replace. At this time, if the battery is low and needs to be replaced during the electrocardiogram data collection, it will also cause abnormal power failure. After the above-mentioned abnormal power failure occurs, the electrocardiogram recording box will terminate the collection of this electrocardiogram data, resulting in data loss in the electrocardiogram data collected within a period of time, making the final electrocardiogram data incomplete. When the processing end processes the electrocardiogram data with data loss, it is very easy to cause errors in the drawn electrocardiogram, or even make it impossible to draw it at all.

[0004] In summary, in the process of powering on again after an abnormal power failure, recording dynamic ECG data during the abnormal power failure to obtain a complete ECG file is a technical problem to be solved in the art. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide an electrocardiogram file recording method, device, equipment and medium that supports power-off persistence, which can realize the recording of dynamic electrocardiogram data during abnormal power failure during the power-on process after abnormal power failure, so as to obtain a complete electrocardiogram file. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a method for recording an electrocardiogram file that supports power-off persistence, comprising:

[0007] When the Holter monitor is powered on again after power failure, the current power-on real-time time is obtained, and the sector number corresponding to the last valid Holter data storage sector and the power-on real-time time corresponding to the start of writing the valid Holter data are determined, and the corresponding last sector number and target power-on real-time time are obtained;

[0008] Determine a current sector number corresponding to a current sector for storing currently acquired dynamic electrocardiogram data based on the sector number sequence and the previous sector number;

[0009] Determine the duration of valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off according to the sampling time corresponding to the sector and the previous sector number, and determine the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real-time time, the current power-on real-time time and the valid dynamic electrocardiogram data duration, so as to obtain the target power-off duration;

[0010] The disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector is supplemented with data using the preset ECG waveform data to obtain a complete ECG data recording file.

[0011] Optionally, when the Holter monitor is powered off and then powered on again, before obtaining the current power-on real time, the method further includes:

[0012] The disk space of the dynamic electrocardiograph is divided to obtain a number of sectors at different consecutive moments.

[0013] Optionally, the disk space of the dynamic electrocardiogram detector is divided to obtain a number of sectors at different consecutive moments, including:

[0014] Determine corresponding cluster information based on the maximum recording time that can be recorded by the Holter monitor;

[0015] Using the cluster information, the disk space of the dynamic electrocardiogram detector is divided to obtain corresponding clusters;

[0016] The cluster is spatially divided to obtain a number of sectors at different consecutive moments.

[0017] Optionally, after spatially dividing the cluster to obtain a plurality of sectors at consecutive different moments, the method further includes:

[0018] Based on the sectors at the several consecutive different moments, the sectors are numbered according to the cluster information of the cluster to which the sectors belong and the sector position information of the cluster to which the sectors belong, so as to obtain sector numbers corresponding to the sectors.

[0019] Optionally, the determining of the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real-time time corresponding to when the valid dynamic electrocardiogram data starts to be written, and obtaining the corresponding last sector number and the target power-on real-time time includes:

[0020] Acquire the sector number corresponding to the last valid dynamic electrocardiogram data storage sector from the non-volatile storage area, and determine the sector number as the last sector number;

[0021] Correspondingly, determining the current sector number corresponding to the current sector for storing the currently acquired dynamic electrocardiogram data based on the sector number sequence and the previous sector number includes:

[0022] Based on the sector number sequence and the previous sector number, a current sector number corresponding to the current sector for storing the currently acquired dynamic electrocardiogram data is determined from the non-volatile storage area.

[0023] Optionally, determining the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real-time time, the current power-on real-time time and the valid dynamic electrocardiogram data duration to obtain the target power-off duration includes:

[0024] Determine the power-on duration of the last valid dynamic electrocardiogram data storage sector based on the target power-on real-time time and the current power-on real-time time to obtain the target power-on duration;

[0025] The target power-on duration and the valid dynamic electrocardiogram data duration are used to determine the power-off duration of the last valid dynamic electrocardiogram data storage sector to obtain the target power-off duration.

[0026] Optionally, the method of using preset ECG waveform data to fill the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector to obtain a complete ECG data recording file includes:

[0027] The preset ECG waveform data is written into the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector; when the end of the dynamic ECG data recording event is detected, the sector offset corresponding to the target power-off duration is converted, and the sector offset is performed according to the sector offset to fill in the data of the dynamic ECG data of the actual duration, obtain the target ECG data, and construct a complete ECG data recording file based on the target ECG data.

[0028] In a second aspect, the present application discloses an electrocardiogram file recording device that supports power-off persistence, comprising:

[0029] The time acquisition module is used to obtain the current power-on real-time time when the Holter monitor is powered on again after power failure, and determine the sector number corresponding to the last valid Holter data storage sector and the power-on real-time time corresponding to the start of writing of valid Holter data, and obtain the corresponding last sector number and target power-on real-time time;

[0030] A number acquisition module, used to determine the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data based on the sector number sequence and the previous sector number;

[0031] A power-off duration determination module is used to determine the duration of valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off according to the sampling time corresponding to the sector and the last sector number, and determine the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real-time time, the current power-on real-time time and the valid dynamic electrocardiogram data duration, so as to obtain the target power-off duration;

[0032] The file recording module is used to fill in the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector with preset ECG waveform data to obtain a complete ECG data recording file.

[0033] In a third aspect, the present application discloses an electronic device, comprising:

[0034] Memory, used to store computer programs;

[0035] The processor is used to execute the computer program to implement the steps of the aforementioned disclosed electrocardiogram file recording method supporting power-off persistence.

[0036] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed electrocardiogram file recording method supporting power-off persistence are implemented.

[0037] It can be seen that the present application discloses an electrocardiogram file recording method that supports power-off persistence, including: when the dynamic electrocardiogram detector is powered on again after power failure, obtaining the current power-on real-time time, and determining the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real-time time corresponding to the start of writing of the valid dynamic electrocardiogram data, to obtain the corresponding last sector number and the target power-on real-time time; determining the current sector number corresponding to the current sector used to store the currently collected dynamic electrocardiogram data based on the sector number sequence and the last sector number; determining the duration of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off according to the sampling time corresponding to the sector and the last sector number, and determining the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real-time time, the current power-on real-time time and the valid dynamic electrocardiogram data duration, to obtain the target power-off duration; using preset electrocardiogram waveform data to fill in the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector, to obtain a complete electrocardiogram data recording file. It can be seen that for the event of the dynamic electrocardiogram detector being powered on again after power failure, the current power-on real-time time is obtained, and the sector number corresponding to the sector where the last valid dynamic electrocardiogram data storage before the current power-on event and the corresponding power-on real-time time when the valid electrocardiogram data starts to be written are determined, and then the current sector number is obtained, which is used to store the currently collected dynamic electrocardiogram data in the current sector corresponding to the current sector number. In this way, the valid electrocardiogram data generated by power failure and power on again is written to the new sector to distinguish it from the sector where the valid electrocardiogram data was written during the last power failure, and then the sampling time corresponding to the sector and the previous sector number are used to determine whether the dynamic electrocardiogram detector has been powered off. The effective dynamic ECG data duration stored during power-on is determined, and the power-off duration of the last effective dynamic ECG data storage sector is determined according to the target power-on real-time time, the current power-on real-time time and the effective dynamic ECG data duration, so as to obtain the target power-off duration, and finally the preset ECG waveform data is added to the disk space corresponding to the last valid dynamic ECG data storage sector occupied by the target power-off duration, to ensure that the preset ECG waveform data can be added when a power-off event occurs, and the complete ECG data record file can be obtained, avoiding the loss of ECG data caused by power-off during the storage process, facilitating the processing end to identify and process valid data files, and minimizing the adverse experience and impact caused by storage power-off. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] 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 or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0039] Figure 1 A flow chart of an electrocardiogram file recording method supporting power-off persistence disclosed in this application;

[0040] Figure 2 A schematic diagram of an electrocardiogram file recording method for multiple power-off persistence disclosed in the present application;

[0041] Figure 3 A flowchart of a specific electrocardiogram file recording method supporting power-off persistence disclosed in this application;

[0042] Figure 4 This is a schematic diagram of the structure of an electrocardiogram file recording device that supports power-off persistence disclosed in this application;

[0043] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 making creative work are within the scope of protection of the present invention.

[0045] The dynamic electrocardiogram system consists of two parts: an electrocardiogram recording box and a processing end. It is used to continuously record and analyze the changes in the electrocardiogram of the heart during human activity and rest over a period of time. The electrocardiogram recording box collects and stores the user's electrocardiogram data over a period of time through electrodes placed on the user's body surface. After the electrocardiogram data collection is completed, the electrocardiogram data is transmitted to the processing end through SD cards and USB data cables. The processing end reads and automatically analyzes the electrocardiogram data to complete the drawing of the electrocardiogram.

[0046] Since the dynamic electrocardiogram system requires the user to wear the electrocardiogram recording box in real time when using the electrocardiogram recording box to collect electrocardiogram data, it is possible that the electrocardiogram recording box battery may have poor contact for a short time due to the user's movement, resulting in abnormal power failure. In addition, in order to facilitate user use, the electrocardiogram recording box is generally powered by alkaline batteries that are easy to replace. At this time, if the battery is low and needs to be replaced during the electrocardiogram data collection, it will also cause abnormal power failure. After the above-mentioned abnormal power failure occurs, the electrocardiogram recording box will terminate the collection of this electrocardiogram data, resulting in data loss in the electrocardiogram data collected within a period of time, making the final electrocardiogram data incomplete. When the processing end processes the electrocardiogram data with data loss, it is very easy to cause errors in the drawn electrocardiogram, or even make it impossible to draw it at all.

[0047] To this end, the present application provides an ECG file recording solution that supports power-off persistence, which can record dynamic ECG data during the abnormal power outage process during the power-on process after the abnormal power outage, so as to obtain a complete ECG file.

[0048] Reference Figure 1 As shown, the embodiment of the present application discloses a method for recording an electrocardiogram file that supports power-off persistence, including:

[0049] Step S11: When the dynamic electrocardiogram detector is powered on again after power failure, the current power-on real-time time is obtained, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real-time time corresponding to the start of writing the valid dynamic electrocardiogram data are determined, and the corresponding last sector number and target power-on real-time time are obtained.

[0050] In this embodiment, when the Holter monitor is powered on again after power failure, the current power-on real-time time is recorded and the sector number corresponding to the last valid Holter data storage sector is obtained from the non-volatile storage area, and the sector number is determined as the last sector number, that is, the last valid sector number. In this way, the valid Holter data storage sector corresponding to the valid Holter data storage when the Holter monitor is powered off can be determined by the last sector number to obtain the last valid Holter data storage sector. The power-on real-time time corresponding to the start of writing the valid Holter data in the last valid Holter data storage sector is obtained to obtain the target power-on real-time time.

[0051] Step S12: determining the current sector number corresponding to the current sector for storing the currently acquired dynamic electrocardiogram data based on the sector number sequence and the previous sector number.

[0052] In this embodiment, the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data is determined from the non-volatile storage area according to the sector numbering sequence and the previous sector number. It can be understood that the current sector number is determined from the non-volatile storage area according to the sector numbering sequence and the previous sector number, that is, all sectors are sorted according to the numbering sequence, and when the power is turned off and then on again, the current sector number corresponding to the current sector recording the valid dynamic electrocardiogram data after the current power-on is determined according to the numbering sequence and the previous sector number corresponding to the sector recording the valid dynamic electrocardiogram data before the power-off.

[0053] Step S13: Determine the duration of valid dynamic ECG data stored when the dynamic electrocardiogram detector is powered off according to the sampling time corresponding to the sector and the previous sector number, and determine the power-off duration of the last valid dynamic ECG data storage sector according to the target power-on real-time time, the current power-on real-time time and the valid dynamic ECG data duration to obtain the target power-off duration.

[0054] In this embodiment, the effective dynamic electrocardiogram data duration stored when the dynamic electrocardiogram detector is powered off is determined according to the sampling time corresponding to the sector and the previous sector number. Specifically, the sampling time corresponding to each sector is set by the user or preset by the system of the dynamic electrocardiogram detector. Then, the number of sectors in which the electrocardiogram data has been recorded is obtained by using the sector number information contained in the previous sector number, and then the sampling time is multiplied by the number of sectors to obtain the first storage data duration when the power is off, that is, the effective dynamic electrocardiogram data duration. Then, based on the target power-on real-time time and the current power-on real-time time, the power-on duration of the last effective dynamic electrocardiogram data storage sector is determined to obtain the target power-on duration; the target power-on duration and the effective dynamic electrocardiogram data duration are used to determine the power-off duration of the last effective dynamic electrocardiogram data storage sector to obtain the target power-off duration. It can be understood that the target power-on duration of the last effective dynamic electrocardiogram data storage sector is determined by subtracting the target power-on real-time time from the current power-on real-time time. Then, the target power-on duration is subtracted from the valid dynamic ECG data duration to obtain the power-off duration of the last valid dynamic ECG data storage sector, that is, the target power-off duration.

[0055] Reference Figure 2As shown, the sampling time required to write each sector data is preset by the system or set by the user. It should be noted that the power-off event includes: the power-off process and the power-on process. When the dynamic ECG data begins to be stored, the clock chip starts timing and records the real-time time T0 at the same time, which is the target power-on real-time time. When the first power-off event occurs, the clock chip continues to time. At this time, the clock chip obtains a signal and records the first timing T1, which is the current power-on real-time time. The first power-on duration ΔT1=T1-T0 can be calculated, which is the target power-on duration ΔT1. Similarly, the second power-on duration ΔT2=T2-T1 can be obtained. The first power-on duration ΔT1 consists of two durations, namely the first data storage duration H1, which is the effective dynamic ECG data duration H1 and the first power-off duration D1, which is the target power-off duration. Therefore, ΔT1=H1+D1. The sector number (C X , S Y ) can be used to know the number of sectors that have recorded ECG data. By multiplying this number by the sampling time required for each sector data, the first data storage duration H1 when power failure occurs can be calculated. The first power failure duration D1 can be calculated by D1 = ΔT1-H1. According to the above method, multiple ΔT i , H i , D i From this, we can know the actual total recording time ΣΔT i =H+D, where H=H1+...+H N+1 , D=D1+...+D N .like Figure 2 As shown, the first power-off duration = first power-on time - start storage time - first data storage duration; the second power-off duration = second power-on time - first power-on time - second data storage duration; the nth power-off duration = nth power-on time - nth - 1st power-on time - nth data storage duration; the last data storage duration = total data size converted to duration - each data storage duration; total recording duration = sum of each data storage duration + sum of each power-off duration; actual recording total duration = sum of each data storage duration. Among them, the duration of each data storage duration can be calculated by converting the data sampling rate and the size of each data storage duration.

[0056] When a power failure occurs, the writing of the Holter file is interrupted. After power is restored, the number of the sector last written before the power failure is read from the non-volatile storage area, and the file writing continues from the next sector of the sector. For example, the read sector number is (C5, S 10 ), then the next sector number is (C5, S 11), when the power is turned on again, data writing will continue from this sector. The total recording time of the ECG file can be preset in advance or set by the user. If N power failures occur during the recording process, N+1 storage data durations H and N power failure durations D can be obtained.

[0057] Step S14: using the preset ECG waveform data to fill the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector, so as to obtain a complete ECG data recording file.

[0058] In this embodiment, the preset ECG waveform data is written to the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector. When the dynamic ECG data recording event is detected to be over, the sector offset corresponding to the target power-off duration is converted, and the sector offset is performed according to the sector offset to fill the data gap of the dynamic ECG data of the actual duration, obtain the target ECG data, and construct a complete ECG data recording file according to the target ECG data. It can be understood that due to the power-off event during the acquisition process, the effective acquisition duration, that is, the value of the storage data duration H is less than the preset total recording duration of the ECG file. In order to ensure the accuracy of the data duration, the processing end will supplement the storage data duration H when entering data to make it equal to the preset total recording duration of the ECG file. Specifically, the processing end can read the power-on real-time time and the last valid sector number, calculate the power-off time period duration in combination with the starting storage real-time time recorded when starting storage, convert and calculate the sector offset corresponding to the power-off duration, perform sector offset, and restore the actual duration data.

[0059] When the processing end parses the ECG data and power-off information, it first obtains the position of each time node (the time point when recording starts, the time point when the Nth power-on is turned on), calculates the position of the Nth power-off time point, and then calculates the duration of each segment, that is, the duration of each storage segment data and the duration of each power-off segment, and finally supplements the power-off duration data at each power-off time node, thereby obtaining the complete data after recovery. The power-off segment duration data can be uniformly supplemented with agreed characteristic waveform data, such as: triangular wave data of a specific frequency.

[0060] When the recording ends, the file end mark is written, specifically: write the file size, change the file size attribute of the specified file root directory, etc., and then record the actual stored file size to prevent the file from being too large. Specifically, when the dynamic ECG data collection is completed, the dynamic ECG file writing ends, and the end mark is written to the last sector (C x’ , S Y’ ), the entire ECG data recording file is written. When the file is written, the entire ECG data recording file occupies sectors (C1, S1) to (C x’ , SY’ ), the sectors that have been assigned sector numbers but not occupied will be released after the file is written to reduce the file size. It can be seen that updating the file size attribute according to the recorded continuous sector size when the file ends storage not only effectively reduces the storage space occupied by the file, but also saves time for the processing end to process data in units of files, which has practical significance.

[0061] It can be seen that the present application discloses an ECG file recording method that supports power-off persistence, including: when the dynamic electrocardiogram detector is powered on again after power failure, the current power-on real-time time is obtained, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real-time time corresponding to the start of writing of the valid dynamic electrocardiogram data are determined to obtain the corresponding last sector number and the target power-on real-time time; based on the sector numbering sequence and the last sector number, the current sector number corresponding to the current sector used to store the currently collected dynamic electrocardiogram data is determined; according to the sampling time corresponding to the sector and the last sector number, the duration of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined, and the power-off duration of the last valid dynamic electrocardiogram data storage sector is determined according to the target power-on real-time time, the current power-on real-time time and the duration of the valid dynamic electrocardiogram data to obtain the target power-off duration; the preset ECG waveform data is written to the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector to obtain a complete ECG data recording file. It can be seen that for the event of the dynamic electrocardiogram detector being powered on again after power failure, the current power-on real-time time is obtained, and the sector number corresponding to the sector where the last valid dynamic electrocardiogram data storage before the current power-on event and the corresponding power-on real-time time when the valid electrocardiogram data starts to be written are determined, and then the current sector number is obtained, which is used to store the currently collected dynamic electrocardiogram data in the current sector corresponding to the current sector number. In this way, the valid electrocardiogram data generated by power failure and power on again is written to the new sector to distinguish it from the sector where the valid electrocardiogram data was written during the last power failure, and then the sampling time corresponding to the sector and the previous sector number are used to determine whether the dynamic electrocardiogram detector has been powered off. The effective dynamic ECG data duration stored during power-on is determined, and the power-off duration of the last effective dynamic ECG data storage sector is determined according to the target power-on real-time time, the current power-on real-time time and the effective dynamic ECG data duration, so as to obtain the target power-off duration, and finally the preset ECG waveform data is added to the disk space corresponding to the last valid dynamic ECG data storage sector occupied by the target power-off duration, to ensure that the preset ECG waveform data can be added when a power-off event occurs, and the complete ECG data record file can be obtained, avoiding the loss of ECG data caused by power-off during the storage process, facilitating the processing end to identify and process valid data files, and minimizing the adverse experience and impact caused by storage power-off.

[0062] Reference Figure 3 As shown, the embodiment of the present invention discloses a specific electrocardiogram file recording method that supports power-off persistence, in step S11: when the dynamic electrocardiogram detector is powered off and then powered on again, before obtaining the current power-on real-time time, it also includes:

[0063] Step S21: Divide the disk space of the dynamic electrocardiograph to obtain a number of sectors at different consecutive moments.

[0064] In this embodiment, the corresponding cluster information is determined based on the maximum recording time that the dynamic electrocardiogram detector can record; the disk space of the dynamic electrocardiogram detector is divided using the cluster information to obtain the corresponding clusters; the clusters are spatially divided to obtain a number of sectors at different consecutive moments. It can be understood that the number of clusters is determined based on the maximum allowed recording time, and continuous clusters are created in the disk space based on the number of clusters. For example, if the maximum allowed recording time is H, the dynamic electrocardiogram data with a recording time of H requires X clusters of space to store, and the cluster number of each cluster is defined as C1~C X In one embodiment, the maximum recording time allowed by the dynamic electrocardiograph is 24 hours. According to the maximum recording time allowed by the dynamic electrocardiograph, the memory needs 234.375M (Mega) to store the electrocardiogram data, that is, a total of 15,000 clusters are required. Then, the cluster space is further divided on each cluster to obtain several sectors at different consecutive moments. For example, each cluster is divided into Y sectors, and each sector number is defined as S1~S Y In this way, X×Y sectors are obtained.

[0065] Step S22: Based on the sectors at the several consecutive different moments, the sectors are numbered according to the cluster information of the cluster to which each sector belongs and the sector position information of the cluster to which each sector belongs, so as to obtain sector numbers corresponding to the sectors.

[0066] In this embodiment, each sector is numbered based on the cluster information of the cluster to which each sector belongs and the sector position information of each sector in the cluster to which it belongs. Specifically, when a sector is the Cth cluster, X In the cluster, the sector number is S Y When the position is, the corresponding sector number is (C X , S Y ), thus, in the process of writing dynamic ECG data, each individual sector is addressed by the sector number, and the dynamic ECG data is written into the addressed sector.

[0067] In this embodiment, the FAT16 (File Allocation Table, 16-bit) format is used as an example for explanation. It should be noted that this embodiment can also be used for other file formats such as FAT32 (File Allocation Table, 32-bit) or NTFS (New Technology File System), and no specific limitation is made thereto. In the FAT16 format, a cluster of data contains 32 sectors. When the dynamic electrocardiograph system starts recording electrocardiograph data once, the system automatically allocates the required disk space according to the 24-hour recording time set by the user, creates 15,000 continuous clusters, each cluster contains 32 sectors, and 15,000×32 sectors can be obtained. In the process of writing the collected dynamic electrocardiograph data, data writing starts from the first sector (C1, S1).

[0068] When updating the data sector, the sector number is recorded and written into the non-volatile storage area, wherein the non-volatile storage area may specifically include but is not limited to: Flash (memory), etc. Specifically, when writing the collected dynamic ECG data to a file, the sector number (C X , S Y ), recorded in the non-volatile storage area. For example: when the sector number (C5, S 10 ) sector, the sector number (C5, S 10 ) is recorded in the non-volatile storage area.

[0069] When a power outage occurs, after power is restored, the real-time power-on time and the last valid sector number are recorded, and then the ECG data is stored in the order of the sector numbers. When the processing end enters data, the actual duration data can be restored based on the recorded power-off information, where the actual duration data = storage duration data + power-off duration data.

[0070] It can be seen that the writing method of a single sector of a file replaces the commonly used method of writing a file to a cluster, which improves the data storage accuracy when restoring storage due to anomalies, greatly reduces the interference caused by errors, and facilitates the post-processing of dynamic ECG data; in addition, the storage method of pre-allocated continuous storage sectors of files can achieve stable data storage, and with the real-time recording of the recorded data sector numbers, it is convenient to accurately locate each time node, which enhances the security of the entire file data storage and also provides a reliable method for accurately finding key time nodes when repairing data anomalies.

[0071] Reference Figure 4As shown, an embodiment of the present invention discloses an electrocardiogram file recording device supporting power-off persistence, comprising:

[0072] The time acquisition module 11 is used to obtain the current power-on real-time time when the Holter monitor is powered on again after power failure, and determine the sector number corresponding to the last valid Holter data storage sector and the power-on real-time time corresponding to the start of writing the valid Holter data, and obtain the corresponding last sector number and the target power-on real-time time;

[0073] A number acquisition module 12, used to determine the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data based on the sector number sequence and the previous sector number;

[0074] The power-off duration determination module 13 is used to determine the duration of valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off according to the sampling time corresponding to the sector and the last sector number, and determine the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real-time time, the current power-on real-time time and the valid dynamic electrocardiogram data duration, so as to obtain the target power-off duration;

[0075] The file recording module 14 is used to write the preset ECG waveform data into the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector to obtain a complete ECG data recording file.

[0076] It can be seen that the present application discloses that when the dynamic electrocardiogram detector is powered on again after being powered off, the current power-on real-time time is obtained, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real-time time corresponding to the start of writing of the valid dynamic electrocardiogram data are determined to obtain the corresponding last sector number and the target power-on real-time time; based on the sector numbering sequence and the last sector number, the current sector number corresponding to the current sector used to store the currently collected dynamic electrocardiogram data is determined; according to the sampling time corresponding to the sector and the last sector number, the duration of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined, and according to the target power-on real-time time, the current power-on real-time time and the duration of the valid dynamic electrocardiogram data, the power-off duration of the last valid dynamic electrocardiogram data storage sector is determined to obtain the target power-off duration; the preset ECG waveform data is written to the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector to obtain a complete ECG data record file. It can be seen that for the event of the dynamic electrocardiogram detector being powered on again after power failure, the current power-on real-time time is obtained, and the sector number corresponding to the sector where the last valid dynamic electrocardiogram data storage before the current power-on event and the corresponding power-on real-time time when the valid electrocardiogram data starts to be written are determined, and then the current sector number is obtained, which is used to store the currently collected dynamic electrocardiogram data in the current sector corresponding to the current sector number. In this way, the valid electrocardiogram data generated by power failure and power on again is written to the new sector to distinguish it from the sector where the valid electrocardiogram data was written during the last power failure, and then the sampling time corresponding to the sector and the previous sector number are used to determine whether the dynamic electrocardiogram detector has been powered off. The effective dynamic ECG data duration stored during power-on is determined, and the power-off duration of the last effective dynamic ECG data storage sector is determined according to the target power-on real-time time, the current power-on real-time time and the effective dynamic ECG data duration, so as to obtain the target power-off duration, and finally the preset ECG waveform data is added to the disk space corresponding to the last valid dynamic ECG data storage sector occupied by the target power-off duration, to ensure that the preset ECG waveform data can be added when a power-off event occurs, and the complete ECG data record file can be obtained, avoiding the loss of ECG data caused by power-off during the storage process, facilitating the processing end to identify and process valid data files, and minimizing the adverse experience and impact caused by storage power-off.

[0077] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0078] Figure 5A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the electrocardiogram file recording method supporting power-off continuity disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0079] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0080] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0081] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0082] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the processor 21 on the massive data 223 in the memory 22, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the electrocardiogram file recording method supporting power-off persistence executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data received by the electronic device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0083] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed electrocardiogram file recording method supporting power-off persistence is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0084] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0085] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. The steps of the method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly with hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory RAM (Random Access Memory), memory, read-only memory ROM (Read Only Memory), electrically programmable EPROM (Electrically Programmable Read Only Memory), electrically erasable programmable EEPROM (ElectricErasableProgrammableReadOnlyMemory), register, hard disk, removable disk, CD-ROM (CompactDisc-ReadOnlyMemory), or any other form of storage medium known in the technical field.

[0086] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" 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 other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0087] The above is a detailed introduction to the ECG file recording method, device, equipment and medium that supports power-off persistence provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for recording electrocardiogram files that supports power-off persistence, characterized in that: include: When the Holter monitor is powered on again after power failure, the current power-on real-time time is obtained, and the sector number corresponding to the last valid Holter data storage sector and the power-on real-time time corresponding to the start of writing the valid Holter data are determined, and the corresponding last sector number and target power-on real-time time are obtained; Determine a current sector number corresponding to a current sector for storing currently acquired dynamic electrocardiogram data based on the sector number sequence and the previous sector number; Determine the duration of valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off according to the sampling time corresponding to the sector and the previous sector number, and determine the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real-time time, the current power-on real-time time and the valid dynamic electrocardiogram data duration, so as to obtain the target power-off duration; The disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector is supplemented with data using the preset ECG waveform data to obtain a complete ECG data recording file.

2. The electrocardiogram file recording method supporting power-off persistence according to claim 1, characterized in that: When the dynamic electrocardiogram detector is powered on again after power failure, before obtaining the current power-on real time, it also includes: The disk space of the dynamic electrocardiograph is divided to obtain a number of sectors at different consecutive moments.

3. The electrocardiogram file recording method supporting power-off persistence according to claim 2, characterized in that: The disk space of the dynamic electrocardiogram detector is divided to obtain a number of sectors at different consecutive moments, including: Determine corresponding cluster information based on the maximum recording time that can be recorded by the Holter monitor; Using the cluster information, the disk space of the dynamic electrocardiogram detector is divided to obtain corresponding clusters; The cluster is spatially divided to obtain a number of sectors at different consecutive moments.

4. The electrocardiogram file recording method supporting power-off persistence according to claim 3, characterized in that: After the cluster is spatially divided to obtain a plurality of sectors at consecutive different moments, the method further includes: Based on the sectors at the several consecutive different moments, the sectors are numbered according to the cluster information of the cluster to which the sectors belong and the sector position information of the cluster to which the sectors belong, so as to obtain sector numbers corresponding to the sectors.

5. The electrocardiogram file recording method supporting power-off persistence according to claim 1, characterized in that: The step of determining the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real-time time corresponding to when the valid dynamic electrocardiogram data starts to be written, and obtaining the corresponding last sector number and the target power-on real-time time, comprises: Acquire the sector number corresponding to the last valid dynamic electrocardiogram data storage sector from the non-volatile storage area, and determine the sector number as the last sector number; Correspondingly, determining the current sector number corresponding to the current sector for storing the currently acquired dynamic electrocardiogram data based on the sector number sequence and the previous sector number includes: Based on the sector number sequence and the previous sector number, a current sector number corresponding to the current sector for storing the currently acquired dynamic electrocardiogram data is determined from the non-volatile storage area.

6. The electrocardiogram file recording method supporting power-off persistence according to claim 1, characterized in that: The step of determining the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real-time time, the current power-on real-time time, and the valid dynamic electrocardiogram data duration to obtain the target power-off duration includes: Determine the power-on duration of the last valid dynamic electrocardiogram data storage sector based on the target power-on real-time time and the current power-on real-time time to obtain the target power-on duration; The target power-on duration and the valid dynamic electrocardiogram data duration are used to determine the power-off duration of the last valid dynamic electrocardiogram data storage sector to obtain the target power-off duration.

7. The electrocardiogram file recording method supporting power-off persistence according to any one of claims 1 to 6, characterized in that: The method of using the preset ECG waveform data to fill the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector to obtain a complete ECG data recording file includes: The preset ECG waveform data is written into the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector; when the end of the dynamic ECG data recording event is detected, the sector offset corresponding to the target power-off duration is converted, and the sector offset is performed according to the sector offset to fill in the data of the dynamic ECG data of the actual duration, obtain the target ECG data, and construct a complete ECG data recording file based on the target ECG data.

8. An electrocardiogram file recording device supporting power-off persistence, characterized in that: include: The time acquisition module is used to obtain the current power-on real-time time when the Holter monitor is powered on again after power failure, and determine the sector number corresponding to the last valid Holter data storage sector and the power-on real-time time corresponding to the start of writing of valid Holter data, and obtain the corresponding last sector number and target power-on real-time time; A number acquisition module, used to determine the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data based on the sector number sequence and the previous sector number; A power-off duration determination module is used to determine the duration of valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off according to the sampling time corresponding to the sector and the last sector number, and determine the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real-time time, the current power-on real-time time and the valid dynamic electrocardiogram data duration, so as to obtain the target power-off duration; The file recording module is used to fill in the disk space corresponding to the target power-off duration in the last valid dynamic ECG data storage sector with preset ECG waveform data to obtain a complete ECG data recording file.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the electrocardiogram file recording method supporting power-off persistence as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the electrocardiogram file recording method supporting power-off persistence as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Dynamic electrocardiogram processing method and system

    CN109480820A

  • FTL power failure test method, system and device and storage medium

    CN110619918A

  • Data processing method, computer system and readable medium

    CN115793975A

  • Device for estimating optical disk defect

    JP1986211876A