A kind of PET control network communicating system and method
Technical field
The invention belongs to the communications field more particularly to a kind of PET control network communicating system and methods.
Background technique
Positron emission computed tomography (PositronEmission Tomography, PET) technology is core doctor
The more advanced clinical examination image technology in field, needs to detect high rate photon, high rate photon signal is changed into
Voltage signal is changed into digital signal to voltage signal sampling, and the digital data transmission to computer, computer is according to specific calculation
Digital signal is reassembled into projected image by method.
PET system includes front end data sampling system and Back end data Transmission system, and front end data sampling system will be a pair of
Photon is transformed into voltage signal and carries out high-speed sampling, obtains high speed, the data of large capacity, the realization of Back end data Transmission system will be high
Speed, Large Volume Data are transmitted to central computer.
During PET host is run, host monitor module is also communicated with monitoring outlay by network foundation, is received external
Monitoring device orders monitoring, modification and inquiry of PET host relevant parameter etc..Between external equipment and host monitor module
Data interaction must defer to the network communication protocol of agreement.PET control related data interaction relates generally to various request of data or shape
A kind of state report, its main feature is that data volume is smaller, to reliability requirement height, it is therefore desirable to more reasonable communication protocol satisfaction
PET control network is more effectively reliably communicated.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of PET control network communicating system and method, can at least overcome existing
There is the segmental defect of technology.
The present embodiments relate to a kind of PET control network communicating system, comprising: monitoring outlay and PET monitoring
Module;
The monitoring outlay sends data request information to the PET monitoring module;
The PET monitoring module sends datagram to the monitoring outlay accuses message, and is receiving the PET
Response is replied after the data request information that monitoring module is sent to reply message;
The data request information, it is described response reply message and the data report message in include type of message,
Information order word, number of parameters and parameter;The message type part is the marker in the data interaction direction of the message;Institute
State the marker for the operational order type that information order character segment is the message;The number of parameters part is in the message
The marker of the number for the parameter that inquiry or operation/order are related to;The argument section includes the information query or operation/life
Enable the data volume and corresponding parameter attribute code of the parameter being related to.
The present embodiments relate to a kind of PET control network communication method, comprising:
Monitoring outlay sends data request information message to PET monitoring module;
After the PET monitoring module receives the data request information, relevant parameter information is collected, response is packaged into and replys
Message packet replies to the monitoring outlay;
The message packet includes the data volume and corresponding parameter attribute code for the parameter that the data request information is related to, and is led to
Type of message mark data interaction direction is crossed, the type requested by information order word mark data is identified by number of parameters
The number of parameter involved in the message packet.
A kind of PET provided in an embodiment of the present invention controls network communicating system and the beneficial effect of method includes:
A kind of PET control network communicating system provided by the invention and method, set according to the actual conditions that PET controls network
The characteristics of fixed communication protocol has data volume small, high reliablity, suitable for PET control network communication more quick and safe
Communication.
It may include multiple parameters in data request information, reduce message packet and transmit number, improve interactive efficiency.PET
The response that monitoring module is replied, which replies message, to be the format of single or multiple message, when PET monitoring module is to request of data
When a part of parameter collection time is longer in message or collects failure, can first it be received to monitoring outlay reply
The response of the parameter of collection replies message, and transmits the data that can be inquired in time, while monitoring personnel can understand PET more in time
Monitoring module processing parameter there are the problem of and do timely processing.Inquiry or operation/order involved in data request information
When two or more parameters are that single parameter type serializes inquiry request, operational order type can be set as to special
Determine the data query in section, agreement additional parameter identifies the head and the tail in section respectively, and number of parameters is in data request information at this time
2, it can reduce the size of data inquiry request message, the more succinct inquiry for sending multiple parameters to PET monitoring module disappears
Breath.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is the schematic diagram of the embodiment of PET control communication unit parameter query interacting message provided by the invention;
Fig. 2 is the schematic diagram of the embodiment one of PET control communication multiple parameters query messages interaction provided by the invention;
Fig. 3 is the schematic diagram of the embodiment two of PET control communication multiple parameters query messages interaction provided by the invention;
Fig. 4 is the schematic diagram of the embodiment three of PET control communication multiple parameters query messages interaction provided by the invention;
Fig. 5 is the schematic diagram of the example IV of PET control communication multiple parameters query messages interaction provided by the invention;
Fig. 6 is that the embodiment of the format of message packet is shown in a kind of PET control network communicating system provided by the invention
It is intended to.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment one
Embodiment one provided by the invention is the embodiment that a kind of PET provided by the invention controls network communicating system.
The communication system includes: monitoring outlay and PET monitoring module.
Monitoring outlay sends data request information to PET monitoring module.
PET monitoring module sends datagram to monitoring outlay accuses message, and sends receiving PET monitoring module
Data request information after reply response reply message.
The data request information, response reply message in data report message include type of message, information order word,
Number of parameters and parameter, the message type part are the marker in the data interaction direction of the message, and information order character segment is
The marker of the operational order type of the message, number of parameters part are the parameter that inquiry or operation/order are related in message
The marker of number, the data volume and character pair code of the parameter that argument section includes the information query or operation/order is related to.
Specifically, the interactive process in PET control network between PET monitoring module and monitoring outlay includes: outside
Monitoring device sends status query request to PET monitoring module, and the status query request is replied in the response of PET monitoring module;It is external
Monitoring device sends operation/command request to PET monitoring module, and the operation/command request is replied in the response of PET monitoring module;PET
Monitoring module actively sends data or state report to monitoring outlay.
It is as shown in table 1 type of message type table provided by the invention.
Title |
It encodes (16bit) |
Associated description |
REQ |
0x0001 |
The status query request initiated by monitoring outlay |
ACK |
0x0002 |
By PET monitoring module responsive state inquiry request or operation/command request |
CMD |
0x0004 |
Operation/the command request initiated by monitoring outlay |
RPT |
0x0010 |
The data or state report actively initiated by PET monitoring module |
… |
… |
… |
Table 1: type of message type table
As shown in Table 1, type of message mark message data interaction direction include: status query request (REQ pseudo-code),
Operation/command request (CMD pseudo-code), status inquiry or operation/command request response (ACK pseudo-code) and data or state report
(RPT pseudo-code) etc..Wherein status query request and operation/command request are what monitoring outlay was initiated to PET monitoring module,
Status inquiry or operation/command request response and data or state report be PET monitoring module replied to monitoring outlay or
What person actively initiated.
It is as shown in table 2 information order word type table provided by the invention.
Table 2: information order word type table
The operational order type of information order word mark includes query argument (GET) and setup parameter (SET) etc..Such as table 3
Parameter format table provided by the invention and parameter type table are shown with table 4.
Table 3: parameter format table
Table 4: parameter type table
By table 3 and table 4 it is found that argument section further includes parameter identification code, reservation and data body length, parameter type includes
X module, the voltage of Y module and Z module, temperature, rotation speed of the fan etc., which module indicates that the message needs to inquire or operate is
Which parameter.
Number of parameters not restriction in each message, when needing to express multiple operation requests, and these requests can belong to
When identical theme, it both can choose and these operation requests be respectively packaged into independent message, can also have been incited somebody to action by parameter combination
It merges into single message.For example it is assumed that needing to inquire the voltage of some submodule, temperature, rotation speed of the fan etc., because of its operation master
Topic is parameter query, and corresponding information order word is identical, can be expressed by the inclusion of the message format of multiple parameters.
The schematic diagram of the embodiment of communication unit parameter query interacting message is controlled for PET provided by the invention as shown in Figure 1.
As shown in Figure 1, data request information, response replies message and inquiry or the parameter that is related to of operation/order in data report message
Number when being 1, number of parameters is 1 in message, and argument section is the data volume and character pair code of this parameter.
It is as shown in Figures 2 and 3 respectively the implementation of PET control communication multiple parameters query messages interaction provided by the invention
The schematic diagram of example one and embodiment two, from Fig. 2 and Fig. 3 it is found that monitoring outlay by way of combination to PET monitoring module
When sending in status query request or operation/command request message comprising two or more parameters, PET monitoring module is received
To after the request of multiple parameters query composition, relevant parameter information is collected, parameter sequence to be checked can be arranged according to actual needs
The response sequence of column.Both all parameter states can be collected and is finished, be then combined into single message and replied;Certain parameters
Acquisition time is longer or occurs collecting failure, can be replied by the way of gradation at this time, preference return other parameters.If
No particular protocol is arranged, and the relative ranks in request message and response message between parameter need not be consistent, and can be passed through
Parameter attribute code mark.
It is illustrated in figure 4 showing for the embodiment three of PET control communication multiple parameters query messages interaction provided by the invention
It is intended to, the multiple queries that timesharing reaches is requested, when inquiry request frequency is higher, and PET monitoring module answer speed can not
It is contemplated that in such a way that parameter combination is at single message and is replied when matching, carry out appropriate optimization.
Preferably, it is illustrated in figure 5 the embodiment of PET control communication multiple parameters query messages interaction provided by the invention
Four schematic diagram, as shown in Figure 5, by protocol conventions, combination parameter message also can be applied to single parameter type serializing
Inquiry request and response, for example, inquiring one group of contact potential series of some submodule, sequence address number is 0,1,2 ..., N-1, N,
The target component of request is voltage, and only Address d istribution is different.The operational order type of information order word mark further includes spy
Determine the data query (GETARRAY) in section, agreement additional parameter identifies the head and the tail in section respectively, at this time in data request information
Number of parameters is 2, and argument section is the data volume and character pair code of initial parameters 0 and terminal parameter N.The corresponding response replied
Combination or gradation mode (mode replied in the embodiment that Fig. 4 is provided for combination), the sound can be used by replying message
It is N+1 that middle number of parameters, which should be replied message, and argument section is N+1 parameter of the corresponding initial parameters 0 to terminal parameter N
Data volume and character pair code.
Further, in a kind of PET control network communicating system provided by the invention, monitoring outlay and PET monitoring
It is interacted, is illustrated in figure 6 in a kind of PET control network communicating system provided by the invention by message packet between module
The schematic diagram of the embodiment of the format of message packet, it will be appreciated from fig. 6 that message packet includes stem, passes in PET control communication system
Defeated packet and tail portion, multiple message composition message sequences are set in transmission packet.Message packet can be divided into biography according to hierarchical structure
Defeated packet (Packet), message (Message), parameter (Parameter) logic unit.
Transmission packet is the master data transmission unit of PET control communication as the carrier of message sequence and is based on message sequence
Column addition stem description field and tail portion check code are composed.It is as shown in table 5 transport packet format table.
Table 5: transport packet format table
As shown in Table 5, transmission packet stem includes transmission packet identification code, transmission packet version number, transmission package body byte length
With message number.Transmission packet identification code is used for transmission packet boundary mark;Transmission packet version number's packet format version mark, headed by visual
Portion's identification code a part, while convenient for the following extension;Transmitting package body byte length indicates to be free of the body matter byte of head and the tail
Length convenient for data receiver and determines packet boundary;Message number indicates the message number that text includes.
Message sequence is the Payload of transmission packet, is made of one or more message logic units.
Tail portion check code is to be calculated based on stem and text using CRC16-CCITT algorithm (multinomial: 0x1021)
Cyclic redundancy check.
Each field uses high byte prioritised transmission (Big-Endian) in message format.
The BSR semantic unit that each message for including in the message sequence of packet is operation is transmitted, 0 or more can be added
A parameter.It is as shown in table 6 message format table.
Table 6: message format table
It as shown in Table 6, further include message in message other than comprising type of message, information order word and number of parameters
Identification code indicate message boundaries mark;The version number of message is message format version identifier, can be considered stem identification code one
Point, while convenient for the following extension;The text byte length of message indicates to be free of message text (argument sequence) byte long of stem
Degree, convenient for the boundary of data receiver and determining message.
Embodiment two
Embodiment two provided by the invention is the embodiment that a kind of PET provided by the invention controls network communication method.
The communication means includes: monitoring outlay to PET monitoring module transmission data request information message, and PET is monitored
After module receives the data request information message, collect relevant parameter information, be packaged into response reply message message reply to it is outer
Portion's monitoring device.
The message packet includes the data volume and corresponding parameter attribute code for the parameter that data request information is related to, and passes through message
Type identification data interacts direction, and the type requested by information order word mark data is identified in message by number of parameters
The number for the parameter being related to.
Preferably, data request information includes status query request and operation/command request.PET monitoring module can also be led
The dynamic data or status report messages initiated are to monitoring outlay.
Data interaction direction includes: the status query request that monitoring outlay is sent to PET monitoring module, outside monitoring
Operation/command request that equipment is sent to PET monitoring module, the status inquiry that PET monitoring module is sent to monitoring outlay
Or operation/command request response, data or state report that PET monitoring module is sent to monitoring outlay etc..
The type of request of data includes: query argument and setup parameter etc..Indicate that the message is status query request message
Or operation/command request message.
The type of parameter includes X module, the voltage of Y module and Z module, temperature, rotation speed of the fan etc., indicates the message needs
Inquiry or operation are which parameters of which module.
When some parameter is inquired or operated/ordered, data request information and corresponding response are replied message
In number of parameters be 1, include the data volume and character pair code of this parameter in message.
When needing to express multiple operation requests, and when these requests can belong to identical theme, both can choose this
A little operation requests are respectively packaged into independent message packet, and single message message can also be merged by parameter combination.Example
Such as, it is assumed that need to inquire voltage, temperature, rotation speed of the fan of some submodule etc., it is corresponding because its operating theme is parameter query
Information order word it is identical, can be expressed by the inclusion of the message of the message format of multiple parameters.
After PET monitoring module receives the request of multiple parameters query composition, relevant parameter information is collected, it can be according to reality
Border needs to arrange the response sequence of argument sequence to be checked.Both all parameter states can be collected and is finished, be then combined into list
A message packet is replied;Certain parameter collection times are longer or occur collecting failure, at this time can be by the way of gradation
It is replied, preference return other parameters.It is opposite between parameter in request message and response message if no particular protocol agreement
Sequence need not be consistent, and can be identified by parameter attribute code.
For the multiple queries request that timesharing reaches, when inquiry request frequency is higher, and monitoring module answer speed can not
It is contemplated that in such a way that parameter combination is at single message message and is replied when matching, carry out appropriate optimization.
Preferably, by protocol conventions, combination parameter message, which also can be applied to single parameter type serializing inquiry, is asked
It asks and responds, for example, inquiring one group of contact potential series of some submodule, sequence address number is 0,1,2 ..., N-1, N, request
Target component is voltage, and only Address d istribution is different.The operational order type of information order word mark further includes specific sections
Data query (GETARRAY), agreement additional parameter identifies the head and the tail in section respectively, at this time parameter in data request information
Number is 2, and argument section is the data volume and character pair code of initial parameters 0 and terminal parameter N.The corresponding response reply replied disappears
Breath can use combination or gradation mode, and it is N+1 which, which replies message middle number of parameters, and argument section is to correspond to
Initial parameters 0 to terminal parameter N N+1 parameter data volume and character pair code.
Message packet includes transmission packet and its stem and tail portion;Transmission packet includes the message sequence of multiple message composition;
Further, the stem for transmitting packet includes transmission packet identification code, transmission packet version number, transmission package body byte length
With message number;The transmission packet identification code is used for transmission packet boundary mark;Transmission packet version number's packet format version mark;
The transmission package body byte length indicates to be free of the body matter byte length of head and the tail;The message number indicates that text includes
The message number;
The tail portion of transmission packet is the cyclic redundancy check for using CRC16-CCITT algorithm to calculate based on stem and text.
Message includes stem and parameters part;The stem of the message includes the version of the identification code of message, message
Number, the text byte length of message, the type of message, the information order word and the number of parameters, the message
Identification code indicates message boundaries mark;The version number of the message is message format version identifier;The text byte of the message
Length indicates to be free of the message text byte length of stem;The argument section includes parameter identification code, reservation, parameter spy
Levy code, data body length and the data volume.
Each field uses high byte prioritised transmission in the message packet format.
Those of ordinary skill in the art be further appreciated that implement the method for the above embodiments be can
It is completed with instructing relevant hardware by program, the program can store in computer-readable storage medium,
Described storage medium, including ROM/RAM, disk, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.