DICOM file processing method, device, computer equipment and storage medium

By parsing the header data of DICOM files and writing medical imaging data directly into the stream, it solves the problems of memory consumption and hardware resource requirements in processing large DICOM files, achieving memory performance optimization and hardware cost savings.

CN113808711BActive Publication Date: 2024-09-24SHANGHAI UNITED IMAGING METAHEALTHCARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110923288.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-12
Publication Date
2024-09-24
Estimated Expiration
2041-08-12

AI Technical Summary

Technical Problem

When processing large DICOM files, the existing technology needs to read the file completely into the memory or cache, resulting in a sharp increase in memory consumption, slow system response, and the need to frequently increase hardware resources to cope with large files, increasing costs and low performance problems. .

Method used

By parsing the header data of the DICOM file, only the header data is parsed into the memory, while the medical imaging data is written directly into the stream to be processed, avoiding parsing all the data into the memory, thus optimizing memory usage and hardware configuration.

Benefits of technology

It effectively maintains stable memory usage, improves memory performance, avoids the need for increased hardware resources due to large file sizes, expands the scope of applications, and saves hardware expenses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113808711B
    Figure CN113808711B
Patent Text Reader

Abstract

The present application relates to a DICOM file processing method, device, computer equipment and storage medium. The method includes: receiving a request sent by the other end, determining the service type of the request; obtaining a first processing stream; parsing the header data in the first processing stream; writing the parsed header data to a second processing stream, and processing the second processing stream. Since only the header data needs to be parsed into the memory, and the medical imaging data does not need to be parsed into the memory, but is directly written into the second processing stream to be processed, in the process of processing the DICOM file, it is possible to avoid parsing all the data into the memory, thereby maintaining stable use of the memory and improving memory usage performance. In addition, this method can make it possible to process the DICOM file without being limited by the size of the DICOM file, and there is no need to increase the hardware configuration for large-volume DICOM files, thereby expanding the scope of application and saving hardware expenses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of medical file processing, and in particular to a DICOM file processing method, apparatus, computer equipment and storage medium. Background Art

[0002] In the relevant medical information systems, for the support of DICOM (Digital Imaging and Communications in Medicine) protocol, no matter the underlying implementation of C++, C# or Java, there is no guarantee to fully support the reception and transmission of large files. In the relevant technology, when receiving or sending medical image files that support the DICOM protocol, it is necessary to read the DICOM file completely into the memory or generate a local cache file of the medical image in full before receiving or sending. The size of DICOM files generated by different medical imaging devices is also different. The size of many DICOM files will exceed 500M, and some DICOM files will be very large and even reach several G.

[0003] Since DICOM files are usually large, if the DICOM files are read into the memory in full each time they are processed, as the number of DICOM files increases and the frequency of processing DICOM files increases, the memory consumption will increase sharply and the response of the medical information system will become slower. Even if they are read into the local cache, the I / O read and write resources will increase, resulting in poor performance. In order to improve the response speed, it is necessary to increase hardware resources, which will bring higher costs. Summary of the invention

[0004] Based on this, it is necessary to provide a DICOM file processing method, device, computer equipment and storage medium that can improve the response speed in response to the above technical problems.

[0005] A DICOM file processing method, the method comprising:

[0006] Receive the request sent by the peer and determine the requested service type;

[0007] Obtaining a first processing stream;

[0008] Parsing header data in the first processing stream;

[0009] The parsed header data is written into a second processing stream, the second processing stream includes the unparsed medical image data in the first processing stream, and the second processing stream is processed.

[0010] In one of the embodiments, the service type is a storage service; accordingly, the first processing flow is a network flow sent by the peer end, and the second processing flow is a local file flow.

[0011] In one embodiment, the header data includes the record length of the unparsed medical image data; accordingly, before processing the second processing stream, the method further includes:

[0012] Determining the actual length of the unparsed medical imaging data;

[0013] If the record length is consistent with the actual length, the unparsed medical image data is obtained from the first processing stream, and the unparsed medical image data is written to the second processing stream.

[0014] In one of the embodiments, the service type is a forwarding service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is a network flow forwarded externally.

[0015] In one embodiment, before processing the second processing flow, the method further includes:

[0016] If the data content identical to the unparsed medical image data is stored locally, the medical image data stored locally is written to the second processing stream; if the data content identical to the unparsed medical image data is not stored locally, the unparsed medical image data is obtained from the first processing stream and written to the second processing stream.

[0017] In one embodiment, the header data includes a record length of the unparsed medical image data; accordingly, obtaining the unparsed medical image data from the first processing stream includes:

[0018] Determining the actual length of the unparsed medical imaging data;

[0019] If the record length is consistent with the actual length, unparsed medical image data is obtained from the first processing stream.

[0020] In one embodiment, processing the second processing stream includes:

[0021] According to the column storage database instruction, the second processing flow is sent externally.

[0022] A DICOM file processing device, the device comprising:

[0023] A receiving module, used to receive a request sent by the other end and determine the service type of the request;

[0024] A first acquisition module, used for acquiring a first processing flow;

[0025] A parsing module, used for parsing the header data in the first processing flow;

