Low-memory DICOM file fast transmission method and device

By parsing DICOM data frame by frame and dynamically storing it in blocks on low-memory devices, combined with Lagrange optimization and entropy priority scheduling, efficient transmission of ultrasound DICOM data was achieved. This solved the problems of DICOM file integrity and availability on low-memory devices, and improved the reliability and system stability of image data transmission in primary healthcare scenarios.

CN121334142APending Publication Date: 2026-01-13WEIRUAN (JIANGSU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511624490.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing technologies cannot efficiently receive, store, and transmit ultrasound DICOM data on low-memory embedded devices, leading to memory overflows and program crashes. Furthermore, the block-based scheme lacks structured frame indexing and priority design, affecting file integrity and diagnostic usability.

Method used

The system receives DICOM data streams frame by frame based on item tags, and performs lightweight parsing to separate metadata and pixel data within a circular buffer. It calculates frame memory increments and updates available memory in real time. It calculates the rate of change of memory pressure based on differential evolution, calculates the optimal block size using a chaotic prediction formula, and outputs prediction coefficients. It uses Lagrange optimization for breakpoint resumption and combines HTTP Chunked encoding and entropy priority scheduling queues to reassemble files on the server side.

Benefits of technology

It effectively avoids program crashes caused by full memory loading, solves the memory accumulation problem caused by the mismatch between data output rate and network bandwidth, and ensures the reliability of image data transmission and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121334142A_ABST
    Figure CN121334142A_ABST
Patent Text Reader

Abstract

According to the low-memory DICOM file rapid transmission method and device provided by the invention, through a closed-loop mechanism of streaming receiving, dynamic block storage, backpressure transmission optimization and server-side entropy priority recombination, program crash caused by full-amount loading of a memory in the prior art is effectively avoided; the problem of memory accumulation caused by mismatching of the data output rate and the network bandwidth is solved, and the server is ensured to efficiently and disorderly recombine the complete DICOM file through structured state feedback, so that the transmission reliability and the system stability of the image data in a basic medical scene are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of medical informatization, and particularly relates to a low-memory DICOM file fast transmission method and device. BACKGROUND

[0002] With the rapid development of primary medical care and mobile medical care, embedded devices (such as portable ultrasonic data collectors) are widely used to receive DICOM files output by ultrasonic devices and upload to a medical platform after network recovery to support remote diagnosis and image sharing. Early technologies mainly rely on the mode of "complete reception-memory caching-one-time writing" to temporarily store the entire DICOM file (especially dynamic ultrasonic sequences, the volume of which usually reaches tens of MB to hundreds of MB) in the memory and then process it. Although this mode is simple to implement, the memory resources of embedded devices are limited (usually only 16-64 MB), and memory overflow (OOM) is easily caused during the reception process, resulting in program crashes. Subsequent improvements attempt to introduce block transmission or edge-receiving-edge-transmission mechanisms to alleviate memory pressure.

[0003] However, since the ultrasonic data output rate (1-5 MB / s) is much higher than the primary network bandwidth (usually less than 2 Mbps), the transmission delay causes data to continuously accumulate in the memory, further exacerbating resource conflicts. At the same time, the existing block scheme lacks structured frame indexing and priority design, and the frame order is easily disordered when reassembled on the server side, affecting the integrity of the DICOM file and the availability of diagnosis.

[0004] These defects seriously limit the reliable application of low-memory devices in edge medical scenarios. SUMMARY

[0005] The purpose of the present application is to provide a low-memory DICOM file fast transmission method and device to solve the problem that the prior art cannot achieve efficient reception, storage and transmission of ultrasonic DICOM data on low-memory embedded devices.

[0006] To achieve one of the above-mentioned purposes, an embodiment of the present application provides a low-memory DICOM file fast transmission method, which comprises,

[0007] frame-by-frame reception of DICOM data streams according to Item tags, lightweight parsing in a fixed-size ring buffer to separate metadata and pixel data, and real-time calculation of frame memory increment and updating of available memory;

[0008] based on the differential evolution calculation of memory pressure change rate and next-time memory pressure index, calculation of the optimal block size based on a chaotic prediction formula and output of the next-time prediction coefficient, writing of accumulated frame data into a local block file and releasing of memory when the next-time memory pressure index exceeds a preset threshold, and output of the current input-output rate.

[0009] Using Lagrange optimization, according to the optimal block size, memory pressure rate of change and real-time bandwidth, the next time transmission granularity and delay are calculated, breakpoint resume is performed through HTTP Chunked encoding additional state header, and the block stream is pushed to the server;

[0010] After the server receives the block, the queue is scheduled according to the entropy priority, the pixel data and the metadata are spliced to generate a complete file in accordance with the DICOM Part 10 standard format.

[0011] As a further improvement of an embodiment of the application, the method further comprises, the lightweight parsing in the fixed-size ring buffer to separate the metadata and the pixel data, and real-time calculation of the frame memory increment and updating of the available memory,

[0012] The lightweight parsing includes extracting a predefined group of required tags and ignoring private tags;

[0013] Based on the extracted tags, the metadata and the pixel data are separated by tag value mapping to realize independent buffering;

[0014] The calculation formula of the frame memory increment is as follows:

[0015]

[0016] Wherein, is the size of the pixel data, is the header overhead;

[0017] Based on the frame memory increment, the available memory is updated by memory allocation tracking to reflect the resource consumption of the receiving process.

[0018] As a further improvement of an embodiment of the application, the method further comprises, the memory pressure rate of change is calculated based on differential evolution,

[0019] The calculation formula of the memory pressure rate of change is as follows:

[0020]

[0021] Wherein, is the pressure gain, is a super-linear index, is a jitter amplitude, is a phase angle, calculated by a timestamp t and a preset period to introduce periodic oscillation;

[0022] Based on the memory pressure rate of change, the next time memory pressure index is calculated by integral approximation to evaluate the cumulative resource pressure.

[0023] As a further improvement of an embodiment of the application, the method further comprises, based on the differential evolution calculation, outputting a next time memory pressure index comprising,

[0024] The calculation formula of the next time memory pressure index is:

[0025]

[0026] wherein, is a current memory pressure index, is a frame receiving interval, is a prediction bias correction coefficient, is a current prediction coefficient;

[0027] Based on the next time memory pressure index, determining whether to trigger a storage operation to maintain memory balance through threshold comparison.

[0028] As a further improvement of an embodiment of the application, the method further comprises, based on the chaotic prediction formula, calculating an optimal block size comprising,

[0029] The calculation formula of the optimal block size is:

[0030]

[0031] wherein, is a current block size, is a decay index, is a pressure power, is a current time frame number, is a maximum cache frame number, is an input-output weighting coefficient, is a current input-output rate, is a reference input-output rate;

[0032] Based on the optimal block size, the cumulative frame data is divided by a data segmentation algorithm to optimize storage efficiency.

[0033] As a further improvement of an embodiment of the application, the method further comprises, based on the chaotic prediction formula, outputting a next time prediction coefficient comprising,

[0034] The calculation formula of the next time prediction coefficient is:

[0035]

[0036] wherein, is a prediction sensitivity, is an amplification coefficient, is the historical average frame size, updated by exponential smoothing to capture frame size fluctuations;

[0037] Based on the next time prediction coefficient, the next time memory pressure index calculation is adjusted by a feedback loop to form a closed-loop resource management.

[0038] As a further improvement of an embodiment of the present application, the method further comprises, the using Lagrange optimization, according to the optimal block size, the memory pressure change rate and the real-time bandwidth, calculating the next time transmission granularity and delay includes,

[0039] The formula for calculating the next time transmission granularity is:

[0040]

[0041] Wherein, is the bandwidth constraint weight, is the memory constraint weight, is the real-time bandwidth, is the previous time delay;

[0042] Based on the next time transmission granularity, the delay is calculated by a constraint balancing to balance the transmission and memory resources;

[0043] The formula for calculating the delay is:

[0044]

[0045] Wherein, is the back pressure index;

[0046] Based on the delay, a back pressure mechanism is executed by a timing scheduling to prevent transmission interference with the receiving process.

[0047] As a further improvement of an embodiment of the present application, the method further comprises, the receiving blocks at the server according to the entropy priority scheduling queue, streaming splicing pixel data and metadata to generate a complete file in accordance with the DICOM Part 10 standard format includes,

[0048] After receiving the block stream at the server, the checksum is verified and the temporary directory is temporarily stored;

[0049] Based on the transmission granularity in the state header and the memory pressure change rate Calculate the block entropy priority ;

[0050] The formula for calculating the entropy priority is:

[0051]

[0052] wherein, is the frame size information entropy, is the smoothing constant, is the pressure threshold, is the super-linear exponent;

[0053] according to the entropy priority scheduling the reorganization queue in descending order;

[0054] The pixel data and the metadata are spliced by the stream file positioning and writing operation to generate a complete file conforming to the DICOM Part 10 standard format, and the full memory loading of the server is avoided.

[0055] To achieve one of the above-mentioned purposes, an embodiment of the present application further provides a low-memory DICOM file fast transmission device, which comprises a lightweight analysis module, an adaptive block storage decision module, a transmission optimization module and a stream reorganization module.

[0056] The lightweight analysis module is used for receiving the DICOM data stream frame by frame according to the Item label, performing lightweight analysis in the fixed-size ring buffer to separate the metadata and the pixel data, and calculating the frame memory increment and updating the available memory in real time.

[0057] The adaptive block storage decision module is used for calculating the memory pressure change rate and the next time memory pressure exponent based on the differential evolution, calculating the optimal block size based on the chaotic prediction formula and outputting the next time prediction coefficient, and writing the accumulated frame data into the local block file and releasing the memory when the next time memory pressure exponent exceeds the preset threshold, while outputting the current input and output rate.

[0058] The transmission optimization module is used for calculating the next time transmission granularity and delay according to the optimal block size, the memory pressure change rate and the real-time bandwidth by using the Lagrange optimization, performing the breakpoint continuation by HTTP Chunked encoding and adding the state header, and pushing the block stream to the server.

[0059] The stream reorganization module is used for scheduling the queue according to the entropy priority after receiving the block in the server, and splicing the pixel data and the metadata to generate a complete file conforming to the DICOM Part 10 standard format.

[0060] Compared with existing technologies, this invention provides a low-memory DICOM file fast transmission method and apparatus. Through a closed-loop mechanism of streaming reception, dynamic block storage, backpressure transmission optimization, and server-side entropy priority reorganization, it effectively avoids program crashes caused by full memory loading in existing technologies, solves the memory accumulation problem caused by the mismatch between data output rate and network bandwidth, and ensures that the server efficiently and disorderly reorganizes complete DICOM files through structured status feedback, thereby improving the transmission reliability and system stability of image data in primary healthcare scenarios. Attached Figure Description

[0061] Figure 1 This is an overall flowchart of the low-memory DICOM file fast transfer method described in this invention.

[0062] Figure 2 This is a schematic diagram of the architecture of the low-memory DICOM file fast transfer device described in this invention. Detailed Implementation

[0063] The present invention will now be described in detail with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the scope of protection of the present invention.

[0064] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0065] In Embodiment 1 of the present invention, the present invention provides a method for fast transfer of DICOM files with low memory usage, such as... Figure 1 As shown, the method includes,

