CN-121985351-A - Method and system for optimizing security communication protocol of wireless network camera mainboard
Abstract
The invention relates to the technical field of network safety communication, in particular to a method and a system for optimizing a wireless network camera mainboard safety communication protocol, comprising the following steps of reading a signal-to-noise ratio and a signal strength value, calculating a link quality score, capturing photoelectric shot noise, converting the photoelectric shot noise into a true random entropy source sequence, and generating a dynamic session key by combining clock jitter; analyzing the monitoring video stream to separate I frame from P frame, encrypting the I frame to generate core ciphertext, generating integrity check code for P frame, constructing safety protocol data frame according to error correction code rate and executing data transmitting action. According to the invention, by introducing a channel state perceived dynamic fragmentation mechanism, the encryption density of video data is dynamically adjusted according to the signal-to-noise ratio of the real-time signal, the calculation overhead of a main board in a weak network environment is effectively reduced, and the problem of picture interruption caused by heavy frequency connection is fundamentally eliminated by replacing the traditional complete handshake flow with the lightweight re-authentication logic based on the hardware noise characteristics.
Inventors
- XU HONGHUA
Assignees
- 深圳睿杰讯视科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260203
Claims (10)
- 1. The method for optimizing the security communication protocol of the wireless network camera main board is characterized by comprising the following steps of: S1, reading a signal-to-noise ratio value and a signal intensity value of a radio frequency front end of a main board of a wireless network camera, calculating a link quality score by using a weighted product of the signal-to-noise ratio value and the signal intensity value, and constructing a congestion judgment threshold value based on fluctuation variance of the link quality score in a time window; S2, capturing photoelectric shot noise at the bottom layer of the CMOS sensor in an image acquisition gap, mapping the analog level of the photoelectric shot noise to a preset quantization interval, converting the analog level into a true random entropy source sequence, and generating a dynamic session key through exclusive OR logic operation of the true random entropy source sequence and clock jitter frequency; S3, analyzing the monitoring video stream to separate I frame data from P frame data, comparing the link quality score with the congestion judging threshold, calling the dynamic session key to execute AES encryption on the I frame data to generate a core ciphertext when judging that the link quality score is lower than the threshold, and performing CRC (cyclic redundancy check) on the P frame data to generate an integrity check code; S4, interweaving and reorganizing the core ciphertext and the integrity check code according to the error correction coding rate reversely mapped by the link quality score to construct a safety protocol data frame, embedding an encryption strategy index value in the physical layer head of the safety protocol data frame, and driving a wireless transmitting unit to execute data transmitting action.
- 2. The method for optimizing the secure communication protocol of the wireless network camera motherboard according to claim 1, wherein the executing process of S1 specifically includes: S11, periodically scanning a current working frequency band by calling a radio frequency driving interface, extracting the signal-to-noise ratio value refreshed in real time and the corresponding signal strength value from a physical layer register, and carrying out normalization processing on the acquired original data to eliminate dimension differences so as to generate a standardized radio frequency characteristic parameter set; s12, obtaining a standardized signal-to-noise ratio and a standardized signal strength in the standardized radio frequency characteristic parameter set, respectively giving corresponding weighting coefficients to the standardized signal-to-noise ratio and the standardized signal strength according to a preset communication quality weight distribution model, calculating a link communication state index at the current moment through a linear weighting summation algorithm, and generating a link quality score; And S13, establishing a sliding time window containing a plurality of continuous sampling points, storing the link quality scores into a buffer queue of the time window, calculating the statistical variance of all score data in the queue to represent the fluctuation degree of the channel stability, and dynamically fitting the fluctuation variance with a reference congestion coefficient to generate the congestion judgment threshold.
- 3. The method for optimizing the secure communication protocol of the wireless network camera motherboard according to claim 1, wherein the executing process of S2 specifically includes: S21, monitoring a vertical synchronous signal of a CMOS image sensor, starting a bottom noise acquisition circuit in a vertical blanking interval after each frame of image is transmitted, and capturing the photoelectric shot noise generated by a photodiode under the condition of no illumination due to thermally excited electrons; s22, acquiring a weak analog voltage signal of the photoelectric shot noise, inputting the weak analog voltage signal into a high-precision analog-to-digital converter, dividing a plurality of nonlinear quantization levels according to a preset voltage amplitude distribution range, mapping voltage values of sampling points into corresponding binary digital codes, and generating the true random entropy source sequence; S23, microsecond clock jitter frequency data generated in the operation process of the mainboard crystal oscillator circuit are obtained, bitwise exclusive OR logic operation is carried out on the true random entropy source sequence and the clock jitter frequency data, the correlation of an original sequence is scattered by utilizing an operation result, a bit stream with a fixed length is intercepted, and the dynamic session key is generated.
- 4. The method for optimizing the secure communication protocol of the wireless network camera motherboard according to claim 1, wherein the executing process of S3 specifically includes: S31, analyzing a monitoring video stream in an H.264 or H.265 format, and demultiplexing the video stream into I frame data containing key picture information and P frame data containing differentiated motion vectors by identifying a frame type identifier of a network extraction layer unit head; S32, acquiring the link quality score and the congestion judging threshold value, comparing the values of the link quality score and the congestion judging threshold value in real time, judging that the current channel is in a high congestion and high packet loss risk state if the link quality score is found to be smaller than the congestion judging threshold value, and generating a strong encryption triggering signal; S33, responding to the strong encryption trigger signal, calling the dynamic session key to initialize an AES encryption engine, carrying out block encryption operation on the I frame data by adopting a cipher block link mode to generate a core ciphertext, calculating the polynomial remainder of the P frame data by utilizing a cyclic redundancy check algorithm, and generating the integrity check code.
- 5. The method for optimizing the secure communication protocol of the wireless network camera motherboard according to claim 1, wherein the executing process of S4 specifically includes: s41, obtaining the link quality score, inquiring a mapping table of preset channel quality and forward error correction coding rate, selecting a redundancy check bit length inversely proportional to the current score, and determining the error correction coding rate; S42, obtaining a core ciphertext and the integrity check code, generating redundancy check data according to the error correction coding rate, performing discretization rearrangement on a data bit stream and a check bit stream by adopting a pseudo-random interleaving algorithm, preventing continuous data loss caused by bursty error codes, and constructing the safety protocol data frame; And S43, extracting an algorithm type identifier and a key version number adopted in the encryption process, combining the algorithm type identifier and the key version number to generate the encryption strategy index value, writing the index value into a physical layer preamble field of the security protocol data frame, and sending a transmission instruction to a radio frequency sending circuit to drive the wireless transmitting unit to execute data transmitting action.
- 6. The method for optimizing a secure communication protocol of a wireless network camera motherboard according to claim 2, wherein the calculating the link quality score comprises: Acquiring the signal-to-noise ratio value and the signal strength value, and calculating the link quality score according to the influence weight of the channel environment on the communication stability by using the following formula: ; Wherein, the Representing the quality score of the link in question, Representing the signal to noise ratio value currently being read, Representing the theoretical maximum signal-to-noise ratio of the radio frequency chip, Representing the signal strength value currently being read, Representing the strength of a standard reference signal, Representing a preset signal to noise ratio weight factor, Representing the duration of time that the link remains connected.
- 7. The method for optimizing a secure communication protocol of a wireless network camera motherboard according to claim 3, wherein the generating process of the true random entropy source sequence specifically comprises: acquiring an analog voltage amplitude of the photoelectric shot noise, establishing a quantization threshold set comprising a plurality of non-uniformly distributed intervals, and comparing the analog voltage amplitude with boundary thresholds of the intervals step by step; When the voltage amplitude falls into a high probability density interval, mapping the voltage amplitude into a binary code with low bit width, when the voltage amplitude falls into a long tail interval with low probability density, mapping the voltage amplitude into a binary code with high bit width, and generating the true random entropy source sequence by splicing binary code streams obtained by conversion at each sampling moment.
- 8. The method for optimizing a secure communication protocol of a wireless network camera motherboard according to claim 4, wherein the generating process of the core ciphertext specifically comprises: Acquiring I frame data to be encrypted, dividing the I frame data into a plurality of 128-bit fixed data blocks, introducing a randomly generated initialization vector and performing exclusive OR operation on the first plaintext data block; And calling the result of the exclusive-or of the dynamic session key to execute multi-turn byte substitution, row shift, column mixing and round key addition transformation, outputting the ciphertext of the previous round as an exclusive-or input factor of the plaintext block of the next round, and sequentially completing chained encryption operation of all data blocks to generate a core ciphertext.
- 9. The method for optimizing a secure communication protocol of a wireless network camera motherboard according to claim 5, wherein the process of constructing the secure protocol data frame specifically comprises: Acquiring a mixed bit stream after interleaving and reorganization, and establishing a link layer frame header structure containing a synchronous word, a frame length indicator, a source address and a destination address; And packaging the encryption strategy index value into a custom extended frame header field, filling the mixed bit stream as payload data into a data field, adding a cyclic redundancy check code for a physical layer frame check sequence at the frame tail, and completing standardized assembly of a data packet structure to construct the safety protocol data frame.
- 10. A wireless network camera motherboard secure communication protocol optimization system, wherein the system is configured to implement the wireless network camera motherboard secure communication protocol optimization method of any one of claims 1-9, the system comprising: The channel state monitoring module is configured to read a signal-to-noise ratio value and a signal intensity value of the radio frequency front end of the main board of the wireless network camera, calculate a link quality score by utilizing a weighted product of the signal-to-noise ratio value and the signal intensity value, and construct a congestion judgment threshold value based on fluctuation variance of the link quality score in a time window; The entropy source key extraction module is configured to capture photoelectric shot noise at the bottom layer of the CMOS sensor in an image acquisition gap, map the analog level of the photoelectric shot noise to a preset quantization interval, convert the analog level into a true random entropy source sequence, and generate a dynamic session key through exclusive OR logic operation of the true random entropy source sequence and clock jitter frequency; The self-adaptive hierarchical encryption module is configured to analyze the monitoring video stream to separate I frame data from P frame data, compare the link quality score with a congestion judgment threshold, call the dynamic session key to execute AES encryption on the I frame data to generate a core ciphertext when judging that the link quality score is lower than the threshold, and perform CRC on the P frame data to generate an integrity check code; And the protocol frame encapsulation and transmission module is configured to interweave and reorganize the core ciphertext and the integrity check code according to the error correction coding rate reversely mapped by the link quality score to construct a safety protocol data frame, and an encryption strategy index value is embedded in the physical layer head of the safety protocol data frame to drive the wireless transmitting unit to execute data transmitting action.
Description
Method and system for optimizing security communication protocol of wireless network camera mainboard Technical Field The invention relates to the technical field of network security communication, in particular to a method and a system for optimizing a security communication protocol of a wireless network camera mainboard. Background The technical field of network security communication relates to a technical set for guaranteeing confidentiality, integrity and availability of data in a wireless transmission network, and covers construction and execution of an encryption algorithm, an identity authentication mechanism and a data transmission handshake protocol. The method for optimizing the security communication protocol of the main board of the traditional wireless network camera is to encrypt the collected video stream data in full quantity by adopting a standard SSL/TLS protocol or a preset AES static key, and execute the package, handshake verification and ciphertext transmission of the data packet in sequence by a general CPU on the main board, and generally rely on a fixed TCP/IP protocol stack to process a retransmission mechanism when the network is congested. In the prior art, a full-quantity encryption mode is adopted to aggravate the load of a main board computing resource, so that obvious coding delay is generated during high-resolution video stream transmission, a fixed handshake verification mechanism cannot adapt to dynamic changes of wireless signal intensity, a complete reconnection process is frequently triggered when channel interference is serious, data packet loss and picture blocking are caused, the integrity and instantaneity of a video stream cannot be guaranteed under a scene with limited bandwidth or complex electromagnetic environment, and the severe requirement of industrial monitoring on low-delay communication is difficult to meet. Disclosure of Invention The invention aims to solve the defects in the prior art, and provides a method and a system for optimizing a security communication protocol of a wireless network camera main board. In order to achieve the above purpose, the present invention adopts the following technical scheme, and a method for optimizing a secure communication protocol of a wireless network camera motherboard, which comprises the following steps: S1, reading a signal-to-noise ratio value and a signal intensity value of a radio frequency front end of a main board of a wireless network camera, calculating a link quality score by using a weighted product of the signal-to-noise ratio value and the signal intensity value, and constructing a congestion judgment threshold value based on fluctuation variance of the link quality score in a time window; S2, capturing photoelectric shot noise at the bottom layer of the CMOS sensor in an image acquisition gap, mapping the analog level of the photoelectric shot noise to a preset quantization interval, converting the analog level into a true random entropy source sequence, and generating a dynamic session key through exclusive OR logic operation of the true random entropy source sequence and clock jitter frequency; S3, analyzing the monitoring video stream to separate I frame data from P frame data, comparing the link quality score with the congestion judging threshold, calling the dynamic session key to execute AES encryption on the I frame data to generate a core ciphertext when judging that the link quality score is lower than the threshold, and performing CRC (cyclic redundancy check) on the P frame data to generate an integrity check code; S4, interweaving and reorganizing the core ciphertext and the integrity check code according to the error correction coding rate reversely mapped by the link quality score to construct a safety protocol data frame, embedding an encryption strategy index value in the physical layer head of the safety protocol data frame, and driving a wireless transmitting unit to execute data transmitting action. As a further scheme of the present invention, the implementation process of S1 specifically includes: S11, periodically scanning a current working frequency band by calling a radio frequency driving interface, extracting the signal-to-noise ratio value refreshed in real time and the corresponding signal strength value from a physical layer register, and carrying out normalization processing on the acquired original data to eliminate dimension differences so as to generate a standardized radio frequency characteristic parameter set; s12, obtaining a standardized signal-to-noise ratio and a standardized signal strength in the standardized radio frequency characteristic parameter set, respectively giving corresponding weighting coefficients to the standardized signal-to-noise ratio and the standardized signal strength according to a preset communication quality weight distribution model, calculating a link communication state index at the current moment through a linear weighting summatio