[0026] A first writing module, used for writing the parsed header data into a second processing stream, wherein the second processing stream includes the unparsed medical image data in the first processing stream;

[0027] The processing module is used to process the second processing flow.

[0028] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0029] Receive the request sent by the peer and determine the requested service type;

[0030] Obtaining a first processing stream;

[0031] Parsing header data in the first processing stream;

[0032] The parsed header data is written into a second processing stream, the second processing stream includes the unparsed medical image data in the first processing stream, and the second processing stream is processed.

[0033] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0034] Receive the request sent by the peer and determine the requested service type;

[0035] Obtaining a first processing stream;

[0036] Parsing header data in the first processing stream;

[0037] The parsed header data is written into a second processing stream, the second processing stream includes the unparsed medical image data in the first processing stream, and the second processing stream is processed.

[0038] The above-mentioned DICOM file processing method, device, computer equipment and storage medium determine the service type of the request by receiving the request sent by the other end. Obtain the first processing stream and parse the header data in the first processing stream. Write the parsed header data into the second processing stream, and process the second processing stream. Since only part of the non-medical image data in the first processing stream, that is, the header data, needs to be parsed into the memory, and the medical image data does not need to be parsed into the memory, but can be directly written into the second processing stream to be processed, in the process of processing the DICOM file, it is possible to avoid parsing all the data into the memory, thereby maintaining the stable use of the memory and improving the performance of the memory. In addition, this method can make it possible to process the DICOM file without being limited by the size of the DICOM file, and there is no need to increase the hardware configuration for large-volume DICOM files, thereby expanding the scope of application and saving hardware expenses. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 Schematic diagram of a DICOM file processing method in one embodiment;

[0040] Figure 2 is a flowchart of a DICOM file processing method in another embodiment;

[0041] Figure 3 is a flowchart of a DICOM file processing method in yet another embodiment;

[0042] Figure 4 A flowchart of a DICOM file processing method in another embodiment;

[0043] Figure 5 is a structural block diagram of a DICOM file processing device in one embodiment;

[0044] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0046] It is understood that the terms "first", "second", etc. used in this application can be used in this article to describe various professional terms, but unless otherwise specified, these professional terms are not limited by these terms. These terms are only used to distinguish one professional term from another professional term. For example, without departing from the scope of this application, the third preset threshold and the fourth preset threshold can be the same or different.

[0047] The DICOM protocol is an international standard for medical images and related information. It defines a medical image format that can be used for data exchange and has a quality that meets clinical needs. In the relevant technology, no matter whether it is the underlying implementation of C++, C#, or Java, there is no guarantee that large files can be fully supported for reception and transmission. Among them, for archived DICOM files, generally C-Store SCP (Service Class Provider), that is, the server end that supports the DICOM protocol for receiving files will parse all the received network streams into memory, and then write the data in the memory to the disk or the outgoing network stream, so that the memory usage rate of the server end will surge with the size of the DICOM file, resulting in the final server crash. For sent DICOM files, generally C-Store SCU (Service Class User), that is, the client end that supports the DICOM protocol for sending files will read all the DICOM files into memory, and then write them to the network stream, so that the memory usage rate of the client end will also surge with the size of the DICOM file, resulting in the client end being unable to send DICOM files normally.

[0048] Regardless of the above situation, as DICOM files become larger and larger, to ensure the normal operation of the system, it is necessary to continuously improve hardware resources, which will increase hardware costs. In addition, all data are parsed into memory, and a lot of unused data is parsed, which will lead to low overall performance during data storage and subsequent data processing. Therefore, there is an urgent need for a file transfer method that solves the above technical problems.

[0049] In view of the problems existing in the above-mentioned related technologies, an embodiment of the present invention provides a DICOM file processing method, which can be applied to a server. It should be noted that the number of "multiple" and the like mentioned in each embodiment of the present application refers to the number of "at least two", for example, "multiple" refers to "at least two".

[0050] In combination with the above description, in one embodiment, see Figure 1 , provides a DICOM file processing method. Taking the method applied to a server and the execution subject being the server as an example, the method includes the following steps:

[0051] 101. Receive a request sent by the peer end and determine the requested service type;

[0052] 102. Obtain a first processing flow;

[0053] 103. Parse the header data in the first processing flow;

[0054] 104. Write the parsed header data into a second processing stream, the second processing stream includes the unparsed medical image data in the first processing stream, and process the second processing stream.

[0055] In the above step 101, the other end may refer to the client, and the request may be sent by the client to the server in the form of a processing flow. The processing flow may include a data set and a command set generated based on the DICOM protocol format specification, and the data set is the first processing flow. Based on the command set, the server can learn the service type requested by the other end to provide corresponding processing, such as subsequent parsing processing. The service type can be divided into multiple types according to actual needs, which can be query service, storage service, acquisition service, sending service or deletion service, etc., and the embodiment of the present invention does not specifically limit this.

[0056] Before step 101, the client and the server may first establish a network connection. The embodiment of the present invention does not specifically limit the manner of establishing a network connection with the other end, including but not limited to: receiving a network connection establishment request sent by the other end; determining the service type requested by the other end based on the network connection establishment request; judging whether the service type is supported locally, and if supported, returning a confirmation message to the other end, and establishing a network connection with the other end. It should be noted that if the server does not locally support the service type requested by the other end, a rejection message will be returned to the other end, and a network communication connection will not be established with the other end. Among them, the server can support different service types by pre-configuring different operating environments.

[0057] In the above step 102, the first processing stream can be sent by the opposite end, that is, it can be sent by the client, and the first processing stream contains medical image data. In the above step 103, the header data in the first processing stream can be parsed based on the DICOM protocol format specification. Among them, the header data and the unparsed medical image data are distinguished based on the end mark in the first processing stream, so that the header data in the first processing stream can be parsed based on the end mark. Specifically, (7fe0,0010) can be used as the end mark, the data before the end mark is used as the header data, and the data after the end mark is used as the medical image data. In the actual implementation process, the parsing can be started from the starting position of the first processing stream until it is parsed to the end mark, and the parsed header data can be stored in the memory. In addition, the header data is usually 12 bytes, mainly including file meta information, that is, file meta tag. The file meta tag defines the transmission syntax, and the length of the medical image data in the DICOM file can be recorded at the same time.

[0058] In the above step 104, the type of the second processing stream and the processing method of the second processing stream correspond to the requested service type. The header data parsed in the above step 103 is written from the memory to the second processing stream. At the same time, in order to make the second processing stream include the unparsed medical image data in the first processing stream, the unparsed medical image data can also be written to the second processing stream. As for the data source of the unparsed medical image data in the second processing stream, it can be derived from the first processing stream or from the local, and the embodiment of the present invention does not specifically limit this.

[0059] The method provided by the embodiment of the present invention determines the service type of the request by receiving the request sent by the opposite end. A first processing stream is obtained, and the header data in the first processing stream is parsed. The parsed header data is written to the second processing stream, and the second processing stream is processed. Since only part of the non-medical imaging data in the first processing stream, that is, the header data, needs to be parsed into the memory, and the medical imaging data does not need to be parsed into the memory, but can be directly written into the second processing stream to be processed, in the process of processing the DICOM file, it is possible to avoid parsing all the data into the memory, thereby maintaining the stable use of the memory and improving the performance of the memory. In addition, this method can make it possible to process the DICOM file without being limited by the size of the DICOM file, and there is no need to increase the hardware configuration for large-volume DICOM files, thereby expanding the scope of application and saving hardware expenses.

[0060] In combination with the content of the above embodiments, in one embodiment, the service type is a storage service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is a local file flow.

[0061] The application scenario corresponding to the storage service is mainly that the client sends DICOM files to the server, and the server receives and saves the DICOM files. Specifically, a client that supports the DICOM protocol can send DICOM files to the server through C-Store. At this time, the first processing flow refers to the network flow sent by the client to the server. The network flow can specifically refer to the socket network flow. The embodiment of the present invention does not specifically limit the transmission protocol used for the network flow. The second processing flow is a local file flow, and the local file flow can be used to realize the local storage of DICOM files.

[0062] For ease of understanding, combined with the contents of the above embodiments, Figure 2 , now we explain the implementation process of storage service:

[0063] (1) The client sends a network connection establishment request A-SSOCIATE-RQ to the server. Since there may be many types of services requested through this request, the server will selectively return a confirmation message A-SSOCIATE-AC only for the service types that the server can support. At this point, a network connection is established between the server and the client. If the server does not support the service type requested by the client, the server will return a rejection message A-SSOCIATE-RJ.

[0064] (2) The client receives A-SSOCIATE-AC returned by the server, indicating that the client and the server have established a network connection. At this time, the client can send a processing stream P-DATA-TF (RQ) to the server, and P-DATA-TF (RQ) carries a command set and a data set. P-DATA-TF (RQ) can be specifically a socket network stream, and the server can listen through the socket port to receive the socket network stream. It should be noted that the socket network stream can be composed of segments of data, that is, segments, and each segment can have a maximum length limit. The socket network stream can first be the command set part and then the data set part. Among them, the first segment can be a command set and a partial data set, and the subsequent received segments can all be data sets.

[0065] It should also be noted that when the client sends the processing flow P-DATA-TF (RQ) to the server, it can be sent according to the column storage database instruction. The column storage database can be specifically C-Store, which is not specifically limited in the embodiment of the present invention. Among them, C-Store is a relational database designed for fast query. In order to achieve faster query performance, C-Store stores data by column. Different columns in the same table may be stored in different and possibly overlapping Projections. Among them, Projection refers to a collection of data storage columns.

[0066] (3) After receiving P-DATA-TF (RQ), the server can first parse the command set therein to determine the service type requested by the client, and then use a specific service to process the data set subsequently accessed in P-DATA-TF, that is, the first processing flow. In the related art, the processing method is to write all received data sets into the memory, resulting in excessive consumption of memory resources. Alternatively, the data is directly written into the local cache and then retrieved from the cache for subsequent use, resulting in a sharp increase in I / O (Input / Ouput) operations, reducing the system processing performance.

[0067] In order to avoid the above two situations, the present application mainly analyzes the characteristics of the components of each data element in the data set of the DICOM file based on the provisions of the DICOM standard on the DICOM file format, so as to de-memorize and de-cache the medical image data that describes part of the image information, that is, bypass the memory and cache, and directly establish a pipeline connection with the real destination, so as to realize fast and efficient processing of medical image data.

[0068] (4) The server side obtains the data set in P-DATA-TF (RQ), that is, the data part in the socket network stream (the first processing stream), and parses the header data in the first processing stream. It should be noted that in the embodiment of the present invention, the server side actually provides a storage service. In the actual implementation process, the server side can monitor the acquired network data, that is, it can dynamically acquire the required data from the socket network stream. For example, the above-mentioned dynamic acquisition method can be used in acquiring the command set and the first processing stream. Since acquiring network data is actually an I / O operation, the network data can be acquired using a blocking I / O mechanism and a non-blocking I / O mechanism, and the network data can also be acquired using a synchronous I / O mechanism and an asynchronous I / O mechanism.

[0069] The above two concepts of blocking I / O and non-blocking I / O are at the program level, and are mainly used to describe how the program should handle the problem if the I / O resources are not ready after the program requests the operating system I / O operation. Specifically, if the I / O resources are not ready, the blocking I / O mechanism will wait, while the non-blocking I / O mechanism will continue to execute, that is, it will use threads to poll until there are I / O resources ready.

[0070] The above-mentioned concepts of synchronous I / O and asynchronous I / O are at the operating system level, and mainly describe how the operating system responds to the program after receiving a program request for an I / O operation if the I / O resources are not ready. Specifically, if the I / O resources are not ready, the synchronous I / O will not respond until the I / O resources are ready. The asynchronous I / O will return a mark to mark the return target of the event after the subsequent I / O resource ready event is triggered. Through the above-mentioned different I / O mechanisms, the server side can parse the first processing stream segment by segment. Specifically, only the header data in the first processing stream is parsed, and the header data is usually 12 bytes and will not exceed 16Kb. Therefore, the header data can be cut out from the first processing stream through the end mark mentioned in the above embodiment, and the parsed header data can be recorded and saved.

[0071] (5) The server writes the parsed header data to the second processing stream, that is, to the local file stream of the server. At the same time, the unparsed medical image data in the first processing stream can also be written to the second processing stream. Finally, the DICOM file can be stored locally on the disk through the second processing stream. At this point, the storage service provided by the server ends. It should be noted that after this, the server can selectively return P-DATA-TF (RSP) to the client to indicate the end of the storage service as a reply response. After receiving P-DATA-TF (RSP), the client can send a network connection release request A-RELEASE-RQ to the server. After receiving A-RELEASE-RQ, the server can return A-RELEASE-RP to the terminal to indicate that the network connection between it and the client has been released.

[0072] The above content is the specific process when the service type is storage service. The brief process can also be referred to as follows Figure 3 , specifically including:

[0073] (1) Receive C-Store SCP receiving Socket network flow;

[0074] (2) Parse the command set in the Socket network stream;

[0075] (3) Parse the data set in the Socket network stream using the end marker as the demarcation point;

[0076] (4) Record 12 bytes of header data;

[0077] (5) Write the parsed header data and the unparsed medical image data in the Socket network stream into the second processing stream.

[0078] The method provided by the embodiment of the present invention can avoid excessive consumption of memory resources because it is not necessary to write all received data sets into the memory. At the same time, it is not necessary to write all received data sets into the local cache and then retrieve them from the local cache, thereby avoiding a sharp increase in I / O operations and reducing system processing performance.

[0079] In combination with the contents of the above embodiments, in one embodiment, the header data includes the record length of the unparsed medical image data; accordingly, before processing the second processing stream, it also includes: determining the actual length of the unparsed medical image data; if the record length is consistent with the actual length, obtaining the unparsed medical image data from the first processing stream, and writing the unparsed medical image data to the second processing stream.

[0080] It can be seen from the content of the above embodiment that the header data and the medical image data in the first processing flow are mainly distinguished by the end mark. In the embodiment of the present invention, statistics can be started from the end mark until the end position of the medical image data in the first processing flow, so that the actual length of the unparsed medical image data can be determined. Among them, the end position of the medical image data in the first processing flow can be a preset end mark, such as a preset character or a preset fixed byte position, and the embodiment of the present invention does not specifically limit this.

[0081] When the service type is storage service, the data source of the unresolved medical image data is the first processing stream, so the unresolved medical image data needs to be obtained from the first processing stream. Therefore, in the above process, the record length can be compared with the actual length first. If the two are inconsistent, the unresolved medical image data cannot be obtained from the first processing stream. At this time, a resend message can be returned to the client so that the client resends the first processing stream. If the two are consistent, the unresolved medical image data can be obtained from the first processing stream, and the unresolved medical image data can be written to the second processing stream without going through the memory or local cache.

[0082] The method provided by the embodiment of the present invention determines the actual length of the unparsed medical image data, and if the record length is consistent with the actual length, obtains the unparsed medical image data from the first processing stream and writes the unparsed medical image data to the second processing stream. Since the judgment result of whether the actual length of the medical image data is consistent with the record length can be used to indicate whether the medical image data is wrong, through the above judgment process, it is possible to avoid writing wrong medical image data into the second processing stream, thereby ensuring the accuracy of the data when it is subsequently written to the local disk.

[0083] In combination with the content of the above embodiments, in one embodiment, the service type is a forwarding service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is a network flow forwarded externally.

[0084] The application scenario corresponding to the forwarding service is mainly that the client sends a DICOM file to the server, and the server forwards it to other clients or other servers after receiving it. Specifically, a client that supports the DICOM protocol can send a DICOM file to the server through C-Store. At this time, the first processing flow refers to the network flow sent by the client to the server. The network flow can also specifically refer to a socket network flow. The embodiment of the present invention does not specifically limit the transmission protocol used for the network flow. The second processing flow is the network flow forwarded externally by the server. Through the network flow forwarded externally, the DICOM file can be forwarded to other clients or servers.

[0085] The method provided by the embodiment of the present invention can avoid excessive consumption of memory resources because it is not necessary to write all received data sets into the memory. At the same time, it is not necessary to write all received data sets into the local cache and then retrieve them from the local cache, thereby avoiding a sharp increase in I / O operations and reducing system processing performance.

[0086] In combination with the contents of the above embodiments, in one embodiment, before processing the second processing stream, it also includes: if the data content identical to the unparsed medical image data is stored locally, the locally stored medical image data is written to the second processing stream; if the data content identical to the unparsed medical image data is not stored locally, the unparsed medical image data is obtained from the first processing stream, and the unparsed medical image data is written to the second processing stream.

[0087] As can be seen from the above embodiments, the service type in the embodiment of the present invention is a forwarding service, that is, the client sends the DICOM file to a server, and the server forwards the DICOM file to other clients or servers. Among them, after the client sends the DICOM file to a server, the server may not store the DICOM file in advance, or may have stored the DICOM file. Therefore, for different situations, there are different processing procedures in the embodiment of the present invention. When judging whether the data content that is the same as the unparsed medical image data is stored locally, it can be judged according to the parsed header data. Specifically, the parsed header data stores identification data that is uniquely corresponding to the medical image data, such as tag data, including image width, height, data transmission format, patient name, patient birthday, medical record hospital, medical record department, description of the condition, and the like. For a certain medical image data, if it is necessary to judge whether the medical image data has been stored locally, then find whether the tag data of the medical image data has been stored locally. If it has been stored, it indicates that the medical image data has been stored locally. If it has not been stored, it indicates that the medical image data has not been stored locally.

[0088] For ease of understanding, combined with the contents of the above embodiments, Figure 2 , now the implementation process of the forwarding service is explained:

[0089] (1) The client sends a network connection establishment request A-SSOCIATE-RQ to the server. Since there may be many types of services requested through this request, the server will selectively return a confirmation message A-SSOCIATE-AC only for the service types that the server can support. At this point, a network connection is established between the server and the client. If the server does not support the service type requested by the client, the server will return a rejection message A-SSOCIATE-RJ.

[0090] (2) The client receives A-SSOCIATE-AC returned by the server, indicating that the client and the server have established a network connection. At this time, the client can send a processing stream P-DATA-TF (RQ) to the server, and P-DATA-TF (RQ) carries a command set and a data set. P-DATA-TF (RQ) can be specifically a socket network stream, and the server can listen through the socket port to receive the socket network stream. It should be noted that the socket network stream can be composed of segments of data, that is, segments, and each segment can have a maximum length limit. The socket network stream can first be the command set part and then the data set part. Among them, the first segment can be a command set and a part of the data set, and the subsequent received segments can all be data sets.

[0091] It should also be noted that the client may send the processing flow P-DATA-TF (RQ) to the server according to the C-Store instruction, which is not specifically limited in the embodiment of the present invention. C-Store is a relational database designed for fast query. In order to achieve faster query performance, C-Store stores data by column. Different columns in the same table may be stored in different and possibly overlapping Projections.

[0092] (3) After receiving P-DATA-TF (RQ), the server can first parse the command set therein to determine the service type requested by the client, and then use a specific service to process the data set subsequently accessed in P-DATA-TF, that is, the first processing flow. In the related art, the processing method is to write all received data sets into the memory, resulting in excessive consumption of memory resources. Alternatively, the data is directly written into the local cache and then retrieved from the cache for subsequent use, resulting in a sharp increase in I / O operations and reduced system processing performance.

[0093] In order to avoid the above two situations, the present application mainly analyzes the characteristics of the components of each data element in the data set of the DICOM file based on the provisions of the DICOM standard on the DICOM file format, so as to de-memorize and de-cache the medical image data that describes part of the image information, that is, bypass the memory and cache, and directly establish a pipeline connection with the real destination, so as to realize fast and efficient processing of medical image data.

[0094] (4) The data set in P-DATA-TF (RQ), that is, the data part in the socket network stream, is the first processing stream. Since the unparsed medical image data in the first processing stream may or may not be stored on the server side, the server side can determine whether the local side stores medical image data with the same content as the unparsed medical image data based on the parsed header data.

[0095] Medical image data can be verified by a check code, and each medical image data can correspond to a unique check code. Based on this, the embodiment of the present invention does not specifically limit the method of determining whether medical image data with the same content as the unresolved medical image data is stored locally based on the resolved header data, including but not limited to: obtaining the check code corresponding to the unresolved medical image data; comparing the check code with the check code corresponding to the medical image data stored locally; if the same check code exists, it is determined that the medical image data identical to the unresolved medical image data is stored locally, and if the same check code does not exist, it is determined that the medical image data identical to the unresolved medical image data is not stored locally.

[0096] (5) If the server determines that the same medical image data as the unparsed medical image data is stored locally, the parsed header data is written into the second processing flow, that is, written into the network flow to be forwarded externally, and the same medical image data as the unparsed medical image data is written into the second processing flow. If the server determines that the same medical image data as the unparsed medical image data is not stored locally, the parsed header data is written into the second processing flow, that is, written into the network flow to be forwarded externally, and the unparsed medical image data in the first processing flow is written into the second processing flow. After this, the DICOM file can be forwarded externally through the second processing flow.

[0097] At this point, the storage service provided by the server has ended. It should be noted that after this, the server can selectively return P-DATA-TF (RSP) to the client to indicate the end of the storage service as a reply response. After receiving P-DATA-TF (RSP), the client can send a network connection release request A-RELEASE-RQ to the server. After receiving A-RELEASE-RQ, the server can return A-RELEASE-RP to the terminal to indicate that it is determined to release the network connection between it and the client.

[0098] It should also be noted that the above process only indicates the end of data transmission between the client and the server. The server needs to forward the DICOM file to other clients or other servers, so the server needs to establish a network connection with the destination. The specific process can be referred to the data transmission process between the client and the server, which will not be repeated here.

[0099] The above content is the specific process when the service type is forwarding service. Taking the medical image data stored locally on the server as an example, the same as the unparsed medical image data, the brief process can also be referred to as follows Figure 4 , specifically including:

[0100] (1) Establishing a DICOM file stream; It should be noted that, since the server has locally stored the same medical image data as the unparsed medical image data, in order to write it into the second processing stream, it is necessary to first establish a DICOM file stream of the medical image data;

[0101] (2) Parsing the file metadata of the DICOM file stream; it should be noted that since it is no longer a network stream, the file metadata no longer exists in the header data.

[0102] (3) Writing the parsed file meta-information and the unparsed medical image data in the DICOM file stream into the second processing stream; it should be noted that the second processing stream may be a Socket network stream sent externally.

[0103] (4) Send the second processing flow outward.

[0104] The method provided by the embodiment of the present invention can avoid excessive consumption of memory resources because it is not necessary to write all received data sets into the memory. At the same time, because it is not necessary to write all received data sets into the local cache and then retrieve them from the local cache, it is possible to avoid a sharp increase in I / O operations and a decrease in system processing performance. In addition, because it is possible to select the data source when writing the medical image data into the second processing flow according to whether the server side serving as the forwarding relay stores the medical image data to be forwarded, it is possible to improve the fault tolerance rate when forwarding data.

[0105] In combination with the contents of the above embodiments, in one embodiment, the header data includes the record length of the unparsed medical image data; accordingly, obtaining the unparsed medical image data from the first processing stream includes: determining the actual length of the unparsed medical image data; if the record length is consistent with the actual length, obtaining the unparsed medical image data from the first processing stream.

[0106] It can be seen from the content of the above embodiment that the header data and the medical image data in the first processing flow are mainly distinguished by the end mark. In the embodiment of the present invention, statistics can be started from the end mark until the end position of the medical image data in the first processing flow, so that the actual length of the unparsed medical image data can be determined. Among them, the end position of the medical image data in the first processing flow can be a preset end mark, such as a preset character or a preset fixed byte position, and the embodiment of the present invention does not specifically limit this.

[0107] When the service type is a forwarding service, the data source of the unresolved medical image data is the first processing stream or the local file stream. When the data source is not the first processing stream, the unresolved medical image data needs to be obtained from the first processing stream. Therefore, in the above process, the record length can be compared with the actual length first. If the two are inconsistent, the unresolved medical image data cannot be obtained from the first processing stream. At this time, a resend message can be returned to the client so that the client resends the first processing stream. If the two are consistent, the unresolved medical image data can be obtained from the first processing stream, and the unresolved medical image data can be written to the second processing stream without going through the memory or local cache.

[0108] The method provided by the embodiment of the present invention determines the actual length of the unresolved medical image data, and if the record length is consistent with the actual length, the unresolved medical image data is obtained from the first processing stream, and the unresolved medical image data is written into the second processing stream. Since the judgment result of whether the actual length of the medical image data is consistent with the record length can be used to indicate whether the medical image data is wrong, through the above judgment process, it is possible to avoid writing wrong medical image data into the second processing stream, thereby ensuring the data accuracy when the second processing stream is subsequently processed.

[0109] In combination with the content of the above embodiments, in one embodiment, the embodiment of the present invention does not specifically limit the manner of processing the second processing flow, including but not limited to: sending the second processing flow externally according to the column storage database instruction.