[0066] S1: Receive DICOM data stream frame by frame according to Item label, perform lightweight parsing within a fixed-size circular buffer to separate metadata and pixel data, and calculate frame memory increments and update available memory in real time;

[0067] S2: Calculate the memory pressure change rate and the memory pressure index at the next moment based on differential evolution, calculate the optimal block size based on the chaotic prediction formula and output the prediction coefficient at the next moment, and when the memory pressure index at the next moment exceeds the preset threshold, write the accumulated frame data to the local block file and release the memory, while outputting the current input and output rate.

[0068] S3: Utilizes Lagrange optimization to calculate the next moment's transmission granularity and latency based on the optimal chunk size, memory pressure change rate, and real-time bandwidth. It then performs breakpoint resumption by attaching status headers using HTTP Chunked encoding and pushes the chunked stream to the server.

[0069] S4: After receiving the chunks, the server schedules the queue according to entropy priority, and streams the pixel data and metadata to generate a complete file conforming to the DICOM Part 10 standard format.

[0070] In one specific embodiment of the present invention, lightweight parsing is performed within a fixed-size circular buffer to separate metadata and pixel data, and frame memory increments are calculated in real time and available memory is updated. Specifically,

[0071] The lightweight parsing includes extracting the required tags from predefined groups and ignoring private tags;

