A real-time entropy evaluation post-processing quantum random number generation method

By monitoring the changes in quantum state purity in real time and dynamically adjusting the size of the Toeplitz matrix, the entropy source instability problem of the quantum random number generator under long-term working conditions was solved, achieving highly stable and secure quantum random number generation with a generation rate of 11 Gbts/s.

CN116405205BActive Publication Date: 2026-06-26TAIYUAN UNIVERSITY OF TECHNOLOGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TAIYUAN UNIVERSITY OF TECHNOLOGY
Filing Date
2023-04-26
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Under long-term operating conditions, the entropy source of existing quantum random number generators may be affected by factors such as temperature and noise, causing changes in its entropy value, which affects its high stability and security. Furthermore, existing entropy assessment methods cannot monitor the dynamic characteristics and security of the system in real time.

Method used

A real-time entropy evaluation post-processing method is adopted. By reconstructing the vacuum state Wigner function, the KLD relative entropy is used to measure the difference between the experimental vacuum state and the ideal vacuum state. The change in quantum state purity is monitored in real time, the size of the Toeplitz matrix is ​​dynamically adjusted, and a three-level parallel pipeline algorithm of field-programmable gate array is constructed to realize real-time entropy evaluation and security monitoring, and generate high-speed quantum random numbers.

Benefits of technology

It achieves high stability and security under long-term working conditions, with a quantum random number generation rate of 11 Gbts/s. It has passed NIST, Diehard and TestU01 tests, ensuring the real-time security and high-speed generation of random numbers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116405205B_ABST
    Figure CN116405205B_ABST
Patent Text Reader

Abstract

The application provides a real-time entropy evaluation post-processing quantum random number generation method. The quality of random numbers determines the privacy and security of a communication system. Quantum detection is inevitable in the quantum random number generation process, which will introduce side information. Therefore, the quantum noise entropy content of the system must be strictly evaluated, and the random numbers must be post-processed by using a security information theory extractor. The application proposes to reconstruct the quantum state phase space distribution in real time in a continuous variable quantum random number generation scheme and measure the deviation from the ideal value. If the deviation reaches the rejudgment threshold, the entropy evaluation is updated in real time, so as to adjust the size of the post-processing matrix in real time. The seed used to construct the random extractor is also updated in real time. On this basis, the information theory security generalized hash post-processing of multiple quantum random numbers is realized in parallel. The application provides a cost-intensive and expandable random number real-time entropy evaluation post-processing scheme, which can effectively improve the actual security and practicability of the quantum random number generator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of encryption technology, specifically relating to a method for generating quantum random numbers after real-time entropy evaluation and post-processing. Background Technology

[0002] Random codes are crucial to encryption technology, fundamentally determining the security of information systems. Quantum random number generators, based on the intrinsic uncertainty of quantum physics and possessing provable randomness according to information theory, offer the most secure random number generation schemes. For the past decade, research in this field has largely focused on breaking through higher yield thresholds and passing more comprehensive statistical test suites. Recently, the information security field has increasingly recognized that the research focus of random numbers should shift to the rigorous evaluation of their entropy sources. Strictly speaking, any flaw in the physical implementation of a quantum random number generator could leak information related to the generation of random numbers, the so-called side information. Correlation, such as classical or quantum, could be exploited by eavesdroppers to guess measurement results. In the presence of side information, the maximum random quantity that can be extracted is determined by the quantum conditional minimum entropy. Previous reported continuous-variable quantum random number generation schemes relied on a one-time entropy assessment, failing to continuously monitor the dynamic characteristics of the system and prove its security. Instead, they applied statistical test suites, equally applicable to pseudo-random numbers, a posteriori to test the privacy-enhancing output. Only a real-time, reliable prior evaluation of minimum entropy can guarantee its security and randomness.

