Disclosure of Invention
In order to solve the technical problems, the application provides an optimization processing method for electrocardiographic data of a patient suffering from a wound, so as to solve the existing problems.
The application relates to an optimization processing method of electrocardiographic data of a patient with wound, which adopts the following technical scheme:
one embodiment of the application provides an optimization processing method for electrocardiographic data of a patient suffering from a wound, which comprises the following steps:
s10, acquiring electrocardiographic data of a patient suffering from a wound, and acquiring the cycle number and the average cycle duration of the electrocardiographic data;
S20, determining the local smoothness of the electrocardiograph data at the moment corresponding to the element based on element distribution in the differential sequence of the electrocardiograph data; the determination process of the local smoothness comprises the following steps:
S21, acquiring a differential absolute value sequence of electrocardiographic data of a patient suffering from a wound; for each element of the differential absolute value sequence, setting a window of the element;
s22, determining local relative floating values of electrocardiographic data at corresponding moments of the elements based on local position change degrees of the elements in the differential absolute value sequence;
S23, determining probability turbulence coefficients of the element windows based on probability differences in the element windows;
s24, determining the local smoothness of the electrocardiographic data at the moment corresponding to the element by combining the local relative floating value, the probability fluctuation coefficient and the data distribution in the element window;
s30, determining the length of a self-adaptive dynamic window of each electrocardiograph data based on the numerical value of the local smoothness and the periodic distribution condition; the determining process of the length of the adaptive dynamic window comprises the following steps:
s31, forming a local smoothness sequence of the electrocardiographic data according to a time sequence; determining window calculated amount of electrocardiographic data at the moment corresponding to each element based on the numerical value of each element of the local smoothness sequence and the periodic characteristic in the window;
S32, determining the length of a self-adaptive dynamic window of each electrocardiograph data by combining the window length of an original SG polynomial filtering algorithm and the window calculation amount of each electrocardiograph data;
And S40, improving an SG polynomial filtering algorithm based on the length of the self-adaptive dynamic window of each electrocardiograph data to obtain the filtered electrocardiograph data, and realizing the optimization processing of the electrocardiograph data of the trauma patient.
Preferably, the acquiring the cycle number and the average cycle duration of the electrocardiographic data includes:
Acquiring each R wave peak of the electrocardio data; taking two adjacent R wave peaks as a period to obtain the period number; and taking the average time length of all the periods as the average period time length of the electrocardiograph data.
Preferably, the acquiring the differential absolute value sequence of the electrocardiographic data of the patient with the wound comprises:
obtaining a differential sequence of electrocardiographic data of a patient with a wound by adopting a first-order differential method, and obtaining absolute values of numerical values of elements in the differential sequence to obtain a differential absolute value sequence.
Preferably, the window of the element is: and taking the element as a center element, and respectively taking windows formed by the same number of elements on the left side and the right side of the center element.
Preferably, the method for determining the local relative floating value includes:
acquiring data and values of an element and the left adjacent element thereof; acquiring a data average value in a window of an element; and taking the ratio of the data sum value to the data average value as a local relative floating value of the electrocardiographic data at the moment corresponding to the element.
Preferably, the method for determining the probability turbulence coefficient includes:
Obtaining the maximum probability value in the element window; calculating the difference value between the maximum probability value and the probability of each element in the element window, constructing an exponential function taking the difference value as an index and taking a natural constant as a base, and taking the average value of the calculation results of the exponential function of all elements in the element window as the probability turbulence coefficient of the element window.
Preferably, the method for determining the local smoothness includes:
Acquiring element data mean values and element values with the largest occurrence times in element windows; calculating the product of the element data mean value and the probability fluctuation coefficient as a first product, and calculating the product of the element value with the largest occurrence number and the local relative floating value as a second product;
and taking the ratio of the first product to the second product as the local smoothness of the electrocardiographic data at the moment corresponding to the element.
Preferably, the method for determining the window calculation amount includes:
for each element of the local smoothness sequence, obtaining a local smoothness mean value of the element at the position where the lower standard value of all elements in the element window is located under equal proportion diffusion of average period duration, and calculating a difference absolute value of the local smoothness of the element and the local smoothness mean value;
The numerical value composition sequence of all elements in the element window is recorded as a window data sequence, and the frequency of the window data sequence in the local smoothness sequence is obtained by adopting a KMP algorithm; calculating the absolute value of the difference between the frequency number and the cycle number;
Taking the product of the absolute values of the two differences as the window calculated quantity of the electrocardiograph data at the moment corresponding to the element.
Preferably, the method for determining the length of the adaptive dynamic window includes:
And calculating the sum value of the normalized value and 1 of the window calculation amount of each electrocardiograph data, and taking the nearest odd value of the product result of the sum value and the window length of the original SG polynomial filtering algorithm as the length of the self-adaptive dynamic window of each electrocardiograph data.
Preferably, the method for obtaining the filtered electrocardiographic data comprises the following steps:
And taking the electrocardio data as input of the SG polynomial filtering algorithm, taking the length of the self-adaptive dynamic window of the electrocardio data as the window of the electrocardio data in the original SG polynomial filtering algorithm, and outputting the filtered electrocardio data.
The application has at least the following beneficial effects:
According to the application, based on the window of each element of the differential absolute value sequence of the electrocardiograph data, the local relative floating value of each electrocardiograph data is constructed, the local relative floating value considers the local relative change degree of the electrocardiograph data, and a proper time window and polynomial order can be selected to better approximate an original signal, so that the overfitting phenomenon is avoided, the key characteristics of the signal can be captured more accurately, and the optimization precision of different electrocardiograph data is improved; obtaining the local smoothness of the electrocardiographic data by analyzing the probability of each element in the window and the local relative floating value, wherein the local smoothness fully considers the local bending degree of the data, the higher the bending degree is, the smaller the local smoothness is when the window is selected, the finer the signal can be processed, the detail characteristics and the tiny changes in the original electrocardiographic signal are kept as much as possible, and the important information is prevented from being lost due to excessive smoothness; according to the application, the window calculation amount of the electrocardiographic data is obtained by utilizing the local smoothness of the electrocardiographic data of the element, the window calculation amount considers the influence degree of noise data on the electrocardiographic data, and longer windows are used for smoothing processing on a region with larger noise so as to effectively inhibit the noise and keep the effective information of electrocardiographic signals, and the denoising effect of the electrocardiographic data is improved; based on the self-adaptive dynamic window of the electrocardio data, the window size of the filter can be flexibly adjusted according to the local characteristics and the periodic characteristics of the electrocardio data in different time periods or frequency periods, the change characteristics of the electrocardio data of a patient suffering from a wound are more accurately and flexibly filtered, the accuracy and the effectiveness of signal analysis are improved, and therefore the electrocardio signals are processed more accurately and finely.
Detailed Description
In order to further describe the technical means and effects adopted by the application to achieve the preset aim, the following detailed description refers to specific implementation, structure, characteristics and effects of the method for optimizing and processing electrocardiographic data of a patient suffering from a wound according to the application by combining the accompanying drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
The application provides a specific scheme of an optimized processing method for electrocardiographic data of a patient suffering from a wound, which is specifically described below with reference to the accompanying drawings.
The application provides an optimization processing method for electrocardiographic data of a patient suffering from a wound.
Specifically, the following method for optimizing and processing electrocardiographic data of a patient with wound is provided, referring to fig. 1, the method comprises the following steps:
s10, acquiring electrocardiographic data of a patient suffering from a wound, and acquiring the cycle number and the average cycle duration of the electrocardiographic data.
Preferably, in an embodiment of the present application, the method for acquiring the electrocardiographic data and the cycle number and the average cycle duration of the electrocardiographic data includes:
And acquiring electrocardiographic data of the patient suffering from the wound from a database of an electrocardiographic detection system of a hospital, wherein the acquisition time interval is 1Oms, and the total acquisition time is 1min. Since the data may have a missing phenomenon, the present embodiment adopts a linear interpolation method to fill the missing data, and since the linear interpolation method is a known technique, the specific calculation process is not described herein. The filled electrocardiographic data of the trauma patient is recorded as ECG. In other embodiments of the present invention, the practitioner may also fill the missing data by using other methods such as lagrangian filling, according to the actual situation.
Preferably, the R-wave peak of the electrocardiographic data is obtained by using a differential threshold method for the filled electrocardiographic data, and because the differential threshold method is a formula technology, the specific calculation process is not described herein, and the practitioner can also obtain the R-wave peak by using other methods according to actual situations. The time length T of each period of a wounded patient is obtained by taking two adjacent R wave peaks as one period, and the period number n and the average period time length L of electrocardiographic data can be obtained.
Thus, the electrocardiographic data of the wounded patient can be obtained, and the period number and the average period duration of the electrocardiographic data can be obtained.
S20, determining the local smoothness of the electrocardiographic data at the moment corresponding to the element based on element distribution in the differential sequence of the electrocardiographic data. The determination process of the local smoothness comprises the following steps:
for the electrocardiographic data of a patient suffering from the wound, the local relative floating value of the electrocardiographic data can be calculated by deeply analyzing the change degree of the electrocardiographic data at each local position.
In one embodiment of the application, the local relative float value is increased when a patient experiences significant abnormalities in heart activity due to trauma-induced physiological stress, hemodynamic changes, or other pathological factors. Therefore, in this embodiment, a first-order differential method is adopted for the electrocardiographic data of the patient with the wound, and then the absolute value of the differential data is calculated to obtain the differential absolute value sequence ECG' of the electrocardiographic data. By analyzing the distribution of adjacent values in the electrocardio data differential absolute value sequence, the local relative floating value of each electrocardio data of the wounded patient can be obtained. A window of 2a+1 is set for each element in the differential absolute value sequence, and a takes a value of 3, so that an implementer can set the window according to actual conditions.
Preferably, in one embodiment of the present application, the method for determining the local relative floating value specifically includes:
Taking the local relative floating value of the ith electrocardiographic data of the wounded patient as an example:
Wherein Lrfi represents the local relative float value of the ith electrocardiographic data of the trauma patient; ECG 'i-1、ECG′i and ECG'j represent the values of the i-1 th, i-th and j-th elements, respectively, of the differential absolute value sequence of the cardiac data of the trauma patient; a represents the window length minus half the length of 1.
It should be noted that when the rate of change of the ECG data of the patient with a wound is steeper, that is, the amplitude ECG'i-1+ECG′i of the change around the sampling point is larger, this generally means that there is a drastic change or abnormality in the heart activity. When the electrocardiographic data changes relatively smoothly in a region, the ratio Lrfi of adjacent amplitudes to the mean of all changes in the window is approximately 2, indicating that the slope of the signal in this window is substantially constant, the curve shape then approaches a straight line. In this case, when curve fitting is performed, a smaller time window and a lower polynomial order can be selected to better approximate the original signal, so as to avoid the phenomenon of over-fitting, and at the same time, the key features of the signal can be captured more accurately.
Notably, the differential absolute value sequence can reflect the severity of the change in the electrocardiographic signal over time when analyzing and processing electrocardiographic data of a patient with a trauma. When the data distribution within a window is more diffuse, meaning that the electrocardiographic waveform fluctuates more strongly within the window interval, there may be more noise or non-stationary physiological signals. This volatility is quantified by calculating a probability distribution within each element window.
Preferably, in one embodiment of the present application, the method for determining the local smoothness specifically includes:
Specifically, if the difference between the probability value and the maximum probability of each element in the window is small, the signals in the window tend to be consistent, i.e. the local smoothness is high. For each window of elements of the differential absolute sequence ECG', the probability of occurrence of each element within the window is counted, denoted P, and the probability maximum within each window is denoted Pi,z. Taking the local smoothness of the ith electrocardiographic data of a trauma patient as an example:
Wherein ELSi represents the local smoothness of the ith electrocardiographic data of the trauma patient; 2a+1 represents window size; exp () represents an exponential function based on a natural constant; pi,z represents the maximum probability value within the i-th element window in the differential absolute value sequence ECG'; pi,k represents the probability value of the kth element in the ith element window in the differential absolute value sequence ECG'; mui represents the data mean value within the i-th element window in the differential absolute value sequence ECG'; ECG 'i,z represents the value of the element with the highest occurrence in the ith element window in the differential absolute value sequence ECG'; lrfi represents the local relative float of the ith electrocardiographic data of the trauma patient. Wherein,For the first product, ECG'i,z×Lrfi is the second product.
It should be noted that, when the distribution of the differential absolute value sequence of the electrocardiographic data of the patient with wound in each element window is more dispersed, the fluctuation degree of the electrocardiographic signal is larger, the difference between the probability value and the maximum probability of each element in the window is smaller, the average value obtained by calculationThe smaller the electrocardiosignal is, the steeper the electrocardiosignal is transformed, the larger the local relative floating value Lrfi of the electrocardiosignal is, the smaller the value of the local smoothness ELSi of the electrocardiosignal is, which means that the electrocardiosignal at the position possibly contains more noise or mutation information, and a smaller sliding window is selected during denoising, so that the signal can be processed more finely, the detail characteristics and tiny changes in the original electrocardiosignal are kept as much as possible, and the important information is prevented from being lost due to excessive smoothness.
S30, determining the length of the self-adaptive dynamic window of each electrocardiographic data based on the numerical value of the local smoothness and the periodic distribution condition. The determining process of the length of the adaptive dynamic window comprises the following steps:
Preferably, in one embodiment of the present application, it is critical to identify portions of noise that may be present for electrocardiographic data of a patient at any time during a trauma. In order to evaluate the noise intensity of each sampling point in the electrocardiographic data, the periodic characteristics of the electrocardiographic data are utilized to analyze the local smoothness of the electrocardiographic data, and the window calculated amount of the electrocardiographic data is calculated through the noise intensity of the electrocardiographic data.
Preferably, in one embodiment of the present application, the method for determining the window calculation amount specifically includes:
The local smoothness of the electrocardiographic data of the trauma patient at each moment is formed into a local smoothness sequence according to a time sequence, and the window calculated amount of each electrocardiographic data is calculated according to the local smoothness sequence.
Wherein, NIi represents the window calculated amount of the ith electrocardiograph data of the wounded patient; ELSi represents the local smoothness of the ith electrocardiographic data of a trauma patient; a represents the window length minus half the length of 1; l represents the average period duration of the electrocardiographic data; ELSi+q*L represents the local smoothness of the i+q.L-th electrocardiographic data of a trauma patient; NKMP (Li, ELS) represents the frequency of occurrence of the output pattern string Li in the main string ELS, wherein the adopted method is KMP algorithm, which is a known technique, and the embodiment will not be described again; n represents the number of cycles of electrocardiographic data; li represents the data sequence of the ith element window of the local smoothness sequence; ELS represents a sequence of local smoothness of electrocardiographic data of a patient with a wound.
It should be noted that the more likely the data is noise, the greater the difference between the data and the periodic data, i.eThe larger the value of (c), the more the signal that accounts for the current sample point deviates from its surrounding periodic features and is therefore more likely to be noise or anomalous fluctuations. Meanwhile, the stronger the noise interference is, the smaller the window repeatability is calculated, namely NKMP (Li, ELS) is, the larger the value of the noise intensity value | NKMP (Li, ELS) -n| is, and the larger the value of the window calculated amount NIi corresponding to the electrocardiographic data of the wounded patient is. And smoothing the region with larger noise by using a longer window so as to effectively suppress noise and retain effective information of electrocardiosignals.
It is worth noting that in the region with more noise, more information can be better fused by increasing the window length, so that the influence of noise is reduced and the basic form of the signal is maintained; and in areas where the signal is relatively smooth and less noisy, the window length is reduced appropriately to avoid excessive smoothing resulting in loss of critical details.
In other embodiments of the present application, other methods of calculating window calculations may be employed.
Preferably, in one embodiment of the present application, the adaptive dynamic window of each of the electrocardiographic data of the patient is dynamically calculated by the above formula. Taking the length of the adaptive dynamic window of the ith electrocardiographic data of a trauma patient as an example:
mi=ODD((1+norm(NIi))×D)
Where mi represents the length of the adaptive dynamic window of the ith electrocardiographic data of the trauma patient; ODD () represents taking the nearest ODD function; norm () represents a normalization function; NIi represents the window calculation of the ith electrocardiographic data of the trauma patient; d represents the window length of the original SG polynomial filtering algorithm, which is set to 7 in this embodiment, and the practitioner can set itself according to the actual situation.
In one embodiment of the present application, a flowchart for constructing an index of the length of the adaptive dynamic window of each electrocardiographic data is shown in fig. 2.
It should be noted that, when the value of the window calculated amount NIi for obtaining the electrocardiographic data of the patient with the wound is larger, the electrocardiographic data of the region is more strongly interfered by noise, which indicates that when the SG polynomial filtering algorithm is adopted, the electrocardiographic data should be smoothed by adopting a larger window, and the value of the window calculated amount NIi is larger, the value of the data normalized is larger, and the value of the adaptive window length mi is calculated. The method is more accurate and flexible in filtering aiming at the change characteristics of the electrocardiographic data of the patient suffering from the wound, so that the accuracy and the effectiveness of signal analysis are improved.
And S40, improving an SG polynomial filtering algorithm based on the length of the self-adaptive dynamic window of each electrocardiograph data to obtain the filtered electrocardiograph data, and realizing the optimization processing of the electrocardiograph data of the trauma patient.
Preferably, the adaptive dynamic window length m of the electrocardiographic data of the trauma patient calculated through the steps is improved, and the window length of the SG polynomial filtering algorithm can be adaptively adjusted according to the actual dynamic characteristics of the electrocardiographic data. When the electrocardiosignal changes severely, the window length is correspondingly reduced to capture the detail of rapid change; in the relatively stable signal region, the window length is increased appropriately to enhance the filtering effect and stability, so that the accuracy of the SG polynomial filtering algorithm is improved.
In one embodiment of the application, the electrocardiographic data of a patient with wound is taken as input, an SG polynomial filtering algorithm is adopted, a filtering window for each electrocardiographic data in the algorithm is set to be the length of a self-adaptive dynamic window corresponding to the electrocardiographic data, the highest order of the algorithm is set to be 5, and the output result is the filtered electrocardiographic data.
In one embodiment of the present application, the raw electrocardiographic data before optimization is shown in fig. 3, and the filtered electrocardiographic data is shown in fig. 4.
It should be noted that, it has kept the important clinical information of original signal, has improved signal to noise ratio and analysis accuracy by a wide margin, helps doctor to evaluate patient's condition and make diagnosis and treatment scheme more accurately.
So far, the embodiment can realize the optimization of the electrocardiographic data of the wounded patient through the method.
In summary, according to the embodiment of the application, based on the windows of each element of the differential absolute value sequence of the electrocardiograph data, the local relative floating value of each electrocardiograph data is constructed, and the local relative floating value considers the local relative change degree of the electrocardiograph data, so that an appropriate time window and polynomial order can be selected to better approximate an original signal, the overfitting phenomenon is avoided, meanwhile, key characteristics of the signals can be captured more accurately, and the optimization precision of different electrocardiograph data is improved; obtaining the local smoothness of the electrocardiographic data by analyzing the probability of each element in the window and the local relative floating value, wherein the local smoothness fully considers the local bending degree of the data, the higher the bending degree is, the smaller the local smoothness is when the window is selected, the finer the signal can be processed, the detail characteristics and the tiny changes in the original electrocardiographic signal are kept as much as possible, and the important information is prevented from being lost due to excessive smoothness; according to the embodiment of the application, the window calculation amount of the electrocardiographic data is obtained by utilizing the local smoothness of the electrocardiographic data of the element, the window calculation amount considers the influence degree of noise data on the electrocardiographic data, and longer windows are used for smoothing processing in a region with larger noise so as to effectively inhibit noise and keep the effective information of electrocardiographic signals, and the denoising effect of the electrocardiographic data is improved; based on the self-adaptive dynamic window of the electrocardio data, the window size of the filter can be flexibly adjusted according to the local characteristics and the periodic characteristics of the electrocardio data in different time periods or frequency periods, the change characteristics of the electrocardio data of a patient suffering from a wound are more accurately and flexibly filtered, the accuracy and the effectiveness of signal analysis are improved, and therefore the electrocardio signals are processed more accurately and finely.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and the same or similar parts of each embodiment are referred to each other, and each embodiment mainly describes differences from other embodiments.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; the technical solutions described in the foregoing embodiments are modified or some of the technical features are replaced equivalently, so that the essence of the corresponding technical solutions does not deviate from the scope of the technical solutions of the embodiments of the present application, and all the technical solutions are included in the protection scope of the present application.