A multi-channel energy spectrum data communication method based on parity check bits
By splitting multichannel energy spectrum data into high and low 8 bits and sending them using parity checking, the communication pressure and byte misalignment problems of high-precision energy spectrum data are solved, achieving efficient data transmission and detection efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUBEI FANGYUAN ENVIRONMENTAL PROTECTION SCI & TECH CO LTD
- Filing Date
- 2023-12-19
- Publication Date
- 2026-07-10
AI Technical Summary
In multichannel energy spectrum detection, the real-time uploading of high-precision energy spectrum data puts a heavy burden on communication. Misalignment of data bytes leads to low detection efficiency. Existing technologies that add flag bits increase communication overhead and affect data throughput.
The 16-bit energy spectrum data is split into high 8 bits and low 8 bits, and sent via serial port using parity checking. The parity bits are used to correct data byte misalignment and ensure that the data is correctly reassembled.
In high-energy-resolution and high-activity radioactive sample measurements, reduce communication overhead, improve data throughput, and ensure detection efficiency.
Smart Images

Figure CN117890954B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of nuclear electron detection technology, and in particular to a multichannel energy spectrum data communication method based on parity check bits. Background Technology
[0002] In multichannel energy dispersive spectroscopy (EDS), the spectral data detected by the multichannel detection device needs to be uploaded to the host computer's spectral interpretation software in real time for signal processing, spectral analysis, and nuclide identification. In applications requiring high energy resolution, high sample activity, and high radioactive particle count rates—that is, EDS measurements demanding both high precision and high data throughput—the number of spectral measurement channels exceeds 16,384 (i.e., 14-bit precision), reaching a maximum of 65,536 (i.e., 16-bit precision). This necessitates the transmission of at least 14 data bits. Furthermore, the decay of radioactive materials follows statistical laws; during measurement, continuous decay sometimes occurs, and the radioactive content produced by each decay... The energy spectrum data of the particles needs to be uploaded to the host computer's spectrum interpretation software in real time, which puts a lot of pressure on communication. When the communication speed cannot keep up with the counting of energy particles produced by the decay of radioactive materials, the multichannel detection device has to discard some of the energy spectrum measurement data that cannot be uploaded in time, affecting the data throughput and thus affecting the detection efficiency. In addition, energy spectrum data with a precision of 14 bits or more needs to be transmitted in sequence in serial communication. During the transmission process, due to line interference or other reasons, the byte order may be misaligned. When receiving the data, the host computer's spectrum interpretation software must promptly determine the order of each energy spectrum data. When a byte order misalignment is found, it should be corrected in time to avoid affecting the reception of subsequent data.
[0003] Reference Figure 2 Conventional serial communication methods use data bit encoding, which means taking a portion of the data bits from each byte of data transmitted as flag bits to distinguish the high and low bytes of an energy spectrum data. For energy spectrum measurements of 16384 channels (i.e., 14-bit precision) or more, additional flag bits are required, which increases communication overhead, affects the data throughput of the nuclear spectrum, and thus affects detection efficiency. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a multi-channel energy spectrum data communication method based on parity bits. The 65,536 channels (i.e., 16-bit precision) of energy spectrum data to be uploaded in real-time by the multi-channel energy spectrum detection device are split into two bytes: the high 8 bits and the low 8 bits. The low 8 bits are sent via serial port using odd parity, and the high 8 bits are sent using even parity. Only two bytes are needed to upload the energy spectrum data to the host computer for spectrum analysis. Furthermore, when the host computer continuously receives multiple energy spectrum data during spectrum analysis, if the data bytes are misaligned due to interference or other reasons, the parity bits can be used to correct this in a timely manner.
[0005] The technical solution adopted by this invention to solve its technical problem is: to provide a multi-channel energy spectrum data communication method based on parity check bits, comprising the following steps:
[0006] S1. The multi-channel energy spectrum detection device sends energy spectrum data to the host computer in real time. The energy spectrum data is 65536 channel collected data, that is, 16-bit binary data encoded data. When sending, the 16-bit binary data encoded data is divided into the lower 8 bits as a byte and sent according to the odd parity or even parity method, and the higher 8 bits as a byte and sent according to the even parity or odd parity method. The lower 8 bits and the higher 8 bits use different parity methods.
[0007] S2. After receiving the energy spectrum data sent by the multi-channel energy spectrum detection device, the host computer verifies the energy spectrum data until the reception is complete.
[0008] In step S1, one byte is sent in odd parity mode, and the sent content includes a start bit, the lower 8 bits of the data byte, the odd parity bit, and the stop bit. The other byte is sent in even parity mode, and the sent content includes a start bit, the higher 8 bits of the data byte, the even parity bit, and the stop bit.
[0009] Step S2 verification is handled in the following ways:
[0010] a. If, in two consecutive bytes received by the host computer, the byte sent in odd parity mode is correctly checked and the byte sent in even parity mode is incorrectly checked, then the energy spectrum data is determined to be valid energy spectrum data.
[0011] b. If in two consecutive bytes received by the host computer, both bytes sent in odd parity mode and even parity mode are correct, or the byte sent in odd parity mode is incorrect and the byte sent in even parity mode is correct, then discard the byte sent in odd parity mode and continue receiving and verifying.
[0012] c. If two consecutive bytes received by the host computer contain parity errors in both odd and even parity modes, then discard these two bytes and continue receiving and verifying.
[0013] The beneficial effects of this invention based on its technical solution are as follows:
[0014] This invention provides a multi-channel energy spectrum data communication method based on parity bits. The method involves splitting the 65536 channels (i.e., 16-bit precision) of energy spectrum data to be uploaded in real-time by the multi-channel energy spectrum detection device into two bytes: a high 8-bit data and a low 8-bit data. These are transmitted via a serial port using either odd parity or even parity, sending either the low 8-bit or high 8-bit data. The host computer receives the two bytes of data uploaded by the multi-channel energy spectrum detection device using either odd or even parity. One byte of data has a correct parity check (i.e., the parity check is correct), while the other byte may have a parity error. According to the data transmission rules of the multi-channel energy spectrum detection device, the byte with the correct parity check and the byte with the parity error are recombined to obtain the two bytes of normal energy spectrum data value. A 65,536-channel (16-bit precision) multichannel energy spectrum analyzer can upload energy spectrum data to a host computer for interpretation using only two bytes. Furthermore, when the host computer continuously receives multiple energy spectrum data, if data bytes are misaligned due to interference or other reasons, the parity check bit can correct this in a timely manner. This communication mechanism, using parity check bits as flags, ensures real-time performance while minimizing communication overhead and achieving high data throughput when measuring radioactive samples with high nuclear particle energy resolution and activity at the same baud rate, all within the same baud rate.
[0015] This invention provides a multichannel energy spectrum data communication method based on parity check bits. Utilizing the principle of serial communication, the parity check bits are used as flag bits and encoded together with the energy spectrum data uploaded in real time by the multichannel energy spectrum detection device. The multichannel energy spectrum detection device uploads the encoded data to the host computer's spectrum interpretation software. After receiving the data, the host computer's spectrum interpretation software judges and reassembles the data according to whether the parity check is incorrect, and the order of correct and incorrect parity checks, and then parses out the corresponding energy spectrum data. This method is particularly suitable for the measurement needs of radioactive samples with high nuclear particle energy resolution and high activity. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the data frame format of the present invention.
[0017] Figure 2 This is a schematic diagram of a traditional data frame format.
[0018] Figure 3 This is a schematic diagram illustrating the data frame format of the present invention used in this embodiment.
[0019] Figure 4 This is a schematic diagram of the traditional data frame format used in this embodiment. Detailed Implementation
[0020] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0021] This invention provides a multichannel energy spectrum data communication method based on parity check bits, comprising the following steps:
[0022] S1. The multi-channel energy spectrum detection device sends energy spectrum data to the host computer in real time. The energy spectrum data is 65536 channels of collected data, that is, 16-bit binary data encoded data AAAAAAAABBBBBBBB. When sending, the 16-bit binary data encoded data is divided into the lower 8 bits of data BBBBBBBB as a byte and sent according to odd parity or even parity. The higher 8 bits of data AAAAAAAA are sent as a byte according to even parity or odd parity. The lower 8 bits of data and the higher 8 bits of data use different parity methods.
[0023] Reference Figure 1 The first byte is sent in odd parity mode, and the content includes the start bit, the lower 8 data bytes, the odd parity bit, and the stop bit. The second byte is sent in even parity mode, and the content includes the start bit, the higher 8 data bytes, the even parity bit, and the stop bit.
[0024] In practical applications, the parity check order of the above-mentioned multichannel energy spectrum detection device can be reversed, and the order of sending high-byte and low-byte data can also be reversed; the host computer's spectrum interpretation software serial port can receive data according to odd parity or even parity.
[0025] S2. After receiving the energy spectrum data sent by the multi-channel energy spectrum detection device, the host computer verifies the energy spectrum data until the reception is complete.
[0026] by Figure 1 Taking the energy spectrum data shown as an example, when the multi-channel energy spectrum detection device continuously sends multiple energy spectrum data, the sequence of sent byte parity bits is sent in the order of "odd parity + even parity + odd parity + even parity + ...". After receiving the data, the host computer's spectrum decomposition software receives the data in the order of "verification correct + verification error + verification correct + verification error + ...", and then performs reassembly and spectrum decomposition processing.
[0027] The specific data verification is handled in the following ways:
[0028] a. When the host computer's spectrum interpretation software continuously receives two bytes of data with verification results of "verification correct + verification incorrect", according to the data transmission rules of the multichannel energy spectrum detection device, the received two bytes of data are the effective energy spectrum data sent by the multichannel energy spectrum detection device, and are received, reassembled and processed.
[0029] b. When the host computer's spectrum interpretation software receives two consecutive bytes of data with verification results of "verification correct + verification correct" or "verification incorrect + verification correct", discard the first byte of data, use the second byte of data with verification correct as the first byte, and continue to receive one byte of data as the second byte of data to perform parity check together.
[0030] c. When the host computer's spectrum interpretation software receives two consecutive bytes of data with the same check result of "check error + check error", discard the two bytes and continue to receive two bytes of data for parity check.
[0031] Taking 16-bit energy spectrum data 0x5d8e as an example, the transmission method of this invention is compared with the traditional energy spectrum data transmission method.
[0032] Reference Figure 3 The multichannel energy dispersive spectroscopy (EDS) device needs to upload 65,536 valid energy dispersive spectral channels, i.e., 2... 16 =65536, the transmitted energy spectrum data is 2 bytes. Assuming the multichannel energy spectrum detector transmits 16-bit energy spectrum data 0x5d8e in real time, i.e., 0101110110001110, 0101110110001110 is split into two bytes: 01011101 (0x5d) and 10001110 (0x8e). The multichannel energy spectrum detector transmits 10001110 (0x8e) as the first byte with odd parity, and 01011101 (0x5d) as the second byte with even parity. The parity check is sent to the host computer's spectrum interpretation software. Assuming the host computer's spectrum interpretation software communicates in odd parity mode, it receives 10001110 (0x8e) from the multichannel energy spectrum detector. The odd parity is correct, so it is processed as the low byte data. Then it receives 01011101 (0x5d). After odd parity check, an error is found, so it is processed as the high byte data. According to the parity bit encoding rules of the data sent by the multichannel energy spectrum detector, it is recombined into a valid 16-bit energy spectrum data 0101110110001110, which is 0x5d8e.
[0033] like Figure 4 As shown, when transmitting energy spectrum data 0x5d8e using the traditional flag bit framing method, three bytes of data are required for transmission, with each byte requiring 2 bits for encoding. Following the communication format of "1 start bit + 8 data bits + 1 stop bit + no parity bit," sending 3 bytes of energy spectrum data (0x8b560e) requires 30 bits. The present invention provides a multichannel energy spectrum data communication method based on parity bits, which, following the communication format of "1 start bit + 8 data bits + 1 stop bit + 1 parity bit," requires 22 bits to send 2 bytes of energy spectrum data.
[0034] It is evident that, under the same baud rate, in nuclear spectroscopy measurements where high energy resolution is required, the activity of the sample being measured is high, and the count rate of radioactive particles is relatively high, the time for transmitting one energy spectrum data using this invention is 22 bits / 30 bits = 73% of the time for traditional flag bits. This reduces communication overhead, improves data throughput, and also reduces the impact on detection efficiency.
Claims
1. A multichannel energy spectrum data communication method based on parity check bits, characterized in that... Includes the following steps: S1. The multi-channel energy spectrum detection device sends energy spectrum data to the host computer in real time. The energy spectrum data is 65536 channel collected data, that is, 16-bit binary data encoded data. When sending, the 16-bit binary data encoded data is divided into the lower 8 bits as a byte and sent according to the odd parity or even parity method, and the higher 8 bits as a byte and sent according to the even parity or odd parity method. The lower 8 bits and the higher 8 bits use different parity methods. S2. After receiving the energy spectrum data sent by the multichannel energy spectrum detection device, the host computer verifies the energy spectrum data until the reception is complete; the verification is handled in the following ways: a. If, in two consecutive bytes received by the host computer, the byte sent in odd parity mode is correctly checked and the byte sent in even parity mode is incorrectly checked, then the energy spectrum data is determined to be valid energy spectrum data. b. If in two consecutive bytes received by the host computer, both bytes sent in odd parity mode and even parity mode are correct, or the byte sent in odd parity mode is incorrect and the byte sent in even parity mode is correct, then discard the byte sent in odd parity mode and continue receiving and verifying. c. If two consecutive bytes received by the host computer contain parity errors in both odd and even parity modes, then discard these two bytes and continue receiving and verifying.
2. The multichannel energy spectrum data communication method based on parity check bits according to claim 1, characterized in that: In step S1, one byte is sent in odd parity mode, and the sent content includes a start bit, the lower 8 bits of the data byte, the odd parity bit, and the stop bit. The other byte is sent in even parity mode, and the sent content includes a start bit, the higher 8 bits of the data byte, the even parity bit, and the stop bit.