[0003] Among quantum random number generation schemes, those based on measuring the uncertainty of fluctuations in the quantum orthogonal components of the vacuum state are particularly promising for practical application. The vacuum state is unaffected by external physical quantities and cannot be controlled or correlated by attackers. In practical applications, as communication distances and durations increase, higher demands are placed on the generation rate and real-time security of quantum random numbers. A significant issue is that the entropy of the physical entropy source may change over long periods due to variable factors such as temperature and noise, affecting the high stability and security of the quantum random number generator under prolonged operating conditions. Summary of the Invention

[0004] This invention addresses the problems of existing technologies by providing a method for generating quantum random numbers after real-time entropy evaluation and post-processing, specifically including the following steps:

[0005] Entropy evaluation is performed on the original true random sequence; the distribution of the vacuum state Wigner function in phase space is reconstructed; the KLD relative entropy is used to measure the difference between the experimental vacuum state and the ideal vacuum state; the change in quantum state purity is monitored in real time; the minimum entropy lower bound fluctuation range obtained from the laboratory safety environment is used to obtain the exact threshold; if the fluctuation exceeds the threshold during actual operation, it is considered to be attacked or interfered with by a third party, and then the minimum entropy evaluation is re-performed to obtain the size of the real-time Toeplitz post-processing matrix.

[0006] Based on the hardware conditions of field-programmable gate arrays and the size of the Toeplitz matrix, a three-stage parallel pipeline algorithm is designed to dynamically change the matrix size with the real-time evaluation of quantum entropy. The random seed for constructing the Toeplitz hash matrix is ​​updated in real time, and information-theoretic-safe real-time generalized hash extraction is performed on quantum random numbers.

[0007] Leveraging the parallel computing advantages of field-programmable gate arrays, real-time extraction of more than three different quantum sideband modes is achieved, enabling multi-channel real-time parallel high-speed generation of secure quantum random numbers.

[0008] Furthermore, the method for generating the original truly random sequence is as follows:

[0009] A balanced zero-beat detection system for the vacuum state of the optical field is constructed. Vacuum quantum fluctuations are extracted as the entropy source for generating true random numbers. The background light and the vacuum field are interfered with by a 50 / 50 optical beam splitter. After the beam splitter outputs two light signals with approximately equal light intensities, balanced zero-beat detection is performed to obtain the photocurrent signal. The photocurrent signal obtained by balanced zero-beat detection is mixed with the radio frequency signal and filtered. Then, it is converted from analog to digital by an analog-to-digital converter to obtain the original true random sequence.

[0010] Furthermore, when performing entropy evaluation on the original truly random sequence, the optimal sampling range needs to be determined in advance.

[0011] Furthermore, the method for determining the optimal sampling range is as follows:

[0012] The AC voltage gain is continuously adjusted using a voltage amplifier, and the amplified outputs of each channel are collected using an oscilloscope. The collected data is then statistically analyzed for frequency. When the frequency that exceeds the oscilloscope's sampling range is approximately equal to the frequency of the highest frame in the middle, the ratio of "0" to "1" in the collected true random sequence is similar, which is the optimal sampling range for random numbers.

[0013] Furthermore, the variable-size three-stage parallel pipeline algorithm includes:

[0014] The first stage is the construction of sub-matrices, which involves selecting sub-seeds from the BRAM sequentially using addresses to construct random sub-matrices;

[0015] The second level is the submatrix operation, which involves multiplying the constructed submatrix with the original random sequence to obtain the submatrix multiplication result;

[0016] The third level is the XOR operation of the submatrix results, which performs an XOR operation on the submatrix multiplication results obtained in each cycle.

[0017] Furthermore, the construction of the submatrix includes two modules: storing random seeds and selecting random seeds.

[0018] Furthermore, the dynamic matrix scaling transformation after real-time entropy evaluation includes the following three steps;

[0019] The first step is to establish a minimum entropy physical model to remove edge information; calculate the transfer function of the balanced zero-beat detection system and calibrate the power spectrum of the device output; under the optimal sampling range of the ADC, obtain the signal variance, conditional signal variance, and conditional excess noise variance by calibrating the power spectrum; establish the distance between system parameters and safety parameters, i.e., the confidence interval, and strictly calibrate the lower bound of minimum entropy.