[0072] Based on the extracted tags, the metadata and pixel data are separated by tag value mapping to achieve independent buffering;

[0073] The frame memory increment The calculation formula is:

[0074]

[0075] in, For pixel data size, For head expenses;

[0076] Based on the frame memory increment, the available memory is updated via memory allocation tracking. This reflects the resource consumption during the receiving process.

[0077] It should be noted that the purpose of separating metadata and pixel data through lightweight parsing is to decompose the large-volume DICOM data stream into two controllable parts, metadata and pixel data, without interrupting the continuous output of the ultrasound device. It also precisely quantifies the instantaneous consumption of memory resources for each frame, providing a real-time and accumulative resource pressure signal for the subsequent adaptive block storage decision module, thereby preventing disorderly memory expansion.

[0078] Furthermore, lightweight parsing extracts the necessary tags from predefined groups (Group 0002, 0008, 0010, 0020) and ignores vendor-specific tags. Its purpose is to significantly reduce parsing overhead (fixed memory usage ≤2MB), avoid resource waste caused by processing irrelevant tags, and ensure metadata integrity to support rapid server-side reassembly.

[0079] Furthermore, based on the extracted tags, metadata and pixel data are separated through tag value mapping. This physically isolates control information (small size, high priority) from image load (large size, latency tolerance), laying a structural foundation for prioritizing the transmission of metadata and storing pixel data first. The separation result is directly output to the end of the circular buffer, forming a logical hierarchy of "metadata area → pixel data area," which facilitates the dynamic storage module to extract data as needed.

[0080] In a specific implementation of this invention, during the process of separating metadata and pixel data through tag value mapping, the system maintains a tag offset table to record the starting byte position and length of each necessary tag. This table is used to quickly locate the (7FE0, 0010) tag boundary of PixelData, avoiding byte-by-byte scanning. After parsing the first frame, this table is cached at the beginning of a circular buffer, supporting reuse in subsequent frames and improving parsing throughput. After separation, the metadata is serialized into a JSON-like structure (keys are tag values, values ​​are extracted content), while the pixel data remains in its original binary form, ensuring that metadata transmission is independent of image payload. This structure is output to the end of the buffer, forming an indexable "metadata offset + pixel offset" pair, facilitating on-demand reading and truncation by the dynamic storage module.

[0081] Furthermore, the calculation of frame memory increments involves assigning a precise memory "cost label" to each frame of data, enabling the system to accumulate resource consumption frame by frame, rather than relying on coarse-grained estimation.

[0082] Furthermore, tracking and updating available memory through memory allocation aims to build a globally consistent view of memory state, which kernel hook functions can read in real time and feed back to the prediction coefficients. The closed-loop adjustment. This updated value... It's not just the threshold for triggering storage, but also the memory constraint weight in the Lagrange backpressure transmission optimization module. Dynamic input ensures that transmission decisions are always aware of the current parsing load, preventing transmission from preempting receiving resources.

