WebSocket-based pathological section streaming transmission and real-time preview method and device and readable storage medium thereof

By adopting the pathological slice streaming and real-time preview method based on WebSocket in medical image transmission technology, combining customized data frames, dynamic priority scheduling, pyramid blocking and blockchain evidence storage technologies, the problems of low transmission efficiency, high latency and poor fault tolerance are solved, and efficient and real-time pathological slice transmission and preview are achieved.

CN120072355AInactive Publication Date: 2025-05-30SHENZHEN SHENGQIANG TECH

Patent Information

Application Number
CN202510533785.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-05-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing medical image transmission technology has problems such as low transmission efficiency, high real-time interaction delay, poor fault tolerance and insufficient concurrency performance during the transmission of large medical images such as full-sliced ​​digital pathological images (WSI).

Method used

Using the WebSocket-based pathological slice streaming and real-time preview method, low-latency streaming and real-time preview of pathological slices are achieved by customizing WebSocket mixed data frames, dynamic priority scheduling algorithms, pyramid blocking and LSTM prediction loading, blockchain evidence storage and fault tolerance, and QUIC+WebSocket hybrid transmission modes.

Benefits of technology

It improves transmission efficiency, reduces real-time interaction delay, enhances fault tolerance and concurrency performance, and realizes low-latency streaming and real-time preview of pathological slices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120072355A_ABST
    Figure CN120072355A_ABST
Patent Text Reader

Abstract

The invention provides a WebSocket-based pathological section streaming transmission and real-time preview method and device and a readable storage medium thereof. The method comprises a customized mixed data frame structure, an integrated block index, a priority mark and a hash check value; high-resolution block priority transmission is ensured based on dynamic priority scheduling of user viewport coordinates and focus areas; combining pyramid layering and blocking with LSTM prediction to load a model; the block transmission state is stored by using the block chain, and only missing blocks are retransmitted during reconnection; a QUIC + WebSocket mixed transmission mode is adopted, QUIC processes low-priority blocks and supports over 1000 paths of concurrence, and WebSocket guarantees that real-time instruction interaction delay is smaller than 50 ms. The technical bottleneck of large file transmission and real-time interaction is broken through, an efficient and reliable solution is provided for scenes such as remote pathological diagnosis and multi-doctor cooperation, and the medical image transmission efficiency and the user experience are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image transmission, and particularly to a method, device and readable storage medium for streaming transmission and real-time preview of pathological sections based on WebSocket, which is applicable to real-time collaboration and remote diagnosis scenarios of large medical images such as whole-slide digital pathology (WSI). Background Art

[0002] In the field of medical imaging technology, due to the huge amount of data of whole-slide digital pathology images (WSI) (a single file can reach hundreds of GB), traditional transmission methods require waiting for the file to be completely uploaded before previewing, resulting in significant delays for doctors in remote diagnosis and real-time collaboration. Existing technologies usually adopt standard WebSocket sharding or HTTP chunked transmission, but there are the following problems: 1. Low protocol efficiency: The metadata and image data are transmitted separately, resulting in multiple handshakes and additional verification overhead; 2. Insufficient real-time interaction: The fixed chunking strategy cannot dynamically adjust the priority according to the user's viewport, and the rendering delay of key areas is high; 3. Weak fault tolerance: It relies on cache mechanisms such as Redis to store the transmission status, and is prone to data loss or low retransmission efficiency due to single-point failures; 4. Limited concurrency performance: A single protocol is difficult to balance high-concurrency transmission and real-time instruction response, especially with poor stability in multi-user collaboration scenarios.

[0003] With the growth of the demand for telemedicine, there is an urgent need for a transmission solution that can achieve real-time preview, efficient interaction and reliable fault tolerance when the pathological section is not completely uploaded. Summary of the Invention

[0004] Embodiments of the present invention provide a method, device and readable storage medium for streaming transmission and real-time preview of pathological sections based on WebSocket, aiming at the problems of the existing technology that the traditional solution relies on a single protocol (such as HTTP / WebSocket), has low transmission efficiency, high real-time interaction delay, poor fault tolerance, and does not perform intelligent chunking and priority scheduling in combination with the business characteristics of pathological images.