[0020] The second step is real-time entropy assessment feedback; detecting changes in the lower bound of minimum entropy and preparing for quantum attacks, reconstructing the distribution of the vacuum state Wigner function in phase space, and using KLD relative entropy to measure the difference between the experimental vacuum state and the ideal vacuum state, monitoring changes in quantum state purity in real time, and obtaining the real-time post-processing matrix size by combining the fluctuation range of the lower bound of minimum entropy; after obtaining the real-time matrix size, taking four parallel post-processing channels as an example: the host computer transmits eight-bit instructions to the programmable gate array through the UART interface to represent the sixty-four matrix sizes of the four parallel post-processing channels;

[0021] The third step is the dynamic transformation of the post-processing matrix size within the field-programmable gate array (FPGA). First, a selection circuit is constructed. Assuming the largest matrix size is j×k and the submatrix size is j×q, there are k / q different submatrix multiplication results with a total XOR period, which is also the total number of submatrixes contained within different matrix sizes. Here, we use y to represent this. After receiving the instruction, the decoder parses the matrix size of the corresponding channel. After completing a large matrix multiplication, the corresponding submatrix multiplication results are selected according to the matrix size to achieve dynamic matrix size transformation after real-time entropy evaluation based on the total XOR period.

[0022] Furthermore, when acquiring optoelectronic signals, the processing clock of the field-programmable gate array is reduced to half of the sampling clock of the analog-to-digital converter, a buffer is used to drive the global clock and the global reset high fan-out signal, and multi-stage pipelined registers are inserted in the critical path to reduce logic latency; register copying is used to reduce the fan-out of the high fan-out registers.

[0023] Furthermore, the background light is a continuous wave laser output from a LD-TC40 semiconductor laser with a center wavelength of 1550nm;

[0024] The radio frequency signal is generated by an HP8648A signal generator with different frequency bands, ranging from 100kHz to 4000MHz.

[0025] The balanced zero-beat detection uses a 1.6GHz PDB480C-AC balanced detector.;

[0026] The filters are ZFM-11+ type mixers with a frequency range of 1MHz-2GHz and BLP-100+ type low-pass filters with a frequency of 100MHz.

[0027] The field-programmable gate array is a Xilinx Kintex-7 XC7K325T;

[0028] The analog-to-digital converter is model ADS42LB69.

[0029] This invention has one of the following technical effects:

[0030] (1) This invention implements the random dynamic selection of true random seeds for constructing the hash post-processing matrix. The n sub-seeds generated by shifting m true random seeds, along with multiple true random numbers of length a bits, are stored in different on-chip block memories of the FPGA. The a-bit true random numbers are randomly represented as 0 to 2. a -1; Divide 2^a into m equal parts. After each matrix multiplication, select a true random seed based on the magnitude of the random number to construct a new Toeplitz hash matrix. Discard each used true random number and write a new a-bit true random number into the original block memory address to eliminate the periodicity of use. Randomly and dynamically selecting a true random seed to construct the hash post-processing matrix can improve the security of random numbers and eliminate the non-random factors introduced by using an unchanging true random seed to construct the Toeplitz matrix.

[0031] (2) This invention realizes real-time entropy evaluation and real-time dynamic change of the Toeplitz matrix during the true random number generation process. While generating true random numbers at high speed, raw random data is collected in real time for entropy evaluation to obtain the real-time extraction ratio and calculate the exact size of the Toeplitz hash matrix. Y matrix sizes are preset in the field-programmable gate array (FPGA). The host computer transmits corresponding instructions to the FPGA via UART serial port based on the real-time entropy evaluation results. The FPGA decodes and parses the instructions to obtain the matrix size of each channel. After completing a large matrix multiplication, a selection circuit selects the corresponding submatrix multiplication result and XORs it with the total number of cycles to achieve dynamic transformation of the Toeplitz hash matrix. This ensures both real-time high-speed random number generation and effective security.

