Electrocardiogram file recording method, device and equipment supporting power-off persistence and medium
By acquiring the real-time time and sector number when the dynamic electrocardiogram monitor is powered on again after a power outage, calculating the power outage duration, and filling in the missing data, the problem of incomplete data caused by power outages is solved, ensuring the integrity of electrocardiogram data and the accuracy of plotting.
Patent Information
- Application Number
- CN202311507723.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-11-13
AI Technical Summary
When a dynamic electrocardiogram (ECG) system experiences an abnormal power outage, ECG data acquisition ceases, resulting in incomplete data and affecting the accuracy of ECG mapping.
By obtaining the current real-time time and the last valid data storage sector number when the dynamic electrocardiogram monitor is powered on again after a power outage, the current sector number is determined, and the power outage duration is calculated based on the sampling time and real-time time. The missing data is then filled in using preset electrocardiogram waveform data to obtain a complete electrocardiogram data record.
It enables the acquisition of complete ECG data records during the power-on process after a power outage, avoiding data loss and improving the accuracy of ECG drawing.
Smart Images

Figure CN119970051B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electrocardio data storage, and particularly relates to an electrocardiogram file recording method and device supporting power-off continuation, equipment and a medium. BACKGROUND
[0002] A dynamic electrocardiogram system is composed of an electrocardio recording box and a processing end, and is used for continuously recording and analyzing the changes of electrocardiogram of a heart in a human body in an active state and a quiet state within a period of time. The electrocardio recording box collects and stores electrocardio data of a user within a period of time through electrodes placed on the body surface of the user, and after the electrocardio data collection is completed, the electrocardio data is transmitted to the processing end through an SD (Secure Digital Memory Card, secure digital memory card) card and a USB (Universal Serial Bus, universal serial bus) data line transmission, and the electrocardio data is read and automatically analyzed by the processing end, so as to complete the drawing of the electrocardiogram.
[0003] Since the dynamic electrocardiogram system needs the user to wear the electrocardio recording box in real time when collecting the electrocardio data by using the electrocardio recording box, the battery of the electrocardio recording box may be in poor contact for a short time due to the movement of the user, so that the abnormal power-off occurs. In addition, in order to facilitate the use of the user, the electrocardio recording box generally uses an alkaline battery which is convenient to replace for power supply, and if the battery needs to be replaced due to insufficient power during the collection of the electrocardio data, the abnormal power-off also occurs. After the abnormal power-off occurs, the electrocardio recording box terminates the collection of the electrocardio data, so that the electrocardio data collected within a period of time is lost, and the electrocardio data obtained is incomplete. When the processing end processes the electrocardio data with data loss, the electrocardiogram drawn is extremely easy to have errors, and even cannot be drawn.
[0004] In summary, during the process of re-powering after abnormal power-off, the recording of the dynamic electrocardio data in the abnormal power-off process is realized to obtain a complete electrocardiogram file, which is a technical problem to be solved in the field. SUMMARY
[0005] Therefore, the present application aims to provide an electrocardiogram file recording method and device supporting power-off continuation, equipment and a medium, which can realize the recording of the dynamic electrocardio data in the abnormal power-off process during the process of re-powering after abnormal power-off, so as to obtain a complete electrocardiogram file. The specific scheme is as follows.
[0006] In a first aspect, the present application discloses an electrocardiogram file recording method supporting power-off continuation, comprising the following steps.
[0007] When the dynamic electrocardiogram detector is powered on again after power failure, a current power-on real time is obtained, and a sector number corresponding to a last valid dynamic electrocardiogram data storage sector and a power-on real time corresponding to a start of writing of the valid dynamic electrocardiogram data are determined, to obtain a corresponding last sector number and a target power-on real time;
[0008] A current sector number corresponding to a current sector for storing currently collected dynamic electrocardiogram data is determined based on a sector number sequence and the last sector number;
[0009] A duration of valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined according to a sampling time corresponding to a sector and the last sector number, and a power-off duration of the last valid dynamic electrocardiogram data storage sector is determined according to the target power-on real time, the current power-on real time and the duration of the valid dynamic electrocardiogram data, to obtain a target power-off duration;
[0010] Data is supplemented in disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector by using preset electrocardiogram waveform data, to obtain a complete electrocardiogram data record file.
[0011] Optionally, before the current power-on real time is obtained when the dynamic electrocardiogram detector is powered on again after power failure, the method further includes:
[0012] Disk space of the dynamic electrocardiogram detector is divided to obtain sectors at a plurality of continuous time points.
[0013] Optionally, the disk space of the dynamic electrocardiogram detector is divided to obtain the sectors at the plurality of continuous time points, and the method further includes:
[0014] Corresponding cluster information is determined based on a maximum recordable record duration of the dynamic electrocardiogram detector;
[0015] The disk space of the dynamic electrocardiogram detector is divided by using the cluster information to obtain corresponding clusters.
[0016] The clusters are spatially divided to obtain the sectors at the plurality of continuous time points.
[0017] Optionally, after the clusters are spatially divided to obtain the sectors at the plurality of continuous time points, the method further includes:
[0018] The sectors are numbered based on cluster information of clusters to which the sectors belong and sector position information of the clusters to which the sectors belong, to obtain sector numbers corresponding to the sectors.
[0019] Optionally, the 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, obtaining the corresponding last sector number and target power-on real-time time, comprises:
[0020] acquiring the sector number corresponding to the last valid dynamic electrocardiogram data storage sector from the non-volatile storage area, and determining the sector number as the last sector number;
[0021] Correspondingly, the determining 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 last sector number comprises:
[0022] determining the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data from the non-volatile storage area based on the sector number sequence and the last sector number.
[0023] Optionally, the 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 a target power-off duration, comprises:
[0024] determining 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 a target power-on duration;
[0025] determining the power-off duration of the last valid dynamic electrocardiogram data storage sector using the target power-on duration and the valid dynamic electrocardiogram data duration, to obtain a target power-off duration.
[0026] Optionally, the data supplementing in the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector using preset electrocardiogram waveform data, to obtain a complete electrocardiogram data record file, comprises:
[0027] writing preset electrocardiogram waveform data into the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector, when a dynamic electrocardiogram data record event is detected to end, converting the sector offset corresponding to the target power-off duration, and performing sector offset according to the sector offset, to supplement the dynamic electrocardiogram data of the actual duration, obtain target electrocardiogram data, and construct a complete electrocardiogram data record file according to the target electrocardiogram data.
[0028] In a second aspect, the application discloses an electrocardiogram file recording device supporting power-off continuation, comprising:
[0029] The time acquisition module is configured to acquire a current power-on real time when the dynamic electrocardiogram detector is powered on again after power failure, determine a sector number corresponding to a last valid dynamic electrocardiogram data storage sector and a power-on real time corresponding to a start of writing of the valid dynamic electrocardiogram data, and obtain a corresponding last sector number and a target power-on real time.
[0030] The number acquisition module is configured to determine a current sector number corresponding to a current sector for storing the currently collected dynamic electrocardiogram data based on a sector number sequence and the last sector number.
[0031] The power failure duration determination module is configured to determine a duration of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off according to a sampling time corresponding to a sector and the last sector number, and determine a power failure duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real time, the current power-on real time and the duration of the valid dynamic electrocardiogram data, to obtain a target power failure duration.
[0032] The file recording module is configured to perform data compensation on disk space corresponding to the target power failure duration in the last valid dynamic electrocardiogram data storage sector by using preset electrocardiogram waveform data, to obtain a complete electrocardiogram data record file.
[0033] In a third aspect, the present application discloses an electronic device, comprising:
[0034] A memory is configured to save a computer program.
[0035] A processor is configured to execute the computer program to implement steps of the electrocardiogram file recording method supporting power failure continuation disclosed above.
[0036] In a fourth aspect, the present application discloses a computer readable storage medium configured to store a computer program; wherein the computer program is executed by a processor to implement steps of the electrocardiogram file recording method supporting power failure continuation disclosed above.
[0037] It can be seen that the application discloses a power-off persistent electrocardiogram file recording method, which comprises the following steps: when a dynamic electrocardiogram detector is powered on again after power-off, current power-on real time is obtained, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real time corresponding to the start of writing of the valid dynamic electrocardiogram data are determined to obtain the corresponding last sector number and target power-on real time; the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data is determined based on the sector number sequence and the last sector number; the length of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined according to the sampling time corresponding to the sector and the last sector number, and the power-off duration of the last valid dynamic electrocardiogram data storage sector is determined according to the target power-on real time, the current power-on real time and the length of the valid dynamic electrocardiogram data to obtain a target power-off duration; the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector is supplemented with preset electrocardiogram waveform data to obtain a complete electrocardiogram data record file. It can be seen that for the event of powering on again of the dynamic electrocardiogram detector after power-off, the current power-on real time is obtained, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector before the current power-on event and the power-on real time corresponding to the start of writing of the valid electrocardiogram data are determined, and then the current sector number is obtained for storing the currently collected dynamic electrocardiogram data in the current sector corresponding to the current sector number. In this way, the valid electrocardiogram data generated after power-off is written into a new sector to distinguish from the sector in which the valid electrocardiogram data is written when power-off last time, and then the length of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined according to the sampling time corresponding to the sector and the last sector number, and the power-off duration of the last valid dynamic electrocardiogram data storage sector is determined according to the target power-on real time, the current power-on real time and the length of the valid dynamic electrocardiogram data to obtain a target power-off duration. Finally, the preset electrocardiogram waveform data is supplemented into the disk space corresponding to the last valid dynamic electrocardiogram data storage sector occupied by the target power-off duration, so that the preset electrocardiogram waveform data can be supplemented when a power-off event occurs, complete electrocardiogram data record files can be obtained, the missing of electrocardiogram data caused by power-off during storage is avoided, the processing end can identify and process valid data files, and the adverse experience and influence caused by power-off during storage are minimized. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only belong to the embodiments of the present application, and those skilled in the art can also obtain other drawings according to the provided drawings without any creative effort.
[0039] Figure 1 A flow chart of an electrocardiogram file recording method supporting power-off continuation disclosed in the present application;
[0040] Figure 2 A schematic diagram of an electrocardiogram file recording method supporting multiple power-off continuation disclosed in the present application;
[0041] Figure 3 A flow chart of a specific electrocardiogram file recording method supporting power-off continuation disclosed in the present application;
[0042] Figure 4 A structural schematic diagram of an electrocardiogram file recording device supporting power-off continuation disclosed in the present application;
[0043] Figure 5 A structural diagram of an electronic device disclosed in the present application. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0045] The dynamic electrocardiogram system is composed of an electrocardiogram recording box and a processing end, and is used for continuously recording and analyzing the changes of electrocardiogram of a heart in a human body under active and quiet states for a period of time. The electrocardiogram recording box collects and stores electrocardiogram data of a user for a period of time through electrodes placed on the body surface of the user. After the electrocardiogram data collection is completed, the electrocardiogram data is transmitted to the processing end through an SD card and a USB data line, and the processing end reads and automatically analyzes the electrocardiogram data, so as to complete the drawing of the electrocardiogram.
[0046] Since the dynamic electrocardiogram system needs the user to wear the electrocardiogram recording box in real time when collecting electrocardiogram data by using the electrocardiogram recording box, the battery of the electrocardiogram recording box may be in short contact for a short time due to the user's movement, and thus abnormal power-off may occur. In addition, in order to facilitate the user to use, the electrocardiogram recording box generally uses alkaline batteries which are convenient to replace for power supply. If the battery needs to be replaced due to insufficient power during the collection of electrocardiogram data, abnormal power-off may also occur. After the above abnormal power-off occurs, the electrocardiogram recording box will terminate the collection of electrocardiogram data this time, so that the electrocardiogram data collected in a period of time finally appears data loss, and the electrocardiogram obtained finally is incomplete. When the processing end processes the electrocardiogram data with data loss, the electrocardiogram drawn is extremely easy to have errors, and even cannot be drawn at all.
[0047] Therefore, the application provides an electrocardiogram file recording scheme supporting power-off continuation, which can realize the recording of dynamic electrocardiogram data in the abnormal power-off process to obtain a complete electrocardiogram file during the re-power-on process after abnormal power-off.
[0048] Referring to Figure 1 The application embodiment discloses an electrocardiogram file recording method supporting power-off continuation, which comprises the following steps:
[0049] Step S11: When the dynamic electrocardiogram detector is powered off and then powered on, the current power-on real time is obtained, the sector number corresponding to the last valid dynamic electrocardiogram data storage sector is determined, and the power-on real time corresponding to the start of writing of the valid dynamic electrocardiogram data is determined, to obtain the corresponding last sector number and target power-on real time.
[0050] In the embodiment, when the dynamic electrocardiogram detector is powered off and then powered on, the current power-on real time is recorded, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector is obtained from the non-volatile storage area. The sector number is determined as the last sector number, that is, the last valid sector number. In this way, the last sector number can be used to determine the valid dynamic electrocardiogram data storage sector corresponding to the valid dynamic electrocardiogram data storage when the dynamic electrocardiogram detector is powered off, to obtain the last valid dynamic electrocardiogram data storage sector. The power-on real time corresponding to the start of writing of the valid dynamic electrocardiogram data in the last valid dynamic electrocardiogram data storage sector is obtained, to obtain the target power-on real time.
[0051] Step S12: The current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data is determined based on the sector number sequence and the last sector number.
[0052] In the embodiment, the current sector number corresponding to the current sector storing the currently collected dynamic electrocardiogram data is determined from the nonvolatile storage area according to the sector number sequence and the last sector number. It can be understood that the current sector number is determined from the nonvolatile storage area according to the sector number sequence and the last sector number, that is, all sectors are sorted according to the number sequence, and when power-off and power-on again, the current sector number corresponding to the current sector recording valid dynamic electrocardiogram data after power-on is determined according to the number sequence and the last sector number corresponding to the sector recording valid dynamic electrocardiogram data before power-off.
[0053] Step S13: determining the length 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 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 length of valid dynamic electrocardiogram data to obtain the target power-off duration.
[0054] In the embodiment, the length of valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined according to the sampling time corresponding to the sector and the last 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 recording electrocardiogram data is obtained by using the sector number information contained in the last sector number, and then the length of data stored for the first time when power-off occurs, that is, the length of valid dynamic electrocardiogram data, is obtained by multiplying the sampling time by the number of sectors. Then, the power-on duration of the last valid dynamic electrocardiogram data storage sector is determined 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 power-off duration of the last valid dynamic electrocardiogram data storage sector is determined by using the target power-on duration and the length of valid dynamic electrocardiogram data to obtain the target power-off duration. It can be understood that the target power-on duration of the last valid 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 power-off duration of the last valid dynamic electrocardiogram data storage sector, that is, the target power-off duration, is obtained by subtracting the length of valid dynamic electrocardiogram data from the target power-on duration.
[0055] Reference Figure 2As shown, the sampling time required to write data to each sector is preset by the system or set by the user. It is important to note that a power-down event includes both a power-down process and a power-on process. When dynamic ECG data begins to be stored, the clock chip simultaneously starts timing and records the real-time time T0, which is the target power-on real-time time. When the first power-down event occurs, the clock chip continues timing, receiving a signal to record the first timing T1, which is the current power-on real-time time. The first power-on duration ΔT1 = T1 - T0, which is the target power-on duration ΔT1, can be calculated. Similarly, the second power-on duration ΔT2 = T2 - T1 can be obtained. The first power-on duration ΔT1 consists of two durations: the first data storage duration H1, which is the effective dynamic ECG data duration H1, and the first power-down duration D1, which is the target power-down duration. Therefore, ΔT1 = H1 + D1. The sector number (C) stored in the non-volatile memory area when the power-down event occurs can be read. X S Y The number of sectors containing recorded ECG data can be determined. Multiplying this number by the sampling time required for each sector allows us to calculate the initial data storage duration H1 during a power outage. The duration of the first power outage, D1, can be calculated using the formula D1 = ΔT1 - H1. Following this method, multiple ΔT values can be obtained. i H i D i The value of ΣΔT. 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 duration of the first power outage is calculated as follows: first power-on time - start storage time - duration of the first data storage segment; second power outage duration is calculated as: second power-on time - first power-on time - duration of the second data storage segment; nth power outage duration is calculated as: nth power-on time - (n-1)th power-on time - duration of the nth data storage segment; last data storage duration is calculated as: total data size converted to duration - duration of each data storage segment; total recording duration is calculated as: sum of durations of each data storage segment + sum of durations of each power outage segment; actual total recording duration is calculated as: sum of durations of each data storage segment. The duration of each data storage segment can be calculated using the data sampling rate and the data size of each segment.
[0056] When a power outage occurs, the dynamic ECG file writing is interrupted. Upon power restoration, the file reads the sector number last written before the power outage from the non-volatile memory and resumes writing from the next sector. For example, the sector number read is (C5, S...). 10 If the next sector number is (C5, S), then the next sector number is (C5, S). 11), when power is on again, the data write will continue from the sector. The total length of the ECG file can be preset or set by the user. If N power-off events occur during the recording process, N+1 storage data length H and N power-off length D can be obtained.
[0057] Step S14: using the preset ECG waveform data to fill in the data in the disk space corresponding to the target power-off length in the last valid dynamic ECG data storage sector, to obtain a complete ECG data record file.
[0058] In this embodiment, the preset ECG waveform data is written into the disk space corresponding to the target power-off length in the last valid dynamic ECG data storage sector, and when the dynamic ECG data recording event is detected to end, the sector offset corresponding to the target power-off length is converted, and the sector offset is performed according to the sector offset, to fill in the data of the actual length of the dynamic ECG data, obtain the target ECG data, and construct a complete ECG data record file according to the target ECG data. It can be understood that due to the power-off event occurring during the collection process, the valid collection length, i.e. the value of the storage data length H, is less than the total preset recording length of the ECG file. In order to ensure the accuracy of the data length, the processing end will supplement the storage data length H when entering the data, so that it is equal to the total preset recording length 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 length in combination with the starting storage real-time time recorded at the beginning of the storage, convert and calculate the sector offset corresponding to the power-off length, perform the sector offset, and restore the actual length data.
[0059] When the processing end analyzes the ECG data and the power-off information, the positions of each time node (the starting recording time point, the Nth power-on time point) are obtained first, the Nth power-off time point position is calculated, then the lengths of each section are calculated, i.e. the lengths of each storage section data and each power-off section, and finally the data of the Nth power-off length is supplemented at each power-off time node, so that the complete data after restoration is obtained. The power-off section length data can be uniformly supplemented as the agreed characteristic waveform data, for example, the triangular wave data of a specific frequency.
[0060] When the recording is ended, the end marker is written into the file, specifically: the file size is written, the file size attribute of the specified file root directory is changed, etc., and then the actual storage file size is recorded to prevent the file from being too large. Specifically, when the dynamic ECG data collection is completed, the dynamic ECG file is written to end, at this time the end marker is written into the last sector (C x’ , S Y’ ) and the entire ECG data record file writing is ended. When the file writing is ended, the sectors occupied by the entire ECG data record file are (C1, S1) to (C x’ , SY’ ), the sector number has been allocated but not occupied, will be released after file writing to reduce file size. It can be seen that the file end storage is updated according to the recorded continuous sector size to update the file size attribute, which not only effectively reduces the storage space occupied by the file, but also saves time for the processing end to process data in file units, which has practical significance.
[0061] It can be seen that the electrocardiogram file recording method disclosed in the application supports power-off continuation, including: when the dynamic electrocardiogram detector is powered on again after power failure, the current power-on real time is obtained, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real time corresponding to the start of writing of the valid dynamic electrocardiogram data are determined to obtain the corresponding last sector number and target power-on real time; the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data is determined based on the sector number sequence and the last sector number; the duration of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined according to the sampling time corresponding to the sector and the last sector number, and the duration of the last valid dynamic electrocardiogram data storage sector when powered off is determined according to the target power-on real time, the current power-on real time and the duration of the valid dynamic electrocardiogram data to obtain a target power-off duration; and the preset electrocardiogram waveform data is written into 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 record file. It can be seen that for the event of powering on the dynamic electrocardiogram detector again after power failure, the current power-on real time is obtained, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector before the current power-on event and the power-on real time corresponding to the start of writing of the valid electrocardiogram data are determined, and then the current sector number is obtained for storing the currently collected dynamic electrocardiogram data in the current sector corresponding to the current sector number. In this way, by writing the valid electrocardiogram data generated after power failure into a new sector, the sector is distinguished from the sector in which the valid electrocardiogram data is written when the last power failure occurs. Then, the duration of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined according to the sampling time corresponding to the sector and the last sector number, and the duration of the last valid dynamic electrocardiogram data storage sector when powered off is determined according to the target power-on real time, the current power-on real time and the duration of the valid dynamic electrocardiogram data to obtain a target power-off duration. Finally, the preset electrocardiogram waveform data is supplemented into the disk space corresponding to the last valid dynamic electrocardiogram data storage sector occupied by the target power-off duration, which ensures that the preset electrocardiogram waveform data can be supplemented when a power failure occurs, complete electrocardiogram data record files can be obtained, the missing of electrocardiogram data caused by power failure during storage is avoided, the processing end can identify and process valid data files, and the adverse experience and influence caused by storage power failure are minimized.
[0062] With reference to Figure 3 The embodiment of the present application discloses a specific power-off persistent electrocardiogram file recording method, which comprises the following steps:
[0063] Step S21: dividing the disk space of the dynamic electrocardiogram detector to obtain sectors at a plurality of continuous time points.
[0064] In the embodiment, the cluster information is determined based on the maximum recording duration of the dynamic electrocardiogram detector; the disk space of the dynamic electrocardiogram detector is divided by using the cluster information to obtain corresponding clusters; and the clusters are divided in space to obtain sectors at a plurality of continuous time points. It can be understood that the number of clusters is determined according to the maximum recording duration, and the continuous clusters are created in the disk space based on the number of clusters, for example, the maximum recording duration allowed for writing is H, and the dynamic electrocardiogram data with a recording duration of H requires X clusters of space for storage, and the cluster numbers of each cluster are defined as C1-CX. X In an embodiment, the maximum duration allowed for recording by the dynamic electrocardiogram detector is 24 hours, and according to the maximum duration allowed for recording by the dynamic electrocardiogram detector, the memory needs to store 234.375M (Mega, megabytes) of electrocardiogram data, that is, a total of 15000 clusters. Then, the cluster space is further divided on each cluster to obtain sectors at a plurality of continuous time points. For example, each cluster is divided into Y sectors, and each sector number is defined as S1-SY. Y In this way, X×Y sectors are obtained.
[0065] Step S22: numbering the sectors based on the cluster information of the clusters to which the sectors belong and the sector position information of the sectors in the clusters to which the sectors belong, to obtain sector numbers corresponding to the sectors.
[0066] In the embodiment, each sector is numbered based on the cluster information of the cluster to which the sector belongs and the sector position information of the sector in the cluster to which the sector belongs. Specifically, when a sector is in the C X th cluster and the sector number is S Y , the corresponding sector number is (C X , S Y ). In this way, during the writing of dynamic electrocardiogram data, each individual sector is addressed by the sector number, and the dynamic electrocardiogram data is written in the addressed sector.
[0067] The embodiment takes the FAT16 (File Allocation Table, 16-bit) format as an example for illustration, and it should be noted that the embodiment can also be used for FAT32 (File Allocation Table, 32-bit) or NTFS (New Technology File System) and other file formats, and no specific limitation is made in this regard. In the FAT16 format, one cluster of data contains 32 sectors, and when the dynamic electrocardiogram system starts a recording of electrocardiogram data, the system automatically allocates the required disk space according to the 24-hour recording time set by the user, creates 15000 continuous clusters, each cluster contains 32 sectors, and then 15000*32 sectors can be obtained. In the process of writing the collected dynamic electrocardiogram 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, which can include but is not limited to Flash (memory) and the like. Specifically, when writing a file of the collected dynamic electrocardiogram data, the sector number (C X , S Y ) of each sector is recorded into the non-volatile storage area after the data writing of the sector is completed. For example, when the data writing of the sector with the sector number (C5, S 10 ) is completed, the sector number (C5, S 10 ) corresponding to the sector is recorded into the non-volatile storage area.
[0069] When a power failure occurs, after power-up, the real-time time of the power-up and the last valid sector number are recorded, and then the electrocardiogram data is continuously stored according to the sector number order. When the processing end enters data, the actual duration data can be recovered according to the recorded power failure information, where the actual duration data = storage duration data + power failure duration data.
[0070] As can be seen, the writing method of a single sector of a file replaces the commonly used file writing method of a cluster, improves the data storage accuracy when recovering storage due to abnormalities, greatly reduces the interference caused by errors, and facilitates the post-processing of dynamic electrocardiogram data. In addition, the continuous storage sector pre-allocation storage method can realize stable data storage, and the real-time recording of the recorded data sector number facilitates accurate positioning of each time node, enhances the security of the entire file data storage, and also provides a reliable method for accurately finding the key time node when repairing data abnormalities.
[0071] Reference Figure 4As shown, the embodiment of the present application discloses an electrocardiogram file recording device supporting power-off continuation, comprising:
[0072] The time acquisition module 11 is configured to acquire current power-on real time when the dynamic electrocardiogram detector is powered on again after power-off, determine the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real time corresponding to the start of writing of the valid dynamic electrocardiogram data, and obtain the corresponding last sector number and target power-on real time.
[0073] The sector number acquisition module 12 is configured 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 last sector number.
[0074] The power-off duration determination module 13 is configured to determine 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 determine the power-off duration of the last valid dynamic electrocardiogram data storage sector according to the target power-on real time, the current power-on real time and the duration of the valid dynamic electrocardiogram data, so as to obtain the target power-off duration.
[0075] The file recording module 14 is configured to write the preset electrocardiogram waveform data into the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector, so as to obtain a complete electrocardiogram data record file.
[0076] Therefore, the application discloses the following technical scheme. When the dynamic electrocardiogram detector is powered off and then powered on, the current power-on real time is obtained, the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real time corresponding to the start of writing of the valid dynamic electrocardiogram data are determined, the corresponding last sector number and target power-on real time are obtained, the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data is determined based on the sector number sequence and the last sector number, the duration of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined according to the sampling time corresponding to the sector and the last sector number, and the power-off duration of the last valid dynamic electrocardiogram data storage sector is determined according to the target power-on real time, the current power-on real time and the duration of the valid dynamic electrocardiogram data, so as to obtain the target power-off duration. The preset electrocardiogram waveform data is written into the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector, so as to obtain a complete electrocardiogram data record file. It can be seen that, for the event that the dynamic electrocardiogram detector is powered off and then powered on, the current power-on real time is obtained, the sector number corresponding to the last valid dynamic electrocardiogram data storage sector before the current power-on event and the power-on real time corresponding to the start of writing of the valid electrocardiogram data are determined, the current sector number is obtained, and the currently collected dynamic electrocardiogram data is stored in the current sector corresponding to the current sector number. In this way, the valid electrocardiogram data generated after power-off and power-on is written into a new sector, so as to be distinguished from the sector in which the valid electrocardiogram data is written when the power is last powered off. Then, the duration of the valid dynamic electrocardiogram data stored when the dynamic electrocardiogram detector is powered off is determined according to the sampling time corresponding to the sector and the last sector number, and the power-off duration of the last valid dynamic electrocardiogram data storage sector is determined according to the target power-on real time, the current power-on real time and the duration of the valid dynamic electrocardiogram data, so as to obtain the target power-off duration. Finally, the preset electrocardiogram waveform data is supplemented into the disk space corresponding to the last valid dynamic electrocardiogram data storage sector occupied by the target power-off duration, so as to ensure that the preset electrocardiogram waveform data can be supplemented when the power-off event occurs, complete electrocardiogram data record files can be obtained, the missing electrocardiogram data caused by power-off during storage is avoided, the processing end can identify and process the valid data file, and the adverse experience and influence caused by power-off during storage are minimized.
[0077] Further, the application also discloses an electronic device, Figure 5 The electronic device 20 is shown in a structural diagram according to an example embodiment, and the content in the diagram cannot be considered as any limitation on the use range of the application.
[0078] Figure 5A structural schematic diagram of an electronic device 20 is provided in the embodiments of the present application. The electronic device 20 can 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 configured to store a computer program, and the processor 21 is configured to load and execute the computer program to implement the related steps in the method for supporting power-off continuous recording of electrocardiogram files disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the embodiments can be specifically an electronic computer.
[0079] In the embodiments, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 is capable of creating a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solutions of the present application, which is not specifically limited herein; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not specifically limited herein.
[0080] The processor 21 can 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 of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array) and a PLA (Programmable Logic Array). The processor 21 can also include a main processor and a coprocessor. The main processor is a processor for processing data in a wake-up state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 can further include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.
[0081] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.
[0082] The operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to realize the operation and processing of the processor 21 on the mass data 223 in the memory 22, which can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the power-off continuation support electrocardiogram file recording method disclosed by the electronic device 20, the computer program 222 can further include a computer program capable of completing other specific work. The data 223 can include the data received by the electronic device from the external device, and can also include the data collected by the self input and output interface 25, etc.
[0083] Further, the application also discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to realize the power-off continuation support electrocardiogram file recording method disclosed above. The specific steps of the method can refer to the corresponding contents disclosed in the foregoing embodiments, and will not be described here.
[0084] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. For the same or similar parts between each embodiment, refer 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 part can refer to the method part.
[0085] Those skilled in the art will further appreciate that the units and algorithms described in connection with the examples disclosed herein can be embodied directly in hardware, in software, or in a combination of the two. For ease of understanding, the illustrative examples are described in general terms in the instant disclosure. The software includes program instructions, code, or the like that, when executed by a processor, software, or the like, directly or indirectly cause the processor, software, or the like to perform the steps described herein. The software can be stored on a computer program product, which includes a computer-readable medium, such as a floppy disk, a CD-ROM, a DVD, a memory, a USB drive, a RAM, a ROM, or the like. The software can also be stored at a remote location from the computing / processing device and can be downloaded over the Internet or other computing network. The software can be downloaded in pieces or as a whole, as desired. The software, when loaded into the computing / processing device and executed, becomes active software in the computing / processing device and causes the computing / processing device to perform the steps described herein.
[0086] Finally, it should be noted that, in this document, the terms "first", "second", etc. are used merely as label, and are not necessarily intended to signify that a particular entity or action is essential to one or another of the embodiments. Moreover, the terms "include", "have", or the like are used synonymously with "comprise". Also, it is to be understood that the use of "or" in the present document is used in the inclusive sense, unless otherwise stated. Furthermore, many of the details, options and embodiments described herein are also applicable to other implementations and contexts. Throughout this document, any identity of elements with the same or similar reference numerals in different embodiments and / or variations thereof, denote the same or similar elements.
[0087] The electrocardiogram file recording method, device, equipment and medium provided by the application are described in detail above, the principle and implementation mode of the application are described by applying specific examples in this paper, and the above example is only used to help understand the method and core idea of the application; meanwhile, for those skilled in the art, according to the idea of the application, the specific implementation mode and application range will be changed, and the above description should not be understood as a limitation of the application.
Claims
1. A method for electrocardiogram file recording supporting power failure continuity, characterized by, The method comprises the following steps: When the dynamic electrocardiogram detector is powered on again after power failure, the current power-on real time is obtained, and the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real time corresponding to the start of writing of the valid dynamic electrocardiogram data are determined to obtain the corresponding last sector number and target power-on real time; Based on the sector number sequence and the last sector number, the current sector number corresponding to the current sector for storing the currently collected dynamic electrocardiogram data is determined; According to the sampling time corresponding to the sector and the last sector number, the length 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, the current power-on real time and the length 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 disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector is filled with data by using the preset electrocardiogram waveform data to obtain a complete electrocardiogram data record file.
2. The ECG file recording method with power-off continuity support according to claim 1, characterized in that, Before the step of obtaining the current power-on real time when the dynamic electrocardiogram detector is powered on again after power failure, the method further comprises the following steps: The disk space of the dynamic electrocardiogram detector is divided to obtain sectors at a plurality of continuous time points.
3. The ECG file recording method with power-off continuity support according to claim 2, characterized in that, The step of dividing the disk space of the dynamic electrocardiogram detector to obtain sectors at a plurality of continuous time points comprises the following steps: Based on the maximum recordable record duration of the dynamic electrocardiogram detector, corresponding cluster information is determined; The disk space of the dynamic electrocardiogram detector is divided based on the cluster information to obtain corresponding clusters; The clusters are spatially divided to obtain sectors at a plurality of continuous time points.
4. The ECG file recording method with power-off continuity support according to claim 3, characterized in that, After the step of spatially dividing the clusters to obtain sectors at a plurality of continuous time points, the method further comprises the following steps: Based on the sectors at a plurality of continuous time points, the sectors are numbered based on the cluster information of the clusters to which the sectors belong and the sector position information of the sectors in the clusters to obtain the sector numbers corresponding to the sectors.
5. The ECG file recording method with power failure continuity support according to claim 1, characterized by, The step of determining the sector number corresponding to the last valid dynamic electrocardiogram data storage sector and the power-on real time corresponding to the start of writing of the valid dynamic electrocardiogram data to obtain the corresponding last sector number and target power-on real time comprises the following steps: The sector number corresponding to the last valid dynamic electrocardiogram data storage sector is obtained from a non-volatile storage area, and the sector number is determined as the last sector number; Correspondingly, the step of determining 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 last sector number comprises the following steps: 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 based on the sector number sequence and the last sector number.
6. The ECG file recording method with power-failure continuity support according to claim 1, wherein, The step of determining the power-off duration of the last valid dynamic electrocardiogram data storage sector based on the target power-on real time, the current power-on real time and the length of the valid dynamic electrocardiogram data to obtain the target power-off duration comprises the following steps: determine the power-on duration of the last valid dynamic electrocardiogram data storage sector based on the target power-on real-time and the current power-on real-time, to obtain a target power-on duration; determine the power-off duration of the last valid dynamic electrocardiogram data storage sector based on the target power-on duration and the target power-off duration, to obtain a target power-off duration.
7. The power-fail persistent electrocardiogram file recording method according to any one of claims 1 to 6, characterized by, the data supplementing of the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector by using preset electrocardiogram waveform data, to obtain a complete electrocardiogram data record file, including: writing preset electrocardiogram waveform data into the disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector, and when detecting that a dynamic electrocardiogram data record event ends, converting the sector offset corresponding to the target power-off duration, and performing sector offset according to the sector offset, to supplement the dynamic electrocardiogram data of the actual duration, obtain target electrocardiogram data, and construct a complete electrocardiogram data record file according to the target electrocardiogram data.
8. An electrocardiogram file recording apparatus supporting power failover, characterized by comprising: including: a time obtaining module, configured to obtain a current power-on real-time when a dynamic electrocardiogram detector is powered on after power-off, and determine a sector number corresponding to a last valid dynamic electrocardiogram data storage sector and a power-on real-time corresponding to the start of writing of valid dynamic electrocardiogram data, to obtain a corresponding last sector number and a target power-on real-time; a number obtaining module, configured to determine a current sector number corresponding to a current sector for storing currently collected dynamic electrocardiogram data based on a sector number sequence and the last sector number; a power-off duration determining module, configured to determine a dynamic electrocardiogram data duration stored after power-off of the dynamic electrocardiogram detector based on a sampling time corresponding to a sector and the last sector number, and determine a power-off duration of the last valid dynamic electrocardiogram data storage sector based on the target power-on real-time, the current power-on real-time and the dynamic electrocardiogram data duration, to obtain a target power-off duration; a file record module, configured to supplement data of a disk space corresponding to the target power-off duration in the last valid dynamic electrocardiogram data storage sector by using preset electrocardiogram waveform data, to obtain a complete electrocardiogram data record file.
9. An electronic device, comprising: including: a memory, configured to save a computer program; a processor, configured to execute the computer program, to implement steps of the electrocardiogram file record method supporting power-off continuation as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, a memory, configured to save a computer program; wherein the computer program is executed by a processor to implement steps of the electrocardiogram file record method supporting power-off continuation as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Dynamic electrocardiogram processing method and system
CN109480820A
Data processing method, computer system and readable medium
CN115793975A