[0083] In one specific embodiment of the present invention, the rate of change of memory pressure is calculated based on differential evolution, specifically as follows:

[0084] The memory pressure change rate The calculation formula is:

[0085]

[0086] in, For pressure gain, It is a superlinear exponent. The amplitude of the shaking. The phase angle is calculated using the timestamp t and a preset period to introduce periodic oscillations.

[0087] Based on the aforementioned memory pressure change rate, the memory pressure index for the next moment is approximately calculated using integration. To assess accumulated resource pressure.

[0088] It should be noted that the memory pressure change rate calculated based on differential evolution aims to transform the instantaneous frame increment and available memory output by the preceding lightweight parsing module into a continuous and differentiable dynamic pressure signal. This captures the nonlinear impact of sudden frame size fluctuations (such as pixel peaks caused by the heartbeat cycle) on memory in the ultrasound data stream and provides a forward-looking warning for subsequent batch-level decisions, avoiding the lag and oscillation of traditional fixed threshold methods.

[0089] Furthermore, the calculation of memory pressure change rate aims to establish a bridge from "single frame resource consumption" to "system pressure evolution rate". By introducing a periodic oscillation term to simulate the frame rate pulse of an ultrasonic device, frequent write / release switching is prevented due to minor disturbances near the threshold.

[0090] Furthermore, by approximating the memory pressure index at the next moment through integration, the aim is to accumulate the instantaneous rate of change into a batch-level comparable pressure scalar, thereby assessing the resource risk after multiple frames are superimposed. This index As the core trigger signal, it is output to the threshold judgment logic within the same module. or This determines whether to immediately activate block writing; at the same time, the index is uploaded to the server-side entropy priority scheduling module through the status header X-MPI, realizing cross-end mapping of terminal pressure to cloud reorganization priority.

[0091] In a specific embodiment of the present invention, when approximating the memory pressure index at the next time step through integration, the integration employs the Euler forward difference method, and each... If a frame is detected during each iteration (due to discontinuous item sequence numbers), a zero increment is inserted. To maintain continuity. Before output, a smoothing filter (first-order low-pass, cutoff frequency 0.1Hz) is applied to suppress noise peaks and ensure the stability of threshold judgment. This index is embedded in the binary payload (4-byte floating-point) of the X-MPI status header and bound to the frame index, facilitating server-side backtracking of terminal load history and supporting multi-terminal load balancing.

[0092] In one specific embodiment of the present invention, the memory pressure index at the next time step is calculated based on differential evolution, specifically as follows:

[0093] The formula for calculating the memory pressure index at the next moment is:

[0094]

[0095] in, This represents the current memory pressure index. The frame reception interval, For prediction bias correction factor, These are the current prediction coefficients;

[0096] Based on the memory pressure index at the next moment, a threshold comparison is used to determine whether to trigger a storage operation to maintain memory balance.

[0097] It should be noted that the memory pressure index for the next time step is calculated based on differential evolution. The aim is to integrate the rate of change of the preceding memory pressure and fuse it with the prediction bias correction to form a comprehensive pressure scalar that can be directly used for threshold decision. This achieves a smooth transition from "instantaneous rate perception" to "cumulative risk assessment" and provides closed-loop feedback input for subsequent chaotic block size calculation. This ensures that storage operations are only activated when real resources are scarce, avoiding invalid I / O overhead.

[0098] Furthermore, the memory pressure index at the next moment The calculation is used to inherit the current pressure state. Based on this, the integral term of the rate of change and the prediction deviation term are superimposed, where the prediction deviation term is obtained through the current prediction coefficient. Introducing predictions for future frame size fluctuations.

[0099] Furthermore, the memory pressure index at the next moment is compared with a threshold to determine whether to trigger a storage operation, depending on when... Exceeding the preset threshold (0.75) or the current batch frame count Immediately activate the subsequent chaotic prediction formula to calculate the optimal block size. And perform the write operation. This trigger signal is simultaneously output to the Lagrange backpressure transmission optimization module (via the X-MPI status header), making the transmission decision aware of the storage load; furthermore, the memory release operation following the trigger will update... The available memory is fed back to the lightweight parsing module, forming a global resource balancing loop of storage → parsing → re-storage.

[0100] In one specific embodiment of the present invention, when a storage operation is triggered by a threshold comparison, if When the value approaches the threshold boundary (0.75±0.05), the system performs a secondary confirmation: comparing the cumulative values ​​of the most recent 3 frames. If the deviation from the historical average exceeds 20%, an event will be triggered earlier to buffer potential peak values. Upon triggering, an event log will be generated, recording the trigger time. Value and This is available for the debugging module to read. Simultaneously, memory release operations are performed in batches, releasing pixel data areas first and then metadata areas to prevent buffer fragmentation. This update... Global synchronization is ensured by broadcasting to all modules through a shared memory segment.

[0101] In one specific embodiment of the present invention, the optimal block size is calculated based on a chaotic prediction formula, specifically as follows:

[0102] The formula for calculating the optimal block size is:

[0103]

[0104] in, This is the current block size. The decay exponent, For pressure power, The current frame number. The maximum number of buffered frames. These are the input and output weighting coefficients. The current input / output rate, For reference input / output rates;

[0105] Based on the optimal block size, the accumulated frame data is segmented using a data segmentation algorithm to optimize storage efficiency.

[0106] It should be noted that the optimal block size calculation based on the chaotic prediction formula aims to transform the storage demand triggered by the exponential memory pressure of the previous and next time steps into an adaptive block size. By coupling the real-time pressure change rate, the current batch frame count, and the I / O rate, the block granularity can be non-linearly shrunk or expanded according to the system load and hardware bottleneck. This reduces the write unit to avoid further resource contention when memory is tight, and appropriately increases the storage throughput when I / O is efficient, thus achieving the optimal balance of global resource utilization.

[0107] Furthermore, the calculation of the optimal block size lies in starting from the current block baseline. Starting with a chaotic exponential decay mechanism, a high pressure change rate is introduced. or high frame rate In this scenario, the blocks are automatically reduced "exponentially" to prevent large block writes from causing I / O blocking; at the same time, the storage hardware status is sensed through the I / O rate weighting term, and the blocks are appropriately enlarged when random write performance is good.

[0108] Furthermore, segmenting the accumulated frame data using a data segmentation algorithm involves combining the accumulated pixel data and metadata in the circular buffer according to... Precise boundary segmentation generates structured block files (such as frame_[start]-[end].dat) along with a frame index table, ensuring lossless and recoverable subsequent transmission and server reassembly. The segmentation result is immediately written to local disk and the corresponding memory is released, and updates are performed. Feedback is sent to the lightweight parsing module, forming a fast loop of storage release → memory recovery → continued reception; simultaneously, the block file list and... This information is passed as input to the Lagrange backpressure transmission optimization module to guide the transmission granularity. The calculation enables coordinated matching between storage granularity and transmission granularity.

[0109] In one specific embodiment of the present invention, binary search positioning is used when the data segmentation algorithm segments the accumulated frame data. The system ensures frame boundary alignment (no cross-frame splitting). If the remaining data is less than the minimum block threshold (1MB), it is merged into the previous file. This split generates a frame index table, stored in a B-tree structure as {frame ID: file offset + length}, supporting O(log n) lookups. During writing, asynchronous I / O is used to submit tasks, and the main thread is notified to release memory upon completion via a completion queue. This file list is serialized into a protocol buffer format and appended to the transmission status header for fast server-side parsing and verification.

[0110] In one specific embodiment of the present invention, the prediction coefficients for the next time step are output based on the chaotic prediction formula, specifically as follows:

[0111] The formula for calculating the next time-time prediction coefficient is as follows:

[0112]

[0113] in, To predict sensitivity, This is the magnification factor. The historical average frame size is updated exponentially to capture frame size fluctuations.

[0114] Based on the predicted coefficient for the next time step, the memory pressure index for the next time step is adjusted through a feedback loop to form a closed-loop resource management system.

[0115] It should be noted that the prediction coefficients for the next moment based on the chaotic prediction formula aim to capture the deviation of the current frame pixel data from the historical average, and generate prediction coefficients through the chaotic amplification mechanism. This injects "expected increments" into the memory pressure evolution of subsequent frames, so that the system can tighten the block or transmission strategy in advance when the size of ultrasound sequence frames fluctuates drastically (such as the heartbeat cycle), avoid instantaneous memory overflow caused by sudden large frames, and realize the leap from "passive response" to "active adaptation" in resource management.

[0116] Furthermore, the prediction coefficient for the next time step. The calculation involves transforming the single-frame bias into an accumulative prediction multiplier, where the exponential amplification term utilizes the rate of change of pressure. Enhance early warning sensitivity under high load scenarios.