[0032] (3) The well-designed timing of this invention ensures the high stability and security of the quantum random number generator under long-term working conditions. During the 12-hour long-term test, the generated random numbers all passed the NIST, Diehard and TestU01 tests.

[0033] (4) The high-speed random sequence generated by this invention makes full use of the parallel computing advantage of the logic operation hardware unit, realizes the generalized hash post-processing of multiple quantum random numbers in parallel, and generates quantum random numbers in real time and at high speed, ultimately achieving a generation rate of 11Gbts / s. Attached Figure Description

[0034] The accompanying drawings illustrate various embodiments generally by way of example rather than limitation, and are used, together with the specification and claims, to explain embodiments of the invention. Where appropriate, the same reference numerals are used in all drawings to refer to the same or similar parts. Such embodiments are illustrative and are not intended to be exhaustive or exclusive embodiments of the apparatus or method.

[0035] Figure 1 This is a schematic diagram of the balanced zero-beat detection system of the present invention;

[0036] Figure 2 This is a spectrum diagram of vacuum noise in this invention;

[0037] Figure 3 This is a schematic diagram of the signal-to-noise ratio of the present invention;

[0038] Figure 4 This is a flowchart of the post-processing algorithm of the present invention;

[0039] In the diagram: 1. 1550nm LD-TC40 semiconductor laser; 2. Optical attenuator; 3. 50 / 50 beam splitter; 4. Low-pass filter; 5. Photodetector; 6. Balanced null detector; 7. Mixer; 8. Signal generator; 9. 100MHz low-pass filter; 10. Oscilloscope; 11. Analog-to-digital converter; 12. Field-programmable gate array; 13. UART serial port; 14. Host computer. Detailed Implementation

[0040] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0041] This invention provides a method for generating quantum random numbers after real-time entropy evaluation and post-processing, comprising the following steps:

[0042] Step 1: Construct a balanced zero-time detection system for the optical field vacuum state. The balanced zero-time detection system for the optical field vacuum state is as follows: Figure 1As shown, a 1550nm LD-TC40 semiconductor laser 1 continuously outputs a continuous-wave laser as the background light for the balanced zero-beat detection system. After passing through an attenuator 2, it interferes with vacuum light via a 50 / 50 optical beam splitter 3, producing reflected and transmitted light of approximately equal intensity. The reflected and transmitted light are detected by a pair of high-quantum-efficiency and symmetrical photodetectors 5. The two detectors convert the fluctuations in the detected light signal intensity into broadband photocurrent signal fluctuations. The difference in the photocurrent signal is proportional to the orthogonal component fluctuations of the vacuum field and amplifies them to a macroscopic level. Figure 3 As shown, the signal-to-noise ratio of quantum noise to low-frequency noise is above 10 dB, making it suitable as a quantum entropy source for this type of quantum random number generator. In this step, a 1.6 GHz PDB480C-AC balanced detector is used for balanced zero-beat detection.

[0043] Step 2: As Figure 1 As shown, the photocurrent output of the balanced zero-beat detector 6 is mixed with the radio frequency signal 8 by a ZFM-11+ type mixer 7 with a frequency range of 1MHz-2GHz, and then filtered by a BLP-100+ type low-pass filter 9 with a frequency of 100MHz to reduce the bandwidth to 100MHz to satisfy the Nyquist double sampling law; then it is acquired by an analog-to-digital converter 11 with a model number of ADS42LB69 and a maximum sampling rate of 250MS / S.

[0044] Step 3: Acquire beat frequency signals to establish a minimum entropy physical model to remove edge information. The ADC acquires the beat frequency signals output by the balanced zero-beat detection system at various frequencies within the detector bandwidth. The power spectrum is reconstructed using the average periodogram method and calibrated. Under the optimal sampling range of the ADC, the signal variance, conditional signal variance, and conditional excess noise variance are obtained from the calibrated power spectrum. The distance between system parameters and safety parameters, i.e., the confidence interval, is established. The lower bound of the minimum entropy is strictly calibrated, and the fluctuation range of the minimum entropy is obtained.

