CN113438198B - Electrocardio data transmission method and system based on udp transmission protocol - Google Patents

Electrocardio data transmission method and system based on udp transmission protocol Download PDF

Info

Publication number
CN113438198B
CN113438198B CN202110332902.5A CN202110332902A CN113438198B CN 113438198 B CN113438198 B CN 113438198B CN 202110332902 A CN202110332902 A CN 202110332902A CN 113438198 B CN113438198 B CN 113438198B
Authority
CN
China
Prior art keywords
data
packet
group
peak
electrocardiogram
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110332902.5A
Other languages
Chinese (zh)
Other versions
CN113438198A (en
Inventor
刘长红
李泽轩
吕滨雄
贾剑超
胡献
翁文杰
全伟鑫
邵楚越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou University
Original Assignee
Guangzhou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou University filed Critical Guangzhou University
Priority to CN202110332902.5A priority Critical patent/CN113438198B/en
Publication of CN113438198A publication Critical patent/CN113438198A/en
Application granted granted Critical
Publication of CN113438198B publication Critical patent/CN113438198B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/63Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an electrocardiogram data transmission method and system based on udp transmission protocol, wherein the method comprises the following steps: s1, the detection end acquires and processes the electrocardiogram data; s2, encapsulating the electrocardiogram data into a data packet according to a preset program; s3, adding a protocol header in front of the data packet, and sending the data packet with the protocol header to a receiving end by using a udp protocol; s4, the receiving end receives the data packet and uses the checksum to calculate and verify the data packet; if the verification is passed, go to step S5; and S5, unpacking the data packet, completing the data, and outputting the final electrocardiogram data. The invention improves the transmission speed and ensures the accuracy of the electrocardio data, and can be applied to various embedded platforms or computer systems.

Description

Electrocardio data transmission method and system based on udp transmission protocol
Technical Field
The invention relates to the technical field of electrocardiosignal analysis, in particular to an electrocardio data transmission method and system based on a udp transmission protocol.
Background
At present, in the field of remote real-time diagnosis and treatment in intelligent medical treatment, particularly in the aspect of electrocardiosignal remote transmission and instant identification on an application level, in order to ensure the absolute accuracy of electrocardiosignals and provide accurate data for clinical analysis, the current general method is to use a GPRS network to create GPRS virtual IP and initiate tcp connection to a remote server to perform bidirectional network data transmission. However, the four-way handshake of tcp sacrifices the absolute instantaneity of data transmission when ensuring the accuracy of data transmission, and the slight error caused by the time delay in clinical medicine may cause serious consequences. If real-time transmission of large amounts of data is desired, however, the udp protocol is preferably used.
UDP is a connectionless transport layer protocol in the OSI reference model, which is mainly used in transport that does not require the arrival of packets in sequence, the inspection and ordering of the packet transmission sequence being done by the application layer, providing a transaction-oriented simple unreliable messaging service. The UDP protocol has less control options, small delay in the data transmission process and high data transmission efficiency. The electrocardiosignal remote transmission used in the application layer can effectively ensure the transmission speed. However, UDP does not guarantee reliability of data packet transmission, and packet loss or transmission errors may occur in the real-time transmission process of the electrocardiographic data, so that a recorded waveform or a displayed waveform is lost; at this time, if the data is sent to the neural network for identification, a wrong result will occur, and even the judgment of a doctor will be misled.
Therefore, there is a need in the industry to develop an electrocardiographic data transmission protocol or method that can improve the electrocardiographic data transmission speed and ensure the data packet transmission accuracy.
Disclosure of Invention
The invention aims to provide an electrocardio data transmission method and system based on a udp transmission protocol, which can ensure the accuracy of a data packet while ensuring the speed by using the udp transmission protocol, and greatly reduce the electrocardio data loss received by a receiving end caused by the damage or loss of the data packet.
An electrocardio data transmission method based on udp transmission protocol includes:
s1, the detection end acquires and processes the electrocardiogram data;
s2, encapsulating the electrocardiogram data into a data packet according to a preset program;
s3, adding a protocol header in front of the data packet, and sending the data packet with the protocol header to a receiving end by using a udp protocol;
s4, the receiving end receives the data packet and uses the checksum to calculate and verify the data packet; if the verification is passed, go to step S5;
and S5, unpacking the data packet, completing the data, and outputting the final electrocardiogram data.
Preferably, step S1 includes: the detection end transmits the acquired electrocardiogram data into a detection area to be detected; and processing the electrocardiogram data in the detection area, and inputting the processed electrocardiogram data into a buffer area.
Preferably, processing the electrocardiographic data at the detection zone comprises: denoising and filtering the electrocardio data; and performing wavelet transformation or signal slicing on the denoised and filtered electrocardiogram data to obtain electrocardiogram data for medical reference.
Preferably, step S2 includes: identifying the electrocardiogram data in the buffer area to obtain a QRS waveform of a patient, and calculating the QRS waveform according to a preset R peak threshold to obtain an R value range; a complete QRS waveform is divided into three packets based on the range of R values.
Preferably, the identifying the electrocardiographic data in the buffer area to obtain the QRS waveform of the patient includes: positioning the electrocardiogram data and determining a lead number; determining the position of the R peak; and searching signals of wave bands before and after the R peak to determine the complete QRS waveform.
Preferably, the electrocardio data is identified and judged in the buffer area according to the R value, and a first R peak, a second R peak and a third R peak in the waveform are judged; packing the waveform data in the first R peak and the second R peak, describing a time stamp, a sequence number and a packet size in a header, and recording a data packet packed this time as a packet I; packing the waveform data in the second R peak and the third R peak, describing a timestamp, a sequence number and a packet size in a header, wherein the timestamp is the same as the timestamp of the first packet, the sequence number is the sequence number of the first packet plus one, and recording the data packet packaged at this time as a second packet;
and packaging the data packet, packaging the waveform data in the first R peak and the third R peak, and describing a timestamp, a sequence number and a packet size in a header, wherein the timestamp is the same as the timestamp of the first packet, the sequence number is the sum of the sequence number of the second packet plus one, the packet size is equal to the sum of the first packet and the second packet, the data packet packaged at this time is marked as a third packet, and the first packet, the second packet and the third packet are a data group.
Preferably, the protocol header comprises a 2-byte data packet identifier and a 2-byte transmission sequence number; the data packet identification is used for indicating that the data packet is a file data packet, a confirmation packet or other control packets, and the sending sequence number is used for indicating the sequence information of the data packet.
Preferably, step S5 includes: the time stamps of the detection end and the receiving end correspond one to one, the data packets are grouped according to the time stamps of the data packets, and the three data packets form a group of data groups; the receiving end reorders the data packets in a group of data groups according to a pre-sequencing rule, so that the sequence is the correct sequence of a packet I, a packet II and a packet III, and the sequencing rule presets the data packet number as a serial number of two bytes; the second packet of the previous data group is the first packet of the next data group, and the second half part of the third packet of the previous data group is the first half part of the third packet of the next data group; if the data packet in the current data group is damaged, completing the data supplementation according to the data of the previous data group and/or the next data group; and (4) carrying out data duplication elimination, and outputting final waveform data after the data packet data of the same waveform is not repeated.
Preferably, if the data packet in the current data group is damaged, completing according to the data in the previous data group and/or the data in the next data group includes: if all three data packets in the current data group exist and no packet is lost, judging that the data packet is completely transmitted, outputting a third packet, and waiting for the next step; if one of the three data packets in the current data group is lost, a packet I or a packet II is lost, the complete transmission is judged, a packet III is output, and the next step is waited; if the third packet is lost, outputting the sum of the first packet and the second packet, and waiting for the next step; if two data packets in the current data group are lost, judging that the data packet is completely transmitted if the data packet is a third data packet, outputting the third data packet, and waiting for the next step; if the packet I exists, outputting all data of the packet I plus bytes of the packet II, and waiting for the next step; if all three data packets in the current data group are lost, the packet loss is judged, all zero data are output, and the next step is waited.
Preferably, the deduplication comprises: one data group is preferably data of packet three, and two data groups are preferably data of previous data group.
An electrocardiogram data verification system based on udp transmission protocol, comprising: a detection end and a receiving end; the detection end comprises a data preprocessing module, a data packaging module and a data sending module; the receiving end comprises a data packet identification processing module and a data output module; the data preprocessing module is used for acquiring and processing the electrocardio data;
the data packaging module is used for packaging the electrocardio data into a data packet according to a preset program; the data sending module is used for adding a protocol head in front of the data packet and sending the data packet with the protocol head to a receiving end by using a udp protocol; the data packet identification processing module is used for calculating and verifying the data packet by using the checksum; and the data output module is used for unpacking the data packet, completing the data and outputting the final electrocardiogram data.
An embodiment of the present invention further provides a computer terminal device, including: one or more processors; a memory coupled to the processor for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the electrocardiographic data transmission method based on the udp transmission protocol.
The embodiment of the present invention further provides a computer readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the electrocardiographic data transmission method based on udp transmission protocol.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
(1) the real-time transmission of data can be realized, and the delay is low;
(2) the multi-packet encapsulation, the multi-packet transmission and the packet-to-packet complementation are adopted, so that the data loss rate caused by packet loss caused by udp protocol transmission is greatly reduced, the speed of the electrocardio data is increased by using the udp protocol, the delay is reduced, and the data accuracy is ensured;
(3) the portable ECG monitoring device can be applied to an embedded system of a common ARM framework, and provides a real-time data transmission function for the portable ECG monitoring device and the portable medical monitoring device.
Drawings
Fig. 1 is a schematic flow chart of the electrocardiographic data transmission method based on udp transmission protocol according to this embodiment.
Fig. 2 is another schematic flow chart of the electrocardiographic data transmission method based on udp transmission protocol according to this embodiment.
Fig. 3 is a detection-side data processing flowchart of the present embodiment.
Fig. 4 is a flow chart of data encapsulation at the detection end in the present embodiment.
Fig. 5 is a flow chart of data transmission at the detection end and data reception at the receiving end in the present embodiment.
Fig. 6 is a flow chart of the receiving-end packet identification processing in the present embodiment.
Fig. 7 is a block diagram of the electrocardiographic data transmission system based on udp transmission protocol according to this embodiment.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention. All other embodiments obtained by a person of ordinary skill in the art without any inventive step based on the embodiments of the present invention shall fall within the scope of protection of the present invention.
Referring to fig. 1, a schematic flow chart of an electrocardiographic data transmission method based on udp transport protocol provided in this embodiment at least includes the following steps:
s10, acquiring and processing the electrocardiogram data;
the electrocardiographic data, i.e., the heart, is excited sequentially by the pacing point, the atrium, and the ventricle in each cardiac cycle, and is accompanied by a bioelectricity change, which is described above. The special conduction system of the heart consists of the sinoatrial node, the node cluster (divided into anterior, middle and posterior node clusters), the atrial cluster (from the node cluster, called Bachmann cluster), the room junction area (atrioventricular node, bundle of his), the bundle branch (divided into left and right bundle branches, and the left bundle branch divided into anterior and posterior branches), and Pukinje fibers (Pukinje fibers), and is closely related to the cardiac electrical changes occurring in sequence in each cardiac cycle. The normal cardiac electrical activity starts at the sinoatrial node, excites the atrium and simultaneously conducts to the atrioventricular node through the internode bundle (excitation conduction, then conduction along the bundle of his-left and right-bundle-Pukeya fibers and finally excites the ventricle.
In this embodiment, the acquired electrocardiographic data is processed, i.e., filtered, and polarization occurs between the electrodes and the skin tissue, which may cause serious interference to the electrocardiographic signal. In addition, the human body is a complex life system, and various other physiological electric signals interfere with the electrocardiosignals. Meanwhile, because the electrocardiosignals are in an electromagnetic surrounding environment, interference signals of about 50Hz can be generated on the electrocardiosignals, and the directly acquired electrocardiosignals must be processed first to filter out clutter.
S20, carrying out data encapsulation according to a preset program;
it should be noted that data encapsulation is because, when data is transmitted between different devices using a network, in order to be reliably and accurately transmitted to a destination and to efficiently use transmission resources, a destination address, a local address, and some bytes for error correction need to be added to the transmitted data, and encryption processing and the like need to be performed when security and reliability are high. These operations are called data encapsulation. The rule followed and negotiated by the two parties is the protocol when processing the data packet. In practical application, networking data encapsulation is carried out according to function layering, the purpose is simple, namely, a complex system can be decomposed into a plurality of modules, the modules are independent and do not influence each other, and each module (each layer) is connected and interacted through an interface and provides services mutually. Therefore, not only is the function easier to realize, but also the whole system has good compatibility and expandability
In this embodiment, the initial signal is identified in the buffer area, the basic QRS waveform of the patient is locked, the size of the R peak is taken, and calculation is performed on the basis of the R peak according to a preset threshold value, so as to obtain the range of the R value. Then, according to the obtained R value range, the electrocardiosignal is preliminarily identified and judged in the buffer area, and each R peak in the waveform is judged. And then packaging the data packets, and dividing a complete QRS waveform into three data packets according to a preset program.
S30, sending the data packet by using udp protocol;
the current practice is to use tcp protocol for electrocardiographic data transmission, and the difference between tcp and udp is as follows: 1. TCP connection-oriented; UDP is connectionless, i.e., no connection needs to be established before sending data. 2. TCP provides reliable services. That is, data transmitted over a TCP connection is error-free, not lost, not duplicated, and arrives in order; UDP makes best effort delivery, i.e., does not guarantee reliable delivery. 3. UDP has better real-time performance, higher working efficiency than TCP, and is suitable for communication or broadcast communication with higher real-time performance and high-speed transmission. 4. Each TCP connection can only be point-to-point; UDP supports one-to-one, one-to-many, many-to-one, and many-to-many interactive communications. 5. TCP has more requirements on system resources, and UDP has less requirements on system resources.
In this embodiment, UDP is used for data transmission, considering that UDP has the advantages of simplicity and fast transmission. The network speed is improved to provide reliable network guarantee for the stability of UDP, and the packet loss rate is very low; in order to realize the reliability of network communication, the TCP uses a complex congestion control algorithm, and a complex handshake process is established, and the TCP is extremely difficult to improve due to the built-in system protocol stack of the TCP. By adopting the TCP, once packet loss occurs, the TCP can cache subsequent packets, and the subsequent packets are continuously sent after retransmission and reception of the previous packets, so that the delay is increased, and the delay caused by the packet loss can be reduced to the minimum under the condition that the real-time requirement is strict based on the UDP, such as real-time transmission of the electrocardiogram data, if the user-defined data verification mechanism of the embodiment is adopted, and the real-time performance and the accuracy of the electrocardiogram data are ensured.
S40, the receiving end receives the data packet, processes and outputs the data packet;
in this embodiment, after the data packet is received, the data is unpacked, and the result is summarized, including the abnormal summary and the parameter summary, and the summarized result may be used to infer a subsequent trend, so as to provide a data basis for subsequent analysis and identification. Namely, the result can be associated with a disease development trend prediction algorithm, the back end outputs key signal characteristics and abnormal type judgment, probability prediction can be made on the future disease development trend based on the disease state change of the time sequence, and a reference path is provided for medical staff to diagnose in advance and take preventive measures. And finally, outputting the obtained data and presenting the electrocardiogram data in real time.
Referring to fig. 2, the present embodiment provides a flowchart of an overall structure of an electrocardiographic data transmission method based on udp transmission protocol;
in this embodiment, the specific steps of the implementation are divided into a detection end data processing flow, a detection end data encapsulation flow, a detection end data sending and receiving end data receiving flow, and a receiving end data packet identification processing flow, which are all described below.
Referring to fig. 3, a flow chart of data processing of the detecting end provided in the present embodiment;
it should be noted that, because the electrocardiographic signal has characteristics of weak, low frequency, high impedance, etc., and is very easily interfered, analyzing the interference source, and taking corresponding filtering measures for different interferences is a problem to be considered in data acquisition. Common interferences include power frequency interference, baseline drift and electromyographic interference, and the acquired original data needs to be subjected to data detection.
In this embodiment, in specific implementation, an original electrocardiographic waveform signal is input, then filtering processing is performed, wavelet transformation and signal slicing are performed on the filtered signal, and parameter judgment and analysis are performed on the signal at the same time. The wavelet transform refers to a frequency transform method, information is extracted from signals, and multi-scale refinement analysis is carried out on functions or signals through calculation functions such as stretching and translation, so that image decomposition and denoising smoothing of electrocardio original signals are realized; signal slicing refers to slicing the complete signal until the end of an entire signal segment. After the steps are carried out, the electromyographic signals are filtered, the power frequency interference is inhibited, and the baseline drift is corrected, and then the electrocardiogram data which can be used for medical reference can be obtained.
Referring to fig. 4, in the detection end data encapsulation flowchart provided in this embodiment, in specific implementation, first, an input signal is located, that is, a lead number is determined; then determining the position of the R peak; searching signals of front and back wave bands such as T wave, P wave and the like, basically determining a complete QRS waveform, then segmenting data signals, and segmenting and packaging data into data sending packets in the following processes:
preliminarily identifying and judging the electrocardiosignal in the buffer area, namely judging each R peak in the waveform, encapsulating a data packet, packaging the waveform data in the first R peak and the second R peak, describing a time stamp, a sequence number and a packet size in a header, and marking as a packet I; packing the waveform data in the second R peak and the third R peak, wherein the header information is described as above, the time stamp of the header information is the same as that of the first packet, and the sequence number of the header information is the sequence number of the first packet plus one and is recorded as a second packet; packing the waveform data in the first R peak and the third R peak, describing the header information as above, and recording the time stamp of the header information as the time stamp of the first packet, the sequence number as the sequence number of the second packet plus one, and the packet size theoretically equal to the sum of the first packet and the second packet as a third packet; the three data packets are a group, in order to reduce data missing caused by packet loss in the udp protocol transmission process, data of the three data packets are overlapped, and the data are marked by a complete obs waveform, so that how the data are expressed as the complete obs waveform is the electrocardio data transmission method based on the udp protocol, and the data packet identification processing flow is provided.
Referring to fig. 5, the main process of the detecting end data sending and receiving end data receiving process provided in this embodiment includes:
detection end:
1. the socket interface is initialized by using a WSAStartup function, the first parameter of the function is the version information of the socket, the second parameter is a variable of a WSADATA type, and the variable stores the socket information returned by the initialization of the WSAStartup function.
2. A SOCKET is created by using a SOCKET function, and a SOCKET variable of a SOCKET type is returned after the creation is successful.
3. After successful creation, the data may be sent to the receiver.
Receiving end:
1. the socket interface is initialized by using a WSAStartup function, the first parameter of the function is the version information of the socket, the second parameter is a variable of a WSADATA type, and the variable stores the socket information returned by the initialization of the WSAStartup function.
2. A SOCKET is created by using a SOCKET function, and a SOCKET variable of a SOCKET type is returned after the creation is successful.
3. Binding a local address to SOCKET variable created by SOCKET by using bind function
4. And after the binding is successful, the data of the detection end can be uploaded.
In this embodiment, it is to be understood that the above-described flow is a conventional udp transmission flow; the detection end data sending and receiving end data receiving process provided by the electrocardio data transmission method based on the udp transmission protocol is the conventional udp transmission process added with the following contents:
1. the new protocol head setting of the data packet at the detection end comprises defining a protocol head with 4 bytes, a data packet identifier with 2 bytes and a sending sequence number with 2 bytes. The data packet mark indicates that the data packet is a file data packet, an acknowledgement packet or other control packet, and the sending sequence number is used for indicating the sequence information of the data packet.
2. And (4) carrying out checksum calculation verification on the UDP at the receiving end.
It is to be understood that the unreliable meaning of the UDP transport protocol is: even if the datagram is lost, the sender is unaware. However, it is still required to improve transmission reliability as much as possible for each datagram. The "checksum" in UDP is a means to improve the reliability of this datagram as much as possible. In this embodiment, checksum verification is used, which is a first pass to ensure the accuracy of the electrocardiographic data; as to how to make the data received by the receiving end more accurate, a receiving end packet identification processing flow provided in this embodiment will be described.
Referring to fig. 6, a flow chart of a receiving end packet identification process provided in this embodiment specifically includes: and judging, integrating and outputting the final data of the received data packet.
The embodiment provides an electrocardiogram data transmission method based on udp transmission protocol, wherein the receiving end data packet identification processing comprises:
1. sequencing the received data packets;
2. unpacking the received data packet;
3. performing data integration on the received data;
4. calculating the similarity of the obtained data segments, and judging whether the data packet is damaged;
5. completing data supplement among the packets;
6. deduplication of the data fragments is performed.
In this embodiment, the receiving end packet identification processing flow is specifically as follows:
the timestamps of the detection end and the receiving end correspond to each other one by one, and sequencing is carried out according to the timestamps of the data packets, wherein generally, the three data packets form a group. If only two data packets exist in the timestamp, no processing is performed; if only one data packet exists in the timestamp, waiting for the next timestamp data packet; if only no data packet exists in the timestamp, the data is judged to be missing.
The detection end and the receiving end agree on the serial numbers of two bytes of a data packet, generally, the serial numbers of a group of three data packets are set, wherein the packet I is 01, the packet II is 10, and the packet III is 11; the receiving end reorders the data packets accordingly, so that the sequence is the correct sequence of the first packet, the second packet and the third packet.
Thirdly, providing transaction-oriented simple unreliable information transmission service based on udp protocol, packet loss is easy to occur in the actual transmission process, if
(1) If all data packets exist in a data group with three data packets as a group and no packet is lost, then: and judging that the transmission is complete, outputting a third packet and waiting for the next step.
(2) If one data packet is lost in a data group consisting of three data packets, the following steps are performed: losing the first packet or the second packet, judging that the transmission is more complete, outputting a third packet, and waiting for the next step; if the third packet is lost, the sum of the first packet and the second packet is output to wait for the next step.
(3) If two data packets are lost in a data group consisting of three data packets, then: if the third packet exists, the third packet is judged to be transmitted completely, and the third packet is output to wait for the next step; if the packet I exists, all data of the packet I is output and bytes of the packet II (which do not exist) are added (all are set to be zero), and the next step is waited.
(4) If all data packets in a data group consisting of three data packets are lost, then: and if the packet loss is judged, outputting all-zero data to wait for the next step.
(5) And repeating the operation on the data group with the next three data packets as a group, and completing the data supplementation of the previous data group according to the situation. In the receiving-end data packet identification process provided in this embodiment, the packet two of the previous data group is the packet one of the next data group, and the rear half of the packet three of the previous data group is the front half of the packet three of the next data group, so that when a certain data group suffers from a partial packet loss, data can be supplemented according to the related supplementary packets of the previous and subsequent data groups, and even when a certain data group suffers from a complete packet loss, if the previous data group has the rear half of the packet two or the packet three and the subsequent data group has the front half of the packet one or the packet three, data can still be supplemented; if the data cannot be supplemented, the waveform is marked as complete data loss, and the output is null.
And fourthly, carrying out duplicate removal on the data output in the step, preferably selecting the data of the third packet in one data group, preferably selecting the data of the previous data group in the two data groups, and outputting final waveform data after the data of the data packets with the same waveform are not repeated.
The embodiment provides an electrocardiographic data transmission method based on a udp transmission protocol, wherein the receiving end data packet identification processing has the advantages that multi-packet encapsulation, multi-packet transmission and completion of packet-to-packet complementation are realized, so that the data loss rate caused by packet loss due to udp protocol transmission is greatly reduced, the speed of electrocardiographic data is increased by using the udp protocol, delay is reduced, and the accuracy of data is ensured.
Referring to fig. 7, a module connection diagram, a detection end and a receiving end of the electrocardiographic data verification system according to the present embodiment are shown; the detection end comprises a data preprocessing module, a data packaging module and a data sending module; the receiving end comprises a data packet identification processing module and a data output module;
the data preprocessing module is used for acquiring and processing the electrocardio data;
the data packaging module is used for packaging the electrocardio data into a data packet according to a preset program;
the data sending module is used for adding a protocol header in front of a data packet and sending the data packet with the protocol header to a receiving end by using a udp protocol;
the data packet identification processing module is used for calculating and verifying the data packet by using the checksum;
and the data output module is used for unpacking the data packet, completing the data and outputting the final electrocardiogram data.
The present embodiment further provides a computer terminal device, including:
one or more processors; the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is the control center for the various servers of the platform, with various interfaces and lines connecting the various parts of the overall method.
A memory coupled to the processor for storing one or more programs; the program may be stored in a computer readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow. In particular, features recited in the various embodiment claims of the disclosure may be combined in various combinations without departing from the spirit and teachings of the disclosure. All such combinations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. It will be understood by those skilled in the art that all or part of the processes in the above-described method embodiments may be implemented by a computer program instructing associated hardware, and the scope of the present disclosure is defined by the appended claims and their equivalents. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (5)

1. An electrocardiogram data transmission method based on udp transmission protocol is characterized by comprising the following steps:
s1, the detection end acquires and processes the electrocardiogram data;
s2, encapsulating the electrocardiogram data into a data packet according to a preset program;
s3, adding a protocol header in front of the data packet, and sending the data packet with the protocol header to a receiving end by using a udp protocol;
s4, the receiving end receives the data packet and uses the checksum to calculate and verify the data packet; if the verification is passed, go to step S5;
s5, unpacking the data packet, completing the data, and outputting the final electrocardiogram data;
step S1 includes:
the detection end transmits the acquired electrocardiogram data into a detection area to be detected; processing the electrocardiogram data in the detection area, and inputting the processed electrocardiogram data into a buffer area;
step S2 includes:
identifying the electrocardio data in the buffer area to obtain the QRS waveform of the patient, and calculating the QRS waveform according to a preset R peak threshold to obtain an R value range; dividing a complete QRS waveform into three data packets according to the R value range;
identifying the electrocardiographic data in the buffer area to obtain the QRS waveform of the patient comprises:
positioning the electrocardiogram data and determining a lead number; determining the position of the R peak; searching signals of wave bands before and after an R peak, and determining a complete QRS waveform;
carrying out identification judgment on the electrocardiogram data in the buffer area according to the R value, and judging a first R peak, a second R peak and a third R peak in the waveform;
packing the waveform data in the first R peak and the second R peak, describing a time stamp, a sequence number and a packet size in a packet head of a data packet, and recording the data packet packed this time as a packet I;
packing the waveform data in the second R peak and the third R peak, describing a timestamp, a sequence number and a packet size in a packet head of a data packet, wherein the timestamp is the same as the timestamp of the first packet, the sequence number is the sequence number of the first packet plus one, and recording the data packet packaged at this time as a second packet;
packaging data packets, namely packaging waveform data in a first R peak and a third R peak, describing a timestamp, a sequence number and a packet size in a packet head of the data packet, wherein the timestamp is the same as the timestamp of a packet I, the sequence number is the sum of the sequence number of a packet II and the packet size is equal to the sum of the packet I and the packet II, the data packet packaged at this time is marked as a packet III, and the packet I, the packet II and the packet III are a data group;
step S5 includes:
the time stamps of the detection end and the receiving end correspond one to one, the data packets are grouped according to the time stamps of the data packets, and the three data packets form a group of data groups;
the receiving end reorders the data packets in a group of data groups according to a pre-ordering rule to ensure that the sequence is the correct sequence of a packet I, a packet II and a packet III, and the ordering rule presets the data packet number as a serial number of two bytes; wherein the packet two of the previous data group is the packet one of the next data group, and the latter half of the packet three of the previous data group is the former half of the packet three of the next data group;
if the data packet in the current data group is damaged, completing the data supplement according to the data of the previous data group and/or the next data group;
data is subjected to duplication elimination, and final waveform data are output after data packet data of the same waveform are not repeated;
if the data packet in the current data group is damaged, completing the data supplement according to the data in the previous data group and/or the next data group comprises the following steps:
if all three data packets in the current data group exist and no packet is lost, judging that the data packet is completely transmitted, outputting a third packet, and waiting for the next step;
if one of the three data packets in the current data group is lost, a packet I or a packet II is lost, the complete transmission is judged, a packet III is output, and the next step is waited; if the third packet is lost, the sum of the first packet and the second packet is output to wait for the next step;
if two data packets in the current data group are lost, judging that the data packet is completely transmitted if the data packet is a third data packet, outputting the third data packet, and waiting for the next step; if the packet I exists, outputting all data of the packet I plus bytes of the packet II, and waiting for the next step;
and if all three data packets in the current data group are lost, judging that the data packets are lost, outputting all zero data, and waiting for the next step.
2. The method for transmitting electrocardiographic data based on udp transport protocol according to claim 1, wherein the processing electrocardiographic data in the detection area comprises:
denoising and filtering the electrocardio data; and performing wavelet transformation or signal slicing on the denoised and filtered electrocardiogram data to obtain electrocardiogram data for medical reference.
3. The electrocardio-data transmission method based on udp transport protocol according to claim 1, wherein the protocol header includes a 2-byte data packet identifier and a 2-byte transmission sequence number; the data packet identifier is used for indicating that the data packet is a file data packet, an acknowledgement packet or other control packets, and the sending sequence number is used for indicating the sequence information of the data packet.
4. The method for transmitting electrocardiographic data based on udp transport protocol according to claim 1, wherein the de-duplicating of data comprises: one data group is preferably data of packet three, and two data groups are preferably data of previous data group.
5. An electrocardiogram data verification system based on udp transmission protocol, comprising: a detection end and a receiving end; the detection end comprises a data preprocessing module, a data packaging module and a data sending module; the receiving end comprises a data packet identification processing module and a data output module;
the data preprocessing module is used for acquiring and processing the electrocardio data;
the data packaging module is used for packaging the electrocardio data into a data packet according to a preset program;
the data sending module is used for adding a protocol header in front of a data packet and sending the data packet with the protocol header to a receiving end by using a udp protocol;
the data packet identification processing module is used for calculating and verifying the data packet by using the checksum;
the data output module is used for unpacking the data packet, completing the data and outputting the final electrocardiogram data;
the detection end is used for transmitting the acquired electrocardiogram data into a detection area to be detected; processing the electrocardiogram data in the detection area, and inputting the processed electrocardiogram data into a buffer area;
identifying the electrocardiogram data in the buffer area to obtain a QRS waveform of a patient, and calculating the QRS waveform according to a preset R peak threshold to obtain an R value range; dividing a complete QRS waveform into three data packets according to the R value range;
identifying the electrocardiographic data in the buffer area to obtain the QRS waveform of the patient comprises:
positioning the electrocardiogram data and determining a lead number; determining the position of the R peak; searching signals of wave bands before and after an R peak, and determining a complete QRS waveform;
carrying out identification judgment on the electrocardiogram data in the buffer area according to the R value, and judging a first R peak, a second R peak and a third R peak in the waveform;
packing the waveform data in the first R peak and the second R peak, describing a time stamp, a sequence number and a packet size in a packet head of a data packet, and recording the data packet packed this time as a packet I;
packing the waveform data in the second R peak and the third R peak, describing a timestamp, a sequence number and a packet size in a packet head of a data packet, wherein the timestamp is the same as the timestamp of the first packet, the sequence number is the sequence number of the first packet plus one, and recording the data packet packaged at this time as a second packet;
packaging data packets, namely packaging waveform data in a first R peak and a third R peak, describing a timestamp, a sequence number and a packet size in a packet head of the data packet, wherein the timestamp is the same as the timestamp of a packet I, the sequence number is the sum of the sequence number of a packet II and the packet size is equal to the sum of the packet I and the packet II, the data packet packaged at this time is marked as a packet III, and the packet I, the packet II and the packet III are a data group;
the time stamps of the detection end and the receiving end are in one-to-one correspondence, the data packets are grouped according to the time stamps of the data packets, and the three data packets form a group of data groups;
the receiving end reorders the data packets in a group of data groups according to a pre-ordering rule to ensure that the sequence is the correct sequence of a packet I, a packet II and a packet III, and the ordering rule presets the data packet number as a serial number of two bytes; wherein the packet two of the previous data group is the packet one of the next data group, and the latter half of the packet three of the previous data group is the former half of the packet three of the next data group;
if the data packet in the current data group is damaged, completing the data supplement according to the data of the previous data group and/or the next data group;
data is subjected to duplication elimination, and final waveform data are output after data packet data of the same waveform are not repeated;
if the data packet in the current data group is damaged, completing the data supplement according to the data in the previous data group and/or the next data group comprises the following steps:
if all three data packets in the current data group exist and no packet is lost, judging that the data packet is completely transmitted, outputting a third packet, and waiting for the next step;
if one of the three data packets in the current data group is lost, a packet I or a packet II is lost, the complete transmission is judged, a packet III is output, and the next step is waited; if the third packet is lost, outputting the sum of the first packet and the second packet, and waiting for the next step;
if two data packets in the current data group are lost, judging that the data packet is completely transmitted if the data packet is a third data packet, outputting the third data packet, and waiting for the next step; if the packet I exists, outputting all data of the packet I plus bytes of the packet II, and waiting for the next step;
and if all three data packets in the current data group are lost, judging that the data packets are lost, outputting all zero data, and waiting for the next step.
CN202110332902.5A 2021-03-29 2021-03-29 Electrocardio data transmission method and system based on udp transmission protocol Active CN113438198B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110332902.5A CN113438198B (en) 2021-03-29 2021-03-29 Electrocardio data transmission method and system based on udp transmission protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110332902.5A CN113438198B (en) 2021-03-29 2021-03-29 Electrocardio data transmission method and system based on udp transmission protocol

Publications (2)

Publication Number Publication Date
CN113438198A CN113438198A (en) 2021-09-24
CN113438198B true CN113438198B (en) 2022-08-26

Family

ID=77753029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110332902.5A Active CN113438198B (en) 2021-03-29 2021-03-29 Electrocardio data transmission method and system based on udp transmission protocol

Country Status (1)

Country Link
CN (1) CN113438198B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114281381A (en) * 2021-12-23 2022-04-05 广州航海学院 Management method and equipment for full-task turbine simulator board card
CN115208836A (en) * 2022-06-17 2022-10-18 珠海格力电器股份有限公司 Data packet processing method, device, equipment and computer readable storage medium
WO2024054504A1 (en) * 2022-09-07 2024-03-14 The Alfred E. Mann Foundation For Scientific Research Systems and methods of deduplicating data collected by an implantable medical device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104135488A (en) * 2014-08-13 2014-11-05 上海申腾信息技术有限公司 Remote medical system related data transmission system and method and applications thereof
CN106130695A (en) * 2016-08-24 2016-11-16 桂林信通科技有限公司 A kind of data transmission method and system
CN108451547A (en) * 2017-02-20 2018-08-28 深圳市理邦精密仪器股份有限公司 Processing method, device and the system of fetal heart sound data
CN110913009A (en) * 2019-12-03 2020-03-24 浙江大学 Device and method for displaying electrocardiogram by browser through UDP network protocol
CN111528833A (en) * 2020-05-07 2020-08-14 广州大学 Method and system for quickly identifying and processing electrocardiosignals
CN112073386A (en) * 2020-08-18 2020-12-11 浙江鸿城科技有限责任公司 Window-free randomly-selectable file transmission method based on UDP (user Datagram protocol)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103746966A (en) * 2013-12-20 2014-04-23 西安电子工程研究所 UDP-based upper-layer protocol and Ethernet MAC layer data transmission method
GB2578606A (en) * 2018-10-31 2020-05-20 Remote Diagnostic Tech Ltd Data transmission protocol
CN111049857A (en) * 2019-12-26 2020-04-21 山东方寸微电子科技有限公司 Network storage system and method based on UDP protocol

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104135488A (en) * 2014-08-13 2014-11-05 上海申腾信息技术有限公司 Remote medical system related data transmission system and method and applications thereof
CN106130695A (en) * 2016-08-24 2016-11-16 桂林信通科技有限公司 A kind of data transmission method and system
CN108451547A (en) * 2017-02-20 2018-08-28 深圳市理邦精密仪器股份有限公司 Processing method, device and the system of fetal heart sound data
CN110913009A (en) * 2019-12-03 2020-03-24 浙江大学 Device and method for displaying electrocardiogram by browser through UDP network protocol
CN111528833A (en) * 2020-05-07 2020-08-14 广州大学 Method and system for quickly identifying and processing electrocardiosignals
CN112073386A (en) * 2020-08-18 2020-12-11 浙江鸿城科技有限责任公司 Window-free randomly-selectable file transmission method based on UDP (user Datagram protocol)

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"A deep learning framework for heart disease classification in an IoTs-based system.";Nguyen, Thanh-Hai, Thanh-Nghia Nguyen, and Thanh-Tam Nguyen.;《A Handbook of Internet of Things in Biomedical and Cyber Physical System 》;20190717;第217-244页 *
"A Software Development Platform for Wearable Medical Applications.";Zhang, Ruikai, and Wei Lin.;《Journal of medical systems》;20150815;第39卷(第10期);第1-6页 *
"Clinical assessment of wireless ECG transmission in real-time cardiac telemonitoring.";Alesanco, Alvaro, and Jose Garcia.;《IEEE Transactions on Information Technology in Biomedicine》;20100408;第14卷(第5期);第1144-1152页 *

Also Published As

Publication number Publication date
CN113438198A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
CN113438198B (en) Electrocardio data transmission method and system based on udp transmission protocol
EP3692901A1 (en) Automatic recognition and classification method for electrocardiogram heartbeat based on artificial intelligence
CN107530019B (en) Automatic detection/classification of ECG cable interchange for different ECG lead systems
CN109272483B (en) Capsule endoscopy and quality control system and control method
US11797846B2 (en) Learning assistance device, method of operating learning assistance device, learning assistance program, learning assistance system, and terminal device
US10817753B2 (en) Learning assistance device, method of operating learning assistance device, learning assistance program, learning assistance system, and terminal device
US20180302189A1 (en) Reliable communication algorithm for wireless medical devices and sensors within monitoring systems
CN110010226A (en) A kind of system and application method for checking cloud medical image by mobile terminal
US20120275292A1 (en) Wireless eeg data recovery
CN106974640A (en) A kind of remote heart monitoring system
Shukla et al. A fast and accurate FPGA based QRS detection system
EP3422640A1 (en) Network sniffer for system watchdog and diagnostic
CN112073272B (en) Method and device for analyzing rail transit data based on index matching
EP4082444A1 (en) Automatic frame selection for 3d model construction
EP2899657B1 (en) Real-time communication between medical devices over a dicom network
CN115861283A (en) Medical image analysis method, device, equipment and storage medium
CN113808143B (en) Image segmentation method and device, readable storage medium and electronic equipment
CN113660057A (en) Monitoring data transmission method and device
CN205597898U (en) Electrocardio medical treatment level node means and systems of leading more
US20220395213A1 (en) Methods and apparatus for determining likely outcomes of an electrophysiology procedure
CN113658677A (en) System and method for identifying and early warning monitored data
US11864843B2 (en) Image diagnosis support apparatus, image diagnosis support method, image diagnosis support program, and heart simulation system
CN117061620A (en) Communication method, system, electronic device and readable storage medium
CN116248745A (en) Anesthesia machine communication method, anesthesia machine communication device, anesthesia machine communication equipment, anesthesia machine communication computer equipment and anesthesia machine storage medium
WO2023097486A1 (en) Monitoring method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant