A chest drainage monitoring method and system based on edge computing
By using edge computing and a lightweight random forest model to process multimodal data, the problem of real-time identification and alarm in the thoracic drainage monitoring system on resource-constrained terminals was solved, achieving accurate drainage status monitoring and a secure alarm mechanism.
Patent Information
- Application Number
- CN202611268316.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-11-24
AI Technical Summary
Existing chest drainage monitoring systems struggle to achieve real-time, accurate status identification and tiered alarms on resource-constrained edge computing terminals, and also pose risks of network latency and privacy breaches.
By employing an edge computing-based approach, multimodal data is collected through the deployment of sensors. Real-time data processing is performed using a lightweight random forest model and fixed-point quantization compression technology. Combined with confidence assessment and resource monitoring, the system can identify and issue alarms regarding the traffic diversion status.
Real-time and accurate drainage status identification was achieved on resource-constrained terminals, reducing the risk of false positives and false negatives, improving the reliability and safety of clinical use, and reducing unnecessary interference alarms.
Smart Images

Figure CN123161815A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical monitoring technology, specifically to a method and system for monitoring thoracic drainage based on edge computing. Background Technology
[0002] Closed chest drainage is a common clinical procedure after thoracic surgery. Traditional monitoring relies on regular rounds by medical staff and visual observation, which has problems such as discontinuous monitoring, strong subjectivity, and delayed response. In recent years, some chest drainage systems have introduced sensor monitoring and multimodal data analysis technologies. For example, they can assess bleeding risk by collecting data on the physical properties of drainage fluid and combining it with heart rate variability data, or perform feature fusion analysis by temporal mapping of chest wall respiratory dynamics and drainage fluid dynamics. However, existing solutions generally suffer from key technical bottlenecks. Complex deep learning models require large computing resources and storage space, while chest drainage monitoring devices, as medical IoT terminals, are severely limited in processor performance, memory capacity, and battery life. When the model cannot complete real-time inference at the edge, the raw data can only be uploaded to the cloud for processing, which increases network transmission latency, poses a risk of patient privacy leakage, and may cause monitoring interruption when the network is unstable. Therefore, there is an urgent need for a monitoring method and system that can achieve real-time, accurate, and low-power chest drainage status identification and graded alarm on resource-constrained edge computing terminals, in order to fill the gap in existing technology in this field. Summary of the Invention
[0003] The purpose of this invention is to provide a method and system for monitoring thoracic drainage based on edge computing, so as to solve the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for monitoring thoracic drainage based on edge computing, comprising the following steps: S1. Deploy various sensors in the drainage device. After the drainage is started, synchronously collect drainage fluid flow rate, pipeline pressure, drainage fluid RGB and transparency / turbidity index, and temperature data. After pre-amplification and analog-to-digital conversion, the data is packaged and transmitted to the edge computing terminal cache area along with the timestamp. S2. The terminal performs integrity verification on the packaged data frames, uses median filtering to process the flow signal, fixed-point Kalman filtering to process the pressure signal, and white balance to correct the color signal. After extracting each feature value, a feature vector is formed. S3. Input the feature vector into the pruned and quantized random forest model, compare the features by threshold and vote, count the category with the highest vote and combine it with the confidence level, and output the traffic identification result from the predefined five-category labels. S4. The scheduling unit monitors the traffic diversion status and resource utilization rate in real time. Under normal conditions, it infers at a 30-second interval. Under abnormal conditions, it switches to a 5-second interval. When the resource utilization rate exceeds the threshold, it temporarily reduces the frequency by 50% and restores it after the resources are restored. S5. Based on the status label mapping, it is divided into four levels: no alarm, attention, warning, and emergency. No alarm only caches locally, attention level uploads status messages, warning level uploads through dual links and intermittently alarms, and emergency level continuously alarms with sound and light and uploads encrypted pressure waveforms to the medical terminal.
[0005] Preferably, step S1 specifically includes the following steps: S101. Before the drainage device is activated, clamp the flow sensor in the middle of the drainage tube, connect the pressure sensor in parallel to the drainage tube through the T-junction, use the optical sensor to align with the transparent observation window of the drainage bag and complete the white balance calibration, attach the temperature sensor to the outer wall of the drainage tube, and after all sensors are in place, the edge computing terminal sends a start command to each sensor, each sensor performs a self-test and enters the standby state, waiting for the drainage start signal. S102. After drainage begins, each sensor starts collecting data synchronously at a preset sampling frequency. The flow sensor senses the volume of liquid flowing through the cross section of the tube in real time and continuously outputs drainage fluid flow data. The pressure sensor senses the static pressure and pulsating pressure components applied by the liquid in the drainage tube through its pressure-sensing diaphragm and outputs drainage tube pressure data. The optical sensor acquires drainage fluid property data. The temperature sensor outputs the temperature value of the drainage fluid synchronously as a temperature compensation parameter for color correction. The raw signals output by all sensors are amplitude-conditioned by their respective preamplifier circuits and then sent to the analog-to-digital converter to complete digital sampling at 12-bit resolution and convert them into digital signals that can be recognized by the edge computing terminal. S103. Pack all digital signals together with a unified timestamp according to a preset data frame format and transmit them to the receiving buffer of the edge computing terminal via a wired serial bus.
[0006] Preferably, step S2 specifically includes the following steps: S201. After receiving the multimodal data frame, the edge computing terminal performs data integrity verification. After the verification is successful, for the drainage fluid flow signal, a sliding window midpoint filtering algorithm is used. The window is formed by five data points before and after the current sampling point, and the midpoint of the data in the window is used to replace the current value. S202. For the pressure signal of the drainage tube, a fixed-point Kalman filter algorithm is used to process it, decomposing the pressure signal into a baseline slow-changing component and a respiratory rhythm fast-changing component. Through prediction-update iterative recursion, sensor thermal noise and motion artifacts are effectively suppressed without the need for a floating-point arithmetic unit. S203. For the RGB three-channel values in the drainage fluid property signal, perform white balance correction, use the drainage fluid temperature value output by the temperature sensor as the compensation parameter, look up the table to correct the drift of each channel at different temperatures, normalize the corrected RGB values, and only perform amplitude limiting processing on the transparency and turbidity index, truncate the values that exceed the reasonable range of 0 to 100 to the boundary value. S204. After a series of preprocessing steps, feature calculations are performed on the preprocessed signals in a sliding window manner along the time dimension. Three features are extracted from the flow signal: mean flow rate, standard deviation of flow rate, and peak flow rate within the window. Three features are extracted from the pressure signal: baseline pressure value, pressure fluctuation amplitude, and average slope of pressure waveform. Three features are extracted from the color signal: mean red channel value, mean yellow channel value, and rate of change of red component. The mean value of the current window is extracted from the transparency and turbidity index as a feature. All feature values are combined in a fixed-dimensional order to form the multimodal feature vector at the current moment.
[0007] Preferably, step S3 specifically includes the following steps: S301. The multimodal feature vectors are sequentially written into the input buffer of the lightweight inference model deployed in the terminal's non-volatile memory. The inference engine loads the model structure information and drives the decision tree group to perform inference calculations. The lightweight inference model adopts a random forest architecture after structured pruning and 8-bit fixed-point quantization compression. It contains 30 decision trees, each with a depth limit of 5 layers. Its classification label set is predefined during the model training phase, specifically including five categories: normal drainage, poor drainage, blocked pipeline, active bleeding, and drainage termination. Starting from the root node of the first tree, the inference engine reads the split feature index and split threshold of each node one by one. It compares the feature value of the corresponding index in the input feature vector with the split threshold using fixed-point integers. If it is less than the threshold, it goes down the left branch; otherwise, it goes down the right branch until it reaches the leaf node. It reads the category voting value stored in the leaf node. After completing the inference of a tree, it immediately releases the register space occupied by the intermediate variables of the tree and then enters the inference process of the next tree. S302. After all 30 decision trees have completed inference, the inference engine accumulates and counts the category voting values output by each tree, takes the category with the highest number of votes as the preliminary identification result of this inference, calculates the difference between the highest number of votes and the second highest number of votes, and if the difference is lower than the preset confidence threshold, the preliminary result is marked as a low confidence identification result, while the second highest category is retained as a candidate result.
[0008] Preferably, step S3 further includes the following steps: S303. The inference engine outputs the final judgment based on the recognition result category and confidence level. If the result is low confidence level and the current status label is normal, the original normal label is kept unchanged, and only the feature vector of the frame is stored in the local cache for subsequent review. S304. If the result is low confidence but the current status label is abnormal, or the result is high confidence, the corresponding traffic generation status category label will be directly output. This label will be selected from the preset five-category set. S305 The inference engine writes the final output status label to the status register, and at the same time stores the feature vectors used in this inference and the output results into the local log cache.
[0009] Preferably, step S4 specifically includes the following steps: S401. Real-time monitoring of two types of input parameters: current diversion status parameters and system resource usage parameters; S402. Input the collected status parameters and resource usage parameters into the preset decision logic for judgment. When the traffic diversion status parameter is normal traffic diversion, set the inference frequency to the first frequency, which is to perform inference once every 30 seconds. When any status parameter is abnormal, immediately switch the inference frequency to the second frequency, which is to perform inference once every 5 seconds. S403. If the CPU load rate is detected to exceed 85% for three consecutive seconds and the memory usage rate exceeds 80%, the resource protection mechanism is triggered, and the current inference frequency is temporarily reduced to 50% of the original frequency. At the same time, the acquisition and caching of sensor data are maintained unchanged. When the resource usage rate drops below 60% and lasts for five seconds, the scheduling unit releases the resource protection mechanism and restores the inference frequency to the set value corresponding to the current state. S404. The frequency control command is sent to the frequency configuration register of the inference engine. After the current inference task is completed, the inference engine reads the new setting value of the register to determine the start interval of the next round of inference.
[0010] Preferably, step S5 specifically includes the following steps: S501: Read the drainage status label and its confidence level mark. The internally preset three-level alarm mapping table maps the five-category status labels to the corresponding levels. Normal drainage is mapped to the no-alarm level, poor drainage and drainage end are mapped to the attention level, tube blockage is mapped to the warning level, and active bleeding is mapped to the emergency level. S502. When the mapping result is no alarm level, the alarm unit does not trigger audible and visual prompts, but only writes the status label, feature average value and timestamp to the local circular cache at a frequency of one per minute, without performing any upload operation. S503. When the mapping result is at the attention level, the alarm unit illuminates a yellow prompt icon on the local display screen and generates a status message containing a status label, feature value, and timestamp. The communication unit prioritizes uploading the message to the nurse station terminal via the Wi-Fi link, without uploading the original sensor data.
[0011] Preferably, step S5 further includes the following steps: S504. When the mapping result is a warning level, the alarm unit starts the buzzer to sound intermittently and lights up the orange indicator light. At the same time, it uploads the message containing the status label, feature vector and the feature value change trajectory in the last minute to the nurse station terminal and the cloud server through Wi-Fi and cellular network dual links. S505. When the mapping result is at the emergency level, the alarm unit triggers a continuous audible and visual alarm, constructs an emergency message containing status tags, feature vectors, feature change trends over the last five minutes, key sampling points of the pressure waveform over the last thirty seconds, and three consecutive inference confidence values. After lightweight encryption, the message is simultaneously uploaded to the cloud server and up to three preset handheld terminals for medical staff via the cellular network. The alarm continues until manually reset.
[0012] The aforementioned edge computing-based thoracic drainage monitoring system includes a data packaging unit, a feature extraction unit, a status recognition unit, a resource monitoring unit, and a level classification unit. The data packaging unit deploys various sensors on the drainage device. After the drainage is started, it synchronously collects drainage fluid flow rate, pipeline pressure, drainage fluid RGB and transparency / turbidity index, and temperature data. After pre-amplification and analog-to-digital conversion, the data is packaged and transmitted to the edge computing terminal cache along with the timestamp. The feature extraction unit uses the terminal to perform integrity verification on the packaged data frames, uses median filtering to process the flow signal, fixed-point Kalman filtering to process the pressure signal, and white balance to correct the color signal. After extracting each feature value, a feature vector is formed. The state recognition unit inputs the feature vector into the pruned and quantized random forest model, performs threshold comparison and voting on the features, counts the category with the highest vote and combines it with the confidence level, and outputs the traffic-driving state recognition result from the predefined five-category labels. The resource monitoring unit uses the scheduling unit to monitor the traffic diversion status and resource occupancy rate in real time. Under normal conditions, it infers at a 30-second interval, and switches to a 5-second interval when it is abnormal. When the resource occupancy rate exceeds the threshold, it temporarily reduces the frequency by 50%, and restores it after the resources are restored. The classification unit is mapped to four levels based on status labels: no alarm, attention, warning, and emergency. The no alarm level only caches locally, the attention level uploads status messages, the warning level uploads via dual links and alarms intermittently, and the emergency level provides continuous audible and visual alarms and encrypts and uploads pressure waveforms to the medical terminal.
[0013] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention uses random forest as the basic model architecture, combined with structured pruning and fixed-point quantization compression technology, which greatly reduces the number of model parameters and storage space, enabling complex drainage status recognition models to run efficiently on embedded microcontrollers with no floating-point arithmetic units and small memory. The time consumption of a single inference meets the needs of real-time clinical monitoring, and successfully solves the technical problem that deep learning models cannot be deployed and inferred in real time on medical IoT terminals.
[0014] 2. This invention introduces a confidence judgment mechanism after model inference. Based on the objective fact that the risk of missed reporting is significantly higher than the risk of false reporting in the clinical scenario of drainage monitoring, an asymmetric decision-making strategy is adopted to effectively balance the risks of false positives and false negatives, ensure high sensitivity identification in emergency situations, and reduce unnecessary interference alarms in normal situations, thereby improving the reliability and safety of clinical use. Attached Figure Description
[0015] Figure 1 An overall method flowchart is provided for embodiments of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Example 1: Please see Figure 1 This invention provides a technical solution: a method for monitoring thoracic drainage based on edge computing, comprising the following steps: S1. Deploy various sensors in the drainage device. After the drainage is started, synchronously collect drainage fluid flow rate, pipeline pressure, drainage fluid RGB and transparency / turbidity index, and temperature data. After pre-amplification and analog-to-digital conversion, the data is packaged and transmitted to the edge computing terminal cache area along with the timestamp. S2. The terminal performs integrity verification on the packaged data frames, uses median filtering to process the flow signal, fixed-point Kalman filtering to process the pressure signal, and white balance to correct the color signal. After extracting each feature value, a feature vector is formed. S3. Input the feature vector into the pruned and quantized random forest model, compare the features by threshold and vote, count the category with the highest vote and combine it with the confidence level, and output the traffic identification result from the predefined five-category labels. S4. The scheduling unit monitors the traffic diversion status and resource utilization rate in real time. Under normal conditions, it infers at a 30-second interval. Under abnormal conditions, it switches to a 5-second interval. When the resource utilization rate exceeds the threshold, it temporarily reduces the frequency by 50% and restores it after the resources are restored. S5. Based on the status label mapping, it is divided into four levels: no alarm, attention, warning, and emergency. No alarm only caches locally, attention level uploads status messages, warning level uploads through dual links and intermittently alarms, and emergency level continuously alarms with sound and light and uploads encrypted pressure waveforms to the medical terminal.
[0018] S1 specifically includes the following steps: S101. Before the drainage device is activated, clamp the flow sensor in the middle of the drainage tube, connect the pressure sensor in parallel to the drainage tube through the T-junction, use the optical sensor to align with the transparent observation window of the drainage bag and complete the white balance calibration, attach the temperature sensor to the outer wall of the drainage tube, and after all sensors are in place, the edge computing terminal sends a start command to each sensor, each sensor performs a self-test and enters the standby state, waiting for the drainage start signal. S102. After drainage begins, each sensor synchronously starts collecting data at a preset sampling frequency. The flow sensor senses the volume of liquid flowing through the tube cross-section in real time and continuously outputs drainage fluid flow data. The pressure sensor senses the static pressure and pulsating pressure components applied by the liquid in the drainage tube through its pressure-sensing diaphragm and outputs drainage tube pressure data. Its sampling frequency is set to be no less than 50Hz to capture pressure fluctuations caused by respiratory rhythm. The optical sensor sequentially emits multiple narrowband spectra covering the visible to near-infrared bands and measures the reflected light intensity and transmitted light intensity of the drainage fluid at each wavelength. Based on this, the absorbance value at each characteristic wavelength is calculated. The RGB three-channel component values, transparency, and turbidity index of the drainage fluid are obtained by inversion using Lambert-Beer's law, thereby obtaining drainage fluid property data. The temperature sensor synchronously outputs the temperature value of the drainage fluid as a temperature compensation parameter for color correction. The raw signals output by all sensors are amplitude-conditioned by their respective preamplifier circuits and then sent to the analog-to-digital converter for 12-bit resolution digital sampling, which is converted into a digital signal that can be recognized by the edge computing terminal. S103. Pack all digital signals together with a unified timestamp according to a preset data frame format and transmit them to the receiving buffer of the edge computing terminal via a wired serial bus. S2 specifically includes the following steps: S201. After receiving the multimodal data frame, the edge computing terminal performs data integrity verification. The terminal verifies whether the timestamp of each frame of data is continuous and whether the data of each sensor channel is complete without missing packets. If data frame loss or verification error is detected, a retransmission request is sent to the sensor end. After the verification is passed, for the drainage fluid flow signal, a sliding window midpoint filtering algorithm is used. The window is formed by five data points before and after the current sampling point, and the midpoint of the data in the window is taken to replace the current value, thereby eliminating the pulse outlier noise caused by changes in the patient's body position or compression of the drainage tube. S202. For the pressure signal of the drainage tube, a fixed-point Kalman filter algorithm is used to process it, decomposing the pressure signal into a baseline slow-changing component and a respiratory rhythm fast-changing component. Through prediction-update iterative recursion, sensor thermal noise and motion artifacts are effectively suppressed without the need for a floating-point arithmetic unit. S203. For the RGB three-channel values in the drainage fluid property signal, perform white balance correction, use the drainage fluid temperature value output by the temperature sensor as the compensation parameter, look up the table to correct the drift of each channel at different temperatures, normalize the corrected RGB values, and only limit the transparency and turbidity index, truncate the values that exceed the reasonable range of 0 to 100 to the boundary value. S204. After a series of preprocessing steps, feature calculations are performed on the preprocessed signal in a sliding window manner along the time dimension. The window duration is set to the data segment of the most recent 10 seconds, with a step size of 2 seconds. Three features are extracted from the flow signal: mean flow, standard deviation of flow, and peak flow within the window. Three features are extracted from the pressure signal: baseline pressure, pressure fluctuation amplitude (maximum value minus minimum value within the window), and average slope of the pressure waveform (calculated by dividing the pressure difference between the beginning and end of the window by the window duration). Three features are extracted from the color signal: mean of the red channel, mean of the yellow channel, and rate of change of the red component (normalized difference between the current mean of red and the mean of red in the previous window). The mean of the current window is extracted from the transparency and turbidity index as a feature. All feature values are combined in a fixed dimensional order to form the multimodal feature vector at the current moment. S3 specifically includes the following steps: S301. The multimodal feature vectors are sequentially written into the input buffer of the lightweight inference model deployed in the terminal's non-volatile memory. The inference engine loads the model structure information and drives the decision tree group to perform inference calculations. The lightweight inference model adopts a random forest architecture after structured pruning and 8-bit fixed-point quantization compression. It contains 30 decision trees, each with a depth limit of 5 layers. Its classification label set is predefined during the model training phase, specifically including five categories: normal drainage, poor drainage, blocked pipeline, active bleeding, and drainage termination. Starting from the root node of the first tree, the inference engine reads the split feature index and split threshold of each node one by one. It compares the feature value of the corresponding index in the input feature vector with the split threshold using fixed-point integers. If it is less than the threshold, it goes down the left branch; otherwise, it goes down the right branch until it reaches the leaf node. It reads the category voting value stored in the leaf node. After completing the inference of a tree, it immediately releases the register space occupied by the intermediate variables of the tree and then enters the inference process of the next tree. S302. After all 30 decision trees have completed inference, the inference engine accumulates and counts the category voting values output by each tree, takes the category with the highest number of votes as the preliminary identification result of this inference, calculates the difference between the highest number of votes and the second highest number of votes, and if the difference is lower than the preset confidence threshold, the preliminary result is marked as a low confidence identification result, while the second highest category is retained as a candidate result. S3 also includes the following steps: S303. The inference engine outputs the final judgment based on the recognition result category and confidence level. If the result is low confidence level and the current status label is normal, the original normal label is kept unchanged, and only the feature vector of the frame is stored in the local cache for subsequent review. S304. If the result is low confidence but the current status label is abnormal, or the result is high confidence, the corresponding traffic generation status category label will be directly output. This label will be selected from the preset five-category set. The above-mentioned judgment mechanism adopts an asymmetric decision-making strategy based on clinical risk priority: when the identification result is low confidence and the current status label is normal, a conservative strategy is adopted to maintain the original judgment to avoid clinical interference caused by false positive alarms; when the identification result is low confidence and the current status label is abnormal, an aggressive strategy is adopted to maintain the original judgment to avoid clinical missed diagnosis caused by false negatives; when the identification result is high confidence, the current identification result is directly output, and the priority order is: prevention of missed reports > prevention of false reports > original model output. This order is set based on the clinical fact that the risk cost of missing active bleeding or tube blockage in the clinical scenario of thoracic drainage is significantly higher than the risk cost of false reporting of normal status. S305. The inference engine writes the final output status label to the status register, and at the same time stores the feature vectors used in this inference and the output results into the local log cache. S4 specifically includes the following steps: S401 monitors two types of input parameters in real time: current traffic status parameters and system resource usage parameters. Traffic status parameters are provided directly by status tags. After each inference engine completes an inference, the data is written to the status register. The scheduling unit reads the current value of the register in a polling manner. System resource usage parameters include the CPU load rate of the edge computing terminal main control chip and the dynamic usage rate of on-chip memory. The CPU load rate is obtained by reading the task statistics variables of the operating system or scheduling kernel. The memory usage rate is obtained by polling the ratio of the number of allocated bytes to the total heap size of the heap manager. S402. Input the collected status parameters and resource usage parameters into the preset decision logic for judgment. When the traffic diversion status parameter is normal traffic diversion, set the inference frequency to the first frequency, which is to perform inference once every 30 seconds. When any status parameter is abnormal, immediately switch the inference frequency to the second frequency, which is to perform inference once every 5 seconds. S403. If the CPU load rate is detected to exceed 85% for three consecutive seconds and the memory usage rate exceeds 80%, the resource protection mechanism is triggered, and the current inference frequency is temporarily reduced to 50% of the original frequency. At the same time, the acquisition and caching of sensor data are maintained unchanged. When the resource usage rate drops below 60% and lasts for five seconds, the scheduling unit releases the resource protection mechanism and restores the inference frequency to the set value corresponding to the current state. S404. The frequency control command is sent to the frequency configuration register of the inference engine. After the current inference task is completed, the inference engine reads the new setting value of the register to determine the start interval of the next round of inference. S5 specifically includes the following steps: S501: Read the drainage status label and its confidence level mark. The internally preset three-level alarm mapping table maps the five-category status labels to the corresponding levels. Normal drainage is mapped to the no-alarm level, poor drainage and drainage end are mapped to the attention level, tube blockage is mapped to the warning level, and active bleeding is mapped to the emergency level. S502. When the mapping result is no alarm level, the alarm unit does not trigger audible and visual prompts, but only writes the status label, feature average value and timestamp to the local circular cache at a frequency of one per minute, without performing any upload operation. S503. When the mapping result is at the attention level, the alarm unit illuminates a yellow prompt icon on the local display screen and generates a status message containing a status label, feature value and timestamp. The communication unit first uploads the message to the nurse station terminal via the Wi-Fi link, without uploading the original sensor data. S5 also includes the following steps: S504. When the mapping result is a warning level, the alarm unit starts the buzzer to sound intermittently and lights up the orange indicator light. At the same time, it uploads the message containing the status label, feature vector and the feature value change trajectory in the last minute to the nurse station terminal and the cloud server through Wi-Fi and cellular network dual links. S505. When the mapping result is at the emergency level, the alarm unit triggers a continuous audible and visual alarm (the buzzer sounds continuously and the red indicator light flashes at a high frequency). An emergency message containing a status label, feature vector, the feature change trend of the last five minutes, the key sampling points of the pressure waveform of the last thirty seconds, and the confidence values of three consecutive inferences is constructed. After being lightly encrypted, the message is simultaneously uploaded to the cloud server and up to three preset handheld terminals of medical staff via the cellular network. The alarm continues until it is manually reset. If both Wi-Fi and cellular network are unavailable, the message to be transmitted is written to the local storage according to priority. After the link is restored, the interrupted transmission is performed according to the principle of emergency priority and sequential retransmission.
[0019] Example 2: The present invention also provides a chest drainage monitoring system based on edge computing, including a data packaging unit, a feature extraction unit, a status recognition unit, a resource monitoring unit, and a level classification unit; The data packaging unit deploys various sensors on the drainage device. After the drainage is started, it synchronously collects drainage fluid flow rate, pipeline pressure, drainage fluid RGB and transparency / turbidity index, and temperature data. After pre-amplification and analog-to-digital conversion, the data is packaged and transmitted to the edge computing terminal cache along with the timestamp. The feature extraction unit uses the terminal to perform integrity verification on the packaged data frames, uses median filtering to process the flow signal, fixed-point Kalman filtering to process the pressure signal, and white balance to correct the color signal. After extracting each feature value, a feature vector is formed. The state recognition unit inputs the feature vector into the pruned and quantized random forest model, compares the features by threshold and votes, counts the category with the highest vote and combines it with the confidence level, and outputs the traffic-driving state recognition result from the predefined five-category labels. The resource monitoring unit uses the scheduling unit to monitor the traffic diversion status and resource utilization rate in real time. Under normal conditions, it infers at a 30-second interval, and switches to a 5-second interval when it is abnormal. When the resource utilization rate exceeds the threshold, the frequency is temporarily reduced by 50%, and it is restored after the resources are recovered. The grading unit is mapped to four levels based on status labels: no alarm, attention, warning, and emergency. No alarm only caches locally, attention uploads status messages, warning uploads via dual links and intermittently alarms, and emergency continuously alarms with sound and light and uploads encrypted pressure waveforms to the medical terminal.
[0020] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0021] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for monitoring thoracic drainage based on edge computing, characterized in that, The method includes the following steps: S1. Deploy various sensors in the drainage device. After the drainage is started, synchronously collect drainage fluid flow rate, pipeline pressure, drainage fluid RGB and transparency / turbidity index, and temperature data. After pre-amplification and analog-to-digital conversion, the data is packaged and transmitted to the edge computing terminal cache area along with the timestamp. S2. The terminal performs integrity verification on the packaged data frames, uses median filtering to process the flow signal, fixed-point Kalman filtering to process the pressure signal, and white balance to correct the color signal. After extracting each feature value, a feature vector is formed. S3. Input the feature vector into the pruned and quantized random forest model, compare the features by threshold and vote, count the category with the highest vote and combine it with the confidence level, and output the traffic identification result from the predefined five-category labels. S4. The scheduling unit monitors the traffic diversion status and resource utilization rate in real time. Under normal conditions, it infers at a 30-second interval. Under abnormal conditions, it switches to a 5-second interval. When the resource utilization rate exceeds the threshold, it temporarily reduces the frequency by 50% and restores it after the resources are restored. S5. Based on the status label mapping, it is divided into four levels: no alarm, attention, warning, and emergency. No alarm only caches locally, attention level uploads status messages, warning level uploads through dual links and intermittently alarms, and emergency level continuously alarms with sound and light and uploads encrypted pressure waveforms to the medical terminal.
2. The method for monitoring thoracic drainage based on edge computing according to claim 1, characterized in that, S1 specifically includes the following steps: S101. Before the drainage device is activated, clamp the flow sensor in the middle of the drainage tube, connect the pressure sensor in parallel to the drainage tube through the T-junction, use the optical sensor to align with the transparent observation window of the drainage bag and complete the white balance calibration, attach the temperature sensor to the outer wall of the drainage tube, and after all sensors are in place, the edge computing terminal sends a start command to each sensor, each sensor performs a self-test and enters the standby state, waiting for the drainage start signal. S102. After drainage begins, each sensor starts collecting data synchronously at a preset sampling frequency. The flow sensor senses the volume of liquid flowing through the cross section of the tube in real time and continuously outputs drainage fluid flow data. The pressure sensor senses the static pressure and pulsating pressure components applied by the liquid in the drainage tube through its pressure-sensing diaphragm and outputs drainage tube pressure data. The optical sensor acquires drainage fluid property data. The temperature sensor outputs the temperature value of the drainage fluid synchronously as a temperature compensation parameter for color correction. The raw signals output by all sensors are amplitude-conditioned by their respective preamplifier circuits and then sent to the analog-to-digital converter to complete digital sampling at 12-bit resolution and convert them into digital signals that can be recognized by the edge computing terminal. S103. Pack all digital signals together with a unified timestamp according to a preset data frame format and transmit them to the receiving buffer of the edge computing terminal via a wired serial bus.
3. The method for monitoring thoracic drainage based on edge computing according to claim 1, characterized in that, S2 specifically includes the following steps: S201. After receiving the multimodal data frame, the edge computing terminal performs data integrity verification. After the verification is successful, for the drainage fluid flow signal, a sliding window midpoint filtering algorithm is used. The window is formed by five data points before and after the current sampling point, and the midpoint of the data in the window is used to replace the current value. S202. For the pressure signal of the drainage tube, a fixed-point Kalman filter algorithm is used to process it, decomposing the pressure signal into a baseline slow-changing component and a respiratory rhythm fast-changing component. Through prediction-update iterative recursion, sensor thermal noise and motion artifacts are effectively suppressed without the need for a floating-point arithmetic unit. S203. For the RGB three-channel values in the drainage fluid property signal, perform white balance correction, use the drainage fluid temperature value output by the temperature sensor as the compensation parameter, look up the table to correct the drift of each channel at different temperatures, normalize the corrected RGB values, and only perform amplitude limiting processing on the transparency and turbidity index, truncate the values that exceed the reasonable range of 0 to 100 to the boundary value. S204. After a series of preprocessing steps, feature calculations are performed on the preprocessed signals in a sliding window manner along the time dimension. Three features are extracted from the flow signal: mean flow rate, standard deviation of flow rate, and peak flow rate within the window. Three features are extracted from the pressure signal: baseline pressure value, pressure fluctuation amplitude, and average slope of pressure waveform. Three features are extracted from the color signal: mean red channel value, mean yellow channel value, and rate of change of red component. The mean value of the current window is extracted from the transparency and turbidity index as a feature. All feature values are combined in a fixed-dimensional order to form the multimodal feature vector at the current moment.
4. The method for monitoring thoracic drainage based on edge computing according to claim 1, characterized in that, S3 specifically includes the following steps: S301. The multimodal feature vectors are sequentially written into the input buffer of the lightweight inference model deployed in the terminal's non-volatile memory. The inference engine loads the model structure information and drives the decision tree group to perform inference calculations. The lightweight inference model adopts a random forest architecture after structured pruning and 8-bit fixed-point quantization compression. It contains 30 decision trees, each with a depth limit of 5 layers. Its classification label set is predefined during the model training phase, specifically including five categories: normal drainage, poor drainage, blocked pipeline, active bleeding, and drainage termination. Starting from the root node of the first tree, the inference engine reads the split feature index and split threshold of each node one by one. It compares the feature value of the corresponding index in the input feature vector with the split threshold using fixed-point integers. If it is less than the threshold, it goes down the left branch; otherwise, it goes down the right branch until it reaches the leaf node. It reads the category voting value stored in the leaf node. After completing the inference of a tree, it immediately releases the register space occupied by the intermediate variables of the tree and then enters the inference process of the next tree. S302. After all 30 decision trees have completed inference, the inference engine accumulates and counts the category voting values output by each tree, takes the category with the highest number of votes as the preliminary identification result of this inference, calculates the difference between the highest number of votes and the second highest number of votes, and if the difference is lower than the preset confidence threshold, the preliminary result is marked as a low confidence identification result, while the second highest category is retained as a candidate result.
5. The method for monitoring thoracic drainage based on edge computing according to claim 4, characterized in that, S3 further includes the following steps: S303. The inference engine outputs the final judgment based on the recognition result category and confidence level. If the result is low confidence level and the current status label is normal, the original normal label is kept unchanged, and only the feature vector of the frame is stored in the local cache for subsequent review. S304. If the result is low confidence but the current status label is abnormal, or the result is high confidence, the corresponding traffic generation status category label will be directly output. This label will be selected from the preset five-category set. S305 The inference engine writes the final output status label to the status register, and at the same time stores the feature vectors used in this inference and the output results into the local log cache.
6. The method for monitoring thoracic drainage based on edge computing according to claim 1, characterized in that, S4 specifically includes the following steps: S401. Real-time monitoring of two types of input parameters: current diversion status parameters and system resource usage parameters; S402. Input the collected status parameters and resource usage parameters into the preset decision logic for judgment. When the traffic diversion status parameter is normal traffic diversion, set the inference frequency to the first frequency, which is to perform inference once every 30 seconds. When any status parameter is abnormal, immediately switch the inference frequency to the second frequency, which is to perform inference once every 5 seconds. S403. If the CPU load rate is detected to exceed 85% for three consecutive seconds and the memory usage rate exceeds 80%, the resource protection mechanism is triggered, and the current inference frequency is temporarily reduced to 50% of the original frequency. At the same time, the acquisition and caching of sensor data are maintained unchanged. When the resource usage rate drops below 60% and lasts for five seconds, the scheduling unit releases the resource protection mechanism and restores the inference frequency to the set value corresponding to the current state. S404. The frequency control command is sent to the frequency configuration register of the inference engine. After the current inference task is completed, the inference engine reads the new setting value of the register to determine the start interval of the next round of inference.
7. The method for monitoring thoracic drainage based on edge computing according to claim 1, characterized in that, S5 specifically includes the following steps: S501: Read the drainage status label and its confidence level mark. The internally preset three-level alarm mapping table maps the five-category status labels to the corresponding levels. Normal drainage is mapped to the no-alarm level, poor drainage and drainage end are mapped to the attention level, tube blockage is mapped to the warning level, and active bleeding is mapped to the emergency level. S502. When the mapping result is no alarm level, the alarm unit does not trigger audible and visual prompts, but only writes the status label, feature average value and timestamp to the local circular cache at a frequency of one per minute, without performing any upload operation. S503. When the mapping result is at the attention level, the alarm unit illuminates a yellow prompt icon on the local display screen and generates a status message containing a status label, feature value, and timestamp. The communication unit prioritizes uploading the message to the nurse station terminal via the Wi-Fi link, without uploading the original sensor data.
8. The method for monitoring thoracic drainage based on edge computing according to claim 7, characterized in that, S5 further includes the following steps: S504. When the mapping result is a warning level, the alarm unit starts the buzzer to sound intermittently and lights up the orange indicator light. At the same time, it uploads the message containing the status label, feature vector and the feature value change trajectory in the last minute to the nurse station terminal and the cloud server through Wi-Fi and cellular network dual links. S505. When the mapping result is at the emergency level, the alarm unit triggers a continuous audible and visual alarm, constructs an emergency message containing status tags, feature vectors, feature change trends over the last five minutes, key sampling points of the pressure waveform over the last thirty seconds, and three consecutive inference confidence values. After lightweight encryption, the message is simultaneously uploaded to the cloud server and up to three preset handheld terminals for medical staff via the cellular network. The alarm continues until manually reset.
9. A chest drainage monitoring system based on edge computing, characterized in that, The chest drainage monitoring system is applicable to the chest drainage monitoring method based on edge computing as described in any one of claims 1-8, and includes a data packaging unit, a feature extraction unit, a status recognition unit, a resource monitoring unit, and a level classification unit; The data packaging unit deploys various sensors on the drainage device. After the drainage is started, it synchronously collects drainage fluid flow rate, pipeline pressure, drainage fluid RGB and transparency / turbidity index, and temperature data. After pre-amplification and analog-to-digital conversion, the data is packaged and transmitted to the edge computing terminal cache along with the timestamp. The feature extraction unit uses the terminal to perform integrity verification on the packaged data frames, uses median filtering to process the flow signal, fixed-point Kalman filtering to process the pressure signal, and white balance to correct the color signal. After extracting each feature value, a feature vector is formed. The state recognition unit inputs the feature vector into the pruned and quantized random forest model, performs threshold comparison and voting on the features, counts the category with the highest vote and combines it with the confidence level, and outputs the traffic-driving state recognition result from the predefined five-category labels. The resource monitoring unit uses the scheduling unit to monitor the traffic diversion status and resource occupancy rate in real time. Under normal conditions, it infers at a 30-second interval, and switches to a 5-second interval when it is abnormal. When the resource occupancy rate exceeds the threshold, it temporarily reduces the frequency by 50%, and restores it after the resources are restored. The classification unit is mapped to four levels based on status labels: no alarm, attention, warning, and emergency. The no alarm level only caches locally, the attention level uploads status messages, the warning level uploads via dual links and alarms intermittently, and the emergency level provides continuous audible and visual alarms and encrypts and uploads pressure waveforms to the medical terminal.