[0045] Step 4: Real-time Entropy Assessment and Feedback. The original random sequence is collected, and changes in the lower bound of the minimum entropy are detected. Potential quantum attacks are guarded against; for example, in the event of a hot state attack, calculating the quantum conditional minimum entropy may actually increase the entropy value. In this case, the Wigner function of the vacuum state will become wider and shorter in phase space. The KLD relative entropy is used to measure the difference between the experimental vacuum state and the ideal vacuum state. By monitoring changes in quantum state purity in real time, quantum attacks can be detected promptly. A threshold judgment is made based on the minimum entropy fluctuation range to determine whether to re-evaluate the quantum conditional minimum entropy, resulting in the post-processing matrix size.

[0046] Step 4: Based on the concurrency characteristics of FPGAs, a three-stage parallel pipeline algorithm with variable matrix size is designed to construct a Toeplitz hash matrix for generalized hash extraction of quantum random numbers by updating the random seed in real time. Leveraging the concurrency characteristics of FPGAs, a large matrix operation is broken down into multiple smaller matrix operations of suitable size. Dividing a large matrix operation in one cycle into multiple sub-matrix operations alleviates the resource and timing pressure on the FPGA 12. The variable matrix size module includes an instruction decoding module and a matrix size selection module. The instruction decoding module parses the instructions transmitted from the host computer according to the designed instruction set to obtain the corresponding channel information and matrix size information. Simultaneously, this module pre-stores y selectable matrix sizes and the corresponding y different clock cycles required for complete large matrix operations. Dynamic transformation of the matrix size is achieved by changing the maximum number of operation clock cycles and the number of sub-seed selection cycles using the parsed channel information and matrix size information. The first stage of the three-stage parallel pipeline is the construction of sub-matrices. For example... Figure 3 As shown, the digital signal output by the analog-to-digital converter is transmitted to the field-programmable gate array (FPGA) via an LVDS differential bus. m truly random seeds are selected to construct the Toeplitz matrix. A C program is written to shift these seeds, generating n sub-seeds, which are then written to a text file. The text file is stored in the on-chip block random access memory (BRAM) of the FPGA. Simultaneously, multiple a-bit truly random numbers, representing 0 to 2, are also stored in the BRAM. a-1, dividing 2^a into m equal parts, after each matrix multiplication, selects an a-bit truly random number, and uses the size of the random number to randomly select a seed to construct a new Toeplitz hash matrix, while simultaneously writing the new truly random number to overwrite the original one. The second stage of the three-stage parallel pipeline is submatrix multiplication. AND gates are used instead of multipliers to implement multiplication between single bits; XOR gates are used to implement addition. A combination of AND and XOR gates can complete a matrix "multiply-add" operation. The third stage of the three-stage parallel pipeline is the submatrix operation result addition module. In the first cycle of the submatrix operation, a register is used to buffer the submatrix operation result. In each subsequent cycle, the current value of the register is XORed with the submatrix operation result. After multiple cycles of XOR operations, the output result is obtained. In this step, to alleviate the resource consumption of the Field-Editable Gate Array (FAGE) and optimize timing, the following methods are used: 1) A dual-port asynchronous FIFO is used to buffer the digital signals output from the analog-to-digital converter (ADC) to the FAGE, reducing the FAGE processing clock to half the ADC sampling clock, thus doubling the original random sequence involved in each clock calculation and alleviating timing pressure. 2) Pipeline registers are inserted into excessively long combinational logic to reduce the number of combinational logic stages; register duplication is used to reduce fan-out and improve drive capability for high-fan-out registers; multi-stage pipeline registers are inserted into critical paths to reduce logic latency. 3) Buffers are used to drive high-fan-out signals such as the global clock and global reset, reducing fan-out, improving drive capability, and optimizing timing.