[0005] The core technology of the present invention mainly realizes low-latency streaming transmission and real-time preview of pathological sections through customized WebSocket hybrid data frames, dynamic priority scheduling algorithms, pyramid chunking and LSTM prediction loading, blockchain evidence storage and fault tolerance, and QUIC+WebSocket hybrid transmission mode.

[0006] In the first aspect, the present invention provides a method for streaming transmission and real-time preview of pathological sections based on WebSocket, and the method includes the following steps: S1. The client establishes a WebSocket connection with the server. The client divides the pathological section file into chunks according to a preset rule and generates metadata, which at least includes chunk index, resolution level, and priority flag. S2. The client sends a chunk request to the server through the WebSocket connection. The server performs dynamic priority scheduling on the chunks according to the metadata, and inserts the high-priority chunks into the head of the transmission queue for priority transmission. S3. The server transmits the chunk data to the client through a custom hybrid data frame. The hybrid data frame includes a header for carrying metadata and a body for carrying image chunk data. The header also includes a hash check value for verifying data integrity. S4. After receiving the hybrid data frame, the client performs hierarchical progressive rendering according to the resolution level and chunk index, and preferentially renders the high-priority chunks within the viewport to achieve real-time preview of the pathological section.

[0007] Further, the preset rule is the pyramid chunking rule, including: The pathological section at the low resolution level is transmitted as a single chunk for quickly previewing the panoramic view. The pathological section at the high resolution level is divided into multiple chunks according to a preset pixel size, supporting local high-resolution rendering.

[0008] Further, the dynamic priority scheduling includes: The client listens to user operations in real time, obtains interaction data, including viewport coordinates and zoom level, and sends them to the server through WebSocket. The server determines the chunks covered by the user viewport according to the interaction data and marks them as high-priority chunks. The server maintains a chunk transmission queue and inserts the high-priority chunks into the head of the queue for priority transmission.

[0009] Further, it also includes a step of preferentially processing the lesion area: The server docks with the pathological information system, automatically identifies the chunks corresponding to the lesion area in the pathological section, and marks the priority of the lesion area chunks as the highest level, and transmits them prior to other chunks in the transmission queue.

[0010] Further, it also includes a prediction loading step based on LSTM: Collect the historical operation data of doctors, including viewport movement trajectory, zoom frequency, and click rate of the marked area. Train a prediction model through the LSTM network. Input the current viewport coordinates, zoom level, and operation sequence, and output a list of predicted chunk indexes that may be accessed within a preset future time. The server adds the predicted chunks to the transmission queue in advance for preloading according to the list of predicted chunk indexes.

[0011] Furthermore, the hierarchical progressive rendering includes: The client first receives the full-image chunks of the low-resolution level and immediately renders the panoramic view; According to the arrival order of the high-resolution chunks, gradually replace the low-resolution data in the corresponding area, and use the bilinear interpolation algorithm for smooth transition.

[0012] Furthermore, it also includes the blockchain evidence storage fault tolerance step: The server stores the hash check values, transmission status, and timestamps of the chunks into the private blockchain. The nodes of the private blockchain include the server, the client, and the hospital audit node; When the client reconnects, submit the list of chunk hash values stored locally to the server; The server compares the on-chain evidence data through the smart contract and only retransmits the chunks missing locally.

[0013] Furthermore, the header of the hybrid data frame also includes: A 4-byte chunk index used to identify the position of the chunk in the pathological section; A 2-byte resolution level used to identify the magnification factor corresponding to the chunk, including 5x, 20x, 40x; A 1-byte priority flag used to identify whether the chunk is a chunk within the user's viewport or a chunk in the lesion area; A 32-byte SHA-256 hash check value used to verify the integrity of the chunk data.

[0014] In a second aspect, the present invention provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the above-mentioned WebSocket-based pathological section streaming transmission and real-time preview method.