[0117] Furthermore, adjusting the calculation of the memory pressure index for the next moment through a feedback loop is to... The deviation correction term in the integral formula for reinjecting memory pressure is used for closed-loop correction. The evolution trajectory allows stress assessment to not only reflect the current load but also predict future frame distribution trends. This feedback path, along with the lightweight parsing module... Output forms a long-term memory ring ( (Continuously updated), forming an instantaneous correction loop with the memory pressure change rate calculation ( Directly participate in the next ( (Integration), and indirectly affect the server-side entropy priority through the X-MPI status header, to ensure cross-end collaboration between terminal prediction and cloud scheduling.

[0118] In one specific embodiment of the present invention, when adjusting the memory pressure index calculation for the next time step in the feedback loop... The stress evolution thread is activated by a condition variable signal, and the MPI trajectory is recalculated every 5 frames. If the accumulated deviation exceeds the threshold (0.1), triggering... Reset to the current sliding window mean. This adjustment is embedded in the prediction history stack, with a depth of 10, and supports a rollback mechanism: in the event of a sudden drop in pressure, the most recent value is retrieved. To restore a conservative strategy, the stack data is uploaded via X-MPI extended fields, supporting server-side simulation of terminal load and optimizing global scheduling.

[0119] In one specific embodiment of the present invention, Lagrange optimization is used to calculate the transmission granularity and latency at the next moment based on the optimal block size, the rate of change of memory pressure, and the real-time bandwidth. Specifically,

[0120] The formula for calculating the transmission granularity at the next moment is:

[0121]

[0122] in, For bandwidth constraint weights, For memory constraint weights, For real-time bandwidth, Delayed from the previous moment;

[0123] Based on the transmission granularity of the next time step, the delay is calculated through constraint equalization. To balance transmission and memory resources;

[0124] The formula for calculating the delay is:

[0125]

[0126] in, Back pressure index;

[0127] Based on the aforementioned delay, a backpressure mechanism is executed through timed scheduling to prevent transmission interference with the reception process.

[0128] It should be noted that the calculation of the next moment's transmission granularity and delay aims to couple the block size output by the preceding adaptive block storage decision module with the real-time pressure change rate of the terminal and the network bandwidth to generate adaptive transmission units and active delays. This achieves optimal backpressure scheduling under the "memory-bandwidth-delay" ternary constraint, preventing transmission from preempting parsing memory in low-bandwidth scenarios of the underlying network, which could lead to reception interruption or OOM. At the same time, it ensures that the block files are pushed in a timely manner to release local storage.

[0129] Furthermore, the granularity of transmission in the next moment The calculation is used to balance the available bandwidth capacity and memory pressure penalty within the Lagrange framework, enabling high... hour Automatically shrinks and prioritizes the transmission of small packets to reduce instantaneous memory usage; moderately enlarges the packet size under low load to improve throughput.

[0130] Furthermore, the transmission granularity at the next moment is used to calculate the delay through constraint equalization. It lies in quantifying the remaining data The transmission delay under the current bandwidth is amplified by applying backpressure. Under high pressure, the delay is actively extended, forcing the transmission module to "give way" to reception and parsing. This delay serves as a timer input, driving the construction and transmission rhythm of HTTP Chunked encoded chunks.

[0131] Furthermore, based on the aforementioned delay, a backpressure mechanism is executed through timed scheduling, the purpose of which is to... The transmission thread is paused temporarily to prioritize the CPU / memory resources of the streaming reception and lightweight parsing modules, and transmission resumes after the delay ends, supporting breakpoint resumption. This mechanism will... After being encapsulated with status headers (X-Frame-Range, X-MPI, X-dMPI), it is pushed to the server-side entropy priority streaming reassembly module to achieve cross-terminal collaboration between terminal backpressure and cloud-based priority scheduling; simultaneously, after successful transmission, the local block is deleted and updated. Feedback is fed into the chaotic prediction formula, forming a closed loop of transmission release → I / O rate → next round of block division.

[0132] In a specific implementation scenario of this invention, when executing the backpressure mechanism based on delay via timed scheduling, the epoll event loop monitors the transmission timer. If Register a read event and wait for a timeout. After the timeout, check the current parsing thread load (sampled via / proc / stat). If it's >80%, extend the delay by 20%. This mechanism supports tiered backpressure: mild backpressure (<200ms) only pauses chunk sending, while severe backpressure (>500ms) freezes the entire transmission queue. After successful transmission, parse the X-Received-Range response header, update the local offset pointer, and support range requests. The status header uses a custom binary protocol (CBOR encoding) and contains... (4 bytes) (4-byte floating point) ensures low-overhead cross-end transmission.

[0133] In one specific embodiment of the present invention, after the server receives the segments, it schedules the queue according to entropy priority, and streams and stitches the pixel data and metadata to generate a complete file conforming to the DICOM Part 10 standard format. Specifically,

[0134] After receiving the segmented stream, the server verifies the checksum and temporarily stores it in a temporary directory.

[0135] Based on the transmission granularity in the status header With memory pressure change rate Calculate block entropy priority ;

[0136] The formula for calculating the entropy priority is:

[0137]

[0138] in, The entropy of the frame size within the block, It is a smoothing constant. The pressure threshold, It is a superlinear exponent;

[0139] According to the entropy priority Descending order scheduling to reorganize queues;

[0140] By using streaming file positioning and writing operations to concatenate the pixel data and metadata, a complete file conforming to the DICOM Part 10 standard format is generated, avoiding the need for the server to load the entire memory.

[0141] It should be noted that after the server receives the chunks, it schedules the queue according to entropy priority, and streams the pixel data and metadata to generate a complete file conforming to the DICOM Part 10 standard format. The aim is to convert the chunked stream pushed by the terminal into a standard DICOM file, while intelligently sorting and reorganizing tasks according to the real-time pressure status of the terminal. It prioritizes the processing of terminal chunks with high memory pressure to accelerate their local storage release, forming a cross-device positive feedback loop of "terminal back pressure → cloud preemption → terminal load reduction". This avoids server memory expansion in multi-terminal concurrent scenarios and ensures the overall system throughput and fairness.

[0142] Furthermore, after the server receives the segmented stream, it verifies the checksum and temporarily stores it in a temporary directory. This establishes a foundation for segmented integrity and persistence, providing a reliable data source for subsequent entropy priority calculation. This step directly receives the HTTP Chunked stream (including status headers X-MPI, X-dMPI, X-Frame-Range, and X-MD5) pushed by the preceding Lagrange backpressure transmission optimization module, achieving seamless integration of transmission → reception → verification.

[0143] Furthermore, calculate the block entropy priority. The key lies in integrating terminal-side transmission decisions and pressure signals to generate a unified cross-terminal scheduling weight, enabling high-performance scheduling. Or uniform frame distribution (low) The blocks that are divided into 0 have higher priority.

[0144] Furthermore, according to entropy priority The purpose of descending-order scheduling and reassembly queues is to break the traditional FIFO order, dynamically reorder tasks from multiple terminals, and ensure that the blocks from high-pressure terminals enter the reassembly pipeline first, indirectly accelerating local file deletion and reassembly. The improvement is fed back to the terminal chaos prediction formula.

[0145] In one specific embodiment of the present invention, based on entropy priority... When reorganizing the queue in descending order, a priority heap is maintained. As the key, it supports O(log n) insertion / pop; if there is a conflict between multiple terminals ( To ensure fairness, a terminal ID hash is introduced as a secondary key. This queue is polled once per second, and the highest-priority task is popped into the pipeline. During streaming concatenation, metadata is preloaded into a memory-mapped file, and PixelData is randomly accessed from the chunked file frame by frame and appended to the output stream. If a frame index is missing, an alarm is triggered and the request is retried from the terminal. After this is completed, a DICOM checksum is generated, and an acknowledgment packet is pushed via WebSocket, containing the reassembly time and file path, supporting end-to-end auditing from the terminal.

[0146] Furthermore, the pixel data and metadata are concatenated through streaming file positioning and writing operations. This is used to append PixelData frame by frame at the disk level (fseek + fwrite), combining it with temporarily stored metadata to generate a Part 10 standard file, without needing to load the complete image sequence. After this operation is completed, temporary blocks are deleted, and the terminal can be notified via WebSocket, achieving an end-to-end closed loop of reassembly completion → terminal cleanup → memory / storage dual release.

[0147] In a second embodiment of the present invention, the present invention provides a low-memory DICOM file fast transfer device, such as... Figure 2 As shown, the device includes a lightweight parsing module 1, an adaptive block storage decision module 2, a transmission optimization module 3, and a streaming reassembly module 4;

[0148] The lightweight parsing module 1 is used to receive DICOM data stream frame by frame according to Item tag, perform lightweight parsing within a fixed-size circular buffer to separate metadata and pixel data, and calculate frame memory increments and update available memory in real time.

[0149] The adaptive block storage decision module 2 is used to calculate the memory pressure change rate and the memory pressure index at the next moment based on differential evolution, calculate the optimal block size based on the chaotic prediction formula and output the prediction coefficient at the next moment. When the memory pressure index at the next moment exceeds the preset threshold, the accumulated frame data is written to the local block file and the memory is released. At the same time, the current input and output rate is output.

[0150] The transmission optimization module 3 is used to use Lagrange optimization to calculate the transmission granularity and latency at the next moment based on the optimal block size, memory pressure change rate and real-time bandwidth, and to perform breakpoint resumption by attaching status headers through HTTP Chunked encoding, pushing the block stream to the server.

[0151] The streaming reconstruction module 4 is used to schedule the queue according to entropy priority after the server receives the blocks, and to stream and stitch pixel data and metadata to generate a complete file that conforms to the DICOM Part 10 standard format.

[0152] In summary, the low-memory DICOM file fast transmission method and apparatus provided by this invention effectively avoids program crashes caused by full memory loading in existing technologies through a closed-loop mechanism of streaming reception, dynamic block storage, backpressure transmission optimization, and server-side entropy priority reorganization. It also solves the memory accumulation problem caused by the mismatch between data output rate and network bandwidth, and ensures that the server efficiently and disorderly reorganizes complete DICOM files through structured status feedback, thereby improving the transmission reliability and system stability of image data in primary healthcare scenarios.

[0153] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the modules described above can be referred to the corresponding process in the aforementioned method implementation, and will not be repeated here.

[0154] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0155] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or in a combination of hardware and software functional modules.

[0156] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer system (which may be a personal computer, server, or network system, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for fast transfer of DICOM files with low memory usage, characterized in that: include, The DICOM data stream is received frame by frame according to the item label, and is lightly parsed within a fixed-size circular buffer to separate metadata and pixel data. The frame memory increment is calculated in real time and the available memory is updated. The memory pressure change rate and the memory pressure index at the next moment are calculated based on differential evolution. The optimal block size is calculated based on the chaotic prediction formula and the prediction coefficient at the next moment is output. When the memory pressure index at the next moment exceeds the preset threshold, the accumulated frame data is written to the local block file and the memory is released. At the same time, the current input and output rate is output. Using Lagrange optimization, the transmission granularity and latency at the next moment are calculated based on the optimal block size, the rate of change of memory pressure and real-time bandwidth. Breakpoint resumption is performed by attaching status headers through HTTP Chunked encoding, and the block stream is pushed to the server. After receiving the chunks, the server schedules the queue according to entropy priority, and streams the pixel data and metadata to generate a complete file conforming to the DICOM Part 10 standard format.

2. The low-memory DICOM file fast transfer method according to claim 1, characterized in that: The process of lightweight parsing within a fixed-size circular buffer to separate metadata from pixel data, and calculating frame memory increments and updating available memory in real time, includes: The lightweight parsing includes extracting the required tags from predefined groups and ignoring private tags; Based on the extracted tags, the metadata and pixel data are separated by tag value mapping to achieve independent buffering; The frame memory increment The calculation formula is: ; in, For pixel data size, For head expenses; Based on the frame memory increment, the available memory is updated via memory allocation tracking. This reflects the resource consumption during the receiving process.

3. The low-memory DICOM file fast transfer method according to claim 2, characterized in that: The rate of change of memory pressure is calculated based on differential evolution, including: The memory pressure change rate The calculation formula is: ; in, For pressure gain, It is a superlinear exponent. The amplitude of the shaking. The phase angle is calculated using the timestamp t and a preset period to introduce periodic oscillations. Based on the aforementioned memory pressure change rate, the memory pressure index for the next moment is approximately calculated using integration. To assess accumulated resource pressure.

4. The low-memory DICOM file fast transfer method according to claim 3, characterized in that: The memory pressure index for the next time step is calculated based on differential evolution, including: The formula for calculating the memory pressure index at the next moment is: ; in, This represents the current memory pressure index. The frame reception interval, For prediction bias correction factor, These are the current prediction coefficients; Based on the memory pressure index at the next moment, a threshold comparison is used to determine whether to trigger a storage operation to maintain memory balance.

5. The low-memory DICOM file fast transfer method according to claim 4, characterized in that: Calculating the optimal block size based on the chaotic prediction formula includes, The formula for calculating the optimal block size is: ; in, This is the current block size. The decay exponent, For pressure power, The current frame number. The maximum number of buffered frames. These are the input and output weighting coefficients. The current input / output rate, For reference input / output rates; Based on the optimal block size, the accumulated frame data is segmented using a data segmentation algorithm to optimize storage efficiency.

6. The low-memory DICOM file fast transfer method according to claim 5, characterized in that: The predicted coefficients for the next time step, based on the chaotic prediction formula, include: The formula for calculating the next time-time prediction coefficient is as follows: ; in, To predict sensitivity, This is the magnification factor. The historical average frame size is updated exponentially to capture frame size fluctuations. Based on the predicted coefficient for the next time step, the memory pressure index for the next time step is adjusted through a feedback loop to form a closed-loop resource management system.

7. The low-memory DICOM file fast transfer method according to claim 6, characterized in that: The process of using Lagrange optimization to calculate the transmission granularity and latency at the next moment based on the optimal block size, memory pressure change rate, and real-time bandwidth includes... The formula for calculating the transmission granularity at the next moment is: ; in, For bandwidth constraint weights, For memory constraint weights, For real-time bandwidth, Delayed from the previous moment; Based on the transmission granularity of the next time step, the delay is calculated through constraint equalization. To balance transmission and memory resources; The formula for calculating the delay is: ; in, Back pressure index; Based on the aforementioned delay, a backpressure mechanism is executed through timed scheduling to prevent transmission interference with the reception process.

8. The low-memory DICOM file fast transfer method according to claim 7, characterized in that: The process of receiving the data chunks on the server, scheduling queues based on entropy priority, and streaming pixel data and metadata to generate a complete file conforming to the DICOM Part 10 standard format includes: After receiving the segmented stream, the server verifies the checksum and temporarily stores it in a temporary directory. Based on the transmission granularity in the status header With memory pressure change rate Calculate block entropy priority ; The formula for calculating the entropy priority is: ; in, The entropy of the frame size within the block, It is a smoothing constant. The pressure threshold, It is a superlinear exponent; According to the entropy priority Descending order scheduling to reorganize queues; By concatenating the pixel data and metadata through streaming file positioning and writing operations, a complete file conforming to the DICOM Part 10 standard format is generated, avoiding the need for the server to load the entire memory.

9. A low-memory DICOM file fast transfer device, characterized in that: It includes a lightweight parsing module, an adaptive block storage decision module, a transmission optimization module, and a streaming reassembly module; The lightweight parsing module is used to receive DICOM data stream frame by frame according to Item tag, perform lightweight parsing within a fixed-size circular buffer to separate metadata and pixel data, and calculate frame memory increments and update available memory in real time. The adaptive block storage decision module is used to calculate the memory pressure change rate and the memory pressure index at the next moment based on differential evolution, calculate the optimal block size based on the chaotic prediction formula and output the prediction coefficient at the next moment. When the memory pressure index at the next moment exceeds the preset threshold, the accumulated frame data is written to the local block file and the memory is released. At the same time, the current input and output rate is output. The transmission optimization module is used to use Lagrange optimization to calculate the transmission granularity and latency at the next moment based on the optimal block size, memory pressure change rate and real-time bandwidth, and to perform breakpoint resumption by attaching status headers through HTTP Chunked encoding, pushing the block stream to the server. The streaming reconstruction module is used to schedule queues according to entropy priority after the server receives the blocks, and to stream and stitch pixel data and metadata to generate a complete file conforming to the DICOM Part 10 standard format.