[0047] Step 5: Based on the three-stage parallel pipeline algorithm with variable matrix size designed in Step 3, implement real-time entropy evaluation and dynamic changes in the Toeplitz hash matrix size in hardware. This includes three steps. The first step is real-time entropy evaluation. Step 3 is repeated periodically to collect the original random sequence, detect the lower bound of the minimum entropy, reconstruct the distribution of the vacuum state Wigner function in phase space, use KLD relative entropy to measure the difference between the experimental vacuum state and the ideal vacuum state, and obtain the post-processing matrix size by monitoring the change in quantum state purity in real time and combining it with the minimum entropy fluctuation range. The second module is the serial port command sending module. This invention designs a simple instruction set. Each instruction size is equal to the serial port width, which is x-bit. The high z bits of the x-bit instruction are encoded as a one-hot code, indicating which of the z channels the instruction is valid for; the remaining bits of the x-bit instruction are binary encoded to represent y different matrix sizes. After obtaining the real-time matrix size, the host computer 14 sends the instruction to the field-programmable gate array 12 via the UART serial port 13. The third step is the matrix dynamic change module. In step 4, a three-stage parallel pipeline algorithm with variable matrix size is designed. After receiving the instruction sent by the host computer, the field-programmable gate array parses it to obtain the channel information and matrix size information. After completing the current large matrix operation, it changes the maximum number of operation clock cycles and the number of sub-seed selection cycles to realize the dynamic change of the post-processing matrix size.

[0048] This invention calculates the entropy introduced by classical noise, subtracts the classical noise entropy from the total entropy of the original data, and calculates the pure quantum entropy contained in the original data. This entropy is used as a parameter for true random number extraction in post-processing, maximizing the extraction ratio of random numbers. Multiple random seeds and continuously updated true random numbers are stored in a field-programmable gate array (FPGA), enabling random selection of the true random seed for constructing the Toeplitz hash matrix and eliminating non-random factors introduced by an unchanging seed. A three-stage parallel pipelined post-processing algorithm with variable matrix size is established through the overall planning of the FPGA's logic resources. The real-time Toeplitz hash matrix size is determined after real-time entropy evaluation, achieving real-time, secure, and high-speed generation of quantum random numbers.

[0049] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the technical scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for generating quantum random numbers after real-time entropy evaluation and post-processing, characterized in that, Specifically, it includes: The entropy of the original true random sequence is evaluated; the distribution of the vacuum state Wigner function in phase space is reconstructed; the KLD relative entropy is used to measure the difference between the experimental vacuum state and the ideal vacuum state, and the change in quantum state purity is understood. A threshold is given based on the minimum entropy fluctuation range under laboratory safety conditions. If the fluctuation exceeds the threshold during actual operation, it is considered to be due to third-party interference or attack. Then, the minimum entropy is re-evaluated and the post-processing matrix is ​​adjusted; the size of the real-time Toeplitz post-processing matrix is ​​obtained. Based on the hardware conditions of field-programmable gate arrays and the size of the Toeplitz matrix, a three-stage parallel pipeline algorithm is designed to dynamically change the matrix size with the real-time evaluation of quantum entropy. The random seed for constructing the Toeplitz hash matrix is ​​updated in real time, and information-theoretic-safe real-time generalized hash extraction is performed on quantum random numbers. Leveraging the parallel computing advantages of field-programmable gate arrays, real-time extraction of more than three different quantum sideband modes is achieved, enabling multi-channel real-time parallel high-speed generation of secure quantum random numbers; The variable matrix-size three-stage parallel pipeline algorithm includes: The first level is the construction of sub-matrixes. Random sub-matrixes are constructed by randomly selecting sub-seeds from on-chip block memory in sequence through addresses, while new true random numbers are written to overwrite the original true random numbers. The second level is the submatrix operation, which involves multiplying the constructed submatrix with the original random sequence to obtain the submatrix multiplication result; The third level is the XOR operation of the submatrix results. The XOR operation of the submatrix multiplication results obtained in each cycle is performed, and the output result is obtained after multiple cycles of XOR operation.