[0015] In a third aspect, the present invention provides a readable storage medium. A computer program is stored in the readable storage medium, and the computer program includes program codes for controlling a process to execute the process, and the process includes the above-mentioned WebSocket-based pathological section streaming transmission and real-time preview method.

[0016] The main contributions and innovations of the present invention are as follows: 1. Improvement in transmission efficiency: The custom WebSocket frame structure (metadata + image chunks) reduces the protocol overhead by 30%, and the hash check value is embedded in the header, improving the integrity verification efficiency by 50%.

[0017] The QUIC protocol carries low-priority chunks, supports over 1000 concurrent connections. WebSocket is dedicated to high-priority data, and the instruction delay is < 50ms.

[0018] 2. Real-time interaction optimization: The dynamic priority scheduling algorithm adjusts the transmission queue in real time according to the user's viewport position and lesion markers. Chunks in key areas are preferentially loaded, and the interaction delay is reduced to less than 200ms.

[0019] 3. The hierarchical progressive rendering technology (bilinear interpolation) shortens the preview delay from 2 - 5 seconds to within 500ms.

[0020] 4. Enhanced fault tolerance and security: The blockchain stores the chunk hashes and transmission status, avoiding single-point failures and data tampering. For resume from breakpoint, only the missing chunks need to be retransmitted, and the recovery efficiency is increased by 80%.

[0021] 5. Deep integration of business logic: The pyramid chunks (5x / 20x / 40x) combined with the LSTM prediction model for lesion area markers achieve a preloading hit rate of 85% and reduce invalid data transmission by 60%.

[0022] Details of one or more embodiments of the present invention are set forth in the following drawings and description to make other features, objects, and advantages of the present invention more concise and understandable. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present invention and form a part of the present invention. The illustrative embodiments and descriptions thereof are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 is a flowchart of the method for streaming transmission and real-time preview of pathological sections based on WebSocket according to an embodiment of the present invention; Figure 2 is a schematic diagram of the frame structure encapsulation according to an embodiment of the present invention; Figure 3 is a schematic diagram of the pyramid hierarchical chunking according to an embodiment of the present invention; Figure 4 is an implementation flowchart according to an embodiment of the present invention; Figure 5 is a schematic diagram of blockchain storage and resume from breakpoint according to an embodiment of the present invention; Figure 6 is a schematic diagram of the QUIC + WebSocket hybrid mode according to an embodiment of the present invention; Figure 7 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed implementation manners

[0024] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with one or more embodiments of this specification. On the contrary, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0025] It should be noted that: In other embodiments, the steps of the corresponding methods are not necessarily executed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or fewer than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step for description in other embodiments.

[0026] The prior art cannot achieve efficient real-time preview and interaction when a large pathological section file is not completely uploaded, and there are problems such as large transmission protocol overhead, lack of dynamic priority scheduling, low reliability of the fault tolerance mechanism, and insufficient concurrency performance.

[0027] Based on this, the present invention is based on a customized WebSocket protocol to solve the problems existing in the prior art.

[0028] Embodiment 1 The present invention aims to propose a method for streaming transmission and real-time preview of pathological sections based on WebSocket. Through a customized WebSocket protocol, hybrid transmission of metadata and image blocks is achieved. Combining dynamic priority scheduling, pyramid block strategy, LSTM prediction loading, and blockchain evidence storage mechanism, the user viewport area is rendered in real time during the transmission of pathological sections, and the transmission efficiency and reliability in high-concurrency scenarios are improved through a QUIC+WebSocket hybrid mode.

[0029] Specifically, an embodiment of the present invention provides a method for streaming transmission and real-time preview of pathological sections based on WebSocket. Specifically, referring to Figure 1 , the method includes: S1. The client establishes a WebSocket connection with the server. The client divides the pathological section file into blocks according to a preset rule and generates metadata, where the metadata at least includes a block index, a resolution level, and a priority mark; In this embodiment, the doctor initiates a pathological section preview request through a client (such as a Web browser or dedicated medical software), specifying the target pathological section file (in WSI format). The client and the server establish a WebSocket long connection (ws: / / server:port / wsi-stream) through TCP three-way handshake for real-time interaction and high-priority data transmission. As Figure 6 shown, a QUIC connection (based on UDP) is established simultaneously for high-concurrency transmission of low-priority chunks (optional, dynamically enabled according to transmission requirements). The server pre-generates chunk metadata, including pyramid hierarchy structure (5x / 20x / 40x resolutions), chunk size (256×256 pixels), coordinates of lesion areas (obtained through the LIS system), etc.