[0110] The column storage database may be a C-Store. In addition, the storage service and forwarding service may be executed concurrently between different clients and servers, so that in the embodiment of the present invention, the concurrency of C-Store instructions may be continuously improved, and DICOM files may be quickly transmitted under the DICOM protocol. At the same time, combined with the process in the above embodiment, the entire service system composed of the client and the server may achieve a higher throughput.

[0111] The method provided by the embodiment of the present invention adopts the C-Store database to store DICOM files, and the length of the C-Store database columns is fixed, so that memory alignment does not need to be considered in database implementation to avoid data crossing boundaries, resulting in the need to access the memory twice for processing one data. Therefore, data elements can be encoded into the most effective form without being limited by the size of the DICOM file.

[0112] It should be understood that although Figures 1 to 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 1 to 4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0113] It should be noted that the technical solutions described above can be implemented as independent embodiments in the actual implementation process, or they can be combined with each other and implemented as a combined embodiment. In addition, when describing the contents of the above embodiments of the present invention, different embodiments are described in a corresponding order based on the idea of ​​convenient description, such as the order of data flow, instead of limiting the execution order between different embodiments. Accordingly, in the actual implementation process, if it is necessary to implement multiple embodiments provided by the present invention, it is not necessary to follow the execution order provided when the embodiments are described by the present invention, but the execution order between different embodiments can be arranged according to the needs.

[0114] In combination with the contents of the above embodiments, in one embodiment, Figure 5 As shown, a DICOM file processing device is provided, comprising: a receiving module 501, an acquisition module 502, a parsing module 503, a first writing module 504 and a processing module 505, wherein:

[0115] The receiving module 501 is used to receive a request sent by the peer end and determine the service type of the request;

[0116] A first acquisition module 502, used to acquire a first processing flow;

[0117] A parsing module 503, used for parsing the header data in the first processing flow;

[0118] A first writing module 504, used to write the parsed header data into a second processing stream, the second processing stream including the unparsed medical image data in the first processing stream;

[0119] The processing module 505 is used to process the second processing flow.

[0120] In one embodiment, the service type is a storage service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is a local file flow.

[0121] In one embodiment, the header data includes the record length of the unparsed medical image data; accordingly, the apparatus further includes:

[0122] A first determination module, used to determine the actual length of the unparsed medical image data;

[0123] The second writing module is used to obtain the unparsed medical image data from the first processing stream and write the unparsed medical image data into the second processing stream when the record length is consistent with the actual length.

[0124] In one embodiment, the service type is a forwarding service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is a network flow forwarded externally.

[0125] In one embodiment, the apparatus further comprises:

[0126] The third writing module is used to write the locally stored medical image data into the second processing stream when the data content identical to the unparsed medical image data is stored locally; if the data content identical to the unparsed medical image data is not stored locally, obtain the unparsed medical image data from the first processing stream and write the unparsed medical image data into the second processing stream.

[0127] In one embodiment, the header data includes a record length of the unparsed medical image data; accordingly, the second acquisition module is used to determine the actual length of the unparsed medical image data; if the record length is consistent with the actual length, the unparsed medical image data is acquired from the first processing stream.

[0128] In one embodiment, the processing module 505 is used to send the second processing flow externally according to the column storage database instruction.

[0129] The device provided by the embodiment of the present invention determines the service type of the request by receiving the request sent by the opposite end. A first processing stream is obtained, and the header data in the first processing stream is parsed. The parsed header data is written to the second processing stream, and the second processing stream is processed. Since only part of the non-medical imaging data in the first processing stream, that is, the header data, needs to be parsed into the memory, and the medical imaging data does not need to be parsed into the memory, but can be directly written into the second processing stream to be processed, in the process of processing the DICOM file, it is possible to avoid parsing all the data into the memory, thereby maintaining the stable use of the memory and improving the performance of the memory. In addition, this method can make it possible to process the DICOM file without being limited by the size of the DICOM file, and there is no need to increase the hardware configuration for large-volume DICOM files, thereby expanding the scope of application and saving hardware expenses.

[0130] The specific definition of the DICOM file processing device can be found in the definition of the DICOM file processing method above, which will not be repeated here. Each module in the above DICOM file processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0131] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset thresholds. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a DICOM file processing method is implemented.

[0132] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0133] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0134] Receive the request sent by the peer and determine the requested service type;

[0135] Obtaining a first processing stream;

[0136] Parsing header data in the first processing stream;

[0137] The parsed header data is written into a second processing stream, the second processing stream includes the unparsed medical image data in the first processing stream, and the second processing stream is processed.

[0138] In one embodiment, when the processor executes the computer program, the service type is a storage service; accordingly, the first processing flow is a network flow sent by the peer end, and the second processing flow is a local file flow.

[0139] In one embodiment, the header data includes the record length of the unparsed medical imaging data; accordingly, when the processor executes the computer program, the following steps are also implemented: determining the actual length of the unparsed medical imaging data; if the record length is consistent with the actual length, obtaining the unparsed medical imaging data from the first processing stream, and writing the unparsed medical imaging data to the second processing stream.

