CT detector data transmission method and device and electronic equipment
Through data buffering programs and shared memory, the problems of high hardware memory requirements and poor software portability in CT detector data transmission are solved, timely data transmission and integrity are achieved, and the reliability of the system is improved.
Patent Information
- Application Number
- CN202510431704.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-22
AI Technical Summary
When ensuring the integrity of data reception, existing CT detector data transmission methods have problems such as high hardware memory requirements, poor software portability and risk of operating system crashes.
The data buffering program and shared memory are adopted to alternately access shared memory and dynamic memory lists in turn to realize timely transmission and storage of detector data, reduce hardware memory requirements, and improve software portability and reliability.
The timeliness and integrity of the detector data during CT scanning is realized, the data receiving device's requirements for hardware memory are reduced, and the software portability and reliability are improved.
Smart Images

Figure CN120356630A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data transmission, and particularly relates to a method, device and electronic device for CT detector data transmission. Background Art
[0002] Computed Tomography (CT) technology is widely used in the field of biomedical detection. As the core component of a CT system, a detector is responsible for receiving X-ray signals that penetrate the object to be detected and transmitting the acquired data through a communication interface. CT detectors have the characteristics of high sampling frequency and large data volume, and each acquired data corresponds to a specific X-ray projection angle, which is crucial for subsequent image reconstruction. Therefore, the transmission of CT detector raw data needs to meet the requirements of high throughput and high reliability.
[0003] Ethernet has become one of the main ways for detector data transmission due to its advantages such as high reliability, low cost, and fast transmission rate. At the data receiving end, in order to ensure the timeliness and integrity of the acquired data, the following two main methods are currently adopted.
[0004] The first method is to allocate a sufficiently large memory space on the receiving end processor to store all the acquired data of a single CT scan. During the scanning process, the received data is sequentially stored in this memory area. The disadvantage of this method is that it has high requirements for the processor memory, lacks flexibility in memory usage, and since the application program needs to read data from this memory, it must run in the same process as the data receiving program, which may cause the application program to occupy too much CPU resources and affect the integrity of data reception.
[0005] The second method is to implement the data receiving function at the operating system layer. This method can ensure that the data receiving program obtains sufficient CPU resources and guarantees the integrity of data reception. However, its disadvantages are that it involves the development of operating system drivers, which is difficult, has poor program portability, and there is a risk of the operating system crashing due to driver problems, and the risk of program update is also relatively high. Summary of the Invention
[0006] The object of the present invention is to provide a method, device and electronic device for CT detector data transmission, which overcome the disadvantages of the above two methods in the prior art, reduce the requirements for system hardware memory while ensuring the integrity of data reception, reduce the development difficulty of the software of the data receiving device, and improve the portability and reliability of the software.
[0007] To this end, in the first aspect of the present invention, a method for CT detector data transmission is provided, including the following steps: the data receiving program receives detector data and stores the detector data in a shared memory, and there are at least two shared memories;
[0008] Read the detector data in the shared memory through a data buffer program and send the detector data to the main application program.
[0009] Preferably, the data receiving program storing the detector data into the shared memory includes:
[0010] Access the shared memory alternately in turn, store the detector data in one shared memory, and when the detector data is stored to the maximum number in one shared memory, access the next shared memory to store the detector data.
[0011] Preferably, the storing the detector data in one shared memory and accessing the next shared memory to store the detector data when the detector data is stored to the maximum number in one shared memory includes:
[0012] Obtain the resource lock of the shared memory;
[0013] Receive the detector data and store it in the shared memory;
[0014] Judge whether the stored detector data in the shared memory reaches the maximum number. If the detector data is stored to the maximum number in the shared memory, release the resource lock of the shared memory.
[0015] Preferably, the reading the detector data in the shared memory through a data buffer program and sending the detector data to the main application program includes:
[0016] Access the shared memory alternately in turn, read the detector data in one shared memory, and after transmitting the detector data to the main application program through a dynamic memory list, access the next shared memory to read the detector data.
[0017] Preferably, the reading the detector data in one shared memory, transmitting the detector data to the main application program, and then accessing the next shared memory to read the detector data includes:
[0018] Obtain the resource lock of the shared memory;
[0019] Apply for dynamic memory, copy the detector data in the shared memory, and add the detector data to the dynamic memory list;
[0020] Release the resource lock of the shared memory.
[0021] Preferably, the main application program reads the dynamic memory list, parses the detector data, and then releases the dynamic memory.
[0022] In a second aspect, a CT detector data transmission device is provided, including:
[0023] A data receiving program for receiving detector data and storing the detector data in a shared memory, where there are at least two shared memories;
[0024] A data buffering program for reading the detector data in the shared memory and sending the detector data to a main application program.
[0025] Preferably, it further includes a data receiving process and an application process. The data receiving program is set in the data receiving process, and the data buffering program and the main application program are set in the application process.
[0026] Preferably, it further includes an operating system and system hardware. The detector data is received through the system hardware and sent to the data receiving process through the operating system.
[0027] In a third aspect, an electronic device is provided, including a memory and a processor;
[0028] The memory stores computer-executable instructions;
[0029] The processor executes the computer-executable instructions stored in the memory, so that the processor executes a CT detector data transmission method as claimed in the claims.
[0030] Advantageous effects:
[0031] 1. The present invention provides a CT detector data transmission method, device and electronic device. By setting a data buffering program and a shared memory to transmit CT detector data, the timeliness and integrity of detector data reception during CT scanning are achieved, the requirement of the data receiving device for hardware memory is reduced, and the portability and reliability of the software are improved.
[0032] 2. In the present invention, the detector data transmission from the data buffering program to the main application program is realized through a dynamic memory list. On the one hand, an asynchronous communication method between the data buffering program and the main application program is realized, and the operation process of the data buffering program is not affected by the main application program, so as to ensure that the data buffering program can timely read the data in the shared memory and avoid data loss between the data receiving process and the application process. On the other hand, within the application process, effective buffering of the detector data from the data buffering program to the main application program is realized, avoiding data loss caused by the response delay of the main application program. Description of the drawings
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0034] Figure 1 It is a flowchart of a method for data transmission of a CT detector in the present invention.
[0035] Figure 2 It is a program block diagram of an embodiment of a method for data transmission of a CT detector in the present invention.
[0036] Figure 3 It is a system structure diagram of a data transmission device of a CT detector in the present invention.
[0037] Figure 4 It is a schematic structural diagram of an electronic device in the present invention.
[0038] Figure 5 It is a system structure diagram of an implementation in the related art.
[0039] Figure 6 It is a system structure diagram of another implementation in the related art.
[0040] In the figure, 110 - application process, 111 - data buffer program, 120 - data receiving process, 121 - data receiving program, 112 - main application program, 130 - shared memory, 140 - operating system, 150 - system hardware, 200 - electronic device, 201 - processor, 202 - memory, 203 - communication component, 204 - bus. Specific Embodiments
[0041] The content of the present invention can be more easily understood by referring to the detailed description of the preferred implementation methods of the present invention below and the included embodiments. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present invention belongs. When there is a conflict, the definition in this specification shall prevail.
[0042] Embodiment 1:
[0043] Computed Tomography (CT) technology is widely used in the field of biomedical detection. As the core component of a CT system, the detector is responsible for receiving the X-ray signals that penetrate the object being detected and transmitting the acquired data through a communication interface. CT detectors have the characteristics of high sampling frequency and large data volume, and the data acquired each time corresponds to a specific X-ray projection angle, which is crucial for subsequent image reconstruction. Therefore, the transmission of the original data of CT detectors needs to meet the requirements of high throughput and high reliability.
[0044] Due to its advantages such as high reliability, low cost, and fast transmission rate, Ethernet has become one of the main ways for detector data transmission. At the data receiving end, in order to ensure the timeliness and integrity of the acquired data, the following two main methods are currently adopted.
[0045] As Figure 5 shown, the first method is to allocate a sufficiently large memory space on the receiving end processor to store all the acquired data of a single CT scan. During the scanning process, the received data is stored in this memory area in sequence. The disadvantage of this method is that it has high requirements for the processor memory, lacks flexibility in memory usage, and since the application program needs to read data from this memory, it must run in the same process as the data receiving program, which may cause the application program to occupy too much CPU resources and affect the integrity of data reception.
[0046] As Figure 6 shown, the second method is to implement the data receiving function at the operating system level. This method can ensure that the data receiving program obtains sufficient CPU resources to guarantee the integrity of data reception, but its disadvantages are that it involves the development of operating system drivers, which is difficult, the program portability is poor, and there is a risk of the operating system crashing due to driver problems, and the risk of program update is also relatively high.
[0047] As Figure 1 shown, in the first aspect of this embodiment, a method for CT detector data transmission is provided, including the following steps:
[0048] S100. The data receiving program receives the detector data and stores the detector data in shared memory, and there are at least two pieces of shared memory;
[0049] This includes: alternately accessing the shared memory, storing the detector data in one shared memory, and when the detector data is stored to the maximum number in one shared memory, accessing the next shared memory to store the detector data.
[0050] Specifically, it includes:
[0051] S110. Obtain the resource lock of the shared memory;
[0052] Among them, a Resource Lock is a synchronization mechanism used to control the access of multiple processes or threads to shared memory, ensuring that only one process can access the shared memory at the same time, thus avoiding consistency problems caused by competition between the data receiving program and the data caching program.
[0053] S120. Receive detector data and store it in the shared memory;
[0054] S130. Determine whether the detector data stored in the shared memory has reached the maximum quantity. If the detector data stored in the shared memory has reached the maximum quantity, release the resource lock of the shared memory.
[0055] S200. Read the detector data in the shared memory through the data buffering program and send the detector data to the main application program.
[0056] This includes alternately accessing the shared memory, reading detector data in a shared memory, and after transmitting the detector data to the main application program through the dynamic memory list, accessing the next shared memory to read detector data.
[0057] Specifically, it includes:
[0058] S210. Obtain the resource lock of the shared memory;
[0059] S220. Apply for dynamic memory, copy the detector data in the shared memory, and add the detector data to the dynamic memory list;
[0060] S230. Release the resource lock of the shared memory.
[0061] When the data receiving process is using the shared memory to receive the detector data packet, the data buffering program cannot obtain the resource lock, and this task will be in a suspended state, waiting for the access right to the shared memory. After the data receiving process releases the resource lock of the shared memory, the data buffering program will immediately start running under the scheduling of the operating system, obtain the resource lock of the shared memory, and read the valid detector data from the shared memory. After the data reading is completed, release the resource lock of the shared memory. Thus, efficient synchronization between the data receiving process and the application process and the transmission of detector data are achieved.
[0062] S300. The main application program reads the dynamic memory list, parses the detector data, and then releases the dynamic memory.
[0063] When the data buffering program reads the detector data in the shared memory, it applies for new dynamic memory according to the length of the data, adds the information of the dynamic memory containing the valid detector data to the list, and then sends a notification message to the main application program.
[0064] Such as Figure 2As shown, a specific example in one embodiment includes that there are two shared memories, which are respectively defined as SMem1 and SMem2 for easy distinction. The length of each shared memory is:
[0065] L smem = L sample *M + L header
[0066] where the length of the detector data message collected once is L sample , the number of data messages that each shared memory can store is M, and the basic information data length of the shared memory is L header .
[0067] After the data receiving program obtains the resource lock of SMem1, it receives the detector data and stores it in SMem1, and judges whether the number of data in SMem1 reaches M. If not, it continues to receive the detector data. If it reaches, it releases the resource lock of SMem1 and obtains the resource lock of SMem2. After the data receiving program obtains the resource lock of SMem2, it receives the detector data and stores it in SMem2, and judges whether the number of data in SMem2 reaches M. If not, it continues to receive the detector data. If it reaches, it releases the resource lock of SMem2 and obtains the resource lock of SMem1.
[0068] After the data receiving program releases the resource lock of SMem1, the data buffering program obtains the resource lock of SMem1, applies for dynamic memory, copies the detector data in SMem1, adds the detector data to the dynamic memory list, and then releases the resource lock of SMem1. After the data receiving program releases the resource lock of SMem2, the data buffering program obtains the resource lock of SMem2, applies for dynamic memory, copies the detector data in SMem2, adds the detector data to the dynamic memory list, and then releases the resource lock of SMem2.
[0069] The main application program reads the dynamic memory list, parses the detector data and then releases the dynamic memory.
[0070] As Figure 3 shown, in a second aspect, a CT detector data transmission device is provided, including:
[0071] A data receiving program 121, configured to receive detector data and store the detector data in a shared memory 130, and the shared memory 130 includes at least two;
[0072] A data buffering program 111, configured to read the detector data in the shared memory 130 and send the detector data to the main application program 112.
[0073] It also includes a data receiving process 120 and an application process 110. The data receiving program is set in the data receiving process 120, and the data buffering program 111 and the main application program 112 are set in the application process 110. The data receiving process 120 is set separately. The data receiving process 120 is only responsible for listening to and receiving detector data packets. Since the process occupies fixed CPU resources and the programs running in the process are simple, it can ensure the timeliness of the response to the detector data packets and avoid the loss of detector data.
[0074] It also includes an operating system 140 and system hardware 150. The detector data is received through the system hardware 150 and sent to the data receiving process 120 through the operating system 140.
[0075] The system hardware 150 includes a chip controller (CPU), a memory (RAM), and a hardware address (MAC). The operating system 140 includes a network protocol, and the network protocol can be TCP / IP optionally. The detector data is sent to the data receiving program through the hardware address via the Ethernet through the network protocol.
[0076] In a third aspect, as Figure 4 shown, there is provided an electronic device, which is characterized by including: a memory, a processor;
[0077] The memory stores computer-executable instructions;
[0078] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above method.
[0079] In one embodiment, the electronic device 200 includes: at least one processor 201 and a memory 202. Optionally, the electronic device 200 further includes a communication component 203. Among them, the processor 201, the memory 202, and the communication component 203 are connected through a bus 204.
[0080] In the specific implementation process, at least one processor 201 executes the computer-executable instructions stored in the memory 202, so that at least one processor 201 executes the above method.
[0081] For the specific implementation process of the processor 201, reference can be made to the above method embodiment. The implementation principle and technical effect are similar, and details are not described herein again.
[0082] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU for short), or other general-purpose processors, digital signal processors (DSP for short), application specific integrated circuits (ASIC for short), etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly implemented by the execution of the hardware processor, or implemented by the combination of the hardware and software modules in the processor.
[0083] The memory may include a high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk memory.
[0084] The bus may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0085] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for CT detector data transmission, characterized in that It includes the following steps: The data receiving program receives detector data and stores the detector data in shared memory, where there are at least two pieces of shared memory; The data buffer program reads the detector data in the shared memory and sends the detector data to the main application program.
2. The CT detector data transmission method according to claim 1, characterized in that The data receiving program storing the detector data in the shared memory includes: Alternately accessing the shared memory, storing detector data in one piece of shared memory. When the detector data stored in one piece of shared memory reaches the maximum quantity, access the next piece of shared memory to store the detector data.
3. A method for transmitting CT detector data according to claim 2, wherein, The storing detector data in one piece of shared memory and, when the detector data stored in one piece of shared memory reaches the maximum quantity, accessing the next piece of shared memory to store the detector data includes: Obtaining the resource lock of the shared memory; Receiving the detector data and storing it in the shared memory; Judging whether the detector data stored in the shared memory has reached the maximum quantity. If the detector data stored in the shared memory has reached the maximum quantity, releasing the resource lock of the shared memory.
4. A method for transmitting CT detector data according to claim 1, characterized in that, The data buffer program reading the detector data in the shared memory and sending the detector data to the main application program includes: Alternately accessing the shared memory, reading the detector data in one piece of shared memory. After transmitting the detector data to the main application program through the dynamic memory list, access the next piece of shared memory to read the detector data.
5. A method for CT detector data transmission according to claim 4, characterized in that The reading the detector data in one piece of shared memory and, after transmitting the detector data to the main application program, accessing the next piece of shared memory to read the detector data includes: Obtaining the resource lock of the shared memory; Applying for dynamic memory, copying the detector data in the shared memory, and adding the detector data to the dynamic memory list; Releasing the resource lock of the shared memory.
6. A method for CT detector data transmission according to claim 5, characterized in that, The main application program reads the dynamic memory list, parses the detector data, and then releases the dynamic memory.
7. A CT detector data transmission device, characterized in that, It includes: A data receiving program, which is used to receive detector data and store the detector data in shared memory, where there are at least two pieces of shared memory; A data buffer program, which is used to read the detector data in the shared memory and send the detector data to the main application program.
8. A CT detector data transmission device according to claim 7, characterized in that, It further includes a data receiving process and an application process. The data receiving program is set in the data receiving process, and the data buffer program and the main application program are set in the application process.
9. The CT detector data transmission device according to claim 8, characterized in that, It further includes an operating system and system hardware. The detector data is received through the system hardware and sent to the data receiving process through the operating system.
10. An electronic device, characterized in that, It includes a memory and a processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes a method according to any one of claims 1-6.