[0030] S2. The client sends a chunk request to the server through the WebSocket connection. The server performs dynamic priority scheduling on the chunks according to the metadata, and inserts the high-priority chunks into the head of the transmission queue for priority transmission; In this embodiment, as Figure 3 shown, the pathological section chunk processing is as follows: 1. Pyramid hierarchical chunking: Level 1 (5x resolution): The full image is scaled to 5x resolution as a single chunk (chunk index 0, default lowest priority) for quick panoramic preview.

[0031] Level 2 (20x resolution): The original image is scaled to 20x resolution and divided into multiple chunks at 256×256 pixels. The chunk indices are numbered row by row (such as 0001, 0002,...).

[0032] Level 3 (40x resolution): Chunking at the original resolution, also divided at 256×256 pixels, and the chunk indices correspond to high-magnification detail areas.

[0033] 2. Lesion area marking: The server obtains the lesion coordinates (such as polygon vertex coordinates) from the pathological information system (LIS) through the API, calculates the covered chunk indices, and marks them as "highest priority" (priority mark 0x02) to ensure that the lesion area chunks in the transmission queue are prior to the chunks outside the viewport.

[0034] In this embodiment, the dynamic priority scheduling and chunk transmission specifically include: 1. Real-time collection of user behavior (client): The front end listens for viewport events (movement, zoom) in real time, obtains the current viewport coordinates (x, y), zoom level (z), and viewport size (width, height), and sends them to the server via WebSocket (frequency ≥ 20Hz). The example code is as follows: { "viewport": { "x": 1024, "y": 768, "width": 512, "height": 512, "zoom": 20 } } 2. High-priority block recognition (server side): Based on the viewport coordinates and resolution level, the server calculates the covered block indices (formula: block_idx=(y / / block_height)*total_blocks_per_row+(x / / block_width), where block_width = block_height = 256 pixels), marks the corresponding blocks as high priority (priority mark 0x01), and inserts them at the head of the transmission queue. The queue data structure uses a doubly linked list, supporting insertion and deletion operations with O(1) time complexity.

[0035] 3. Dynamic adjustment of the transmission queue: The server maintains a block transmission queue (doubly linked list structure), sorted by priority: lesion blocks (0x02) > in-viewport blocks (0x01) > predicted blocks > normal blocks (0x00).

[0036] Newly generated high-priority blocks are inserted at the head of the queue to ensure priority transmission; normal blocks are added to the end of the queue in order.

[0037] 4. LSTM prediction loading (optional optimization): The server uses an LSTM model trained with historical operation data, inputs the current 10-step operation sequence (viewport trajectory, zoom records), and outputs the indices of the top 5 blocks that may be accessed within the next 5 seconds. For example, based on the prediction results, the server adds the top 5 high-probability blocks to the transmission queue, with a preloading hit rate of 85% and the interaction latency reduced to below 200ms.

[0038] Mark the predicted blocks as "prediction priority" (between in-viewport and normal blocks), and add them to the transmission queue in advance, with a preloading hit rate ≥ 85%.

[0039] Among them, the historical operation data is the data collected on doctors' historical operations, including recording the viewport coordinates, zoom level, and mouse click position (when marking the annotation area) every 50 ms, forming an operation sequence S = [(x1, y1, z1), (x2, y2, z2),..., (xn, yn, zn)].

[0040] Among them, for model training, a multi-layer LSTM network (3 layers, with 128 hidden units in each layer) is used. The input is the current 10-step operation sequence, and the output is a list of predicted chunk index that may be accessed within the next 5 seconds (i.e., 100 steps, with one step every 50 ms). The training loss function uses the mean squared error (MSE), the optimizer is Adam, the learning rate is 0.001, and the training dataset contains 100,000 doctor operation records.

