Ultrasonic image playback method, equipment and device
By setting multiple cache blocks in the ultrasound image storage device and pre-reading frame data, the problem of long loading time and low frame rate in ultrasound image playback is solved, and fast loading and high-fluency ultrasound image playback are achieved.
Patent Information
- Application Number
- CN202310886286.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-19
- Publication Date
- 2025-01-21
AI Technical Summary
Existing ultrasound image storage and replay methods have problems such as movie loading time, too large memory space, unable to keep up with the frame rate or stuttering playback, which seriously affects the user experience and may reduce the disk's read and write efficiency and service life.
By setting multiple cache blocks in the memory, the pre-read frame number interval is determined based on the ultrasound image data that currently needs to be displayed, and the subsequent frame data that needs to be displayed is cached in advance, thereby achieving fast loading during playback and avoiding single-frame reading errors. High disk IO usage.
It achieves fast loading of ultrasound image playback, improves playback fluency, extends the service life of the disk, and effectively avoids additional memory consumption.
Smart Images

Figure CN119342267A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an ultrasound image playback method, equipment and device. Background Art
[0002] With the increase in user demand and the improvement in hardware equipment performance, the resolution of ultrasound images is getting higher and higher, and the amount of data stored in ultrasound images is also getting larger and larger. Especially under the ultrasound contrast imaging function, the time required is longer, and often a few minutes of data reaches the upper limit of the allocatable memory of conventionally configured ultrasound equipment.
[0003] Based on this, currently, when storing ultrasound images, ultrasound images are generally stored by directly writing to the hard disk, so that the ultrasound image data can be recalled by accessing the hard disk. However, in the two scenarios using this method, the first method of loading all the movies into the memory before playing often has the problem of too long movie loading time and too much memory space required. The ultrasound image data that exceeds the upper limit of the allocable memory cannot be played back by loading it into the memory at one time; the other method of loading one frame from the disk and playing one frame at a time will cause the frame rate to not keep up or the playback to freeze when the hard disk resources are tight, which seriously affects the user experience. In addition, when the movie is played in a loop, a large amount of disk IO will be occupied. When there are other processes in the program that require disk IO at the same time, the disk read and write efficiency will be reduced, and the service life of the disk will be reduced. Summary of the invention
[0004] The purpose of this application is to provide an ultrasound image playback method, device and apparatus to improve ultrasound image playback performance and enhance user experience.
[0005] In a first aspect, the present application provides an ultrasound image playback method, the method comprising:
[0006] Determining a cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed;
[0007] When the Nth frame of ultrasound image data is in the first cache block, determining the ultrasound playback scene according to the Nth frame of ultrasound image data, wherein the frame data cached in the first cache block is the frame data corresponding to the first pre-read frame number interval, each pre-read frame number interval includes L frames, and L is a positive integer;
[0008] According to the ultrasound playback scenario, a second pre-read frame number interval is determined, and frame data corresponding to the second pre-read frame number interval is updated into a second cache block, wherein the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals;
[0009] Acquire the Nth frame of ultrasonic image data from the first cache block, and process the Nth frame of ultrasonic image data;
[0010] The ultrasonic image corresponding to the processed N-th frame of ultrasonic image data is displayed in the display interface.
[0011] In an optional manner, updating the frame data corresponding to the second pre-read frame number interval into the second cache block includes:
[0012] Determine storage information of frame data corresponding to each frame number in the second pre-read frame number interval in the file system according to the index file, wherein the storage information includes a position and a size of the frame data in the file system;
[0013] Frame data corresponding to each frame number in the second pre-read frame number interval is acquired according to the storage information and stored in the second cache block.
[0014] In an optional manner, determining the second pre-read frame number interval according to the ultrasound playback scene includes:
[0015] When the ultrasound playback scene is a sequential acquisition scene and the current scene is forward playback, retain the frame data cached in the first cache block, and determine the second pre-read frame number interval as the next adjacent interval of the first pre-read frame number interval; or,
[0016] When the ultrasound playback scene is a sequential acquisition scene and the current scene is reverse playback, the frame data cached in the first cache block is retained, and the second pre-read frame number interval is determined to be the previous adjacent interval of the first pre-read frame number interval.
[0017] In an optional manner, determining the second pre-read frame number interval according to the ultrasound playback scene includes:
[0018] When the ultrasound playback scene is a disorderly acquisition scene, the first pre-read frame number interval is split into a front sub-interval and a rear sub-interval from the middle;
[0019] When the Nth frame of ultrasound image data is in the front sub-interval, determining the second pre-read frame number interval as the previous adjacent interval of the first pre-read frame number interval; or,
[0020] When the Nth frame of ultrasound image data is in the latter sub-interval, the second pre-read frame number interval is determined to be the next adjacent interval of the first pre-read frame number interval.
[0021] In an optional manner, determining the second pre-read frame number interval according to the ultrasound playback scene includes:
[0022] When the ultrasound playback scene is a scene of jumping to the first frame or jumping to the last frame of data, directly playing the first frame of data or the last frame of data;
[0023] The first frame data and / or the last frame data are / is fixedly stored in the third cache block.
[0024] In an optional manner, the method further comprises:
[0025] When the Nth frame of ultrasonic image data is not cached, the interval where the Nth frame of ultrasonic image data is located is directly searched and accessed.
[0026] In an optional manner, the method further comprises:
[0027] The total number of frame numbers is obtained, and the total number of frame numbers is divided into X intervals according to the order of the frame numbers, each interval having a length of L, wherein the interval length that does not satisfy L is rounded down.
[0028] In a second aspect, the present application provides an ultrasound image playback device, the device comprising a memory, a processor, and a display screen, the memory comprising a first cache block and a second cache block;
[0029] The processor is configured to determine a cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed; when the Nth frame of ultrasound image data is in the first cache block, determine an ultrasound playback scene according to the Nth frame of ultrasound image data; determine a second pre-read frame number interval according to the ultrasound playback scene, and update frame data corresponding to the second pre-read frame number interval to the second cache block; obtain the Nth frame of ultrasound image data from the first cache block, and process the Nth frame of ultrasound image data;
[0030] The first cache block is used to cache frame data corresponding to a first pre-read frame number interval, the first pre-read frame number interval includes the Nth frame of ultrasound image data, each pre-read frame number interval includes L frames, and L is a positive integer;
[0031] The second cache block is used to cache frame data corresponding to the second pre-read frame number interval, and the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals;
[0032] The display screen is used to display the ultrasonic image corresponding to the processed N-th frame of ultrasonic image data in a display interface.
[0033] In an optional manner, the memory is further used for:
[0034] When the thread starts, the metadata of the frame data corresponding to all ultrasound images is read, and an index file is generated and stored according to the metadata of the frame data. The index file is used to indicate the correspondence between the frame number of the frame data and the storage information of the frame data in the file system, and the storage information includes the position and size of the frame data in the file system.
[0035] In a third aspect, the present application provides an ultrasound image playback device, which is applied to an ultrasound image playback device, comprising:
[0036] a determination module, configured to determine a cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed; and when the Nth frame of ultrasound image data is in a first cache block, determine an ultrasound playback scene according to the Nth frame of ultrasound image data, wherein the frame data cached in the first cache block is the frame data corresponding to a first pre-read frame number interval, each pre-read frame number interval includes L frames, and L is a positive integer;
[0037] a cache module, configured to determine a second pre-read frame number interval according to the ultrasound playback scenario, and update frame data corresponding to the second pre-read frame number interval into a second cache block, wherein the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals;
[0038] A processing module is used to obtain the Nth frame of ultrasonic image data from the first cache block, process the Nth frame of ultrasonic image data; and display the ultrasonic image corresponding to the processed Nth frame of ultrasonic image data in a display interface.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to execute the ultrasound image playback method as described in the first aspect above.
[0040] In a fifth aspect, the present application provides a computer program product, including a computer program:
[0041] When the computer program is executed by a processor, the ultrasound image playback method as described in the first aspect above is implemented.
[0042] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0043] Since the embodiment of the present application determines the pre-read frame number interval according to the Nth frame of ultrasound image data that needs to be displayed currently, the frame data corresponding to the part of the ultrasound image that needs to be displayed later is cached in advance, so that when the subsequent display is performed, due to the pre-loading of multiple frames of data in advance, it is possible to achieve fast loading when the ultrasound image is played back, which can avoid the high occupancy of the disk IO by single-frame reading, extend the service life of the disk, and improve the loading speed of the ultrasound image, so that the playback fluency is higher. And the embodiment of the present application can also formulate different pre-reading strategies in combination with different scenarios to achieve intelligent preloading. In addition, by setting multiple cache blocks, the embodiment of the present application can realize the circular use of multiple memory blocks, better store the pre-read data, and effectively avoid additional memory consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 This is a diagram showing the architecture of the first ultrasound image playback system according to an embodiment of the present application;
[0046] Figure 2 This is a diagram showing the architecture of a second ultrasound image playback system according to an embodiment of the present application;
[0047] Figure 3 This is a diagram showing the architecture of a third ultrasound image playback system according to an embodiment of the present application;
[0048] Figure 4 This is a diagram showing the architecture of the fourth ultrasound image playback system according to an embodiment of the present application;
[0049] Figure 5 This is a fifth ultrasound image playback system architecture diagram of an embodiment of the present application;
[0050] Figure 6 This is a sixth ultrasound image playback system architecture diagram of an embodiment of the present application;
[0051] Figure 7 This is a seventh ultrasound image playback system architecture diagram of the present application embodiment;
[0052] Figure 8 This is a flow chart of an ultrasound image playback method according to an embodiment of the present application;
[0053] Fig. 9 A schematic diagram of a sequential acquisition scenario according to an embodiment of the present application;
[0054] Fig.10 This is a schematic diagram of a disorderly acquisition scenario in an embodiment of the present application;
[0055] Fig.11 A schematic diagram of a specific frame scene in an embodiment of the present application;
[0056] Fig.12 This is a flow chart of a display module acquiring and displaying data according to an embodiment of the present application;
[0057] Fig.13 A callback pre-reading thread and algorithm flow chart for an embodiment of the present application;
[0058] Fig.14 This is a schematic diagram of an ultrasound image playback device according to an embodiment of the present application;
[0059] Fig.15 This is another ultrasound image playback device according to an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the technical solution of the present disclosure, rather than all the embodiments. Based on the embodiments recorded in the present disclosure document, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present disclosure.
[0061] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0062] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented using sequences other than those illustrated or described herein.
[0063] The application scenarios described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0064] At present, with the increase in user demand and the improvement in hardware equipment performance, the resolution of ultrasound images is getting higher and higher, and the amount of data stored in ultrasound images is also getting larger and larger. Especially under the ultrasound contrast imaging function, the time required is longer, and often a few minutes of data reaches the upper limit of the allocatable memory of conventionally configured ultrasound equipment.
[0065] Based on this, currently, when storing ultrasound images, ultrasound images are generally stored by directly writing to the hard disk, so that the ultrasound image data can be recalled by accessing the hard disk. However, in the two scenarios using this method, the first method of loading all the images into the memory before playing often has the problem of too long movie loading time and too much memory space required. The ultrasound image data that exceeds the upper limit of the allocable memory cannot be played back by loading it into the memory at one time; the other method of loading one frame from the disk and playing one frame at a time will cause the frame rate to not keep up or the playback to freeze when the hard disk resources are tight, which seriously affects the user experience. In addition, when the image is played in a loop, a large amount of disk IO will be occupied. When there are other processes in the program that require disk IO at the same time, the disk read and write efficiency will be reduced, and the service life of the disk will be reduced.
[0066] In order to solve the above technical problems, an embodiment of the present invention provides an ultrasound image playback method, which can achieve the purpose of fast data loading by circularly using multiple blocks of memory and preloading multiple frames of data. Memory is intelligently allocated according to the different sizes of single-frame data of the image, thereby avoiding additional memory consumption and effectively saving the memory consumption of the ultrasound software. In addition, multiple frames are pre-read at a time, which can avoid the high occupancy of disk IO by single-frame reading, extend the service life of the disk, and improve the loading speed of ultrasound images.
[0067] Figure 1 The exemplary system architecture that can be applied to the ultrasound image playback method according to the embodiment of the present disclosure is schematically shown. The system architecture may include a processor 100, a memory 200 and a display screen 300, wherein the memory 200 includes a first cache block 201 and a second cache block 202.
[0068] The processor 100 is used to determine the cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed; when the Nth frame of ultrasound image data is in the first cache block, determine the ultrasound replay scene according to the Nth frame of ultrasound image data; determine the second pre-read frame number interval according to the ultrasound replay scene, and update the frame data corresponding to the second pre-read frame number interval to the second cache block; obtain the Nth frame of ultrasound image data from the first cache block, and process the Nth frame of ultrasound image data.
[0069] The memory 200 is used to cache frame data corresponding to the ultrasound image.
[0070] Specifically, the first cache block in the memory is used to cache frame data corresponding to a first pre-read frame number interval, the first pre-read frame number interval includes the Nth frame of ultrasound image data, each pre-read frame number interval includes L frames, and L is a positive integer.
[0071] The second cache block in the memory is used to cache frame data corresponding to the second pre-read frame number interval, and the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals.
[0072] It should be noted that the number of cache blocks included in the memory in the embodiment of the present application can be set according to actual conditions, that is, the number of cache blocks included in the memory can be greater than 2, for example, the memory includes 3 cache blocks.
[0073] In addition, the first cache block and the second cache block do not constitute a name limitation for the cache blocks, and the cache blocks can be used cyclically. For example, the current cache block A includes the target ultrasound image data (such as the Nth frame ultrasound image data), then the cache block A is used to implement the first cache block function, and the other cache block B is used to implement the second cache block function. During the later playback process, the cache block B includes the target ultrasound image data (such as the N+th frame ultrasound image data), then the cache block B is used to implement the first cache block function, and the cache block A is used to implement the second cache block function.
[0074] The display screen 300 is used to display the ultrasonic image corresponding to the processed N-th frame of ultrasonic image data in a display interface.
[0075] Furthermore, if Figure 2 As shown, the processor 100 in the embodiment of the present application may include an image callback pre-reading module 110 .
[0076] The image callback pre-reading module 110 is responsible for interacting with the file system, determining in real time the data frame corresponding to the ultrasound image to be used, and performing pre-reading, and the pre-read data is stored in the pre-read data cache block.
[0077] It can be understood that the pre-read content executed by the processor in the embodiment of the present application can be implemented by the image callback pre-reading module.
[0078] As an optional solution, the file system described in the embodiment of the present application can be stored in a computer's built-in mechanical hard disk or in an external hard disk.
[0079] like Figure 3 As shown, the processor may include a callback data processing module 120.
[0080] The callback data processing module 120 is used for data transfer, notifying the image callback pre-reading module of the data frame corresponding to the currently required ultrasound image, and obtaining the ultrasound image data corresponding to the current frame from the cache block, performing data decompression processing, etc.
[0081] Furthermore, if Figure 4 As shown, the memory 200 may include a pre-read data cache module 210 .
[0082] The pre-read data cache module 210 is used to manage M cache blocks, store data read by the image callback pre-read module, and provide data for the callback data processing module. M is a positive integer not less than 2.
[0083] As an example, the pre-read data cache module 210 in the embodiment of the present application may include two cache blocks, cache block 1 and cache block 2, for managing the data cache contents in the two cache blocks. The cache block 1 and the cache block 2 may be used cyclically.
[0084] Furthermore, if Figure 5 As shown, in the system architecture described in the embodiment of the present application, the processor may further include a data calculation module 130.
[0085] The data calculation module 130 is used to analyze and calculate the image data to realize functions such as measurement and quantitative analysis in the ultrasound system.
[0086] When the user uses these calculation functions, the data calculation module needs to call back the data processing module to forward the data to the data calculation module for use.
[0087] like Figure 6 As shown, in the system architecture described in the embodiment of the present application, the memory may also include an image storage module 220.
[0088] The image storage module 220 is responsible for reading data. The module stores the metadata of the data separately in an index file. Since the index file does not store specific image pixel data, the file is small and can be loaded into the memory at one time, so that the basic information of each frame of data can be directly obtained during callback, and the specific position and size of each frame of data in the file can be directly indexed.
[0089] like Figure 7 As shown, in the system architecture described in the embodiment of the present application, the display may also include an image display module 310.
[0090] The image display module 310 is used to display the processed ultrasound image corresponding to the Nth frame of ultrasound image data on a display screen.
[0091] The image display module is a user interface that refreshes display data in real time, and each displayed data needs to be forwarded by the callback data processing module.
[0092] It should be noted that the display module and the pre-reading module are two different threads. Therefore, when the display module acquires data, the cache block managed by the cache unit does not necessarily contain the Nth frame of ultrasound image data that needs to be displayed. If it does not exist, it waits until the Nth frame of ultrasound image data exists or exits due to an abnormal interrupt.
[0093] In addition, the above Figures 1 to 7 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0094] The following is based on the scenario described in the above system architecture. Figure 8 to Figure 10 The ultrasound image playback method according to the embodiment of the present disclosure is described in detail.
[0095] Figure 8 The flowchart of the ultrasound image playback method according to the embodiment of the present disclosure is schematically shown.
[0096] Step 800: Determine the cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed.
[0097] Step 801: When the Nth frame of ultrasound image data is in the first cache block, determine an ultrasound playback scene according to the Nth frame of ultrasound image data.
[0098] The frame data cached in the first cache block is frame data corresponding to a first pre-read frame number interval, each pre-read frame number interval includes L frames, and L is a positive integer.
[0099] Step 802: determine a second pre-read frame number interval according to the ultrasound playback scenario, and update frame data corresponding to the second pre-read frame number interval into a second cache block, wherein the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals.
[0100] Optionally, in order to more effectively determine the second pre-read frame number interval, the embodiment of the present application may obtain the total number of frame numbers in advance, and divide the total frame number into X intervals in frame number order, each interval length is L, where the interval length that does not satisfy L is rounded down.
[0101] Exemplarily, at the beginning of pre-reading, it is necessary to obtain the total number of frames nTotal, the starting position Pos(n) of each frame of data in the file stream, the length Len(n) of each frame of data, and the maximum data length MaxLen. Then, notify the cache module to allocate two memory blocks Mem1 and Mem2, set the number of frames for each pre-read to L (L>1), and the size requested for each memory block is L*MaxLen. Among them, the size of L depends on the size of the single-frame data image and the performance of the ultrasound equipment. Finally, split the nTotal frame data into Xtotal intervals, each interval length is L, when L divides nTotal, Xtotal=nTotal / L, otherwise Xtotal=nTotal / L+1 rounded down. The range of each interval is [X*L,(X+1)*L-1].
[0102] It is understandable that when L is small, the performance optimization effect provided by the pre-reading algorithm is small. However, L should not be too large. If it is too large, the fixed memory required will also increase, and each read will take a long time, which will lead to negative optimization in some scenarios.
[0103] As an optional solution, the cache blocks in the embodiment of the present application can also be expanded to open more than two cache blocks and used cyclically.
[0104] Step 803: Acquire the Nth frame of ultrasonic image data from the first cache block, and process the Nth frame of ultrasonic image data.
[0105] Step 804: Display the ultrasonic image corresponding to the processed N-th frame of ultrasonic image data in the display interface.
[0106] For example, assuming the first read, the pre-read frame number interval is set to the first interval, that is, [n1, n2], n1 = 1, n2 = L. According to the ultrasound application scenario, when the movie is called back, it will automatically start playing from the first frame, and the user can perform other operations after the playback starts. If there are other scenarios, the first pre-read frame number interval can be set according to the scenario type.
[0107] Then, the pre-reading module reads the data in the interval [n1, n2] from the file system at one time according to the position information Pos[n1] and the length information Len[n1] to Len[n2], and saves the data into the cache Mem1.
[0108] Furthermore, the embodiments of the present application can flexibly perform different pre-reading operations based on different ultrasonic playback scenarios, which are not limited to the following scenarios:
[0109] Scenario 1: Ultrasound playback scenario is a sequential acquisition scenario
[0110] Exemplarily, the sequential acquisition scenario described in the examples of the present application can be understood as a scenario in which a user needs to acquire data frame by frame when performing calculations such as automatic playback scenarios and quantitative analysis.
[0111] For example, Fig. 9 As shown, the sequential scenes can be played forward frame by frame, or can be played backward frame by frame, that is, played in reverse.
[0112] It can be understood that in this scenario, the first interval and the last interval are considered to be adjacent, which is used for the scenario of loop playback.
[0113] Based on the first scenario, the situations in which the pre-reading operation is performed in the embodiment of the present application are classified, and are specifically not limited to the following three situations:
[0114] Case 1: When the ultrasound playback scene is a sequential acquisition scene and the current scene is forward playback, the frame data cached in the first cache block is retained, and the second pre-read frame number interval is determined to be the next adjacent interval of the first pre-read frame number interval.
[0115] As an example, when an embodiment of the present application includes multiple cache blocks, for example, including M cache blocks, when M is greater than or equal to 2, a cache block containing ultrasound image data of the Nth frame is retained, and the remaining (M-1) cache blocks sequentially cache data corresponding to the next adjacent interval corresponding to the first pre-read frame number interval to the next (M-1) interval.
[0116] For example, assuming that M is 3, they are cache block 1, cache block 2 and cache block 3 respectively, where cache block 1 includes the Nth frame of ultrasound image data, then the frame data corresponding to the first pre-read frame number interval cached in the cache block 1 is retained, and the second pre-read frame number interval is determined to be the next adjacent interval of the first pre-read frame number interval, and the second pre-read frame number interval can be cached in the cache block 2, and the third pre-read frame number interval is determined to be the next adjacent interval of the first pre-read frame number interval, and the third pre-read frame number interval can be cached in the cache block 3.
[0117] Case 2: When the ultrasound playback scene is a sequential acquisition scene and the current scene is reverse playback, the frame data cached in the first cache block is retained, and the second pre-read frame number interval is determined to be the previous adjacent interval of the first pre-read frame number interval.
[0118] As an example, when an embodiment of the present application includes multiple cache blocks, for example, including M cache blocks, when M is greater than or equal to 2, a cache block for ultrasound image data of the Nth frame is retained, and the remaining (M-1) cache blocks sequentially cache data corresponding to the previous adjacent interval to the upper (M-1) interval corresponding to the first pre-read frame number interval.
[0119] For example, assuming that M is 3, they are cache block 1, cache block 2 and cache block 3 respectively, where cache block 1 includes the Nth frame of ultrasound image data, then the frame data corresponding to the first pre-read frame number interval cached in the cache block 1 is retained, and the second pre-read frame number interval is determined to be the upper adjacent interval of the first pre-read frame number interval, and the second pre-read frame number interval can be cached in the cache block 2, and the third pre-read frame number interval is determined to be the upper adjacent interval of the first pre-read frame number interval, and the third pre-read frame number interval can be cached in the cache block 3.
[0120] Case 3: When the Nth frame of ultrasonic image data does not exist in the cache block, directly search for the interval where the Nth frame of ultrasonic image data is located and access it.
[0121] Scenario 2: Ultrasonic playback is obtained in a random order
[0122] For example, the out-of-order acquisition scenario described in the examples of the present application can be understood as a scenario where the user performs manual playback. In this scenario, the user may play back forward or backward, and the playback situation is relatively random.
[0123] For example, Fig.10 As shown, in the out-of-order scenario, the user may manually select point A to start playing, and then manually select point B to play after a period of time.
[0124] Based on the second scenario, the situations in which the pre-reading operation is performed in the embodiment of the present application are classified, and are specifically not limited to the following three situations:
[0125] Case 1: When the ultrasound playback scene is a disorderly acquisition scene, the first pre-read frame number interval is split from the middle into a front sub-interval and a rear sub-interval; when the Nth frame ultrasound image data is in the front sub-interval, the second pre-read frame number interval is determined to be the previous adjacent interval of the first pre-read frame number interval. Case 2: When the ultrasound playback scene is a disorderly acquisition scene, the first pre-read frame number interval is split from the middle into a front sub-interval and a rear sub-interval; when the Nth frame ultrasound image data is in the rear sub-interval, the second pre-read frame number interval is determined to be the next adjacent interval of the first pre-read frame number interval.
[0126] Case 3: Determine the storage status of the Nth frame ultrasonic image data in the cache block; when the Nth frame ultrasonic image data does not exist in the cache block, directly search for the interval where the Nth frame ultrasonic image data is located and access it.
[0127] Among them, in this scenario 2, when the number of cache blocks M is greater than 2, the content is similar to that of the above scenario 1. For details, please refer to the introduction of the above scenario 1, and no further details will be given here.
[0128] Scenario 3: Ultrasonic playback scenario is to jump to the first frame or the last frame of data scenario
[0129] like Fig.11 As shown, in this scenario, the data frame is a specific frame, and each frame has only one piece of data size, so the cache block can store these data in a fixed manner during these specific frames. When playing these frames, they can be directly obtained from the cache without affecting the pre-reading thread.
[0130] For example, the embodiment of the present application may store data corresponding to a specific frame in a third cache block, wherein the third cache block may be fixedly used to store the specific frame data.
[0131] It is understandable that in the embodiment of the present application, the cache block where the current frame is located is always reserved, because after obtaining the pre-read interval, the pre-read data is stored in another cache block. If the data in the pre-read cache block is consistent with the pre-fetch interval, there is no need to perform this pre-read.
[0132] Furthermore, in order to better understand the embodiments of the present application, different operation processes are described in detail below.
[0133] Operation process 1: Display module obtains data and displays
[0134] Please refer to Fig.12 As shown, it is a flowchart of a display module obtaining and displaying data provided by an embodiment of the present application.
[0135] Step 1200, callback starts.
[0136] Step 1201: Initialize the callback module.
[0137] Step 1202: Create a callback pre-reading thread.
[0138] Step 1203: Call back all data frame headers.
[0139] Step 1204: Start displaying the nth frame of ultrasound image.
[0140] Step 1205: notify the callback pre-reading thread that the currently required data frame number is n.
[0141] Step 1206 , determine whether the nth frame of ultrasound image data exists in the cache block, if so, execute step 1207 , if not, execute step 1208 .
[0142] Step 1207 , read the nth frame of ultrasound image data, and proceed to step 1209 .
[0143] Step 1208: Wait for the pre-read thread to pre-read and add new data to the cache block.
[0144] Step 1209: decompress the n-th frame of ultrasound image data.
[0145] Step 1210: The interface displays the nth frame of ultrasound image.
[0146] Step 1211, callback ends.
[0147] Operation process 2: callback pre-reading thread and algorithm
[0148] Please refer to Fig.13 As shown, a callback pre-reading thread and algorithm flow chart provided in an embodiment of the present application.
[0149] Step 1300: Display the pre-reading thread starts.
[0150] Step 1301: Obtain initial information from the frame header file.
[0151] Step 1302: Notify the pre-read data cache module to open a second cache block.
[0152] Step 1303, start pre-reading.
[0153] Step 1304: The starting pre-read frame number interval is fixedly set to [n1, n2].
[0154] Wherein, n1=1, n2 is the number of pre-read frames.
[0155] Step 1305: externally input the current display frame number n.
[0156] Step 1306: Determine a pre-reading strategy according to the current application scenario.
[0157] Step 1307: Determine the pre-read frame number interval [n1, n2] according to the pre-read strategy.
[0158] Step 1308 , determine whether the current frame number interval [n1, n2] already exists in the cache block, if so, execute step 1305 , if not, execute step 1309 .
[0159] Step 1309: Pre-read [n1, n2].
[0160] Step 1310: The cache block where the current frame number n is located is retained, and the data of [n1, n2] is overwritten into another cache block.
[0161] Step 1311, callback ends.
[0162] The embodiment of the present application determines the pre-read frame number interval according to the Nth frame of ultrasound image data that needs to be displayed currently, so as to cache in advance some frame data that needs to be displayed later, so that when the subsequent display is performed, due to the pre-loading of multiple frames of data in advance, fast loading can be achieved when the ultrasound image is played back, which can avoid the high occupancy of the disk IO by single-frame reading, extend the service life of the disk, and improve the loading speed of the ultrasound image, so that the playback fluency is higher. And the embodiment of the present application can also formulate different pre-reading strategies in combination with different scenarios to achieve intelligent preloading. In addition, by setting multiple cache blocks, the embodiment of the present application can realize the recycling of multiple memory blocks, better store the pre-read data, and effectively avoid additional memory consumption.
[0163] Based on the same inventive concept, an embodiment of the present invention further provides an ultrasound image playback device. Since the device is the device in the method in the embodiment of the present invention, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0164] like Fig.14 As shown, the device comprises:
[0165] The determination module 1400 is configured to determine the cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed; when the Nth frame of ultrasound image data is in the first cache block, determine the ultrasound playback scene according to the Nth frame of ultrasound image data, wherein the frame data cached in the first cache block is the frame data corresponding to the first pre-read frame number interval, each pre-read frame number interval includes L frames, and L is a positive integer;
[0166] The cache module 1401 is used to determine a second pre-read frame number interval according to the ultrasound playback scene, and update the frame data corresponding to the second pre-read frame number interval into a second cache block, wherein the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals;
[0167] The processing module 1402 is used to obtain the Nth frame of ultrasonic image data from the first cache block, process the Nth frame of ultrasonic image data; and display the ultrasonic image corresponding to the processed Nth frame of ultrasonic image data in a display interface.
[0168] As an optional implementation, the cache module 1401 is specifically used for:
[0169] Determine storage information of frame data corresponding to each frame number in the second pre-read frame number interval in the file system according to the index file, wherein the storage information includes a position and a size of the frame data in the file system;
[0170] Frame data corresponding to each frame number in the second pre-read frame number interval is acquired according to the storage information and stored in the second cache block.
[0171] As an optional implementation manner, the determining module 1400 is specifically configured to:
[0172] When the ultrasound playback scene is a sequential acquisition scene and the current scene is forward playback, retain the frame data cached in the first cache block, and determine the second pre-read frame number interval as the next adjacent interval of the first pre-read frame number interval; or,
[0173] When the ultrasound playback scene is a sequential acquisition scene and the current scene is reverse playback, the frame data cached in the first cache block is retained, and the second pre-read frame number interval is determined to be the previous adjacent interval of the first pre-read frame number interval.
[0174] As an optional implementation manner, the determining module 1400 is specifically configured to:
[0175] When the ultrasound playback scene is a disorderly acquisition scene, the first pre-read frame number interval is split into a front sub-interval and a rear sub-interval from the middle;
[0176] When the Nth frame of ultrasound image data is in the front sub-interval, determining the second pre-read frame number interval as the previous adjacent interval of the first pre-read frame number interval; or,
[0177] When the Nth frame of ultrasound image data is in the latter sub-interval, the second pre-read frame number interval is determined to be the next adjacent interval of the first pre-read frame number interval.
[0178] As an optional implementation manner, the determining module 1400 is specifically configured to:
[0179] When the ultrasound playback scene is a scene of jumping to the first frame or jumping to the last frame of data, directly playing the first frame of data or the last frame of data;
[0180] The first frame data and / or the last frame data are / is fixedly stored in the third cache block.
[0181] As an optional implementation manner, the processing module 1402 is specifically configured to:
[0182] When the Nth frame of ultrasonic image data is not cached, the interval where the Nth frame of ultrasonic image data is located is directly searched and accessed.
[0183] As an optional implementation manner, the processing module 1402 is specifically configured to:
[0184] The total number of frame numbers is obtained, and the total number of frame numbers is divided into X intervals according to the order of the frame numbers, each interval having a length of L, wherein the interval length that does not satisfy L is rounded down.
[0185] Based on the same inventive concept, an embodiment of the present invention further provides an ultrasound image playback device. Since the device is the device in the method in the embodiment of the present invention, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0186] like Fig.15 As shown, the device includes a processor 1500 and a memory 1501, wherein the memory is used to store a program executable by the processor, and the processor is used to read the program in the memory and perform the following steps:
[0187] Determining a cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed;
[0188] When the Nth frame of ultrasound image data is in the first cache block, determining the ultrasound playback scene according to the Nth frame of ultrasound image data, wherein the frame data cached in the first cache block is the frame data corresponding to the first pre-read frame number interval, each pre-read frame number interval includes L frames, and L is a positive integer;
[0189] According to the ultrasound playback scenario, a second pre-read frame number interval is determined, and frame data corresponding to the second pre-read frame number interval is updated into a second cache block, wherein the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals;
[0190] Acquire the Nth frame of ultrasonic image data from the first cache block, and process the Nth frame of ultrasonic image data;
[0191] The ultrasonic image corresponding to the processed N-th frame of ultrasonic image data is displayed in the display interface.
[0192] As an optional implementation manner, the processor 1500 is specifically configured to execute:
[0193] Determine storage information of frame data corresponding to each frame number in the second pre-read frame number interval in the file system according to the index file, wherein the storage information includes a position and a size of the frame data in the file system;
[0194] Frame data corresponding to each frame number in the second pre-read frame number interval is acquired according to the storage information and stored in the second cache block.
[0195] As an optional implementation manner, the processor 1500 is specifically configured to execute:
[0196] When the ultrasound playback scene is a sequential acquisition scene and the current scene is forward playback, retaining the first cache block, and determining the second pre-read frame number interval to be the next adjacent interval of the first pre-read frame number interval; or,
[0197] When the ultrasound playback scene is a sequential acquisition scene and the current scene is reverse playback, the first cache block is retained, and the second pre-read frame number interval is determined to be the previous adjacent interval of the first pre-read frame number interval.
[0198] As an optional implementation manner, the processor 1500 is specifically configured to execute:
[0199] When the ultrasound playback scene is a disorderly acquisition scene, the first pre-read frame number interval is split into a front sub-interval and a rear sub-interval from the middle;
[0200] When the Nth frame of ultrasound image data is in the front sub-interval, determining the second pre-read frame number interval as the previous adjacent interval of the first pre-read frame number interval; or,
[0201] When the Nth frame of ultrasound image data is in the latter sub-interval, the second pre-read frame number interval is determined to be the next adjacent interval of the first pre-read frame number interval.
[0202] As an optional implementation manner, the processor 1500 is specifically configured to execute:
[0203] When the ultrasound playback scene is a scene of jumping to the first frame or jumping to the last frame of data, directly playing the first frame of data or the last frame of data;
[0204] The first frame data and / or the last frame data are / is fixedly stored in the third cache block.
[0205] As an optional implementation manner, the processor 1500 is specifically configured to execute:
[0206] When the Nth frame of ultrasonic image data is not cached, the interval where the Nth frame of ultrasonic image data is located is directly searched and accessed.
[0207] As an optional implementation manner, the processor 1500 is specifically configured to execute:
[0208] The total number of frame numbers is obtained, and the total number of frame numbers is divided into X intervals according to the order of the frame numbers, each interval having a length of L, wherein the interval length that does not satisfy L is rounded down.
[0209] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the following steps are implemented:
[0210] Determining a cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed;
[0211] When the Nth frame of ultrasound image data is in the first cache block, determining the ultrasound playback scene according to the Nth frame of ultrasound image data, wherein the frame data cached in the first cache block is the frame data corresponding to the first pre-read frame number interval, each pre-read frame number interval includes L frames, and L is a positive integer;
[0212] According to the ultrasound playback scenario, a second pre-read frame number interval is determined, and frame data corresponding to the second pre-read frame number interval is updated into a second cache block, wherein the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals;
[0213] Acquire the Nth frame of ultrasonic image data from the first cache block, and process the Nth frame of ultrasonic image data;
[0214] The ultrasonic image corresponding to the processed N-th frame of ultrasonic image data is displayed in the display interface.
[0215] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0216] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that has the functions specified in one or more boxes.
[0217] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0218] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0219] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for replaying an ultrasound image, characterized in that: The method comprises: Determining a cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed; When the Nth frame of ultrasound image data is in the first cache block, determining the ultrasound playback scene according to the Nth frame of ultrasound image data, wherein the frame data cached in the first cache block is the frame data corresponding to the first pre-read frame number interval, each pre-read frame number interval includes L frames, and L is a positive integer; According to the ultrasound playback scenario, a second pre-read frame number interval is determined, and frame data corresponding to the second pre-read frame number interval is updated into a second cache block, wherein the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals; Acquire the Nth frame of ultrasonic image data from the first cache block, and process the Nth frame of ultrasonic image data; The ultrasonic image corresponding to the processed N-th frame of ultrasonic image data is displayed in the display interface.
2. The method according to claim 1, characterized in that The updating of the frame data corresponding to the second pre-read frame number interval into the second cache block includes: Determine storage information of frame data corresponding to each frame number in the second pre-read frame number interval in the file system according to the index file, wherein the storage information includes a position and a size of the frame data in the file system; Frame data corresponding to each frame number in the second pre-read frame number interval is acquired according to the storage information and stored in the second cache block.
3. The method according to claim 1, characterized in that The determining, according to the ultrasound playback scene, a second pre-read frame number interval includes: When the ultrasound playback scene is a sequential acquisition scene and the current scene is forward playback, retain the frame data cached in the first cache block, and determine the second pre-read frame number interval as the next adjacent interval of the first pre-read frame number interval; or, When the ultrasound playback scene is a sequential acquisition scene and the current scene is reverse playback, the frame data cached in the first cache block is retained, and the second pre-read frame number interval is determined to be the previous adjacent interval of the first pre-read frame number interval.
4. The method according to claim 1, characterized in that The determining, according to the ultrasound playback scene, a second pre-read frame number interval includes: When the ultrasound playback scene is a disorderly acquisition scene, the first pre-read frame number interval is split into a front sub-interval and a rear sub-interval from the middle; When the Nth frame of ultrasound image data is in the front sub-interval, determining the second pre-read frame number interval as the previous adjacent interval of the first pre-read frame number interval; or, When the Nth frame of ultrasound image data is in the latter sub-interval, the second pre-read frame number interval is determined to be the next adjacent interval of the first pre-read frame number interval.
5. The method according to claim 1, characterized in that The determining, according to the ultrasound playback scene, a second pre-read frame number interval includes: When the ultrasound playback scene is a scene of jumping to the first frame or jumping to the last frame of data, directly playing the first frame of data or the last frame of data; The first frame data and / or the last frame data are / is fixedly stored in the third cache block.
6. The method according to claim 1, characterized in that The method further comprises: When the Nth frame of ultrasonic image data is not cached, the interval where the Nth frame of ultrasonic image data is located is directly searched and accessed.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The total number of frame numbers is obtained, and the total number of frame numbers is divided into X intervals according to the order of the frame numbers, each interval having a length of L, wherein the interval length that does not satisfy L is rounded down.
8. An ultrasonic image playback device, characterized in that: The device comprises a memory, a processor, and a display screen, wherein the memory comprises a first cache block and a second cache block; The processor is configured to determine a cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed; when the Nth frame of ultrasound image data is in the first cache block, determine an ultrasound playback scene according to the Nth frame of ultrasound image data; determine a second pre-read frame number interval according to the ultrasound playback scene, and update frame data corresponding to the second pre-read frame number interval into the second cache block; Acquire the Nth frame of ultrasonic image data from the first cache block, and process the Nth frame of ultrasonic image data; The first cache block is used to cache frame data corresponding to a first pre-read frame number interval, the first pre-read frame number interval includes the Nth frame of ultrasound image data, each pre-read frame number interval includes L frames, and L is a positive integer; The second cache block is used to cache frame data corresponding to the second pre-read frame number interval, and the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals; The display screen is used to display the ultrasonic image corresponding to the processed N-th frame of ultrasonic image data in a display interface.
9. The image playback device according to claim 8, characterized in that: The memory is also used for: When the thread starts, the metadata of the frame data corresponding to all ultrasound images is read, and an index file is generated and stored according to the metadata of the frame data. The index file is used to indicate the correspondence between the frame number of the frame data and the storage information of the frame data in the file system, and the storage information includes the position and size of the frame data in the file system.
10. An ultrasonic image playback device, characterized in that: The device comprises: a determination module, configured to determine a cache status of the Nth frame of ultrasound image data according to the Nth frame of ultrasound image data currently required to be displayed; and when the Nth frame of ultrasound image data is in a first cache block, determine an ultrasound playback scene according to the Nth frame of ultrasound image data, wherein the frame data cached in the first cache block is the frame data corresponding to a first pre-read frame number interval, each pre-read frame number interval includes L frames, and L is a positive integer; a cache module, configured to determine a second pre-read frame number interval according to the ultrasound playback scenario, and update frame data corresponding to the second pre-read frame number interval into a second cache block, wherein the first pre-read frame number interval and the second pre-read frame number interval are adjacent intervals; A processing module is used to obtain the Nth frame of ultrasonic image data from the first cache block, process the Nth frame of ultrasonic image data; and display the ultrasonic image corresponding to the processed Nth frame of ultrasonic image data in a display interface.