2. The method according to claim 1, characterized in that, The method for generating the original truly random sequence is as follows: A balanced zero-beat detection system for the vacuum state of the optical field is constructed. Vacuum quantum fluctuations are extracted as the entropy source for generating true random numbers. The background light and the vacuum field are interfered with by a 50 / 50 optical beam splitter. After the beam splitter outputs two light signals with approximately equal light intensities, balanced zero-beat detection is performed to obtain the photocurrent signal. The photocurrent signal obtained by balanced zero-beat detection is mixed with the radio frequency signal and filtered. Then, it is converted from analog to digital by an analog-to-digital converter to obtain the original true random sequence.

3. The method according to claim 1, characterized in that, When performing entropy evaluation on the original truly random sequence, the optimal sampling range needs to be determined in advance.

4. The method according to claim 3, characterized in that, The method for determining the optimal sampling range is as follows: The AC voltage gain is continuously adjusted using a voltage amplifier, and the amplified outputs of each channel are collected using an oscilloscope. The collected data is then statistically analyzed for frequency. When the frequency that exceeds the oscilloscope's sampling range is approximately equal to the frequency of the highest frame in the middle, the proportion of "0" and "1" in the collected true random sequence is similar, which is the optimal sampling range for random numbers.

5. The method according to claim 1, characterized in that, The construction of the submatrix includes two modules: storing the random seed and selecting the random seed.

6. The method according to claim 1, characterized in that, The dynamic matrix scaling transformation after real-time entropy evaluation includes the following three steps; The first step is to establish a minimum entropy physical model to remove edge information; calculate the transfer function of the balanced zero-beat detection system and calibrate the power spectrum of the device output; Within the optimal sampling range of the analog-to-digital converter, the signal variance, conditional signal variance, and conditional excess noise variance are obtained by calibrating the power spectrum; the distance between system parameters and safety parameters, i.e., the confidence interval, is established, and the lower bound of the minimum entropy is strictly calibrated. The second step is real-time entropy assessment feedback; detecting changes in the lower bound of minimum entropy and preparing for quantum attacks, reconstructing the distribution of the vacuum state Wigner function in phase space, and using KLD relative entropy to measure the difference between the experimental vacuum state and the ideal vacuum state, monitoring changes in quantum state purity in real time, and obtaining the real-time post-processing matrix size by combining the fluctuation range of the lower bound of minimum entropy; after obtaining the real-time matrix size, taking four parallel post-processing channels as an example: the host computer transmits eight-bit instructions to the programmable gate array through the UART interface to represent the sixty-four matrix sizes of the four parallel post-processing channels; The third step is the dynamic transformation of the post-processing matrix size inside the field-programmable gate array. First, a selection circuit is constructed. After receiving the instruction, it is decoded and parsed to obtain the matrix size of the corresponding channel. After completing a large matrix multiplication, the corresponding sub-matrix multiplication result is selected according to the corresponding matrix size, and the total number of cycles is XORed to realize the dynamic matrix size transformation after real-time entropy evaluation.

7. The method according to claim 2, characterized in that, The background light is a continuous wave laser output from an LD-TC40 semiconductor laser with a center wavelength of 1550nm; The radio frequency signal is generated by an HP8648A signal generator with different frequency bands, ranging from 100kHz to 4000MHz. The balance zero-beat detection is performed using a 1.6GHz PDB480C-AC type balance detector. The filters are ZFM-11+ type mixers with a frequency range of 1MHz-2GHz and BLP-100+ type low-pass filters with a frequency of 100MHz. The field-programmable gate array is a Xilinx Kintex-7 XC7K325T; The analog-to-digital converter is model ADS42LB69.