[0041] S3. The server transmits the chunk data to the client through a custom hybrid data frame. The hybrid data frame includes a header for carrying metadata and a body for carrying image chunk data. The header also includes a hash check value for verifying data integrity; In this embodiment, as Figure 2 shown, the transmission of the custom hybrid data frame (WebSocket frame) specifically includes: 1. Frame structure encapsulation (server): Each chunk is encapsulated into a hybrid data frame. The header (40 bytes) includes: Chunk index (4 bytes, uniquely identifying the chunk position); Resolution level (2 bytes, 0 / 1 / 2 corresponding to 5x / 20x / 40x); Priority flag (1 byte, 0x00 - 0x02, indicating whether it is a chunk within the user's viewport); SHA-256 hash check value (32 bytes, generated by hashing the data body).

[0042] The data body is an image chunk compressed by JPEG2000 (default 256KB, with the compression rate dynamically adjusted to adapt to the network bandwidth).

[0043] 2. Protocol selection (server): High-priority chunks (0x01 / 0x02) are transmitted through the WebSocket connection to ensure real-time performance (instruction delay < 50 ms); Low-priority chunks (0x00) are transmitted through the QUIC connection, taking advantage of multiplexing to support high concurrency (> 1000 chunks transmitted simultaneously).

[0044] S4. After receiving the hybrid data frame, the client performs hierarchical progressive rendering according to the resolution level and chunk index, and preferentially renders the high-priority chunks within the viewport to achieve real-time preview of the pathological section.

[0045] In this embodiment, as Figure 4 shown, the client-side hierarchical progressive rendering specifically includes: 1. Initial panoramic loading: The client preferentially receives the 5x chunks of level 1 and immediately renders a low-resolution panoramic view (time-consuming < 100 ms) to provide a quick preview.

[0046] 2. High-resolution chunk replacement: In the order of chunk arrival, decode the chunks of level 2 (20x) and level 3 (40x), and replace the low-resolution data in the corresponding area of the panoramic image according to the chunk index and resolution level.

[0047] Use the bilinear interpolation algorithm to perform pixel smoothing on the scaled area to avoid screen tearing, and control the rendering delay within 500 ms.

[0048] Among them, the bilinear interpolation of pixel values is implemented using an open-source graphics library (such as WebGL), and the formula is:

[0049] where (x, y) is the floating-point coordinate of the target pixel in the source image, and f(0,0), etc. are the neighboring pixel values.

[0050] 3. Interaction response optimization: When the viewport moves or zooms, the client immediately triggers a priority scheduling request, and the server preferentially transmits the chunks within the new viewport to ensure that the user operation is synchronized with the screen update (interaction delay ≤ 200 ms). That is, the first mixed data frame contains a thumbnail (5x resolution) and pyramid structure metadata (number of levels, chunk size of each level, total number of chunks). After the client parses it, it immediately displays a loading progress bar and a low-resolution preview image to achieve "viewing while transmitting".

[0051] Preferably, it also includes the specific content of blockchain evidence storage and resume from breakpoint: 1. Chunk status evidence storage (server): As Figure 5 shown, after each chunk is sent, the server writes the chunk hash value, transmission status ("sent"), and timestamp into the private blockchain (nodes include the server, client, and hospital audit node).

[0052] After the client receives the chunk and passes the hash verification, it marks the status as "confirmed" by calling confirmBlock(hash) through the smart contract.

[0053] 2. Network interruption recovery: When the client reconnects, it sends all the locally stored chunk hash lists (localHashes) to the server.

[0054] The server queries the hash list (chainHashes) stored on the chain through a smart contract and calculates the difference set missingHashes = chainHashes - localHashes.

[0055] Only the chunks corresponding to missingHashes are retransmitted, and the recovery efficiency is increased by 80% compared to the traditional caching scheme, avoiding full retransmission.

[0056] Preferably, it also includes the specific content of process closed-loop and continuous optimization: 1. User operation loop: The doctor continuously performs operations such as zooming, dragging, and marking. The client provides real-time feedback on the interaction data, and the server dynamically adjusts the chunk priority to form an "operation - transmission - rendering" closed-loop.

[0057] 2. Model iteration and optimization: The LSTM prediction model is updated regularly, incorporating new doctor operation data to improve the preloading hit rate; the chunk size and compression strategy are dynamically adjusted according to network performance data to adapt to different transmission environments.

[0058] In summary, the following is the comparison of the differences between the present invention and the prior art:

[0059] This process fully covers the entire link from chunk processing to final rendering, realizes the streaming transmission and real-time preview of pathological slices through multi-technology integration, and solves the multiple bottlenecks of efficiency, latency, and fault tolerance in the traditional scheme.

[0060] Embodiment III This embodiment also provides an electronic device. Referring to Figure 7 , it includes a memory 404 and a processor 402. The memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0061] Specifically, the above processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0062] Among them, the memory 404 may include a mass storage 404 for data or instructions. By way of example and not limitation, the memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In suitable cases, the memory 404 may include removable or non-removable (or fixed) media. In suitable cases, the memory 404 may be internal or external to the data processing device. In a particular embodiment, the memory 404 is a non-volatile memory. In a particular embodiment, the memory 404 includes a read-only memory (ROM) and a random access memory (RAM). In suitable cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these. In suitable cases, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM may be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0063] The memory 404 can be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402.