[0140] In one embodiment, when the processor executes the computer program, the service type is a forwarding service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is a network flow forwarded externally.

[0141] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the data content identical to the unparsed medical image data is stored locally, the locally stored medical image data is written to the second processing stream; if the data content identical to the unparsed medical image data is not stored locally, the unparsed medical image data is obtained from the first processing stream, and the unparsed medical image data is written to the second processing stream.

[0142] In one embodiment, the header data includes the record length of the unparsed medical imaging data; accordingly, when the processor executes the computer program, the following steps are also implemented: determining the actual length of the unparsed medical imaging data; if the record length is consistent with the actual length, obtaining the unparsed medical imaging data from the first processing stream.

[0143] In one embodiment, when the processor executes the computer program, the following steps are further implemented: according to the column storage database instruction, the second processing flow is sent externally.

[0144] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0145] Receive the request sent by the peer and determine the requested service type;

[0146] Obtaining a first processing stream;

[0147] Parsing header data in the first processing stream;

[0148] The parsed header data is written into a second processing stream, the second processing stream includes the unparsed medical image data in the first processing stream, and the second processing stream is processed.

[0149] In one embodiment, when the computer program is executed by the processor, the service type is a storage service; accordingly, the first processing flow is a network flow sent by the peer end, and the second processing flow is a local file flow.

[0150] In one embodiment, the header data includes the record length of the unparsed medical imaging data; accordingly, when the computer program is executed by the processor, the following steps are also implemented: determining the actual length of the unparsed medical imaging data; if the record length is consistent with the actual length, obtaining the unparsed medical imaging data from the first processing stream, and writing the unparsed medical imaging data to the second processing stream.

[0151] In one embodiment, when the computer program is executed by the processor, the service type is a forwarding service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is a network flow forwarded externally.

[0152] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0153] If the data content identical to the unparsed medical image data is stored locally, the medical image data stored locally is written to the second processing stream; if the data content identical to the unparsed medical image data is not stored locally, the unparsed medical image data is obtained from the first processing stream and written to the second processing stream.

[0154] In one embodiment, the header data includes the record length of the unparsed medical image data; accordingly, when the computer program is executed by the processor, the following steps are also implemented:

[0155] Determining the actual length of the unparsed medical imaging data;

[0156] If the record length is consistent with the actual length, unparsed medical image data is obtained from the first processing stream.

[0157] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: according to the column storage database instruction, the second processing flow is sent externally.

[0158] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this specification.

[0160] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A DICOM file processing method, characterized in that: The method comprises: Receive the request sent by the peer and determine the requested service type; Obtaining a first processing stream; Parsing the header data in the first processing flow into memory; Writing the parsed header data from the memory to a second processing stream, the second processing stream including the unparsed medical image data in the first processing stream, and performing processing corresponding to the service type on the second processing stream; Wherein, the unparsed medical image data in the second processing flow is obtained from the first processing flow or from the medical image data stored locally; Before processing the second processing flow, the method further includes: If the data content identical to the unparsed medical image data is stored locally, the medical image data stored locally is written to the second processing stream; if the data content identical to the unparsed medical image data is not stored locally, the unparsed medical image data is obtained from the first processing stream and written to the second processing stream.

2. The method according to claim 1, characterized in that The service type is a storage service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is the local file flow.

3. The method according to claim 2, characterized in that The header data includes the record length of the unparsed medical image data; accordingly, before processing the second processing stream, the method further includes: Determining an actual length of the unparsed medical image data; If the record length is consistent with the actual length, the unparsed medical image data is obtained from the first processing stream, and the unparsed medical image data is written to the second processing stream.

4. The method according to claim 1, characterized in that: The service type is a forwarding service; accordingly, the first processing flow is a network flow sent by the opposite end, and the second processing flow is a network flow forwarded externally.

5. The method according to any one of claims 1 to 4, characterized in that: The header data includes the record length of the unparsed medical image data; accordingly, obtaining the unparsed medical image data from the first processing stream includes: Determining an actual length of the unparsed medical image data; If the record length is consistent with the actual length, the unparsed medical image data is obtained from the first processing stream.

6. The method according to claim 4, characterized in that The processing of the second processing flow includes: The second processing flow is sent externally according to the column storage database instruction.

7. A DICOM file processing device, characterized in that: The device comprises: A receiving module, used to receive a request sent by the other end and determine the service type of the request; A first acquisition module, used for acquiring a first processing flow; A parsing module, used for parsing the header data in the first processing flow into a memory; a first writing module, used for writing the parsed header data from the memory to a second processing stream, wherein the second processing stream includes the unparsed medical image data in the first processing stream; A processing module, configured to perform processing corresponding to the service type on the second processing flow; Wherein, the unparsed medical image data in the second processing flow is obtained from the first processing flow or from the medical image data stored locally; The device is also used for, before processing the second processing stream, if data content identical to the unparsed medical image data is stored locally, writing the locally stored medical image data into the second processing stream; if data content identical to the unparsed medical image data is not stored locally, obtaining the unparsed medical image data from the first processing stream and writing the unparsed medical image data into the second processing stream.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.