Data processing method, device and computer program product
Through real-time monitoring and dynamic smoothing factor processing, the oscillation problem of traditional curve drawing methods when data changes dramatically is solved, and a smoother and more accurate curve is generated, which is suitable for data visualization of medical equipment such as ventricular assist devices.
Patent Information
- Application Number
- CN202510668003.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-09-05
AI Technical Summary
Traditional curve drawing methods are prone to oscillation and distortion when dealing with drastic data changes, resulting in poor curve effects and making it difficult to meet high-quality application requirements.
By monitoring data anomalies in real time, a special curve drawing method is used to redraw the abnormal data segments, and a dynamically calculated smoothing factor and smooth fitting algorithm are used to generate smooth curve segments to replace the curve segments of the abnormal data on the basic curve.
It significantly improves the accuracy and stability of curve drawing and avoids curve distortion. It is suitable for scenarios such as medical equipment monitoring, especially scenarios where sudden abnormalities and normal data are mixed in ventricular assist devices.
Smart Images

Figure CN120599083A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular, to a data processing method, device, and computer program product. Background Art
[0002] Among traditional curve drawing methods, direct connection based on coordinate points is the simplest and most intuitive way, that is, connecting adjacent data points in sequence with straight lines or broken line segments; the curves drawn by traditional curve drawing methods often have obvious edges and corners and poor smoothness, which makes it difficult to meet application scenarios with high requirements for curve quality.
[0003] Bezier curve interpolation is a mathematical method that generates smooth curves through control points. It uses Bernstein polynomials as basis functions and flexibly adjusts the shape of the curve by adjusting the positions of control points, making the curve more natural and continuous visually.
[0004] However, when the data changes dramatically, the Bezier curve may oscillate, causing the curve to be distorted and the resulting curve to be poor. Summary of the Invention
[0005] The purpose of the embodiments of the present application is to provide a data processing method, device and computer program product, which can effectively reduce the oscillation of the curve and avoid curve distortion to a great extent by monitoring abnormal data in real time during the curve drawing process. When abnormal data is detected, a special curve drawing method is used to redraw the curve corresponding to the abnormal data, thereby effectively reducing the oscillation of the curve and greatly avoiding curve distortion. The drawn curve is smoother and has better effect.
[0006] In a first aspect, an embodiment of the present application provides a data processing method, which includes: obtaining a basic curve based on real-time data; determining whether the real-time data is abnormal data; if the real-time data is abnormal data, redrawing a smooth curve segment of the target data segment including the abnormal data; replacing the abnormal curve segment corresponding to the target data segment including the abnormal data on the basic curve with the smooth curve segment to obtain a curve drawing result.
[0007] In the above implementation process, the data processing method provided by this application can effectively handle data that changes in real time and may fluctuate; when abnormal data is detected, the curve corresponding to the abnormal data is redrawn, and the redrawn smooth curve segment is used to replace the basic curve segment to obtain an overall smooth curve segment, which significantly improves the accuracy and stability of curve drawing.
[0008] Optionally, in an embodiment of the present application, determining whether the real-time data is abnormal data includes: determining a fluctuation difference between the real-time data and previous data adjacent to the real-time data; determining a ratio between the fluctuation difference and a length corresponding to a longitudinal coordinate range of the current frame to obtain a fluctuation ratio; and determining the real-time data as abnormal data when the fluctuation ratio is greater than a fluctuation threshold.
[0009] In the above implementation process, the embodiment of the present application calculates the fluctuation difference between adjacent data points and normalizes it with the vertical coordinate range of the current frame to obtain a fluctuation ratio. This ratio is then dynamically compared with a preset fluctuation threshold to identify abnormal data. Therefore, the data processing method provided by the embodiment of the present application, based on a dynamic relative change determination mechanism, determines whether real-time data is abnormal data. This effectively captures real fluctuations while filtering out small normal fluctuations, thereby improving data processing efficiency.
[0010] Optionally, in an embodiment of the present application, redrawing a smooth curve segment of a target data segment including abnormal data includes: calculating a fluctuation smoothing factor based on a fluctuation ratio and a basic smoothing factor for drawing a basic curve; when the fluctuation smoothing factor is within an allowable range of the smoothing factor, using a first smoothing factor to determine the control point coordinates corresponding to a line segment formed by the abnormal data and the previous data of the abnormal data; and drawing a smooth curve segment based on the previous data of the abnormal data, the control point coordinates, and the abnormal data.
[0011] In the above implementation process, the data processing method provided in the embodiment of the present application realizes adaptive smoothing of fluctuating data by dynamically calculating the fluctuation smoothing factor, thereby retaining key fluctuation characteristics while suppressing noise; it significantly improves the dynamic adaptability and accuracy of data visualization in scenarios such as medical equipment monitoring, while also avoiding information loss caused by excessive smoothing (too small smoothing factors are not used).
[0012] Optionally, in the embodiment of the present application, the fluctuation smoothing factor is calculated based on the fluctuation ratio and the basic smoothing factor of the basic curve, including: using the formula: α t =α0+(P rate -1)*(α min -α0) to calculate the volatility smoothing factor; where α t is the volatility smoothing factor, α0 is the basic smoothing factor, α min is the minimum smoothing factor, P rate is the fluctuation ratio.
[0013] In the above implementation process, the data processing method provided by the present application automatically reduces the smoothing intensity (approximately α) when there is a sharp fluctuation. min) to retain key mutation information, avoiding detail loss or overfitting caused by a fixed smoothing factor, and meeting real-time requirements through lightweight computing, significantly improving the clinical credibility and diagnostic value of data visualization, especially suitable for scenarios where sudden abnormalities and normal data are mixed in medical devices such as ventricular assist devices.
[0014] Optionally, in an embodiment of the present application, the data processing method further includes: when the fluctuation smoothing factor is not within the allowable range of the smoothing factor, using a target smoothing fitting method to process the target data segment; and recalculating the fluctuation smoothing factor until the fluctuation smoothing factor is within the allowable range of the smoothing factor.
[0015] In the above implementation process, in the data processing method provided in the embodiment of the present application, when the calculated fluctuation smoothing factor is not within the allowable range of the smoothing factor, the target smoothing fitting algorithm is used to process the target data segment; thereby avoiding the problem of severe oscillation of the curve due to overfitting noise and outliers, which in turn conceals the true trend of change.
[0016] Optionally, in an embodiment of the present application, in the event of a special event, the method includes: redrawing a smooth curve segment of a special data segment including real-time data corresponding to the special event; replacing the curve segment corresponding to the special data segment including real-time data corresponding to the special event on the basic curve with a smooth curve segment to obtain a curve drawing result.
[0017] In the above implementation process, the data processing method provided in the embodiment of the present application not only determines whether the real-time data is abnormal data, but also monitors whether a special event occurs; when a special event occurs, the curve segment of the special data segment including the real-time data corresponding to the special event is redrawn for the special event.
[0018] Optionally, in an embodiment of the present application, the special event includes a controllable event; redrawing the smooth curve segment of the special data segment including the real-time data corresponding to the special event includes: dividing the special data segment into multiple data segments; using the special event smoothing factor to determine the control point coordinates corresponding to each data segment; for each data segment, based on the control point coordinates and the starting point coordinates and end point coordinates of the data segment, drawing the sub-smooth curve segment corresponding to the data segment; connecting the sub-smooth curve segments corresponding to multiple data segments to obtain the smooth curve segment of the special data segment.
[0019] Optionally, in an embodiment of the present application, controllable events include abnormal fluctuation events and normal fluctuation events, and special events also include out-of-control events.
[0020] In the above implementation process, the data processing method provided in the embodiment of the present application can use a special event smoothing factor to smooth the curve when a special event occurs; using a special smoothing factor with a smaller value in the process of curve drawing can effectively overcome data fluctuations and draw a smooth curve.
[0021] In a second aspect, an embodiment of the present application provides a data processing device, which includes: a basic curve drawing module, an abnormality monitoring module, a smooth curve drawing module and a merge drawing module; a basic curve is obtained based on real-time data; the abnormality judgment module is used to judge whether the real-time data is abnormal data; the smooth curve drawing module is used to redraw the smooth curve segment of the target data segment including the abnormal data when the real-time data is abnormal data; the merge drawing module is used to replace the abnormal curve segment corresponding to the target data segment including the abnormal data on the basic curve with the smooth curve segment to obtain a curve drawing result.
[0022] In a third aspect, an embodiment of the present application provides an electronic computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps in any implementation method of the first aspect are performed.
[0023] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores program instructions, and when the processor reads and runs the program instructions, it executes the steps in any implementation method of the above-mentioned first aspect.
[0024] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer program instructions are stored in the computer-readable storage medium. When the computer program instructions are read and executed by a processor, the steps in any implementation method of the above-mentioned first aspect are executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;
[0027] Figure 2 A flowchart for determining violent fluctuation data provided in an embodiment of the present application;
[0028] Figure 3A flow chart for redrawing a curve of violently fluctuating data provided in an embodiment of the present application;
[0029] Figure 4 A flow chart for redrawing curves corresponding to data for special events provided in an embodiment of the present application;
[0030] Figure 5 A flow chart for redrawing curves corresponding to data of controllable events provided in an embodiment of the present application;
[0031] Figure 6 A schematic diagram of a data processing device according to an embodiment of the present invention;
[0032] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes may also occur in an order different from that marked in the drawings. For example, two consecutive boxes may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, may be implemented using a dedicated hardware-based system that performs the specified functions or actions, or may be implemented using a combination of dedicated hardware and computer instructions. In addition, the functional modules in the various embodiments of the present invention may be integrated together to form a separate part, or each module may exist separately, or two or more modules may be integrated to form a separate part.
[0034] Among traditional curve drawing methods, direct connection based on coordinate points is the simplest and most intuitive approach, connecting adjacent data points sequentially with straight lines or broken line segments. However, these traditional curve drawing methods often produce sharp corners and poor smoothness, making them difficult to meet the requirements of high-quality curve applications. To address this issue, Bezier curve interpolation was introduced. This mathematical method generates smooth curves using control points. It uses Bernstein polynomials as basis functions and flexibly adjusts the curve shape by adjusting the positions of the control points, making the curve visually more natural and continuous.
[0035] The core idea of the Bezier curve interpolation method is to construct a continuous and differentiable curve between given data points, ensuring that the curve not only passes through (or approximates) key nodes but also maintains visual smoothness. Bezier curves are classified into different orders (such as quadratic and cubic). Generally, higher orders result in more precise response to control points, but also increase computational complexity. However, when the data undergoes significant changes, Bezier curves may oscillate, resulting in curve distortion and poor quality.
[0036] Based on this, the present application proposes a data processing method, device and computer program. The data processing method monitors abnormal data in real time during the curve drawing process. When abnormal data is detected, a special curve drawing method is used to redraw the curve corresponding to the abnormal data, which can effectively reduce the oscillation of the curve and avoid curve distortion to a great extent. The drawn curve is smoother and the effect is better.
[0037] Before introducing the specific contents of the data processing method of the present application, it should be noted that the data processing method provided in the embodiment of the present application can show significant advantages in processing human physiological data, such as blood pressure data; and patients using invasive medical devices, such as patients using ventricular assist devices, drawing curves of the patient's physiological parameters, and drawing curves of ventricular assist device operating parameters (such as the current, speed, etc. of the ventricular assist device). The following introduces this solution using patients using ventricular assist devices as an example.
[0038] Please see Figure 1 , Figure 1 Flowchart of the data processing method provided in the embodiment of the present application; The present application provides a data processing method, device and computer program product, which can be processed by Figure 7 The data processing method includes the following steps:
[0039] Step S110: obtaining a basic curve based on real-time data.
[0040] In the above step S100 , during the process of drawing the curve, the data in the picture frame is updated cyclically, and the curve is drawn each time using the updated real-time data.
[0041] There are two ways to update the curve. One is to set the maximum number of data points in the frame to N. When the N+1th point appears, the N+1th data point replaces the first point of the original data. When the N+2th point appears, the N+2th data point replaces the second point of the original data. And so on. The other way to update the curve is to set the maximum number of data points in the frame to N. When the N+1th point appears, it is displayed after the N value and the first point is deleted. And so on.
[0042] Step S200: Determine whether the real-time data is abnormal data.
[0043] Step S300: when the real-time data is abnormal data, redraw the smooth curve segment of the target data segment including the abnormal data.
[0044] In the above steps S200 to S300 , it is determined in real time whether the real-time data is abnormal data, and if the real-time data is identified as abnormal data, the smooth curve segment of the target data segment including the abnormal data is redrawn.
[0045] Abnormal data, in the embodiment of the present application, refers to data that undergoes large fluctuations. Taking patients using ventricular assist devices as an example, the abnormal data may be caused by abnormalities in the motor / pump of the ventricular assist device, abnormal changes in the patient's physiological state, etc.
[0046] Step S400: replacing the abnormal curve segment corresponding to the target data segment including the abnormal data on the basic curve with a smooth curve segment to obtain a curve drawing result.
[0047] In the above step S400, the smooth curve segment corresponding to the redrawn special event is used to replace the curve segment corresponding to the target data segment on the basic curve, thereby obtaining a smooth curve drawing result.
[0048] pass Figure 1 It can be seen that the data processing method provided by this application can effectively handle data that changes in real time and may fluctuate; when abnormal data is detected, the curve corresponding to the abnormal data is redrawn, and the redrawn smooth curve segment is used to replace the basic curve segment to obtain an overall smooth curve segment, which significantly improves the accuracy and stability of curve drawing.
[0049] Please see Figure 2 , Figure 2 This is a flowchart for determining violent fluctuation data provided by an embodiment of the present application. In an optional implementation of the embodiment of the present application, the above step S200 determines whether the real-time data is abnormal data, which can be achieved by the following steps:
[0050] Step S210: Determine the fluctuation difference between the real-time data and the previous data adjacent to the real-time data.
[0051] In the above step S210, the fluctuation difference between the real-time data and its adjacent previous data is first determined. For example, the current real-time data is y i , the previous data adjacent to the real-time data is y i-1 , then the above fluctuation difference ΔY=y i -y i-1 .
[0052] Step S220: Determine the ratio between the fluctuation difference and the length corresponding to the vertical coordinate range of the current frame to obtain the fluctuation ratio.
[0053] In the above step S220, after the fluctuation difference is calculated, the fluctuation ratio is calculated based on the ratio between the fluctuation difference and the length corresponding to the vertical coordinate range of the current frame. For example, the fluctuation ratio Among them, Y MAX The maximum vertical coordinate of the current frame, Y MIN The minimum vertical coordinate of the current frame.
[0054] In the above implementation process, the fluctuation ratio P rate It is a normalized quantity, which avoids misjudgment of a fixed threshold due to different data dimensions or scales, and ensures the versatility of the data processing method provided in the embodiment of the present application in different scenarios (such as different devices, different parameters).
[0055] Step S230: When the fluctuation ratio is greater than the fluctuation threshold, the real-time data is determined to be abnormal data.
[0056] In the above step S230, the fluctuation ratio P is obtained. rate Afterwards, the size between the fluctuation ratio and the fluctuation threshold is determined. When the fluctuation ratio exceeds the fluctuation threshold, the current real-time data is determined to be violently fluctuating data.
[0057] The fluctuation threshold, for example, can be set to 1. rate >1, the current real-time data is judged to be violently fluctuating data; when P rate When ≤, the current real-time data is not judged as violently fluctuating data.
[0058] pass Figure 2 As can be seen, the embodiment of the present application calculates the fluctuation difference between adjacent data points and normalizes it with the vertical coordinate range of the current frame to obtain a fluctuation ratio. This ratio is then dynamically compared with a preset fluctuation threshold to identify abnormal data. Therefore, the data processing method provided by the embodiment of the present application, based on a dynamic relative change determination mechanism, determines whether real-time data is abnormal. This effectively captures real fluctuations while filtering out small normal fluctuations, thereby improving data processing efficiency.
[0059] Please see Figure 3 , Figure 3 A flowchart for redrawing a curve for severely fluctuating data provided in an embodiment of the present application; in an optional implementation of an embodiment of the present application, redrawing a smooth curve segment of the target data segment including the abnormal data in the above step S300 can be achieved by the following steps:
[0060] Step S310: Calculate a fluctuation smoothing factor based on the fluctuation ratio and the basic smoothing factor for drawing a basic curve.
[0061] In the above step S310: based on the basic smoothing factor used when drawing the basic curve and the fluctuation ratio P calculated in step S220 rate , calculate the volatility smoothing factor.
[0062] It should be noted that in the Bezier curve interpolation method, the smoothing factor is a proportional factor with a value in [0,1], which is a control factor used to limit the offset between the control point and the original data point. In the Bezier curve interpolation method, the offset is the product of the length of the line segment between the original points and the smoothing factor. In an embodiment of the present application, the basic Bezier curve interpolation method is first used to draw the basic curve, and the smoothing factor used in this process is called the basic smoothing factor. The range of the basic smoothing factor is usually [0.2, 0.6]. Taking the ventricular assist device as an example, the basic smoothing factor corresponding to the normal speed curve can be selected as 0.4. This offset can make the curve smooth enough without obvious distortion.
[0063] The fluctuation smoothing factor is a smoothing factor used when abnormal data is detected to smooth the fluctuations corresponding to the abnormal data.
[0064] Step S320: When the fluctuation smoothing factor is within the allowable range of the smoothing factor, the first smoothing factor is used to determine the coordinates of the control point corresponding to the line segment formed by the abnormal data and the data preceding the abnormal data.
[0065] In the above step S320, after obtaining the fluctuation smoothing factor, it is necessary to determine whether the fluctuation smoothing factor is within the allowable range of the smoothing factor. If the fluctuation smoothing factor is within the allowable range of the smoothing factor, the smoothing factor is used to determine the control point coordinates corresponding to the line segment formed by the violent fluctuation data and the data before the violent fluctuation data.
[0066] Normally, the allowable range of the smoothing factor is no less than 0.2. If the calculated fluctuation smoothing factor is less than 0.2, the method in this example cannot be used to draw a smooth curve segment of the fluctuating data segment including the violently fluctuating data.
[0067] It should be noted that in the Bezier curve interpolation method, the control points are the key parameter points used to define the shape of the curve. The control points constitute the "control polygon" of the curve. The positions of these points are calculated by weighting based on the mathematical formula of the Bezier curve (Bernstein polynomial), and a smooth continuous curve is generated. For example, a quadratic Bezier curve is defined by 3 control points, and a cubic Bezier curve is defined by 4 control points. In the embodiment of the present application, the third-order Bezier curve is used as an example for explanation, and the four points are the starting point, the end point (the violent fluctuation data and the data before the violent fluctuation data) and two control points. Among them, the method of obtaining the control points refers to the implementation method of the Bezier linear interpolation method, which will not be repeated here.
[0068] Step S330: drawing a smooth curve segment based on the previous data of the abnormal data, the coordinates of the control point and the abnormal data.
[0069] In the above step S330 , the smooth curve segment of the fluctuation data segment is redrawn based on the previous data of the violent fluctuation data, the coordinates of the two control points and the violent fluctuation data.
[0070] pass Figure 3 It can be seen that the data processing method provided in the embodiment of the present application realizes adaptive smoothing of fluctuating data by dynamically calculating the fluctuation smoothing factor, thereby retaining key fluctuation characteristics while suppressing noise; it significantly improves the dynamic adaptability and accuracy of data visualization in scenarios such as medical equipment monitoring, while also avoiding information loss caused by excessive smoothing (too small smoothing factors are not used).
[0071] In an optional embodiment, the calculation of the fluctuation smoothing factor based on the fluctuation ratio and the basic smoothing factor of the basic curve in the above step S310 includes:
[0072] Use the formula: α t =α0+(P rate -1)*(α min -α0) to calculate the volatility smoothing factor; where α t is the volatility smoothing factor, α0 is the basic smoothing factor, α min is the minimum smoothing factor, P rate is the fluctuation ratio.
[0073] In the above implementation process, the fluctuation smoothing factor, based on the basic smoothing factor, when the fluctuation ratio is greater than 1 (identified as abnormal data), (P rater -1) is positive, pushing α t Towards the minimum smoothing factor α min As you get closer, the smoothing strength is reduced to preserve details of data variations.
[0074] It can be seen from this that the data processing method provided by the present application automatically reduces the smoothing intensity (approximately α) when there is a sharp fluctuation. min ) to retain key mutation information, avoiding detail loss or overfitting caused by a fixed smoothing factor, and meeting real-time requirements through lightweight computing, significantly improving the clinical credibility and diagnostic value of data visualization, especially suitable for scenarios where sudden abnormalities and normal data are mixed in medical devices such as ventricular assist devices.
[0075] In an optional embodiment, the data processing method further includes:
[0076] If the fluctuation smoothing factor is not within the allowable range of the smoothing factor, the target smoothing fitting method is used to process the target data segment and the fluctuation smoothing factor is calculated again until the fluctuation smoothing factor is within the allowable range of the smoothing factor.
[0077] In the above implementation process, when the calculated fluctuation smoothing factor is less than 0.2, a target smoothing fitting method (for example, P-spline, B-spline, locally weighted regression (LOESS) or constrained optimization smoothing algorithm, etc., which are suitable for points with drastic changes and have local support characteristics) can be used to process the fluctuation data segment and obtain the smooth curve segment corresponding to the fluctuation data segment.
[0078] When the calculated fluctuation smoothing factor is less than 0.2, if the fluctuation smoothing factor is still used, although the details can be retained, the curve will cause severe fluctuations due to overfitting noise and outliers, which will cover up the real trend and even mislead the diagnosis.
[0079] It can be seen from this that in the data processing method provided in the embodiment of the present application, when the calculated fluctuation smoothing factor is not within the allowable range of the smoothing factor, the target smoothing fitting algorithm is used to process the target data segment; thereby avoiding the problem of severe oscillation of the curve due to overfitting noise and outliers, which in turn conceals the true trend of change.
[0080] Please see Figure 4 , Figure 4 A flow chart of curve redrawing corresponding data of special events provided in an embodiment of the present application; in an optional implementation manner of an embodiment of the present application, while determining whether the real-time data is abnormal data, the embodiment of the present application can also monitor in real time whether a special event occurs.
[0081] In the embodiment of the present application, special events refer to possible events that may cause data fluctuations, such as adjustment of the operating gear of the ventricular assist device, abnormal speed of the ventricular assist device motor, or failure of the ventricular assist device electrode.
[0082] In the embodiment of the present application, when a special event is detected, the following steps are performed:
[0083] Step S500: redrawing the smooth curve segment of the special data segment including the real-time data corresponding to the special event.
[0084] Step S600: replacing the curve segment corresponding to the special data segment including the real-time data corresponding to the special event on the basic curve with a smooth curve segment to obtain a curve drawing result.
[0085] pass Figure 4 It can be seen that the data processing method provided in the embodiment of the present application, while determining whether the real-time data is abnormal data, also monitors whether a special event occurs; when a special event occurs, the curve segment of the special data segment including the real-time data corresponding to the special event is redrawn for the special event.
[0086] Please see Figure 5 , Figure 5 A flow chart for redrawing curves corresponding to data for controllable events provided in an embodiment of the present application. In an optional embodiment, a controllable event refers to an event that can be corrected by adjusting and controlling the ventricular assist device. For example, if the motor speed of the ventricular assist device exceeds a certain threshold of the set target speed, the motor speed is considered abnormal and can be restored to normal by adjusting the device. For another example, some fluctuations caused by the operator's active adjustment of the device are also controllable.
[0087] For controllable events, the above step S500 of redrawing the smooth curve segment of the special data segment including the real-time data corresponding to the special event can be implemented in the following manner:
[0088] Step S510: Divide the special data segment into multiple data segments.
[0089] In the above step S510, the special data segment corresponding to the controllable event is divided into multiple data segments. For example, assuming that the special data segment includes A0, A1, A2...A n , n data, divide these n data into n-1 data segments. In this process, the starting point of each data segment is the end point of the previous data segment, that is, it is divided into line segments A0A1, A1A2...A n-1 A n , n-1 data segments.
[0090] Step S520: Using the special event smoothing factor, determine the coordinates of the control points corresponding to each data segment.
[0091] In the above step S520, due to the occurrence of a special event, the basic smoothing factor used in drawing the basic curve in the above process is no longer applicable; the special event smoothing factor is re-determined, and the control point coordinates corresponding to each data segment are determined using the special event smoothing factor.
[0092] The special event smoothing factor is a smoothing factor used when a special event occurs. Usually, the special event smoothing factor is smaller than the basic smoothing factor.
[0093] Step S530 : For each data segment, draw a sub-smooth curve segment corresponding to the data segment based on the control point coordinates and the start point coordinates and end point coordinates of the data segment.
[0094] Step S540: Connecting the sub-smooth curve segments corresponding to the multiple data segments to obtain the smooth curve segment of the special data segment.
[0095] In the above steps S530 to S540, for each data segment, the sub-smooth curve segment corresponding to the data segment is redrawn based on the control point coordinates, the starting point coordinates and the end point coordinates; and multiple sub-smooth curve segments are connected to obtain the smooth curve segment of the special data segment corresponding to the special event.
[0096] pass Figure 5 It can be seen that the data processing method provided in the embodiment of the present application can use a special event smoothing factor to smooth the curve when a special event occurs; using a special smoothing factor with a smaller value in the process of curve drawing can effectively overcome data fluctuations and draw a smooth curve.
[0097] In an optional embodiment, the controllable event may be an abnormal fluctuation event. During operation of the ventricular assist device, a target speed is typically set and the speed of the ventricular assist device is controlled to be maintained near the target speed. When the motor speed deviates from the target speed by a certain amount and exceeds a threshold, the motor speed may be considered abnormal. In this case, the abnormal fluctuation event is an abnormal motor speed, and a corresponding abnormal alarm message may also be generated.
[0098] In the embodiment of the present application, the data is processed using the special smoothing factor described above until the abnormal fluctuation event is resolved. Furthermore, considering the continuity of the curve, the endpoint of the special data segment is the data after the abnormal fluctuation event is resolved, usually the first data after the resolution.
[0099] For the special event smoothing factor corresponding to the abnormal fluctuation event, the smallest smoothing factor, such as 0.2, can be selected for smoothing.
[0100] It can be seen from this that the special event in the embodiment of the present application may be an abnormal fluctuation event. In the case of normal fluctuations, the minimum smoothing factor is used to dynamically smooth the abnormal data, and the detailed characteristics of the abnormal fluctuation are accurately retained while ensuring the continuity of the curve; at the same time, the first data after the abnormality is resolved is used as the end point of the special data segment to ensure that the smoothed curve can reflect the actual speed changes and avoid excessive smoothing of the mutation data by conventional smoothing methods.
[0101] In an optional embodiment, the controllable events include normal fluctuation events, which refer to data fluctuations caused by device adjustment. For a ventricular assist device, motor speed switching can be considered a normal fluctuation event. Such normal fluctuation events are smoothed using a special event smoothing factor.
[0102] It should be noted that the special event smoothing factor for abnormal fluctuation events can be different from the special event smoothing factor for normal fluctuation events. For the special event smoothing factor corresponding to normal fluctuation events, the minimum smoothing factor, such as 0.2, can also be selected for smoothing.
[0103] In an embodiment of the present application, the length of the special data segment is positively correlated with the fluctuation amplitude of the normal fluctuation event. For example, in the case of a motor speed switch, the time for applying the special smoothing factor may be different depending on the amplitude of the speed switch. The larger the switching amplitude, the longer the applicable time, and the longer the length of the special data segment. For example, when the motor operating gear switches from the smallest p0 gear to the largest p9 gear, the special data segment can be set to a data segment corresponding to a 10s time; for example, when switching from p1 gear to p9 gear, the special data segment can be set to a data segment corresponding to a 9s time.
[0104] It can be seen from this that the embodiment of the present application adaptively adjusts the length of special data segments according to the fluctuation amplitude for normal fluctuation events (for example, the larger the gear switching amplitude, the longer the smoothing processing time), thereby avoiding dynamic response delays caused by excessive smoothing in scenarios such as speed regulation, and ensuring the smoothness of the curve.
[0105] In an optional embodiment, the special event may also be an out-of-control event. In the event of an out-of-control event, the redrawing of the smooth curve segment of the special data segment including the real-time data corresponding to the special event in step S200 may be achieved in the following manner:
[0106] Use the target smooth fitting method to process special data segments and obtain smooth curve segments.
[0107] In the embodiments of the present application, an out-of-control event refers to an unexpected state in which the operating parameters of the equipment (such as the motor speed of a ventricular assist device) are completely out of the controllable range due to a sudden failure or system abnormality, and the fluctuation amplitude far exceeds the preset threshold and cannot be restored to a stable state through conventional adjustment. Such events are usually accompanied by emergency alarms and require immediate intervention. Their data characteristics are manifested as continuous, disordered and violent fluctuations, which are essentially different from the abnormal fluctuation events and normal fluctuation events defined above.
[0108] Target flat fitting methods include, for example, P-spline, B-spline, locally weighted regression (LOESS), or constrained optimization smoothing algorithms. In the data processing method provided in the embodiments of the present application, considering that the data of out-of-control events usually show continuous, disordered and violent fluctuations (such as a sudden increase / decrease in motor speed that completely deviates from the controllable range), if a small smoothing factor (such as 0.2) is still used at this time, although the details can be retained, the curve will be severely oscillated due to overfitting noise and outliers, which will mask the true trend and even mislead the diagnosis.
[0109] As can be seen, when an out-of-control event occurs, the embodiment of the present application uses a target smoothing fitting method to redraw the special data segment containing the out-of-control event data. This avoids the problem of overfitting extreme data with small smoothing factors. Based on the data characteristics of the out-of-control event, while maintaining the continuity of the overall curve, it effectively suppresses the distortion caused by abnormal fluctuations, ensuring that the smooth curve reflects the true trend while avoiding overfitting.
[0110] Optionally, the data processing method provided in the embodiment of the present application can partially retain the previous and subsequent normal data as connection anchor points when calculating the mutation data segment (abnormal data, data segments corresponding to special events) to ensure a smooth transition of the curve. It not only retains the mutation characteristics of the abnormal data (such as a sudden drop in speed), but also ensures the continuity of the curve through the anchor point data to avoid breaks or jumps. Maintaining basic smoothness under normal data conditions and adaptively adjusting the processing strategy under abnormal conditions significantly improves the accuracy of data visualization and the reliability of clinical interpretation.
[0111] Optionally, only newly added data segments can be recalculated, while the previously drawn results are retained for the remaining segments. Curve splicing can be achieved by connecting Bezier curve control points. This local update strategy significantly reduces CPU and memory overhead, making it particularly suitable for high-frequency data monitoring scenarios such as ventricular assist devices.
[0112] Please see Figure 6 , Figure 6 Module diagram of a data processing device provided in an embodiment of the present application; the present application also provides a data processing device, the data processing device 100 including: a basic curve drawing module 110, an abnormality monitoring module 120, a smooth curve drawing module 130 and a merge drawing module 140.
[0113] The basic curve drawing module 110 is used to obtain a basic curve based on real-time data.
[0114] The abnormality determination module 120 is used to determine whether the real-time data is abnormal data.
[0115] The smooth curve drawing module 130 is used to redraw the smooth curve segment of the target data segment including the abnormal data when the real-time data is abnormal data.
[0116] The merging and drawing module 140 is used to replace the abnormal curve segment corresponding to the target data segment including the abnormal data on the basic curve with a smooth curve segment to obtain a curve drawing result.
[0117] In an optional embodiment, in the process of determining whether the real-time data is abnormal data, the abnormality determination module 120 is used to: determine the fluctuation difference between the real-time data and the previous data adjacent to the real-time data; determine the ratio between the fluctuation difference and the length corresponding to the longitudinal coordinate range of the current frame to obtain the fluctuation ratio; and when the fluctuation ratio is greater than the fluctuation threshold, determine the real-time data as abnormal data.
[0118] In an optional embodiment, in the process of redrawing the smooth curve segment of the target data segment including the abnormal data, the smooth curve drawing module 130 is used to: calculate the fluctuation smoothing factor based on the fluctuation ratio and the basic smoothing factor for drawing the basic curve; when the fluctuation smoothing factor is within the allowable range of the smoothing factor, use the first smoothing factor to determine the control point coordinates corresponding to the line segment formed by the abnormal data and the previous data of the abnormal data; and draw the smooth curve segment based on the previous data of the abnormal data, the control point coordinates and the abnormal data.
[0119] In an optional embodiment, the fluctuation smoothing factor is calculated based on the fluctuation ratio and the basic smoothing factor of the basic curve, including: using the formula: α t =α0+(P rate -1)*(α min -α0) to calculate the volatility smoothing factor; where α t is the volatility smoothing factor, α0 is the basic smoothing factor, α min is the minimum smoothing factor, P rate is the fluctuation ratio.
[0120] In an optional embodiment, the data processing device 100 is further configured to, if the fluctuation smoothing factor is not within the allowable range of the smoothing factor, use a target smoothing fitting method to process the target data segment and recalculate the fluctuation smoothing factor until the fluctuation smoothing factor is within the allowable range of the smoothing factor.
[0121] In an optional embodiment, in the event of a special event, the smooth curve drawing module 130 is used to redraw the smooth curve segment of the special data segment including the real-time data corresponding to the special event; the merged drawing module 140 is used to replace the curve segment corresponding to the special data segment including the real-time data corresponding to the special event on the basic curve with the smooth curve segment to obtain the curve drawing result.
[0122] In an optional embodiment, the special event includes a controllable event; in the process of redrawing the smooth curve segment of the special data segment including the real-time data corresponding to the special event, the smooth curve drawing module 130 is used to: divide the special data segment into multiple data segments; use the special event smoothing factor to determine the control point coordinates corresponding to each data segment; for each data segment, based on the control point coordinates and the start coordinates and end coordinates of the data segment, draw the sub-smooth curve segment corresponding to the data segment; connect the sub-smooth curve segments corresponding to multiple data segments to obtain the smooth curve segment of the special data segment.
[0123] In an optional embodiment, controllable events include abnormal fluctuation events and normal fluctuation events, and special events also include out-of-control events.
[0124] See Figure 7 , Figure 7 The electronic device 200 provided in the embodiment of the present application includes a processor 201 and a memory 202 , wherein the memory 202 stores machine-readable instructions executable by the processor 201 , and when the machine-readable instructions are executed by the processor 201 , the method described above is performed.
[0125] Based on the same inventive concept, an embodiment of the present application further provides an electrical computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps in any implementation of the above-mentioned data processing method are executed.
[0126] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, which stores computer program instructions. When the computer program instructions are read and executed by a processor, the steps in any implementation method of the above-mentioned data processing method are executed.
[0127] The computer-readable storage medium can be a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or other media that can store program code.
[0128] In this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the elements.
[0129] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, various modifications and variations of the present application are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: The data processing method includes: Obtain basic curve based on real-time data; Determining whether the real-time data is abnormal data; In the case where the real-time data is abnormal data, redrawing a smooth curve segment of the target data segment including the abnormal data; The abnormal curve segment corresponding to the target data segment including the abnormal data on the basic curve is replaced by the smooth curve segment to obtain a curve drawing result.
2. The method according to claim 1, characterized in that The determining whether the real-time data is abnormal data includes: determining a fluctuation difference between the real-time data and previous data adjacent to the real-time data; Determine the ratio between the fluctuation difference and the length corresponding to the longitudinal coordinate range of the current frame to obtain a fluctuation ratio; When the fluctuation ratio is greater than a fluctuation threshold, the real-time data is determined as the abnormal data.
3. The method according to claim 2, characterized in that The redrawing of the smooth curve segment of the target data segment including the abnormal data comprises: Calculating a fluctuation smoothing factor based on the fluctuation ratio and a basic smoothing factor for drawing the basic curve; When the fluctuation smoothing factor is within an allowable range of the smoothing factor, the first smoothing factor is used to determine the coordinates of a control point corresponding to a line segment formed by the abnormal data and the data preceding the abnormal data; The smooth curve segment is drawn based on previous data of the abnormal data, the coordinates of the control point and the abnormal data.
4. The method according to claim 3, characterized in that The calculating of the fluctuation smoothing factor based on the fluctuation ratio and the basic smoothing factor of the basic curve includes: Use the formula: α t =α0+(P rate -1)*(α min -α0) to calculate the fluctuation smoothing factor; wherein, α t is the fluctuation smoothing factor, α0 is the basic smoothing factor, α min is the minimum smoothing factor, P rate is the fluctuation ratio.
5. The method according to claim 3, characterized in that The data processing method further includes: When the fluctuation smoothing factor is not within the permissible range of the smoothing factor, using a target smoothing fitting method to process the target data segment; The fluctuation smoothing factor is calculated again until the fluctuation smoothing factor is within the allowable range of the smoothing factor.
6. The method according to claim 1, characterized in that In the event of a special event, the method includes: redrawing a smooth curve segment of a special data segment including the real-time data corresponding to the special event; The curve segment corresponding to the special data segment including the real-time data corresponding to the special event on the basic curve is replaced by the smooth curve segment to obtain the curve drawing result.
7. The method according to claim 6, characterized in that The special event includes a controllable event; and the redrawing of a smooth curve segment of a special data segment including real-time data corresponding to the special event includes: Dividing the special data segment into a plurality of data segments; Use the special event smoothing factor to determine the coordinates of the control points corresponding to each data segment; For each of the data segments, based on the control point coordinates and the start point coordinates and the end point coordinates of the data segment, draw a sub-smooth curve segment corresponding to the data segment; Connecting multiple sub-smooth curve segments corresponding to the data segments to obtain the smooth curve segment of the special data segment.
8. The method according to claim 6, characterized in that in, The controllable events include abnormal fluctuation events and normal fluctuation events, and the special events also include out-of-control events.
9. A data processing device, characterized in that: The data processing device includes: a basic curve drawing module, an abnormality monitoring module, a smooth curve drawing module and a merging drawing module; The basic curve drawing module is used to obtain a basic curve based on real-time data; The abnormality judgment module is used to judge whether the real-time data is abnormal data; The smooth curve drawing module is used for redrawing the smooth curve segment of the target data segment including the abnormal data when the real-time data is abnormal data; The merging and drawing module is used to replace the abnormal curve segment corresponding to the target data segment including the abnormal data on the basic curve with the smooth curve segment to obtain a curve drawing result.
10. A computer program product, characterized in that The computer program product comprises a computer program / instruction, which implements the steps of the method according to any one of claims 1 to 8 when executed by a processor.