[0064] By reading and executing the computer program instructions stored in the memory 404, the processor 402 implements any of the WebSocket-based pathological slice streaming transmission and real-time preview methods in the above embodiments.

[0065] Optionally, the above electronic device may further include a transmission device 406 and an input / output device 408. Among them, the transmission device 406 is connected to the above processor 402, and the input / output device 408 is connected to the above processor 402.

[0066] The transmission device 406 can be used to receive or send data via a network. Specific examples of the above network may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one example, the transmission device 406 can be a radio frequency (Radio Frequency, abbreviated as RF) module, which is used to communicate with the Internet wirelessly.

[0067] The input / output device 408 is used to input or output information.

[0068] Embodiment III This embodiment also provides a readable storage medium, in which a computer program is stored. The computer program includes program codes for controlling a process to execute the process. The process includes the WebSocket-based pathological slice streaming transmission and real-time preview method according to Embodiment I.

[0069] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation manners, and will not be elaborated herein.

[0070] Generally, various embodiments can be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the present invention can be implemented in hardware, while other aspects can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the present invention is not limited thereto. Although the various aspects of the present invention can be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, as a non-limiting example, the blocks, devices, systems, technologies, or methods described herein can be implemented in hardware, software, firmware, dedicated circuits or logic, general hardware or a controller or other computing device, or some combination thereof.

[0071] Embodiments of the present invention can be implemented by computer software, which is executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. A computer software or program (also referred to as a program product), including software routines, applets, and / or macros, can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product can include one or more computer-executable components configured to execute the embodiments when the program runs. The one or more computer-executable components can be at least one software code or a part thereof. Additionally, at this point, it should be noted that any box in the logical flow, as Figure 1 described, can represent a program step, or interconnected logic circuits, boxes, and functions, or a combination of program steps and logic circuits, boxes, and functions. The software can be stored on physical media such as memory chips or storage blocks implemented within the processor, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and their data variants, CDs. The physical media are non-transitory media.

[0072] Those skilled in the art should understand that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as within the scope described in this specification.

[0073] The above embodiments only represent several implementation manners of the present invention. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the appended claims.

Claims

1. A method for streaming and real-time previewing of pathological sections based on WebSocket, characterized in that: The following steps are involved: S1. The client establishes a WebSocket connection with the server. The client divides the pathological slice file into blocks according to preset rules and generates metadata. The metadata includes at least a block index, a resolution level, and a priority tag. S2. The client sends a block request to the server through the WebSocket connection. The server dynamically prioritizes the blocks according to the metadata and inserts the high-priority blocks into the head of the transmission queue for priority transmission. S3. The server transmits the block data to the client through a custom mixed data frame, wherein the mixed data frame includes a header for carrying the metadata and a body for carrying the image block data, and the header also includes a hash check value for verifying data integrity; S4. After receiving the mixed data frame, the client performs layered progressive rendering according to the resolution level and the block index, and gives priority to rendering high-priority blocks in the viewport to achieve real-time preview of pathological sections.

2. The WebSocket-based pathological slice streaming and real-time preview method according to claim 1, characterized in that: The preset rules are pyramid block rules, including: Pathology slices at low resolution levels are transmitted as single blocks for quick preview of panoramic views; Pathological slices at high-resolution levels are divided into multiple blocks according to preset pixel sizes, supporting local high-resolution rendering.

3. The WebSocket-based pathological slice streaming and real-time preview method according to claim 1, characterized in that: The dynamic priority scheduling includes: The client monitors user operations in real time, obtains interaction data, including viewport coordinates and zoom level, and sends it to the server via WebSocket; The server determines the blocks covered by the user's viewport according to the interaction data, and marks them as high-priority blocks; The server maintains a block transmission queue and inserts high priority blocks into the head of the queue for priority transmission.

4. The WebSocket-based pathological slice streaming and real-time preview method according to claim 1, characterized in that: It also includes the following steps to prioritize the lesion area: The server is connected to the pathology information system, automatically identifies the blocks corresponding to the lesion area in the pathology section, and marks the priority of the lesion area block as the highest level, which is transmitted in priority to other blocks in the transmission queue.

5. The WebSocket-based pathological slice streaming and real-time preview method according to claim 1, characterized in that: It also includes a LSTM-based prediction loading step: Collect doctors’ historical operation data, including viewport movement trajectory, zoom frequency, and click rate of marked areas; The prediction model is trained through the LSTM network, the current viewport coordinates, zoom level and operation sequence are input, and a list of predicted block indexes that may be accessed within a preset time in the future is output; The server adds the predicted blocks to the transmission queue in advance for preloading according to the predicted block index list.

6. The WebSocket-based pathological slice streaming and real-time preview method according to claim 1, characterized in that: The layered progressive rendering includes: The client first receives the full image tiles at the low-resolution level and immediately renders the panoramic view; According to the arrival order of high-resolution blocks, the low-resolution data of the corresponding area is gradually replaced, and a bilinear interpolation algorithm is used for smooth transition.

7. The WebSocket-based pathological slice streaming and real-time preview method according to claim 1, characterized in that: It also includes the blockchain evidence fault tolerance step: The server stores the hash check value, transmission status and timestamp of the block into a private blockchain, and the nodes of the private blockchain include the server, the client and the hospital audit node; When the client reconnects, it submits the locally stored block hash list to the server; The server compares the on-chain evidence data through smart contracts and only retransmits the blocks that are missing locally.

8. The WebSocket-based pathological slice streaming and real-time preview method according to any one of claims 1 to 7, characterized in that: The header of the mixed data frame also includes: 4-byte block index, used to identify the position of the block in the pathological section; 2-byte resolution level, used to identify the magnification of the block, including 5x, 20x, and 40x; A 1-byte priority flag is used to identify whether the block is a block within the user's viewport or a block in the lesion area; 32-byte SHA-256 hash value, used to verify the integrity of the block data.

9. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the WebSocket-based pathological slice streaming and real-time preview method according to any one of claims 1 to 8.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which includes a program code for controlling a process to execute a process, wherein the process includes the WebSocket-based pathological slice streaming and real-time preview method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image processing method and related equipment

    CN118820625A

  • Parallel synchronization method and system for unstructured files

    CN119513057A

  • Real-time interactive three-dimensional Gaussian sputtering scene rendering method, storage medium and system

    CN119545084A

Cited By

  • Case consultation and pathological section automatic diagnosis system based on AI analysis

    CN122091163A

  • A case consultation and pathological section automatic diagnosis system based on AI analysis

    CN122091163B

  • Pathological image transmission method and device and storage medium

    CN122290911A

  • Pathology image transmission method, device, and storage medium

    CN122290911B