A method for HDMI linear unidirectional data transmission based on black and white pixel coding
By adopting an HDMI linear unidirectional data transmission method based on black and white pixel encoding, the stability and security issues of cross-isolation domain data transmission are solved, realizing stable, reliable and low-cost unidirectional data transmission in power industrial control scenarios, and adapting to existing HDMI devices without modification.
Patent Information
- Application Number
- CN202611231265.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-11-03
AI Technical Summary
Existing cross-isolation domain data transmission solutions suffer from high transmission latency, risk of virus intrusion, high cost, difficulty in adaptation, low bandwidth, and potential signal leakage. Furthermore, traditional screen capture QR code solutions have poor decoding stability and cannot meet the stable one-way data backhaul requirements of power industrial control scenarios.
A linear unidirectional data transmission method based on black and white pixel encoding is adopted. By deploying a lightweight file intelligent classification model at the intranet sending end, a two-dimensional barcode image of black and white binary pixels is generated and output unidirectionally through the HDMI digital video interface. The receiving end performs frame-by-frame recognition and multi-frame verification. Combined with a timing transmission error prediction model, the acquisition duration and decoding strategy are dynamically adjusted to achieve pure digital signal transmission.
It improves the stability and reliability of data transmission, reduces hardware modification costs, meets the long-term uninterrupted transmission requirements of power industrial control scenarios, and improves automation and security while reducing server load.
Smart Images

Figure CN123035196A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of HDMI linear unidirectional data transmission technology, and particularly relates to a method for HDMI linear unidirectional data transmission based on black and white pixel encoding. Background Technology
[0002] In current power and new energy industrial control scenarios, there are strict physical air gap isolation requirements between the production intranet and the external network business platform. Business data such as power and meteorological monitoring of various station units need to be exported unidirectionally. However, existing cross-isolation domain data transmission solutions have obvious shortcomings: manual USB flash drive transfer relies on manual operation, has high transmission latency and is at risk of virus intrusion; the hardware procurement and modification costs of unidirectional optical shutters are high, and it is difficult to adapt to existing HDMI devices; acoustic and infrared communication have extremely low bandwidth and are at risk of signal leakage; traditional screen capture QR code solutions are affected by camera optical noise, focus distortion and light interference, resulting in poor decoding stability and making it difficult to meet the requirements of batch and stable unidirectional data back transmission.
[0003] Existing screen-capture QR code transmission technology has inherent underlying defects. The entire link requires multiple analog processing steps such as photoelectric conversion and analog quantization, which continuously introduces thermal noise and perspective distortion. The pixels of the display screen and the camera cannot be matched one-to-one, and complex correction algorithms are required to barely achieve recognition. In actual engineering, problems such as blurry QR codes and recognition failures have been occurring for a long time. There is a lack of a complete solution integrating pure digital direct acquisition, time synchronization, and multi-layer verification, which cannot meet the business requirements of 24 / 7 uninterrupted and stable transmission in industrial control. Therefore, there is an urgent need for a unidirectional transmission method based on a pure digital HDMI link and black and white pixel encoding to solve the above pain points. Summary of the Invention
[0004] In view of the aforementioned problems, and in conjunction with the first aspect of the present invention, embodiments of the present invention provide a method for HDMI linear unidirectional data transmission based on black and white pixel encoding, the method comprising: A lightweight file intelligent classification model is deployed at the intranet sending end. The multi-dimensional inherent data characteristics of the file to be transmitted are input into the model for inference. The model outputs two types of attribute labels: file security level and data density. The data packet encryption protection level is dynamically adapted according to the file security level. At the same time, the single-frame two-dimensional barcode layout scale and forward error correction redundancy ratio are adaptively adjusted according to the data density attribute. The intranet sending end compresses and segments the original file to be transmitted, and encapsulates each data block into a standardized transmission data packet with an integrity check mark. The data packet is encoded into a black and white binary pixel two-dimensional barcode image, and the hierarchical label and density label output by the lightweight file feature classification model are embedded in the header of the data packet. The transmitting end outputs a video frame consisting of multiple sets of two-dimensional barcodes in a full-screen loop through the HDMI digital video interface with an open-loop equal-length timing period mechanism. It only outputs pure digital pixel video signals in one direction and has no reverse data interaction channel. The external network receiver uses an HDMI digital acquisition device to acquire digital video frames based on a time-series period synchronized with the transmitter. It then uses a lightweight barcode image quality discrimination model to perform inference and recognition on each acquired frame. The model outputs a pixel purity score and only sends valid frames with scores higher than a preset threshold to the decoding thread. The two-dimensional barcodes within the video frames are decoded in parallel, and the results are verified by voting across multiple frames. The receiving end performs integrity verification, orderly reassembly of data blocks, decompression and restoration on the decoded data packets, and finally outputs the original transmission file. The receiving end builds a timing transmission error prediction model, using frame quality scores, data packet CRC error rate, and number of lost blocks in multiple consecutive cycles as model input features. The model predicts the decoding failure risk value for the next transmission cycle. When the risk value exceeds the warning threshold, it automatically pushes a transmission anomaly alarm to the operation and maintenance platform, and adaptively increases the duration of the receiving end's acquisition window and triggers a multi-round repeated decoding retry mechanism.
[0005] Based on the above, relying on the HDMI pure digital TMDS link and HDMI capture card to complete the direct transmission of digital signals, the system completely eliminates various image distortion problems caused by the photoelectric conversion of the camera. With the help of open-loop synchronous timing, multi-frame voting verification, and multi-level data packet verification mechanism, the stability of barcode parsing and file restoration is greatly improved. The entire system reuses the original HDMI interface of the equipment, without the need to modify the network infrastructure. The hardware deployment cost is far lower than that of dedicated isolation equipment such as unidirectional optical gates. At the same time, it does not carry the general network protocol stack throughout the process, blocking the reverse data transmission path from the external network to the internal network at the physical and protocol levels, and fully meeting the high-level physical isolation security specifications of power industrial control.
[0006] The solution incorporates multiple intelligent models, including lightweight file classification, image quality assessment, and temporal risk prediction. It can adaptively adjust encoding and error correction configurations based on file attributes, predict transmission failures, dynamically adjust acquisition duration, and enable multi-round decoding retry strategies. While reducing server CPU load, it also ensures transmission fault tolerance. The system logs are standardized for easy auditing and review, and it supports long-term automatic operation without continuous manual monitoring. Compared with traditional visual ferry solutions, it significantly improves the automation level of data transmission and the reliability of long-term operation. Attached Figure Description
[0007] Figure 1 This is a schematic diagram of the execution flow of a method for HDMI linear unidirectional data transmission based on black and white pixel encoding provided in an embodiment of the present invention; Figure 2This invention relates to a method for transmitting HDMI linear unidirectional data transmission based on black and white pixel encoding, specifically the data query and assembly method at the transmitting end of the site (getFarmData method). Figure 3 This invention relates to a method for assembling and compressing QR code JSON data at the sending end of a linear unidirectional data transmission method for HDMI based on black and white pixel encoding (using the getQrJsonData method). Figure 4 This is a single-file decoding process (decode_file method) at the receiving end of a method for HDMI linear unidirectional data transmission based on black and white pixel encoding provided in an embodiment of the present invention. Figure 5 This invention provides a receiving end main loop scheduling and file storage method (_run_one_round method) for a method of HDMI linear unidirectional data transmission based on black and white pixel encoding. Figure 6 This is a log record of a method for HDMI linear unidirectional data transmission based on black and white pixel encoding provided in an embodiment of the present invention. Detailed Implementation
[0008] The present invention will now be described in detail with reference to the accompanying drawings.
[0009] Step S110: Deploy a lightweight file intelligent classification model at the intranet sending end, input the multi-dimensional inherent data features of the file to be transmitted into the model for inference, and output two types of attribute labels: file security level and data density. Dynamically adapt the data packet encryption protection level according to the file security level, and adaptively adjust the single-frame two-dimensional barcode layout scale and forward error correction redundancy ratio according to the data density attribute. A lightweight file intelligent classification model, optimized for offline quantization and compression, is deployed locally on the intranet industrial control sending server. The model's inference unit shares process memory with the file monitoring module, enabling real-time forward computation without the need for a dedicated GPU. The system pre-defines three inherent feature extraction operators: file extension type, byte distribution variance, and global data entropy. When a new file is detected, the system synchronously reads the full binary stream, performs sequential calculations to obtain the original values of multi-dimensional features, maps them uniformly to the 0-1 range using a min-max normalization algorithm, and concatenates them into a fixed-length one-dimensional feature vector, which is then fed into the model's input layer. The model incorporates multiple sets of lightweight convolutional and fully connected operators, outputting three levels of file security level labels and three levels of data density labels in parallel. The system pre-stores an encryption strategy mapping table: the ordinary level uses only Base64 encoding, the sensitive level uses a 128-bit block cipher, and the security level uses a 256-bit block cipher and key digest. It also includes barcode layout and error correction redundancy matching rules. High sparsity uses a multi-barcode low-redundancy configuration, while low sparsity reduces the number of barcodes and increases the error correction ratio. The two types of tags and their corresponding scheduling parameters are stored in memory for use in subsequent data packet encapsulation. There is no external network interaction throughout the process; feature and tag data are only transferred in local memory. This adapts to the security requirements of internal network physical isolation. The time for a single model inference is controlled in milliseconds, and the file transfer process is not blocked.
[0010] Step S111: The intranet sending end continuously monitors the specified transmission path and captures newly added files to be transmitted. It extracts the inherent data features of the files in multiple dimensions, and after normalization and unified processing, constructs a standardized feature vector and inputs it into a lightweight offline quantization classification model for inference calculation. The model synchronously outputs two types of classification labels: file security level and data density attribute. It adaptively switches the encryption protection strength of the data packet according to the file security level, and dynamically adjusts the layout size of the single frame barcode and the forward error correction redundancy ratio according to the data density attribute. It writes the classification label, encryption configuration, barcode and error correction scheduling parameters into the extended area of the data packet header, completes the encryption of the data payload according to the adapted encryption rules, and generates a business barcode and a matching error correction barcode in combination with the scheduling parameters. It then splices them together to generate the video frame to be transmitted. The internal network sending end is configured with a background resident monitoring thread that scans the preset transmission directory at a fixed polling interval. After triggering the new file capture logic, it initiates the full-process feature processing. It calls a unified feature extraction interface to traverse the file's binary bytes, batch calculating byte distribution statistics, file entropy, and multi-dimensional indicators such as suffix identifiers. After normalization, it generates a standardized one-dimensional feature vector, which is pushed to a lightweight offline quantitative classification model for inference. Simultaneously, it outputs two categories of identifiers: file security level and data density. The program has built-in logic for associating encryption strategies, barcode layout, and error correction redundancy. It reads the model's output labels and automatically matches the corresponding configuration parameters, writing the two categories of identifiers, encryption identifiers, the number of barcodes per frame, and the error correction percentage into the extended reserved fields of the data packet header. The file chunk payload is encrypted according to the matching encryption algorithm. The barcode scheduling parameters are retrieved to generate business QR codes and matching FEC error correction barcodes. The size is unified by nearest neighbor interpolation scaling and integrated into a 1080P complete video frame and cached in the rendering queue, waiting for the timing scheduling module to retrieve and output. All labels and parameters are embedded in the data packet header, without the need for additional auxiliary files. The barcode frame generation and encryption operation are scheduled serially, and resource consumption is controllable.
[0011] Step S112: The intranet sending end performs compression and block processing on the original file to be transmitted, and encapsulates each data block into a standardized transmission data packet with integrity verification mark, encodes the data packet into a black and white binary pixel two-dimensional barcode image, and simultaneously embeds the hierarchical label and density label output by the lightweight file intelligent classification model into the header of the data packet. The intranet sender reads the complete binary data stream of the original file to be transmitted, calls the zlib lossless compression module to complete global compression, reads the system's preset 280-byte single-block payload threshold, and evenly segments the compressed stream to generate independent data units. Each data unit is independently encapsulated into a standardized data packet. The data packet is filled with content strictly according to the preset field order, sequentially writing a fixed 0x4F4C magic number, the first eight bits of the file's MD5 session identifier, block type, sequence number, total number of blocks, payload length, compressed payload, and a trailing CRC32 checksum. The security classification and data density label output by the lightweight classification model are written using the header extended storage area. The complete binary data packet is Base64 encoded and converted into an ASCII string. Based on the Version 15, M-level error correction standard, the qrcode library is called to generate an independent black and white binary QR image. Each barcode carries the information of a single data packet. The generated business barcode and the subsequently synchronously generated FEC error correction barcode are stored in the frame splicing buffer, waiting to be integrated into a complete display frame according to the grid layout. The checksum and classification label are embedded in the data packet structure throughout the process, ensuring that the receiver can completely read all scheduling information.
[0012] Step S113: The transmitting end outputs a video frame consisting of multiple sets of two-dimensional barcodes in a full-screen loop through the HDMI digital video interface in an open-loop equal-length timing period mechanism. It only outputs pure digital pixel video signals in one direction and has no reverse data interaction channel. The sending end deploys an independent, isolated X11 display service, disabling desktop window manager, pop-ups, and border rendering functions. The output resolution is locked at 1920×1080 and bound to the server's HDMI hardware output channel, used only for outputting integrated multi-barcode video frames. The system's local high-precision timer drives open-loop timing logic, pre-synchronizing all parameters at both ends: transmission period T, barcode display duration t_display, and screen clearing interval. The HDMI physical cable only enables unidirectional TMDS digital signal transmission from the intranet to the internet; the hardware circuitry has no reverse signal feedback path. The graphics card driver disables input capture functionality, and there are no hardware or software channels for the receiving end to send responses, retransmissions, or synchronization commands. Each timing cycle retrieves cached barcode frames for full-screen exclusive rendering, continuously outputting a digital RGB pixel stream until the set duration, after which the screen goes black, automatically looping after the cycle ends. A minimum display duration is set for each file, and the corresponding barcode frame is repeatedly output each cycle within the countdown. Multiple exposures improve the success rate of internet acquisition. There is no bidirectional handshake or clock calibration interaction throughout the process; it is purely unidirectional digital pixel output.
[0013] Step S114: The external network receiver acquires digital video frames through an HDMI digital acquisition device based on a time-series period synchronized with the transmitter. It then uses a lightweight barcode image quality discrimination model to perform inference and recognition on each acquired frame. The model outputs a pixel purity score and sends only valid frames with scores higher than a preset threshold to the decoding thread. The two-dimensional barcodes within the video frames are decoded in parallel, and the decoding reliability is improved through multi-frame result voting verification. The receiver reads the encryption and error correction configuration parameters in the extended field of the data packet header and matches the corresponding decryption rules and decoding fault tolerance strategies to complete the initial parsing of the barcode data. The external network receiver is equipped with a PCIe or USB HDMI capture card, and the capture channel is built based on the V4L2 standard interface. The timing parameters are fully aligned with the transmitter, and the video frame format is fixed as YUYV / MJPEG. An independent circular frame buffer is allocated to temporarily store the captured images. The system loads an offline quantized lightweight barcode image quality discrimination model. Each captured digital image frame is directly sent to the inference unit. Using pixel distribution variance, grayscale gradient, and edge integrity as input features, a purity score in the 0-1 range is calculated. A fixed filtering threshold is configured, and frames below the threshold are directly released from the buffer and discarded. Only high-quality frames are sent to the multi-threaded decoding queue. Multi-threaded parallel calls to the pyzbar engine parse all two-dimensional barcodes in the frame are scheduled. The parsed text of barcodes at the same position in different frames is recorded and stored in the voting buffer. After all frames in a single capture window are decoded, the frequency of decoding results at each position is counted, and the most frequent content is selected as the trusted data packet text. The extended fields of the data packet header are read from the text, the encryption and error correction configuration parameters are extracted, and the corresponding decryption algorithm and fault tolerance rules are matched to complete the initial parsing of the data packet, filtering out distorted and invalid frames to reduce computing power consumption.
[0014] Step S115: The receiving end performs integrity verification, orderly reassembly of data blocks, decompression and restoration on the decoded data packets, and finally outputs the original transmission file; The receiving end obtains a trusted Base64 string after multi-frame voting verification. It first performs URL escaping to remove transmission escape characters, then decodes and restores the complete binary data packet. It splits the data packet according to a preset field structure, including the magic number, session ID, sequence number, and CRC checksum. Data packets with mismatched magic numbers are discarded and logged for error. The payload is extracted, and its CRC checksum is calculated separately and compared with the tail checksum. If verification fails, the original frame is retained for fault tracing. If verification passes, the encrypted header extension area and metadata tags are read. A hash cache pool is built in memory using the session identifier as the key. Compliant data blocks are stored in order of sequence number. Once all fragments are collected, a complete compressed data stream is assembled. The encryption layer is stripped based on the header encryption identifier using the corresponding decryption algorithm. zlib is then used to perform lossless decompression to obtain the original binary file. The original MD5 hash and filename metadata from the session cache are read, and the byte stream is written to the destination directory. The file hash is recalculated and compared with the original value. If the verification is correct, a transmission list is generated and archived. Files with hash anomalies are marked as corrupted. If a session times out and fragments are not collected, the missing sequence number is recorded, awaiting packet replenishment in subsequent cycles.
[0015] Step S116: The external network receiving end deploys a time-series transmission quality prediction model, collects multi-dimensional time-series features such as image quality, data packet verification anomalies, and data block loss during multiple consecutive transmission processes, inputs them into the model for inference, predicts the probability of data parsing failure in subsequent transmission stages, and if the predicted failure probability exceeds the preset judgment threshold, it automatically generates transmission anomaly warning information and dynamically adjusts the image acquisition duration of the receiving end and initiates a multi-round data parsing retry strategy.
[0016] An external network receiver has a resident time-series data acquisition thread. After each complete acquisition, decoding, and data packet verification process, it automatically extracts three types of time-series indicators: the average image quality purity of all frames in the current period, the total percentage of CRC errors in the current data packets, and the total number of unrepairable lost data blocks. A fixed-length circular time-series cache is configured to store continuous periodic indicators. Data from the earliest period is automatically discarded when the cache capacity is exceeded to control memory usage from continuously expanding. The system loads a time-series transmission quality prediction model that has been trained offline using fixed-point quantization. It periodically reads complete time-series samples from the cache, performs minimum-maximum normalization mapping on the three types of indicators to 0~1, concatenates them into a one-dimensional feature vector, and feeds it into the model for inference, outputting the decoding fault risk value for the same interval. A global early warning threshold is set to compare risk values in real time. If the threshold is exceeded, a standardized alarm message carrying the period, feature, and timestamp is assembled and pushed to the operation and maintenance platform. A multi-level acquisition duration adjustment strategy and a multi-round decoding retry logic are synchronized to continuously track multi-period risk changes. When the risk falls back, the system automatically restores the lightweight conventional acquisition and decoding mode. The entire prediction and control logic runs independently and does not consume the core computing power of file decoding.
[0017] Step S1161: Configure the transmission timing buffer area on the external network receiving end. Take a single complete file transmission process as the sampling unit. After each round of collection and parsing, extract three types of timing indicators: image quality, data packet verification anomaly, and missing data block. Continuously store them in the buffer according to the transmission timing. The buffer only retains the indicator sequence of a fixed number of recent periods. If the capacity is exceeded, the earliest timing data will be automatically eliminated to control memory consumption. The external network receiver allocates a fixed-capacity circular time-series buffer area in memory, defining a single complete file acquisition, decoding, and verification process as an independent time-series sampling unit. The maximum number of buffer storage cycles is configured to ensure controllable memory resources. After all data packets in each transmission cycle are parsed, three types of time-series characteristic indicators are automatically calculated: the average pixel purity score of all acquired frames in this cycle, the statistical percentage of CRC check failures in all data packets in this cycle, and the total number of data blocks that cannot be repaired after decoding using FEC. The three sets of indicators are appended to the tail of the circular buffer in chronological order. The program monitors the total number of buffer entries in real time. When the preset capacity limit is reached, the earliest set of periodic characteristic data is automatically deleted, continuously maintaining only the most recent consecutive periodic time-series samples in the buffer. Buffer read / write uses a thread lock mechanism to achieve safe isolation between feature writing and model reading threads. All time-series indicators are only temporarily stored in memory and periodically synchronized and written to the local time-series log for persistence, used for subsequent model iteration optimization and transmission failure review and tracing.
[0018] Step S1162: Load the offline time-series training and fixed-point quantization compression time-series transmission quality prediction model, periodically read the complete continuous periodic feature sequence from the time-series storage buffer, perform minimum and maximum normalization processing on the three types of features: image quality, number of data packet verification anomalies, and data block loss, respectively, map them uniformly to the 0 to 1 value range, and then concatenate them into a standard one-dimensional time-series feature vector. Input the feature vector into the time-series transmission quality prediction model to complete the forward inference operation, and the model outputs the decoding failure probability prediction value in the 0-1 range as the failure risk value for the next transmission cycle; During the receiver program startup phase, the offline time-series training and fixed-point quantization compression transmission quality prediction model is loaded. The model weights are loaded into an independent inference buffer, enabling real-time inference computation without a GPU. Feature reading logic is triggered periodically to extract three sets of raw indicator data from the circular time-series cache, representing three consecutive complete cycles. Min-max normalization operations are performed separately on the average image quality, CRC anomaly count, and data loss amount, unifying the values of these three indicators to the 0-1 range. These are then concatenated in a fixed-dimensional order to generate a standard one-dimensional time-series feature vector. This standardized feature vector is input into the model for gradient-free forward inference. The model fits fault trends based on historical transmission time-series patterns, outputting a 0-1 floating-point decoding fault risk value, which serves as the fault prediction indicator for the next transmission cycle. After inference, the temporary memory for the feature vector is automatically released, retaining only the risk prediction value and the raw time-series indicators for threshold comparison and logging. The inference process and decoding thread resources are isolated, preventing them from competing for CPU computing power.
[0019] Step S1163: The receiving end presets a global fault judgment threshold and compares the fault risk prediction value output by the model with the preset judgment threshold in real time. When the predicted risk value is less than or equal to the threshold, the current collection window duration and decoding rounds remain unchanged, and the regular collection and decoding process continues to be executed. When the predicted risk value exceeds the preset judgment threshold, the abnormal handling branch process is immediately triggered. First, a standardized alarm message containing the current cycle number, historical feature indicators, predicted fault probability, and risk exceeding time stamp is assembled and pushed to the operation and maintenance management platform to complete the abnormal information reporting. The receiving end presets a global fault judgment threshold in the system's persistent configuration file. After the model outputs the fault risk value for the next cycle, it starts the numerical comparison logic in real time, with branch judgment running independently of the decoding main thread. When the predicted risk value is less than or equal to the preset threshold, the system does not change the basic operation strategy of the acquisition window duration and single-round parallel decoding. It clears the temporary feature cache for this round of inference and directly enters the time series indicator acquisition process for the next cycle, maintaining a lightweight and conventional operation mode. If the risk value exceeds the judgment threshold, an anomaly handling branch is immediately started. It retrieves the current cycle number, all historical time series features in the cache, the predicted risk value for this cycle, and the system's standard timestamp to assemble a standardized alarm message. The message uses structured JSON format and is actively pushed to the operation and maintenance management platform through the backend communication interface. The platform synchronously generates a visual alarm record and retains the original alarm data for subsequent fault location. The alarm push does not block the normal data acquisition and barcode decoding process for the current cycle.
[0020] Step S1164: Execute the adaptive adjustment logic for acquisition duration, set multi-level duration adjustment gradients based on the risk exceeding the standard, slightly extend the image acquisition window duration when the risk value slightly exceeds the standard, and significantly widen the acquisition window range when the risk value significantly exceeds the standard, to ensure that the acquisition window completely covers the barcode display period at the sending end, and synchronously update the locally stored acquisition duration configuration parameters, and directly load the updated duration parameters in the next transmission cycle to perform video frame acquisition; The system is pre-configured with three levels of risk exceedance gradient rules, distinguishing between minor, moderate, and significant exceedance scenarios, each corresponding to a different extension of the acquisition window. The higher the risk value, the greater the expansion of the acquisition window t_capture. Upon triggering a risk exceedance alarm, the program reads the corresponding gradient's duration adjustment parameters, overwriting the locally persistent acquisition window configuration. The parameters take effect immediately, and the next round of timing acquisition threads directly loads the updated duration parameters to perform image capture. The extended acquisition window duration is always less than the barcode display duration at the sending end, ensuring the window fully covers the barcode output period and increasing the number of effective high-quality frames captured. The duration adjustment operation only modifies local configuration parameters, without requiring a restart of the acquisition and decoding services, and parameter updates are completed within a single transmission cycle. When the risk falls back to the target after multiple cycles, the program automatically reads the system's default baseline duration, overwrites the adjusted parameters, and restores the initial acquisition window configuration. The entire process is dynamically adaptively controlled without manual intervention to modify the configuration file.
[0021] Step S1165: Synchronously start the multi-round data parsing retry mechanism. For all the video frames in the current session, on the basis of the regular one-round parallel decoding, multi-round cyclic decoding logic is automatically superimposed. After each round of decoding is completed, multi-frame voting verification is performed separately. The results of multiple rounds of decoding are cross-compared to each other, and the parsing results of the repeatedly appearing valid data packets are selected as reliable data to improve the data restoration success rate of incomplete frames and slightly distorted frames. After triggering the risk exceeding the limit logic, the system automatically activates a multi-round data parsing retry mechanism. For all valid high-quality frames in the current acquisition window's cache queue, multiple rounds of cyclic decoding tasks are superimposed on top of the default single-round parallel decoding. Each round of decoding independently allocates a fixed number of decoding threads, calling the pyzbar engine to traverse all barcode areas. After each round of decoding, multi-frame voting verification is performed independently, recording the barcode parsing text at each position in each round. After all multiple rounds of decoding are completed, the parsing results from multiple rounds at the same grid position are cross-compared, and the total frequency of each text is counted. The text with the highest frequency is selected as the content of the trusted data packet. Multiple sets of data with the same frequency are directly discarded, avoiding parsing errors caused by distorted frames. Multi-round decoding scheduling allocates a separate computing power thread pool, without preempting basic decoding core resources, effectively improving the data restoration success rate of low-quality and incomplete barcode frames.
[0022] Step S1166: Continuously monitor the trend of predicted risk value changes over multiple consecutive periods. If the predicted risk value of the model falls back to within the judgment threshold after multiple consecutive rounds, the acquisition window duration is automatically reverted to the system default baseline value, the multi-round decoding retry mechanism is turned off, and the receiver's normal lightweight acquisition and decoding operation mode is restored.
[0023] The receiving end time-series prediction module continuously records the model output fault risk value cycle by cycle, maintains a temporary sliding array of risk values for multiple consecutive cycles, and monitors the changing trend of all risk values in the array in real time. When the risk prediction values for a preset number of consecutive cycles all fall back to within the global fault judgment threshold, the program performs an automatic parameter rollback operation, restoring the previously increased image acquisition duration to the factory default baseline parameters, simultaneously disabling the multi-round loop decoding retry scheduling logic, destroying the dedicated thread pool for multi-round decoding, releasing excess CPU computing power resources, and switching back to the lightweight conventional operation mode of single-round parallel decoding. Parameter callback operations are written to the local configuration file for persistent storage in real time to avoid parameter corruption after service restart. After the switch is completed, the risk trend sliding array is cleared, and a new round of continuous cycle risk value monitoring begins. The entire adaptive fallback logic runs automatically, without requiring maintenance personnel to manually restore the acquisition and decoding configurations.
[0024] Step S120: The intranet sending end performs compression and block processing on the original file to be transmitted, and encapsulates each data block into a standardized transmission data packet with integrity verification mark, encodes the data packet into a black and white binary pixel two-dimensional barcode image, and simultaneously embeds the hierarchical label and density label output by the lightweight file feature classification model into the header of the data packet. This specific implementation runs on a dedicated business processing thread of an internal network-isolated industrial control server, without establishing any external network connection, strictly adhering to the physical isolation and control requirements of the production domain. After reading the complete original file binary stream, the program calls the zlib lossless compression operator to perform global compression, uniformly dividing the compressed byte stream according to a preset 280-byte single-block payload threshold, generating independent data units with unique sequence numbers. For each data unit, a standardized transmission data packet is constructed, with a 4-byte CRC32 integrity check code embedded at the end of the data packet as a verification identifier. A dedicated extended storage area is allocated at the beginning of the data packet, where the file security classification label and data density label output by the pre-embedded lightweight file intelligent classification model are completely written into the extended field. The encapsulated binary data packet is converted into ASCII text adapted to two-dimensional barcodes via Base64 encoding. The Version15, M error-correction level black and white QR code standard is used to generate independent binary barcode images. Each data packet corresponds to a barcode. The generated barcode materials are uniformly stored in the memory rendering cache. The entire process of compression, encapsulation, encoding, and image generation is completed in memory only, without any temporary disk files, reducing the internal network storage read and write load. At the same time, the file attribute tags are fixed inside the data packet.
[0025] Step S121: The intranet sending end continuously inspects the designated transmission directory, identifies newly added files to be transmitted, extracts file features and sends them to the lightweight file intelligent classification model for inference, outputs two types of attribute tags: file security level and data density, and caches them in this transmission session. After reading the original binary stream of the file and compressing it without loss, it is evenly split into multiple independent data units according to the single block carrying capacity. This specific implementation is deployed on an internal power control isolation server. A background resident inspection thread polls the preset isolated transmission directory at fixed intervals. Once a new original file to be transmitted is captured, the entire process of feature extraction and lightweight model inference is immediately initiated. The program automatically reads the complete binary bytes of the file, extracts multi-dimensional inherent features such as file extension, byte distribution variance, and global data entropy, unifies the numerical range using a min-max normalization algorithm, and concatenates them into a fixed-length one-dimensional feature vector. This vector is then input into an offline quantized and compressed lightweight file intelligent classification model to perform gradient-free forward inference, and outputs three levels of file security level and three levels of data density as attribute labels. The labels are cached in an independent memory area dedicated to the file's transmission session. Subsequently, the zlib lossless compression operator is called to compress the original binary stream of the file as a whole. Based on the system's preset 28-byte single-block carrying capacity threshold, the compressed data stream is evenly divided, generating multiple isolated data units with independent sequence numbers. The entire data flow is completed only in the local memory of the internal network, without accessing any external network communication links, fully meeting the physical air gap isolation security specifications of the production domain.
[0026] Step S122: Assemble a standardized transmission data packet for each data unit. The data packet contains a fixed check identifier, a unique session identifier, block attributes, sequence number, total number of blocks, payload length, service payload, and a tail check code. The two types of attribute labels output by the model are stored in the packet header extension area, as well as the encryption strategy, barcode layout specifications, and error correction redundancy configuration parameters adapted to this file. This specific implementation standardizes and encapsulates each independent data unit obtained from S121 into a data packet for transmission. The packet byte arrangement strictly follows the unified protocol specification, sequentially filling in a 0x4F4C fixed magic number checksum, a session unique identifier composed of the first eight bits of the file's MD5 hash, a block attribute field distinguishing between services and FEC, a single block sequence number, the total number of file blocks, the payload byte length, compressed service payload, and a 4-byte CRC32 integrity checksum at the end. A fixed extended storage area is reserved in the packet header, where the file security level and data density attribute labels output by the lightweight classification model are written. Simultaneously, the encryption algorithm identifier matching the current file, the 4×2 grid barcode layout specification, and the RS(5,1) forward error correction redundancy ratio parameters are stored. After encapsulation, the total byte length of the data packet is verified. Data packets with field overflow or abnormal length are discarded and written to the local intranet operation log. Compliant data packets are transferred to the Base64 encoding process. All scheduling parameters are embedded in the packet header, allowing the sending and receiving ends to self-parse and adapt without additional synchronized configuration files.
[0027] Step S123: Convert the complete data packet into a text string that can embed a two-dimensional barcode, using a specified black and white QR barcode carrier, and generate an independent barcode image for each data packet; This specific implementation reads the complete binary data packet encapsulated by S122, calls the standard Base64 encoding interface to convert the binary bytes into a pure ASCII text string without special control characters, eliminating the interference of special symbols on barcode parsing. The system consistently uses a Version 15 specification, M-level Reed-Solomon error correction standard black and white binary QR code as the carrier, and relies on the qrcode encoding library to complete barcode rendering. Each independent data packet generates an independent barcode image, which retains only pure black and white pixels and does not have grayscale transition pixels. The generated single barcode image is bound to the corresponding session ID and block sequence number and stored in the in-memory barcode cache queue. Barcode generation is allocated to an independent lightweight quantum thread for asynchronous operation, which does not block the main thread of file compression and data packet encapsulation. The barcode material in the cache waits for the grid stitching process to be called. There is no temporary disk write operation throughout the process, reducing the disk read and write overhead of the internal network server.
[0028] Step S124: Read the barcode layout parameters stored in the packet header, stitch all barcode images according to the corresponding grid specifications, and scale them to standard resolution using an interpolation algorithm without grayscale gradient. This specific implementation reads the barcode layout grid parameters stored in the extended area of the S122 data packet header, determines the standard 4-column 2-row layout specification, retrieves all business QR code images under the same session from the barcode cache queue, and arranges them in ascending order according to the data block sequence number to form a barcode array. The image size adaptation operation uniformly adopts the NEAREST nearest neighbor interpolation algorithm. This algorithm only reuses the original black and white pixel values and does not generate any intermediate grayscale transition pixels, fully preserving the QR code locators and sharp boundaries of data modules, avoiding the edge blurring problem caused by smooth interpolation. After array scaling, it uniformly adapts to the standard 1920×1080 HDMI output resolution, generates complete business barcode frames, and stores them in the rendering memory pool. Image scaling relies only on the server's ordinary CPU basic image operators, without the need for GPU graphics acceleration, adapting to existing industrial control intranet devices without dedicated graphics cards.
[0029] Step S125: Based on the error correction ratio parameters in the packet header, a matching error correction data unit is generated synchronously. The error correction unit reuses the same packet, encoding, and barcode generation process to integrate the business barcode and the error correction barcode into a complete display frame, which is then sent to an independent display program to wait for HDMI timing cycle output.
[0030] This specific implementation reads the FEC error correction redundancy ratio parameters recorded in the extended area of the S122 packet header, generates matching error correction data units according to the preset redundancy ratio, and reuses the same compression, segmentation, standardized packetization, Base64 encoding, and QR code generation processing logic as the business data to generate an independent error correction barcode image. All error correction barcodes are integrated with the business barcode array generated in S124 into the same 1080P video frame, completing the mixed rendering of business and error correction barcodes to generate a complete output display frame, which is then cached in an independent X11 display program rendering queue awaiting timing scheduling instructions. Synchronous transmission of FEC redundant barcodes allows for data repair even in scenarios with minor barcode pixel distortion or localized block loss at the receiving end, significantly improving the probability of complete file restoration in low-quality acquisition scenarios. The entire integration process operates in a closed-loop memory manner, with no intermediate images stored on the ground.
[0031] Step S130: The transmitting end outputs a video frame consisting of multiple sets of two-dimensional barcodes in a full-screen loop through the HDMI digital video interface with an open-loop equal-length timing period mechanism. It only outputs pure digital pixel video signals in one direction and has no reverse data interaction channel. This specific implementation relies on a high-precision hardware timer on the server to build an open-loop timing scheduling system. The transmitting and receiving ends only manually synchronize the basic timing parameters, such as the transmission period T and barcode display duration t_display. The HDMI physical cable hardware circuit is designed only for unidirectional TMDS digital signal transmission, with no reverse electrical transmission loops. Neither the graphics card driver nor the application layer has a communication channel for response, retransmission, or clock synchronization feedback. Each timing cycle scheduling thread retrieves the complete service + error correction barcode image integrated by the S125 and outputs a pure RGB digital pixel stream in full screen through the HDMI TMDS channel. The transmitted data stream only carries barcode pixel information and does not encapsulate TCP / IP or Ethernet network protocol data packets. The system abandons the traditional two-way handshake synchronization mechanism, relying solely on multi-cycle repeated output to compensate for the lack of feedback and real-time retransmission. The entire image output timing logic operates in a closed loop within the intranet, with no cross-network data interaction.
[0032] Step S131: The sending end builds an independent and isolated display environment, shields various interference rendering components on the desktop, unifies and fixes the output resolution and binds the local HDMI hardware output channel for outputting the integrated barcode full-screen image; This specific implementation builds a dedicated, isolated X11 display runtime environment on an intranet server, independently allocating a dedicated display output port. Background processes uniformly disable window managers, pop-up rendering, taskbars, mouse cursors, and window borders—all actions that interfere with rendering—preventing desktop layers from obscuring or cropping the full-screen barcode image. The system locks the display output resolution to a fixed 1920×1080, binding the display rendering path to the local HDMI graphics card output channel at the hardware level. The graphics card driver only enables the image output function, disabling all input capture and reverse signal receiving driver interfaces. This X11 display service runs as an independent systemd process resident in the background, isolated from file processing and barcode generation threads. It is solely used to load and render the integrated barcode display frame generated by the S125, and does not handle other display services such as maintenance desktops or remote operations, eliminating pixel obscuring and distortion issues in the barcode image from the rendering layer.
[0033] Step S132: The system configures a complete set of local timing and timing rules, relies on the local high-precision clock to drive the operation, the link only supports unidirectional signal transmission, there is no bidirectional communication condition, the sending and receiving only have unified basic timing parameters, and there is no handshake, response, or bidirectional synchronization interaction logic throughout the process. In this specific implementation, the entire timing scheduling rule is driven by a local, independent, high-precision hardware timer on the server. It pre-configures a complete set of timing parameters, including the transmission period T, barcode display duration t_display, and black-screen clearing interval. The timer does not rely on the external network or the receiver clock for synchronization calibration. The HDMI physical cable only has unidirectional signal transmission capability from the internal network to the external network. The hardware circuit has no reverse wires, the graphics card driver disables the reverse data capture interface, and the application layer does not create any reverse data listening sub-threads. There are no hardware or software interaction conditions for the receiver to send acknowledgments, retransmissions, or clock calibration commands back to the internal network. The transmitting and receiving ends only need to manually unify the basic timing parameters beforehand to match the timing. There is no bidirectional handshake, feedback confirmation, or clock calibration interaction logic throughout the process. It relies on open-loop autonomous cyclic stable output of barcode frames, fully complying with the safety management standards for unidirectional transmission via physical air gaps in power industrial control systems.
[0034] Step S133: Within each time cycle, the system retrieves the complete screen of the integrated business and error correction barcode and performs exclusive full-screen rendering. It continuously outputs pure pixel digital signals through the HDMI digital channel within the specified duration. After the screen display duration ends, the full-screen screen is cleared and the black screen is maintained until the single cycle is completed. Then, the next output cycle is automatically started. A single file will be displayed repeatedly for multiple cycles, and the success rate of receiving and acquiring data is improved by multiple exposures. In this specific implementation, after each complete timing cycle begins, the scheduling thread retrieves the complete image of the integrated business and error-correcting barcodes from the cache, calls the dedicated full-screen rendering interface, and continuously outputs for the duration set by t_display. The graphics card outputs a pure RGB digital pixel stream bit by bit through the HDMI TMDS channel, and the image only carries black and white barcode pixel data without any additional layer overlay. After the display duration countdown reaches zero, global pure color black screen rendering is performed, the barcode pixel signal output is cut off, and the black screen image is maintained until the complete cycle T ends, and then a new round of barcode rendering output loop is automatically restarted. The system configures a minimum continuous output duration t_min for each file to be transmitted. Before the countdown ends, the corresponding barcode frame is repeatedly output in each timing cycle. By relying on multiple cycles and multiple exposures, the probability of the external network HDMI acquisition device capturing effective images is improved. After a single file is transmitted, the rendering queue for the next file is automatically switched.
[0035] Step S134: The hardware cable, graphics card driver, and application scheduling layers are all subject to one-way isolation restrictions. The physical link only allows the internal network to transmit video signals to the outside, and closes all reverse signal receiving paths. The sending scheduling thread is only responsible for screen output and will not listen to the reverse data of the link. The receiving device only has screen capture function and cannot send any instructions or data in reverse. The entire link achieves one-way isolation transmission. This specific implementation constructs a full-link unidirectional isolation system from three layers: hardware cables, graphics card drivers, and application scheduling. At the hardware level, the unidirectional HDMI cable only connects the HDMI output port of the internal network graphics card to the input port of the external network acquisition card. The cable internally only contains a unidirectional TMDS signal transmission line, with no reverse electrical signal transmission loop. At the graphics card driver level, input acquisition and reverse communication-related driver interfaces are disabled, blocking the reverse signal path at the hardware level. At the application layer, the timing scheduling thread only implements the barcode image rendering output logic and does not create a reverse data listening thread. The external network-side HDMI acquisition hardware only has the function of digital video frame reading and acquisition, and does not have the hardware capability to send images, instructions, or data packets to the external network. It cannot transmit any interactive information to the internal network. The three-layer isolation mechanism completely eliminates the risk of reverse data and instruction leakage from the external network to the internal network, meeting the high-level physical isolation security requirements.
[0036] Step S135: The entire process of image stitching and scaling uses an interpolation method without grayscale gradient to process the barcode image, ensuring that the black and white boundaries of the barcode are clear and complete, and the image is transmitted to the receiving acquisition device without loss via a digital HDMI link.
[0037] In this specific implementation, the NEAREST nearest neighbor interpolation algorithm is used uniformly to complete pixel scaling calculations during the barcode image stitching and size adaptation stages. The calculation process only reuses the original black and white pixel values and does not generate any intermediate grayscale transition pixels, thus fully preserving the sharp black and white boundaries of the QR code locator and data module, and eliminating defects such as edge blurring and pixel gradient distortion. The scaled 1920×1080 standard barcode frame is transmitted through a pure digital HDMI™ link, without going through photoelectric conversion or optical imaging stages, and without the introduction of thermal noise and spatial distortion. The pixels at the sending end and receiving end correspond precisely one-to-one, and the lossless transmission to the external network HDMI capture card provides high-purity original digital image material for the receiver's lightweight image quality discrimination model and multi-threaded decoding module, significantly reducing the probability of frame filtering and barcode decoding failures.
[0038] Step S140: The external network receiver acquires digital video frames through the HDMI digital acquisition device based on the time period synchronized with the transmitter, and accesses the lightweight barcode image quality discrimination model to perform inference recognition on each acquired frame. The model outputs the pixel purity score of the image, and only valid frames with scores higher than the preset threshold are sent to the decoding thread to decode the two-dimensional barcode in the video frame in parallel, and the results of multiple frames are verified by voting. This specific implementation is deployed on an external network service server, relying on a PCIe or USB HDMI capture card to build a receiving and acquisition link. The acquisition program pre-synchronizes a complete set of timing period and acquisition window configuration parameters with the sending end through the V4L2 standard interface. The system timing thread periodically starts the acquisition process. Each time a pure digital HDMI video frame is captured, it is sent to the offline quantization lightweight barcode image quality discrimination model for frame-by-frame inference calculation. Based on three core indicators—pixel distribution, grayscale gradient, and edge integrity—it outputs a pixel purity score in the range of 0 to 1. The program has a built-in image quality filtering mechanism. Only high-definition valid frames with scores higher than the system's preset threshold are sent to the decoding task queue. Low-scoring distortion frames are directly released from the buffer to reduce computing power consumption. The decoding stage uses multi-threaded concurrent scheduling to simultaneously parse all grid QR codes within a single frame. For the parsing results of multiple frames of the same coordinate barcode, a majority voting verification mechanism is used to eliminate single decoding errors. Finally, the reliable parsed text is uniformly pushed to the data packet parsing module. The entire acquisition-discrimination-decoding process is resident in the background and automatically loops without manual intervention.
[0039] Step S141: After the receiver starts up, initialize the HDMI digital acquisition device, establish an acquisition channel based on the V4L2 standard interface, configure the fixed transmission period T and acquisition window t_capture parameters that are completely consistent with the transmitter, synchronously set the video frame output format to YUYV / MJPEG and lock the resolution to 1920×1080, create an independent frame buffer queue for temporary storage of the acquired complete digital video frames, open up the inference memory buffer of the lightweight barcode image quality discrimination model, load the image quality discrimination model weight file that has completed offline quantization training, and complete the initialization of the model forward inference environment; This specific implementation synchronously initializes both the HDMI acquisition hardware and the lightweight image quality discrimination model during the receiver service startup phase. The program calls the standard V4L2 system interface to complete the hardware binding of the acquisition card, uniformly configuring the transmission period T and acquisition window t_capture to perfectly match the transmitter, locking the video output format to YUYV / MJPEG and the output resolution to 1920×1080. A ring-shaped frame buffer with an upper limit is allocated in the process memory to temporarily store unprocessed digital video frames and prevent memory overflow; a dedicated inference buffer is allocated for the model, reading the model weight file completed by offline quantization training, and batch initializing the convolution, fully connected operators, and pixel feature calculation logic, uniformly limiting the model output purity score range to 0 to 1. All initialization operations are executed only once at program startup, and automatically enter the time-series acquisition loop after completion, without requiring manual secondary parameter configuration. The acquisition channel and model memory resources are isolated from each other, and multi-threaded memory read / write conflicts are avoided through thread locks.
[0040] Step S142: The timing scheduling thread of the receiving end runs in a loop according to the synchronization cycle. After each round of acquisition window is opened, it continuously calls the V4L2 interface to capture pure digital video frames output by the HDMI acquisition card. Each time a complete pixel image is acquired, it is sent to the lightweight barcode image quality discrimination model to perform frame-by-frame inference. The model uses the variance of black and white pixel distribution, the mean of gray level gradient, and edge integrity in the frame as input features to automatically calculate and output the image pixel purity score in the range of 0 to 1. This specific implementation uses an independent time-scheduled thread to handle the periodic loop logic. The thread loads the period and acquisition window parameters that are perfectly aligned with the sending end, and generates the acquisition trigger signal based on a local high-precision hardware timer. During the acquisition window opening phase, the V4L2 native frame reading interface is continuously called to directly acquire the raw, pure digital pixel frames output by the HDMI capture card without photoelectric analog-to-digital conversion. The transmission process does not copy the complete frame data; it only passes the pixel memory pointer to the image quality inference sub-thread, significantly reducing memory bandwidth consumption. The sub-thread asynchronously completes the entire process of frame preprocessing, feature statistics, model inference, and score conversion, while the main thread continuously captures frames without interruption. Acquisition and inference are asynchronous and parallel, maximizing the number of digital images captured in a single period, providing sufficient image samples for subsequent multi-frame voting verification. The entire lightweight frame processing logic runs stably for a long time, and the server CPU load is controllable.
[0041] Step S1421: During the initialization phase of the receiving system, the V4L2 acquisition channel and the lightweight barcode image quality discrimination model are loaded as dual resources. The HDMI acquisition card hardware is bound through the V4L2 interface. The acquisition resolution is uniformly configured to 1920×1080 and the image output format is YUYV. A fixed-size circular frame buffer is opened for temporary storage of the captured complete digital frames. The offline quantization weight file of the lightweight barcode image quality discrimination model is read. An independent inference calculation buffer is allocated in memory. The model operator and feature calculation logic are initialized. The preset purity score output range is [0,1]. This specific implementation initializes the core execution logic of the receiving system, simultaneously deploying and loading the V4L2 acquisition channel and the lightweight image quality discrimination model. The program binds to the HDMI acquisition hardware device via V4L2 standard calls, fixing two basic configurations: 1920×1080 resolution and YUYV pixel format. A first-in-first-out circular frame buffer is created, and a maximum storage limit is set to controllable memory capacity. An independent process inference memory partition is allocated, reading the model weight file after fixed-point quantization compression. The pixel variance, grayscale gradient, and edge integrity feature calculation functions are initialized sequentially, along with model convolution and fully connected operators. The preset model output image purity score range is 0 to 1. All hardware binding, weight loading, and operator initialization operations are executed only during program startup; resources are not repeatedly loaded during runtime, effectively reducing the computational overhead of the loop inference process.
[0042] Step S1422: The timing scheduling thread loads the period parameter T and the acquisition window duration t_capture that are perfectly matched with the sending end, and drives the loop process with a local high-precision timer. Whenever the acquisition window start command is triggered, the thread continuously calls the V4L2 frame reading interface to capture raw pure digital pixel images without analog-to-digital conversion and optical distortion from the HDMI acquisition. After each frame is successfully read, the frame pixel memory pointer is passed to the image quality discrimination and inference sub-thread. This specific implementation relies on a local high-precision timer to drive the acquisition loop. The timing scheduling thread loads the transmission period T and acquisition window t_capture parameters pre-unified with the sending end. Whenever the acquisition window triggers a signal, it continuously calls the V4L2 underlying frame reading interface to pull raw digital video frames. The image output by the acquisition card is pure digital pixel data without photoelectric conversion, and there is no analog distortion such as lens distortion or light-sensitive noise. The program does not perform full-frame memory copy operations, but only forwards the pixel data memory address pointer to the image quality inference sub-thread, reducing memory read and write overhead. The main thread continuously captures images, while the inference sub-thread performs synchronous and asynchronous operations. The scheduling of the two does not block each other, and as many raw digital frames as possible are captured within the limited acquisition time, providing sufficient sample support for multi-frame voting verification and improving decoding fault tolerance.
[0043] Step S1423: The inference sub-thread preprocesses the input YUYV format digital frame, separates the luminance Y channel data and discards the chrominance UV channel, retaining only the single-channel grayscale matrix carrying the black and white barcode pixels; based on the grayscale matrix, it sequentially calculates the three types of input features, traverses all pixels to count the distribution variance of black and white pixel values, extracts the mean grayscale gradient of pixels in the barcode grid area, extracts the edge integrity index of barcode locators and module boundaries through edge detection operators, normalizes the three types of features to a unified numerical range, and concatenates them into a one-dimensional standard feature vector as model input; This specific implementation involves the preprocessing of the image quality discrimination model's front-end frames and the logic for feature calculation. After receiving the pointer to the YUYV format digital frame, the inference sub-thread directly strips the UV chromaticity channels, retaining only the Y luminance channel carrying the black and white barcode information to generate a single-channel grayscale matrix. Three feature numerical calculations are performed sequentially: a global traversal of all pixels to calculate the variance of the black and white pixel distribution; the extraction of the average grayscale gradient from the barcode grid area; and the extraction of the QR code locator and the edge integrity index of the data module using an edge detection operator. The three types of features are then normalized, mapped to the same numerical range, and concatenated in a fixed order to form a one-dimensional standard feature vector as model input. The feature calculation process reuses a temporary memory buffer throughout, avoiding the repeated allocation of large memory spaces and effectively controlling memory usage per inference cycle.
[0044] Step S1424: The normalized one-dimensional feature vector is fed into the lightweight barcode image quality discrimination model to perform forward inference operation. The model has built-in multi-layer lightweight convolution and fully connected operators to quantify the degree of pixel distortion and output a single floating-point numerical result. The original output of the model is linearly mapped and converted to normalize the original inference value to the range of 0 to 1 to obtain the pixel purity score of the current frame. This specific implementation executes a lightweight image quality discrimination model's forward inference process. Normalized one-dimensional feature vectors are fed into the model's input layer. Multi-layer lightweight convolutions and fully connected operators are used to comprehensively evaluate the degree of image pixel distortion, outputting unstandardized raw floating-point inference values. The program incorporates a linear mapping conversion function to normalize the model's native output values to the standard range of 0 to 1, generating a pixel purity score specific to the current frame. A score closer to 1 indicates clearer black-and-white boundaries in the barcode and less grayscale noise. After the inference operation is complete, the temporary memory for the feature vectors is immediately released. Only the frame number, the three types of raw features, and the purity score are stored in a thread-safe temporary cache to avoid continuous memory fragmentation and ensure long-term stable server operation.
[0045] Step S1425: After the inference is completed, the current frame number, the three types of original feature values, and the final purity score are bound and stored in the temporary feature log cache, and the temporary memory for grayscale matrix calculation is released simultaneously; the scheduling thread reads the purity score, compares it with the system's preset judgment threshold, completes the effective frame screening branch judgment, and then destroys the temporary resources for this inference, waiting for the next frame of digital image input to execute the repeated inference process; This specific implementation performs cache writing and branch judgment operations after single-frame image quality inference is completed. The current frame sequence number, black-and-white pixel distribution variance, grayscale gradient mean, edge integrity, and normalized purity score are bound and written to the thread-safe feature log cache. Simultaneously, temporary memory for operations such as grayscale matrices and feature vectors is released to avoid long-term memory leaks. The main thread, scheduled in a time-sequence manner, reads the purity score from the cache and performs a real-time numerical comparison with the image quality judgment threshold persistently stored in the system, dividing the process into two categories: valid frames and invalid frames. After the branch logic is executed, all temporary resources generated by this inference are destroyed, and the system enters sleep mode to wait for the next frame of digital image input. This repeats the entire lightweight processing flow of frame capture, feature calculation, and model inference, resulting in low CPU overhead per frame.
[0046] Step S1426: After all frames in a single acquisition window have been processed, the feature and score logs of all frames in this window are archived in batches and pushed to the time-series transmission quality prediction model as a historical image quality time-series feature data source. At the same time, all temporary caches for this round of inference are cleared, and the process of complete frame capture, feature calculation, model inference, and score output is waited for the next acquisition window to open.
[0047] This specific implementation uses a single acquisition window for resource archiving and cache clearing logic. After the current acquisition window completes its full timeout, the program batch reads all frame features and purity score logs stored in this window, packages them uniformly, and pushes them to the upper-layer time-series transmission quality prediction model as historical image quality time-series feature samples for fault probability inference calculations. After the feature data is pushed, the circular frame cache, model inference buffer, and temporary feature log cache are cleared in batches to completely release the memory resources occupied by this round of acquisition and inference, preventing continuous memory expansion caused by multiple cycles. After the cache is cleared, the time-series scheduling thread enters a sleep waiting state until the next acquisition window trigger signal is generated, restarting the complete frame capture, feature calculation, and model inference loop.
[0048] Step S143: Pre-configure a fixed threshold for image quality judgment. The purity score output by the model is compared with the threshold in real time. If the score is lower than the threshold, the current video frame is discarded directly and does not enter the decoding process. The frame buffer memory is released to reduce CPU usage. If the score is higher than the preset threshold, the valid frame is pushed to the multi-threaded decoding task queue. Only high-quality frames are selected to participate in the subsequent two-dimensional barcode parsing, and invalid frames with blur, noise, or grayscale distortion are filtered out. This specific implementation incorporates pre-processing logic for image quality filtering. The system configuration file persistently stores fixed thresholds for image quality assessment. Each frame, after being processed by a lightweight model to output a purity score, automatically triggers a numerical comparison operation. If the score is below the preset threshold, the current frame is determined to have defects such as blurriness, noise, or grayscale distortion. The program directly releases the circular cache memory occupied by that frame, without pushing it to the decoding thread pool, thus saving CPU resources consumed by invalid decoding. If the score is above the threshold, it is marked as a valid high-definition frame, and the frame data is completely pushed to the multi-threaded decoding task queue for concurrent parsing. The frame filtering logic runs on the main acquisition thread, filtering out distorted and invalid images in the pre-decoding stage, optimizing the overall server computing power allocation efficiency. Filtering events are synchronously written to a simple operation log for easy tracing of image quality degradation issues.
[0049] Step S144: Start multi-threaded parallel decoding scheduling for all valid video frames in the task queue, allocate a preset number of decoding threads to synchronously call the pyzbar decoding engine to traverse all two-dimensional barcode areas in the frame, and synchronously parse all barcode images in the screen in a single loop, synchronously record the frame number, grid position, and original decoding text result corresponding to each barcode and temporarily store them in the voting buffer area. This specific implementation constructs a fixed-capacity multi-threaded decoding thread pool. The system presets the number of parallel decoding threads, and idle threads are automatically allocated for concurrent processing after a valid frame is pushed to the task queue. Each thread independently calls the pyzbar decoding engine to traverse all QR code areas in the 4×2 grid within the frame, parsing all two-dimensional barcodes in a single frame at once. For each successfully parsed Base64 text set, the corresponding frame number, barcode grid coordinates, and original decoded text are synchronously recorded and stored in the thread-safe voting buffer. The thread pool adopts a blocking queuing mechanism. When the task is full, new frames are automatically queued, preventing the unlimited creation of decoding threads that would consume CPU resources. After the decoding operation of a single frame is completed, the thread is returned to the thread pool for reuse, eliminating the need for frequent process creation and destruction, and reducing system scheduling overhead.
[0050] Step S145: After all valid frames in the current acquisition window have been decoded in parallel, perform multi-frame voting verification logic for multiple decoded texts generated by multiple frames under the same grid position, count the frequency of the same decoding result, select the text with the most occurrences as the reliable parsing result of the barcode at that position, and discard the barcode data at that position if there are multiple sets of different decoded texts with the same frequency. This specific implementation uses multi-frame voting verification as its core logic. After all valid frames in the current acquisition window are decoded in parallel, the program groups and counts all decoded text according to the unique coordinates of the barcode grid. A majority voting mechanism is used to count the frequency of each parsing result, and the text with the highest repetition frequency is selected as the reliable data packet content for that position. If two or more different texts have the exact same frequency, the barcode is deemed unreliable due to image distortion, and the corresponding decoded data is discarded and not included in subsequent data packet parsing processes. After the voting statistics are completed, all temporary text caches are cleared, string storage memory is released, and only the verified reliable barcode text is retained for output to downstream modules, avoiding data packet parsing errors caused by distorted frames.
[0051] Step S146: Output the trusted barcode text that has completed the voting verification to the data packet parsing module. At the same time, clear the current period frame buffer, model inference buffer and voting buffer, wait for the next synchronous acquisition window to open, and repeat the complete process of frame acquisition, image quality model inference filtering, parallel decoding and multi-frame voting. This specific implementation method, after completing multi-frame voting verification, executes cache reclamation and loop waiting logic. The verified trusted barcode text is pushed in batches to the data packet parsing and processing module, simultaneously clearing the corresponding circular frame cache, model inference temporary buffer, and multi-frame voting text cache for this round. This completely reclaims all memory resources occupied by this round of acquisition, inference, and decoding, avoiding the risk of memory leaks during long-term operation. After all cache resources are cleared, the timing scheduling thread enters a sleep waiting state until the next round of synchronous acquisition window trigger signal is generated, at which point the entire automated loop process of V4L2 frame capture, image quality model frame-by-frame inference, valid frame filtering, multi-threaded parallel decoding, and multi-frame voting verification is restarted.
[0052] Step S147: If the pixel purity score output by the model continues to be lower than the threshold under multiple consecutive acquisition windows, the receiving end automatically writes a structured abnormal log to record the image quality degradation event, and synchronously triggers the upper-layer time-series transmission quality prediction model to collect abnormal features.
[0053] This specific implementation configures continuous image quality degradation monitoring logic. A time-series scheduling thread continuously calculates the average pixel purity score of multiple consecutive acquisition windows. When the model output score of multiple consecutive windows is lower than a preset judgment threshold, a structured JSON format abnormal operation and maintenance log is automatically generated. The log fully records the degradation start time, the number of consecutive degradation windows, the average purity of each frame, the hardware identifier of the acquisition card, and other fault dimension information, and persists it to the local disk. After the log is generated, the current image quality degradation time-series features are actively pushed to the upper-layer time-series transmission quality prediction model as input data for the next cycle's decoding fault probability inference. The entire abnormal monitoring logic runs silently and independently in the background, without interfering with the normal acquisition and decoding core business processes.
[0054] Step S150: The receiving end performs integrity verification, orderly reassembly of data blocks, decompression and restoration on the decoded data packets, and finally outputs the original transmission file; This specific implementation runs on the data restoration sub-thread at the external network receiving end, handling the trusted barcode text output by multi-frame voting verification, and constructing a complete end-to-end processing logic for data packet parsing, verification, reassembly, decompression, and file storage. The program sequentially executes text escape restoration, Base64 binary decoding, data packet field splitting, and magic number and CRC dual integrity verification. Using the session identifier as an index, it aggregates legal data blocks in memory cache, sequentially assembles the payload data stream according to the sequence number, matches the corresponding decryption algorithm with the security classification label stored in the packet header, and calls zlib to complete lossless decompression after stripping the encryption layer. It extracts the file metadata transmitted synchronously with the data packet at the sending end, writes the decompressed binary bytes to a preset isolated storage directory to generate the target file, completes file integrity verification through global MD5 hash comparison, and generates a standardized transmission list for archiving after verification. If transmission times out and blocks are not fully collected, the missing sequence number is recorded, and data is supplemented using subsequent periodically repeating barcode frames. Verification, exception, and archiving logs generated throughout the entire process are uniformly and standardizedly output, allowing batch reconciliation and tracing of each complete transmission session. The entire process is executed serially and independently allocated memory resources, without consuming the computing power of the main acquisition and decoding thread.
[0055] Step S151: Receive valid parsed text, perform escape character restoration and text binary decoding layer by layer, and restore the original data packet binary carrier; This specific implementation uses a trusted Base64 string generated by multi-frame voting as the input source. The first layer performs URL escape character restoration, clearing various escape control characters generated during barcode encoding and HDMI digital transmission, restoring clean, decodable ASCII text. The second layer calls the standard Base64 decoding interface to completely convert the ASCII text into the raw binary byte stream of the data packet, generating a binary carrier and storing it in a thread-safe temporary memory buffer. The decoding process incorporates an illegal character capture mechanism. If the text contains unparseable abnormal characters, the data packet is directly discarded and written to an exception log with a session ID and frame number, avoiding further field splitting and reducing invalid verification operations. After the binary carrier is generated, the string cache memory is released synchronously, retaining only the binary byte data to reduce process memory usage. The processing logic runs lightweight, adapting to long-term continuous parsing scenarios for low-configuration external network business servers.
[0056] Step S152: Split each field according to the unified data packet structure, first verify the unique identifier of the data packet, and discard the packet if the identifier does not match and retain the abnormal record; This specific implementation method segments the binary carrier according to the invention's preset standardized data packet byte offset rules, sequentially separating the 2-byte magic number segment, 4-byte session identifier, block type, sequence number, total number of blocks, payload length, and payload and tail CRC checksum. The program prioritizes magic number validity verification, comparing whether the truncated field is equal to the protocol fixed identifier 0x4F4C. If the magic number does not match, the data packet is directly determined to be illegal and distorted, and the binary carrier is immediately discarded. Simultaneously, the current session's unique identifier and the corresponding acquisition frame number are recorded and stored in the local fault log for problem localization. After the magic number verification passes, all other business fields are split and cached in temporary memory, quickly filtering illegal data packets caused by image quality distortion and transmission noise. This avoids invalid payload verification and data reassembly consuming server CPU computing resources. The layered verification mechanism significantly improves the overall data restoration processing efficiency.
[0057] Step S153: Verify the data packet service payload verification value separately. If the verification fails, retain the original screen log for problem tracing. If the verification passes, read the file classification, encryption, and error correction configuration information attached to the packet header. This specific implementation extracts the compressed payload binary fragment separately from the split data packet fields, independently calculates the CRC32 check value corresponding to the payload, and compares it byte-by-byte with the 4-byte standard check code preset at the end of the data packet. If the two values are inconsistent, it is determined that there is pixel distortion or partial barcode loss during the transmission process. The program automatically saves the original log of the current complete acquisition frame as the original material for later fault tracing. This data packet is directly discarded and will not participate in the reassembly. After the payload check and matching is successful, the preset parameters in the extended storage area of the data packet header are read, and the file security classification label, data density label, matching decryption algorithm identifier, and FEC forward error correction redundancy ratio parameters output by the sending end classification model are extracted and cached in the current session memory. This provides a scheduling basis for subsequent data decryption and missing fragment repair, realizing that the single data packet carries its own configuration and does not require the sending and receiving ends to pre-synchronize configuration files.
[0058] Step S154: Different transmission tasks are distinguished by session identifiers, compliant data packets are temporarily stored in memory cache, the collection progress is statistically analyzed in real time, and data stream splicing is triggered after all data arrives. This specific implementation uses a 4-byte session identifier within the data packet as the unique hash key. An independent session hash storage pool is created in the process heap memory. The payload, block sequence number, and total number of blocks in each file are stored in the corresponding session-specific storage entry. The memory data of different file transmission sessions are isolated from each other and do not interfere with each other. The program counts the cumulative number of valid data blocks received in a single session in real time. When the total number of received blocks is exactly equal to the total number of blocks carried in the data packet, the system automatically triggers the orderly splicing process of the complete data stream. The session storage pool has a built-in 120-second timeout recycling mechanism. If the timer expires and all data fragments have not been collected, the session is marked as interrupted, a list of missing block sequence numbers is automatically generated and written to the operation and maintenance log, waiting for subsequent barcode data packets to be repeatedly output to supplement the missing fragments. The memory cache is periodically and automatically cleaned to prevent long-term memory overflow.
[0059] Step S155: Integrate all payloads in order of data block number, automatically adapt to the corresponding decryption strategy according to the file security level, and strip the encryption layer to obtain the compressed original data stream; This specific implementation traverses all compliant data entries within the same session hash storage pool, arranges all compressed payloads in ascending order based on 4-byte block sequence numbers, and concatenates them byte-by-byte to generate a complete encrypted binary data stream. The program retrieves the file security classification identifier stored in the packet header extension area and automatically matches the layered decryption execution logic: files with ordinary security levels skip decryption operations and output the native compressed stream; sensitive files use a 128-bit block cipher algorithm to decrypt the payload; high-security files combine the session key digest built into the packet header to perform a 256-bit block decryption operation, completely stripping the encryption layer and outputting a clean zlib compressed binary stream. The decryption operation incorporates an exception handling logic; if the key mismatch or encrypted bytes are corrupted, the session is directly marked as corrupted and written to the exception log, preventing further decompression operations and quickly terminating the invalid session processing flow.
[0060] Step S156: Losslessly decompress the compressed stream to obtain the original file binary content, read the accompanying file metadata, and after logging in, verify the file is not damaged or missing by hash check; This specific implementation calls the standard zlib lossless decompression operator to perform global decompression operations on the decrypted continuous compressed binary stream, completely restoring the original binary byte content of the file sent from the intranet. The program synchronously retrieves file metadata stored in the session hash cache, including the original filename, standard MD5 hash value, and total file size in bytes. The decompressed original byte stream is written to a preset isolated landing directory on the external network to generate the target file. After the file is landed, all bytes of the complete file are read, the local MD5 hash value is recalculated, and compared character-by-character with the preset original hash from the sender. A complete hash match indicates the file is complete, without loss or tampering; if the hashes do not match, the file is marked as corrupted, and a corruption anomaly record is generated and stored in the session's full-link log for transmission failure review.
[0061] Step S157: After verifying that the files are correct, generate a complete transmission archive list, store the original files synchronously, and retain the transmission information throughout the entire process; This specific implementation automatically generates a standardized JSON-formatted Manifest transmission archive list after the file passes local MD5 hash verification. The list comprehensively records key indicators across the entire transmission chain, including the session's unique identifier, original file name, file size in bytes, independent CRC checksum for each block, average purity score of the currently collected images, transmission start and end timestamps, FEC redundancy usage status, and file security classification labels. The manifest file is bound to the restored original business file with the same name and is uniformly archived to an external persistent storage directory. Both files are simultaneously stored to retain complete transmission traceability documentation. Upon completion of the manifest writing, a structured operation log is simultaneously output, facilitating batch verification of complete one-way transmission business data by session and date by maintenance personnel, thus meeting industrial control data audit and traceability standards.
[0062] Step S158: Automatically clean up session memory after file archiving; if all data is not collected within a timeout, record the missing fragments and supplement the missing data in subsequent transmission cycles; In this specific implementation, after a single file completes verification and archiving, the program periodically traverses the session hash storage pool, batch-cleans all data blocks, metadata, and temporary string caches corresponding to completed sessions, continuously releasing memory resources occupied by the process and avoiding the problem of continuous memory expansion and overflow during long-term 24 / 7 operation. If the session storage timeout reaches the 120-second timeout threshold, and the current session has not yet collected all data fragments, the program automatically traverses the missing sequence numbers of the session and generates a standardized list of missing fragments, which is written to the operation and maintenance log. The system relies on the multi-cycle repeated output of barcode frames at the sending end to wait for subsequent acquisition and decoding cycles to capture the missing data blocks, and after filling them in, re-executes the complete data stream splicing and file restoration process without manual intervention for retransmission.
[0063] Step S159: Standardize the log format for all verification, reorganization, archiving, and abnormal events to support batch automated reconciliation and verification.
[0064] This specific implementation unifies the entire process of frame acquisition, image quality inference, barcode decoding, data packet verification, data reassembly, file decompression and storage, image quality degradation alarms, and session timeout interruptions into a standardized JSONLines log. Each log entry carries a fixed set of standardized fields including a high-precision timestamp, session ID, fault identifier, core indicator values, and hardware acquisition card identifier. Log files are automatically archived to disk by calendar month to prevent single log files from becoming too large. Maintenance personnel can use the jq text processing tool to batch filter, analyze, and reconcile archived logs, and batch calculate core operational indicators such as file transmission success rate, average frame purity, data packet error rate, and number of missing session fragments. This supports long-term system stability statistics, transmission fault review, and power control system security auditing.
[0065] Step S160: The receiving end builds a timing transmission error prediction model, using frame quality scores, data packet CRC error rate, and number of lost blocks in consecutive multi-cycle periods as model input features. The model predicts the decoding failure risk value for the next transmission cycle. When the risk value exceeds the warning threshold, it automatically pushes a transmission anomaly alarm to the operation and maintenance platform, and adaptively increases the duration of the receiving end's acquisition window and triggers a multi-round repeated decoding retry mechanism.
[0066] This specific implementation deploys an independently scheduled sub-thread in the background of the external network receiving end, without occupying the computing resources of the main acquisition and decoding threads, and constructs a complete transmission risk prediction and adaptive control system. The system builds a time-series transmission error prediction model that has been trained offline. After each complete transmission cycle, it automatically extracts three core time-series indicators: the average frame purity score of the period, the proportion of data packet CRC errors, and the total number of unrepairable lost blocks. After standardization, these are input into the model to complete the time-series pattern fitting and inference, and output a decoding failure risk prediction value in the range of 0 to 1. The program reads the system's preset global warning threshold to complete the numerical comparison. When the risk exceeds the standard, it automatically generates a standardized alarm message and pushes it to the operation and maintenance monitoring platform. At the same time, it executes two sets of adaptive optimization strategies: grading the extension of the HDMI acquisition window duration and enabling a multi-round decoding retry mechanism. By increasing the acquisition sample size and performing multiple cross-validations, the probability of data loss caused by distorted frames is reduced. When the risk falls back, it automatically restores the basic lightweight operation mode. The entire prediction and control logic operates in a fully automatic closed loop without the need for manual intervention to adjust parameters.
[0067] Step S161: During the initialization phase of the receiving system, allocate a time-series feature ring buffer, set the maximum number of buffer entries to N transmission cycles, synchronously complete the loading of the time-series transmission error prediction model, read the offline trained and fixed-point quantized model weight file, open an independent model inference memory buffer, configure minimum and maximum normalization operators for the numerical mapping of three types of input features, and preset the global risk warning threshold and the multi-level up-adjustment gradient parameters of the acquisition window. This specific implementation describes the resource deployment process for the receiving system initialization. Upon program startup, a fixed-capacity circular buffer for time-series features is allocated in the process memory, limiting the maximum number of samples (N) for each storage cycle. A first-in, first-out (FIFO) mechanism is used to prevent memory overflow. The offline-trained and fixed-point quantization compression-based time-series transmission error prediction model is loaded synchronously, and its weights are loaded into a dedicated inference buffer to avoid competing for memory resources with the image quality discrimination model. The program incorporates a min-max normalization operator, uniformly configuring three types of input feature mapping rules. It also persistently stores two sets of adjustable parameters: a global risk warning threshold and a multi-level gradient adjustment for the acquisition window. All configuration items are written to a local configuration file for easy modification during operation and maintenance. The model, buffer, normalization operator, and adjustment parameters are initialized in one go, allowing subsequent transmission cycles to directly reuse the initialized resources without repeated loading, significantly reducing the computational overhead of cycle inference.
[0068] Step S162: After all frames are decoded and data packet verification processes are completed in each complete transmission cycle, batch collect the three types of time-series feature values for the current period, summarize the image quality discrimination purity scores of all valid frames in the current period and calculate the average value as the frame image quality feature, count the total number of CRC check failures in all data packets in the current period and divide it by the total number of packets in the current period to obtain the data packet CRC error rate feature, and count the total number of missing data blocks in data packets that pass verification and cannot be repaired by FEC as the block loss number feature; This specific implementation initiates feature statistics logic after the completion of each round of acquisition, decoding, and data packet verification, automatically summarizing all time-series indicator data for the current period. For frame quality features, the arithmetic mean of the purity scores of all valid frames in the current period is calculated as the comprehensive image quality indicator for that period. For CRC error rate, the total number of data packets and the number of failed verification packets in the current period are calculated, and the error percentage is obtained by division. For the number of lost blocks, the total number of data blocks that cannot be repaired after FEC error correction is summarized. These three types of indicators are calculated independently in real time without interference. After the statistics are completed, a standard ternary feature group for the current period is generated, a timestamp for the current period is added, and the group is sent to a circular buffer write queue. The feature statistics are lightweight and do not consume the core computing power of decoding. The indicator calculation results accurately reflect the overall transmission image quality and data integrity level of the current period.
[0069] Step S163: Write the three sets of feature values for the current period to the end of the circular time-series buffer. If the number of cache entries reaches the upper limit, the feature data of the earliest period will be automatically discarded to ensure that the cache only retains the time-series samples of the most recent consecutive periods. This specific implementation handles the logic for writing and managing the capacity of the time-series feature circular cache. After the calculation of the three types of features for the current period is completed, the feature triplet with the period timestamp is written to the tail storage unit of the circular cache. The program monitors the number of period samples stored in the cache in real time. When the number of stored samples reaches the preset maximum capacity N, it automatically reads and discards the earliest historical period feature data from the cache header, always maintaining that the cache only retains time-series samples from the most recent N consecutive transmission periods, avoiding continuous cache expansion and excessive server memory consumption during long-term operation. Thread mutex locks are set for cache read and write operations to prevent concurrent conflicts between multiple threads for feature writing and model reading. After writing is completed, the temporary calculation memory for the current period's features is released. The cached data is only used for model time-series inference and is not persisted to disk, reducing IO read and write overhead.
[0070] Step S164: Periodically read three sets of original feature sequences for a continuous complete cycle in the circular buffer, perform minimum-maximum normalization on the frame quality mean, CRC error rate, and number of lost blocks respectively, map the three types of features to the 0-1 value range, and concatenate them in a fixed order to form a one-dimensional standard temporal feature vector as the model input. This specific implementation involves a standardized preprocessing flow for model input. A feature reading task is triggered periodically to extract a continuous, complete ternary raw feature sequence from the circular buffer. The min-max normalization operator is applied to three sets of time-series data: frame quality mean, CRC error rate, and number of unrepairable lost blocks. Based on the global extrema of each feature, the values are uniformly mapped to the 0-1 standard range, eliminating differences in the dimensions of different indicators. After normalization, a one-dimensional long-term time-series feature vector is concatenated in a fixed order as the model's standard input. The vector dimension and order remain constant to ensure a consistent input format for each round of inference. Temporary memory is reused throughout feature normalization and vector concatenation. After computation, the original feature copies are released, and only the standardized vector is sent to the model inference buffer.
[0071] Step S165: The normalized time series feature vector is fed into the time series transmission error prediction model to perform forward inference operation. The model outputs a floating-point type decoding failure risk prediction value in the 0-1 interval. The model output risk prediction value is compared with the preset global warning threshold in real time. When the risk value is less than or equal to the threshold, the current acquisition window duration and single-round decoding strategy remain unchanged, and the feature acquisition process of the next transmission cycle is directly entered. This specific implementation executes time-series model inference and basic branch judgment logic. The concatenated one-dimensional standardized time-series feature vector is fed into the time-series transmission error prediction model for gradient-free forward inference. Based on historical multi-cycle transmission patterns, a floating-point decoding failure risk prediction value in the 0-1 range is obtained. A real-time numerical comparison is performed using a preset global warning threshold in the configuration file, dividing the system into high-risk and low-risk scheduling branches. If the predicted risk value is less than or equal to the warning threshold, the next cycle's transmission is deemed stable. No parameter adjustments are performed; the feature and risk temporary caches generated in this round of inference are directly cleared, and the time-series thread jumps to the feature acquisition and statistics process for the next cycle. Throughout the process, the acquisition window and the default lightweight configuration for single-cycle decoding are maintained, without consuming additional CPU computing power.
[0072] Step S1651: Read the continuous periodic time-series feature vector after unified normalization processing, complete the compliance verification of vector dimension and numerical range, remove abnormal dirty data of features, send the standardized feature vector into the inference buffer of the time-series transmission error prediction model, load the static quantization weight of the model, start the gradient-free forward inference calculation process, the model completes risk fitting based on the historical multi-period image quality, verification error, and block loss time-series pattern, outputs the floating-point decoding failure risk assessment value in the range of 0 to 1, and release the feature temporary memory after the inference is completed; This specific implementation method involves pre-inference verification and core computation processes. After receiving the concatenated one-dimensional normalized temporal feature vector, it first performs compliance checks on dimension and numerical range, filtering out dirty feature samples with values exceeding the 0-1 range or abnormal vector lengths to avoid inference distortion. The verified feature vector is copied to the model's independent inference buffer. The initialized fixed-point quantized static weights are read, and gradient-free forward inference computation is initiated. Based on the temporal correlation patterns of multi-period image quality, verification, and block loss, the probability of failure in the next period is quantified, and a standardized risk floating-point value in the 0-1 range is output. The temporary memory for the feature vector is immediately released after the inference computation, retaining only the risk prediction value for subsequent threshold comparison. The original temporal vector is not persistently stored throughout the process to control memory usage.
[0073] Step S1652: Retrieve the global risk warning threshold parameters stored in the system's persistent storage, compare the model's output risk prediction value with the threshold in real time, and generate a branch scheduling identifier; This specific implementation completes the logic for reading risk values and comparing thresholds. The program reads the global risk warning threshold constant from a locally persisted configuration file. This threshold can be remotely modified by operations and maintenance personnel without restarting the service. The floating-point value of the decoding failure risk output by the model inference is compared with the threshold, generating a binary branch scheduling identifier for the time-series thread to call. The comparison operation uses high-precision floating-point arithmetic to avoid branch misjudgment caused by decimal precision errors. The comparison result, along with all current time-series features, risk values, and timestamps, is written to a temporary log cache. This step only performs numerical judgment and does not initiate additional logic such as alarms or parameter adjustments, providing a single judgment basis for subsequent branch scheduling, with extremely low computational overhead.
[0074] Step S1653: If the comparison result shows that the risk prediction value is less than or equal to the warning threshold, it is determined that the next cycle of transmission decoding is stable and has no high probability of failure. No acquisition and decoding parameter adjustment logic is triggered. The current acquisition window duration and basic single-round decoding operation mode are retained unchanged. The temporary features and risk value cache data generated by this round of inference are cleared. The process jumps directly to the time-series feature acquisition stage of the next transmission cycle and executes the complete process of cycle feature statistics, normalization, model inference, and threshold comparison in a loop. This specific implementation uses a low-risk branch complete scheduling logic. When the predicted risk value is less than or equal to the preset warning threshold, the system determines that there is no risk of batch decoding or data loss in the next cycle. It does not trigger adaptive control actions such as extending the acquisition window or retrying multiple rounds of decoding, maintaining the system's default acquisition window duration and lightweight single-round parallel decoding operation strategy. The feature vectors and risk value temporary caches generated by inference are uniformly destroyed and recycled in batches, releasing inference buffer memory resources. The timing scheduling thread directly ends the current prediction process and jumps to the feature statistics acquisition stage after the next transmission cycle ends, cyclically executing the entire timing prediction process of feature summarization, cache writing, normalization, model inference, and threshold comparison.
[0075] Step S1654: Simultaneously write all time-series features, model output risk values, and threshold comparison results of this round into a structured time-series log. The log includes the current period timestamp and serves as sample material for long-term model iteration and optimization. The operating parameters of the acquisition and decoding modules are not changed throughout the process, maintaining the system's lightweight and normal operating state.
[0076] This specific implementation method is responsible for archiving time-series data in low-risk scenarios. All original periodic features, normalized features, model output risk values, and threshold comparison results for this round are bound to high-precision timestamps and written to a structured time-series log buffer. The log data is archived monthly as supplementary training samples for offline model iterations, continuously improving time-series prediction accuracy; it is also retained for later review and verification of transmission stability. The entire log writing logic is executed asynchronously, without blocking the main thread's cycle. After data writing is complete, the temporary storage resources for this round of inference are synchronously cleared, maintaining a lightweight basic operating mode for acquisition and decoding throughout the process, without any parameter changes or additional computing power consumption.
[0077] Step S166: When the predicted risk value exceeds the warning threshold, assemble a standardized abnormal alarm message. The message carries the current timestamp, continuous multi-period characteristic curves, risk prediction value, total session statistics, and missing block details. It is then synchronously reported to the operation and maintenance monitoring platform through the background data push interface to generate a visual abnormal alarm record. This specific implementation describes the high-risk alarm generation and push process. When the predicted risk value exceeds the global warning threshold, the program automatically assembles a standardized JSON alarm message. The message fully includes the current high-precision timestamp, continuous multi-period three-feature time-series curve data, model risk prediction values, the total number of file sessions in the current period, and details of missing data blocks for each session. The message is synchronously reported to the operation and maintenance monitoring platform through the backend internal data push interface. After receiving the message, the platform automatically generates persistent and visualized abnormal alarm records, supporting alarm tiered pop-ups and log retention and retrieval. Alarm push is executed asynchronously, without occupying the core thread of data acquisition and decoding. After the push is completed, the current high-risk period is marked, providing a trigger marker for subsequent data acquisition window adjustments and multi-round decoding logic.
[0078] Step S167: Adjust the gradient of multi-level duration according to the risk exceedance. If the exceedance is small, slightly extend the t_capture acquisition window duration. If the exceedance is large, maximize the acquisition window range and update the acquisition window configuration parameters stored locally. The acquisition logic of the next cycle directly loads the updated duration parameters to expand the effective frame capture time window.
[0079] This specific implementation uses an adaptive, tiered control logic for the acquisition window. The system pre-configures three risk levels corresponding to different duration adjustment gradients. Based on the extent to which the risk value exceeds the threshold, a corresponding extension strategy is matched: a slight exceedance results in a minor increase in the `t_capture` duration, while a significant exceedance maximizes the widening of the acquisition window range. The adjusted duration parameters synchronously overwrite the locally persisted configuration file and memory runtime parameters, taking effect in real-time without requiring a service restart. When the acquisition process starts in the next transmission cycle, the timing thread directly loads the updated window parameters, extending the acquisition duration to increase the number of effective high-definition frames captured, expanding the sample base, and reducing the probability of decoding failure; if the risk decreases, it automatically reverts to the baseline duration. This dynamic adaptation throughout the process requires no manual configuration modification.
[0080] Step S168: Simultaneously enable the multi-round repeated decoding retry mechanism. For all valid video frames cached in the current period, instead of performing only one round of parallel decoding, multiple rounds of decoding tasks are started in a loop. After each round is completed, multi-frame voting verification is performed independently. The output results of multiple rounds of decoding are cross-compared, and the barcode parsing text with the highest recurrence frequency is selected as the trusted data packet content to improve the data restoration capability of distorted frames and low-quality frames. This specific implementation employs a high-risk, multi-round decoding retry mechanism. Once the risk exceeds the limit and the flag is activated, all valid high-definition frames in the current cache will no longer undergo a single round of parallel decoding; instead, independent decoding tasks will be initiated multiple times. After each round of decoding, a multi-frame voting verification is performed separately, and all barcode parsing text for that round is recorded separately. After all rounds of decoding are completed, the output results of all rounds are cross-compared, and the total global frequency of each text is calculated. The text with the highest frequency is selected as the trusted data packet content for that barcode, and multiple sets of results with the same frequency are discarded. A separate backup thread pool is allocated for multi-round decoding, without impacting regular decoding computing power. Multiple cross-verifications offset parsing errors caused by single-round distortion, significantly improving the data restoration success rate in low-quality scenes.
[0081] Step S169: Continuously track the trend of risk prediction values in subsequent cycles. If the risk value output by the model falls back to within the warning threshold for multiple consecutive cycles, automatically revert the collection window duration to the system default baseline value, disable the multi-round decoding retry logic, and switch back to the lightweight single-round decoding normal operation mode. This specific implementation uses an automatic risk fallback recovery logic. A time-series thread continuously monitors risk prediction values for multiple transmission cycles, maintaining a sliding risk observation array to track risk trends in real time. When the risk values for a preset number of consecutive cycles fall back to within the warning threshold, the system automatically performs a parameter fallback operation. This restores the acquisition window duration to the factory default baseline value, simultaneously closes the dedicated thread pool for multi-round decoding retry, destroys the multi-round decoding scheduling logic, and switches back to the lightweight, conventional single-round parallel decoding mode. The parameter fallback results are synchronously updated to the local persistent configuration to avoid parameter retention anomalies after service restarts. The entire fallback monitoring logic runs silently in the background, without interfering with normal acquisition and decoding operations.
[0082] Step S1610: All periodic features, risk prediction values, alarm records, and acquisition window adjustment records are uniformly written into a structured JSON log, archived and stored monthly, and used as a supplementary sample data source for time series model iteration to optimize model prediction accuracy in the long term.
[0083] This specific implementation unifies the archiving rules for full-time-series prediction link logs. Periodic characteristics, risk prediction values, alarm messages, and collection window adjustment records are all encapsulated into standard JSON structured logs. Each log entry carries a unique periodic timestamp and hardware identifier field. Log files are automatically archived to disk for persistent storage on a monthly basis to avoid exceeding single file size limits. Archived logs serve as original evidence for batch reconciliation of operations and maintenance and for reviewing transmission failures. They also serve as supplementary samples for offline retraining to continuously expand the time-series dataset and iteratively optimize model prediction accuracy. Log writing employs an asynchronous I / O mechanism, which does not consume real-time transmission computing power, balancing the dual needs of audit traceability and long-term model iteration.
[0084] It should be noted that, in order to simplify the description of the present invention and thus help to understand one or more embodiments of the invention, multiple features may sometimes be grouped into one embodiment, drawing or description thereof in the foregoing description of the embodiments of the present invention.
[0085] The embodiments of this application have been described above with reference to the accompanying drawings. Unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other. This application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for HDMI linear unidirectional data transmission based on black and white pixel encoding, characterized in that: Includes the following steps: A lightweight file intelligent classification model is deployed at the intranet sending end. The multi-dimensional inherent data characteristics of the file to be transmitted are input into the model for inference. The model outputs two types of attribute labels: file security level and data density. The data packet encryption protection level is dynamically adapted according to the file security level. At the same time, the single-frame two-dimensional barcode layout scale and forward error correction redundancy ratio are adaptively adjusted according to the data density attribute. The intranet sending end compresses and segments the original file to be transmitted, and encapsulates each data block into a standardized transmission data packet with an integrity check mark. The data packet is encoded into a black and white binary pixel two-dimensional barcode image, and the hierarchical label and density label output by the lightweight file feature classification model are embedded in the header of the data packet. The transmitting end outputs a video frame consisting of multiple sets of two-dimensional barcodes in a full-screen loop through the HDMI digital video interface with an open-loop equal-length timing period mechanism. It only outputs pure digital pixel video signals in one direction and has no reverse data interaction channel. The external network receiver uses an HDMI digital acquisition device to acquire digital video frames based on a time-series period synchronized with the transmitter. It then uses a lightweight barcode image quality discrimination model to perform inference and recognition on each acquired frame. The model outputs a pixel purity score and only sends valid frames with scores higher than a preset threshold to the decoding thread. The two-dimensional barcodes within the video frames are decoded in parallel, and the results are verified by voting across multiple frames. The receiving end performs integrity verification, orderly reassembly of data blocks, decompression and restoration on the decoded data packets, and finally outputs the original transmission file. The receiving end builds a timing transmission error prediction model, using frame quality scores, data packet CRC error rate, and number of lost blocks in multiple consecutive cycles as model input features. The model predicts the decoding failure risk value for the next transmission cycle. When the risk value exceeds the warning threshold, it automatically pushes a transmission anomaly alarm to the operation and maintenance platform, and adaptively increases the duration of the receiving end's acquisition window and triggers a multi-round repeated decoding retry mechanism.
2. The method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 1, characterized in that: The deployment of a lightweight file intelligent classification model at the intranet sending end involves inputting the multi-dimensional inherent data features of the file to be transmitted into the model for inference. The model outputs two attribute labels: file security level and data density. The encryption protection level of the data packet is dynamically adapted based on the file security level. Simultaneously, the layout size of the single-frame two-dimensional barcode and the forward error correction redundancy ratio are adaptively adjusted based on the data density attribute, including: The intranet sending end continuously monitors the specified transmission path and captures newly added files to be transmitted. It extracts the inherent data features of the files from multiple dimensions, and after normalization and unified processing, constructs standardized feature vectors and inputs them into a lightweight offline quantization classification model for inference operations. The model synchronously outputs two types of classification labels: file security level and data density attribute. It adaptively switches the encryption protection strength of data packets according to the file security level, and dynamically adjusts the layout size of single-frame barcodes and the forward error correction redundancy ratio according to the data density attribute. It writes the classification label, encryption configuration, barcode, and error correction scheduling parameters into the extended area of the data packet header, completes the encryption of the data payload according to the adapted encryption rules, and generates business barcodes and matching error correction barcodes in combination with scheduling parameters. These are then spliced together to generate the video frame to be transmitted. The intranet sending end compresses and segments the original file to be transmitted, and encapsulates each data block into a standardized transmission data packet with an integrity check mark. The data packet is encoded into a black and white binary pixel two-dimensional barcode image. Simultaneously, the hierarchical label and density label output by the lightweight file intelligent classification model are embedded in the header of the data packet. The transmitting end outputs a video frame consisting of multiple sets of two-dimensional barcodes in a full-screen loop through the HDMI digital video interface with an open-loop equal-length timing period mechanism. It only outputs pure digital pixel video signals in one direction and has no reverse data interaction channel. The external network receiver uses an HDMI digital acquisition device to acquire digital video frames based on a time-series period synchronized with the transmitter. It then uses a lightweight barcode image quality discrimination model to perform inference and recognition on each acquired frame. The model outputs a pixel purity score and only sends valid frames with scores higher than a preset threshold to the decoding thread. The two-dimensional barcodes within the video frames are decoded in parallel, and the decoding reliability is improved through multi-frame result voting verification. The receiver reads the encryption and error correction configuration parameters in the extended field of the data packet header and matches the corresponding decryption rules and decoding fault tolerance strategies to complete the initial parsing of the barcode data. The receiving end performs integrity verification, orderly reassembly of data blocks, decompression and restoration on the decoded data packets, and finally outputs the original transmission file. The external network receiver deploys a time-series transmission quality prediction model, which collects multi-dimensional time-series features such as image quality, data packet verification anomalies, and data block loss during multiple consecutive transmission processes. These features are then input into the model for inference to predict the probability of data parsing failures in subsequent transmission stages. If the predicted failure probability exceeds a preset threshold, a transmission anomaly warning message is automatically generated, and the receiver's image acquisition duration is dynamically adjusted, along with a multi-round data parsing retry strategy.
3. The method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 2, characterized in that: The external network receiving end deploys a time-series transmission quality prediction model, which collects multi-dimensional time-series features such as image quality, data packet verification anomalies, and data block loss during multiple consecutive transmission processes. These features are input into the model for inference to predict the probability of data parsing failures in subsequent transmission stages. If the predicted failure probability exceeds a preset threshold, a transmission anomaly warning message is automatically generated, and the image acquisition duration at the receiving end is dynamically adjusted, along with a multi-round data parsing retry strategy, including: The external network receiving end is configured with a transmission time sequence buffer area. Taking a single complete file transmission process as the sampling unit, after each round of collection and parsing, three types of time sequence indicators are extracted: image quality, data packet verification anomaly, and missing data block. These indicators are continuously stored in the buffer according to the transmission time sequence. The buffer only retains the indicator sequence of a fixed number of recent periods. If the capacity is exceeded, the earliest time sequence data is automatically discarded to control memory consumption. After loading the offline time-series training and fixed-point quantization compression time-series transmission quality prediction model, the complete continuous periodic feature sequence is read from the time-series storage buffer at regular intervals. The three types of features, namely image quality, number of data packet verification anomalies, and data block loss, are subjected to minimum and maximum normalization processing respectively. After being uniformly mapped to the 0 to 1 value range, they are concatenated into a standard one-dimensional time-series feature vector. The feature vector is input into the time-series transmission quality prediction model to complete the forward inference operation. The model outputs the decoding failure probability prediction value in the 0-1 range as the failure risk value for the next transmission cycle. The receiving end presets a global fault judgment threshold and compares the fault risk prediction value output by the model with the preset judgment threshold in real time. When the predicted risk value is less than or equal to the threshold, the current collection window duration and decoding round remain unchanged, and the regular collection and decoding process continues to be executed. When the predicted risk value exceeds the preset judgment threshold, the abnormal handling branch process is immediately triggered. First, a standardized alarm message containing the current cycle number, historical feature indicators, predicted fault probability, and risk exceeding time stamp is assembled and pushed to the operation and maintenance management platform to complete the abnormal information reporting. The logic for adaptive adjustment of acquisition duration is executed. Based on the degree of risk exceeding the standard, multiple duration adjustment gradients are set. When the risk value exceeds the standard slightly, the image acquisition window duration is slightly extended. When the risk value exceeds the standard significantly, the acquisition window range is significantly widened to ensure that the acquisition window fully covers the barcode display period at the sending end. The acquisition duration configuration parameters stored locally are updated synchronously. In the next transmission cycle, the updated duration parameters are directly loaded to execute video frame acquisition. A multi-round data parsing retry mechanism is launched simultaneously. For all video frames in the current session, multiple rounds of cyclic decoding logic are automatically superimposed on the regular single-round parallel decoding. After each round of decoding is completed, multi-frame voting verification is performed separately. The results of multiple rounds of decoding are cross-compared, and the parsing results of repeatedly occurring valid data packets are selected as reliable data to improve the data restoration success rate of incomplete frames and slightly distorted frames. The system continuously monitors the trend of predicted risk values over multiple consecutive periods. If the predicted risk values fall back to within the judgment threshold after multiple consecutive rounds of model prediction, the system automatically reverts the acquisition window duration to the system default baseline value, disables the multi-round decoding retry mechanism, and restores the receiver's normal lightweight acquisition and decoding operation mode.
4. The method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 1, characterized in that: The intranet sending end performs compression and block processing on the original file to be transmitted, and encapsulates each data block into a standardized transmission data packet with an integrity verification mark. The data packet is encoded into a black-and-white binary pixel two-dimensional barcode image, and simultaneously embeds the hierarchical label and density label output by the lightweight file feature classification model into the data packet header, including: The internal network sending end continuously inspects the designated transmission directory, identifies newly added files to be transmitted, extracts file features and sends them to a lightweight file intelligent classification model for inference, outputs two types of attribute tags: file security level and data density, and caches them in the current transmission session. After reading the original binary stream of the file and compressing it without loss, it is evenly split into multiple independent data units according to the single block carrying capacity. For each data unit, a standardized transmission data packet is assembled. The data packet contains a fixed check identifier, a unique session identifier, block attributes, sequence number, total number of blocks, payload length, service payload, and a tail check code. The two types of attribute labels output by the model are stored in the packet header extension area, as well as the encryption strategy, barcode layout specifications, and error correction redundancy configuration parameters adapted to this file. The complete data packet is converted into a text string that can embed a two-dimensional barcode, and a black and white QR barcode carrier of a specified specification is used to generate an independent barcode image for each data packet; Read the barcode layout parameters stored in the header, stitch all barcode images together according to the corresponding grid specifications, and scale them to standard resolution using an interpolation algorithm without grayscale gradient. Based on the error correction ratio parameters in the packet header, a matching error correction data unit is generated synchronously. The error correction unit reuses the same packet, encoding, and barcode generation process to integrate the business barcode and the error correction barcode into a complete display frame, which is then sent to an independent display program to wait for HDMI timing cycle output.
5. The method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 1, characterized in that: The transmitting end, via an HDMI digital video interface, outputs a video frame composed of multiple sets of two-dimensional barcodes in a full-screen loop using an open-loop, equal-length timing period mechanism. It only outputs pure digital pixel video signals in one direction, without a reverse data interaction channel, including: The sending end builds an independent and isolated display environment, shields various interference rendering components on the desktop, unifies and fixes the output resolution and binds the local HDMI hardware output channel, and is used to output the integrated barcode full-screen image; The system is configured with a complete set of local timing and timing rules, and relies on a local high-precision clock to drive operation. The link only supports unidirectional signal transmission and there is no bidirectional communication condition. The sending and receiving only have unified basic timing parameters, and there is no handshake, response, or bidirectional synchronous interaction logic throughout the entire process. Within each time cycle, the system retrieves the complete screen of the integrated business and error correction barcode and performs exclusive full-screen rendering. It continuously outputs pure pixel digital signals through the HDMI digital channel within the specified duration. After the screen display time ends, the full-screen screen is cleared and the black screen is maintained until the single cycle is completed. Then, the next output cycle is automatically started. A single file will be displayed repeatedly for multiple cycles, relying on multiple exposures to improve the success rate of receiving and acquiring data. The hardware cables, graphics card drivers, and application scheduling layers are all subject to one-way isolation restrictions. The physical link only allows the internal network to transmit video signals outward, and closes all reverse signal receiving paths. The sending scheduling thread is only responsible for screen output and will not listen to the reverse data of the link. The receiving device only has screen capture function and cannot send any instructions or data in reverse. The entire link achieves one-way isolation transmission. The entire process of image stitching and scaling uses an interpolation method without grayscale gradient to process the barcode image, ensuring that the black and white boundaries of the barcode are clear and complete, and the image is transmitted to the receiving acquisition device without loss via a digital HDMI link.
6. The method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 1, characterized in that: The external network receiver, via an HDMI digital acquisition device, acquires digital video frames based on a time-series period synchronized with the transmitter. A lightweight barcode image quality discrimination model is then used to perform frame-by-frame inference and recognition. The model outputs a pixel purity score, and only valid frames with scores exceeding a preset threshold are sent to the decoding thread for parallel decoding of the two-dimensional barcodes within the video frames. Verification is performed through a multi-frame result voting process, including: After the receiver starts up, it initializes the HDMI digital acquisition device, establishes an acquisition channel based on the V4L2 standard interface, configures the fixed transmission period T and acquisition window t_capture parameters that are completely consistent with the transmitter, synchronously sets the video frame output format to YUYV / MJPEG and locks the resolution to 1920×1080, creates an independent frame buffer queue for temporary storage of the acquired complete digital video frames, opens the inference memory buffer of the lightweight barcode image quality discrimination model, loads the image quality discrimination model weight file that has been trained offline, and completes the initialization of the model's forward inference environment. The receiving end timing scheduling thread runs in a loop according to the synchronization cycle. After each round of acquisition window is opened, it continuously calls the V4L2 interface to capture pure digital video frames output by the HDMI acquisition card. Each time a complete pixel image is acquired, it is sent to the lightweight barcode image quality discrimination model to perform frame-by-frame inference. The model uses the variance of black and white pixel distribution, the mean of gray level gradient, and edge integrity as input features to automatically calculate and output the image pixel purity score in the range of 0 to 1. A fixed threshold for image quality judgment is pre-configured. The purity score output by the model is compared with the threshold in real time. If the score is lower than the threshold, the current video frame is discarded directly and does not enter the decoding process. The frame buffer memory is released to reduce CPU usage. If the score is higher than the preset threshold, the valid frame is pushed to the multi-threaded decoding task queue. Only high-quality frames are selected to participate in the subsequent two-dimensional barcode parsing, and invalid frames with blur, noise, or grayscale distortion are filtered out. Multi-threaded parallel decoding scheduling is enabled for all valid video frames in the task queue. A preset number of decoding threads are allocated to synchronously call the pyzbar decoding engine to traverse all two-dimensional barcode areas in the frame. In a single loop, all barcode images in the screen are parsed synchronously, and the frame number, grid position, and original decoding text result corresponding to each barcode are recorded synchronously and temporarily stored in the voting buffer. After all valid frames in the current acquisition window have been decoded in parallel, multi-frame voting verification logic is executed for multiple decoded texts generated by multiple frames under the same grid position. The frequency of the same decoding result is counted, and the text with the most occurrences is selected as the reliable parsing result of the barcode at that position. If there are multiple sets of different decoded texts with the same frequency, the barcode data at that position is discarded. The trusted barcode text that has completed the voting verification is output to the data packet parsing module. At the same time, the current period frame buffer, model inference buffer and voting buffer are cleared. Waiting for the next synchronous acquisition window to open, the complete process of frame acquisition, image quality model inference filtering, parallel decoding and multi-frame voting is repeated. If the pixel purity score output by the model remains below the threshold for multiple consecutive acquisition windows, the receiving end automatically writes a structured anomaly log to record the image quality degradation event, and simultaneously triggers the upper-layer time-series transmission quality prediction model to collect abnormal features.
7. The method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 6, characterized in that: The receiving end timing scheduling thread runs cyclically according to the synchronization cycle. After each acquisition window opens, it continuously calls the V4L2 interface to capture pure digital video frames output by the HDMI acquisition card. Each acquired complete pixel image is sent to the lightweight barcode image quality discrimination model for frame-by-frame inference. The model uses the variance of the black and white pixel distribution within the frame, the mean of the grayscale gradient, and the edge integrity as input features to automatically calculate and output a pixel purity score in the range of 0 to 1, including: During the initialization phase of the receiving system, the V4L2 acquisition channel and the lightweight barcode image quality discrimination model are loaded as dual resources. The HDMI acquisition card hardware is bound through the V4L2 interface. The acquisition resolution is uniformly configured to 1920×1080 and the image output format is YUYV. A fixed-size circular frame buffer is opened for temporary storage of the captured complete digital frames. The offline quantization weight file of the lightweight barcode image quality discrimination model is read. An independent inference calculation buffer is allocated in memory. The model operator and feature calculation logic are initialized. The purity score output range is preset to [0,1]. The timing scheduling thread loads the period parameter T and the acquisition window duration t_capture that are perfectly matched with the sending end, and drives the loop process with a local high-precision timer. Whenever the acquisition window start command is triggered, the thread continuously calls the V4L2 frame reading interface to capture raw pure digital pixel images without analog-to-digital conversion and optical distortion from the HDMI acquisition. After each frame is successfully read, the frame pixel memory pointer is passed to the image quality discrimination and inference sub-thread. The inference sub-thread preprocesses the input YUYV format digital frame, separates the luminance Y channel data and discards the chrominance UV channels, retaining only the single-channel grayscale matrix carrying the black and white barcode pixels; based on the grayscale matrix, it sequentially calculates the three types of input features, traverses all pixels to count the distribution variance of black and white pixel values, extracts the mean grayscale gradient of pixels in the barcode grid area, extracts the edge integrity index of barcode locators and module boundaries through edge detection operators, normalizes the three types of features to a unified numerical range, and concatenates them into a one-dimensional standard feature vector as the model input; The normalized one-dimensional feature vector is fed into the lightweight barcode image quality discrimination model to perform forward inference. The model has built-in multi-layer lightweight convolution and fully connected operators to quantify the degree of pixel distortion and output a single floating-point numerical result. The original output of the model is linearly mapped and converted to normalize the original inference value to the range of 0 to 1, and the pixel purity score of the current frame is obtained. After inference is completed, the current frame number, the values of the three types of original features, and the final purity score are bound and stored in the temporary feature log cache, and the temporary memory for grayscale matrix calculation is released simultaneously. The scheduling thread reads the purity score, compares it with the system's preset judgment threshold, completes the effective frame screening branch judgment, and then destroys the temporary resources for this inference, waiting for the next frame of digital image input to execute the repeated inference process. After all frames in a single acquisition window have been processed, the feature and score logs of all frames in this window are archived in batches and pushed to the time-series transmission quality prediction model as a historical image quality time-series feature data source. At the same time, all temporary caches for this round of inference are cleared, waiting for the next acquisition window to open to execute the complete frame capture, feature calculation, model inference, and score output process.
8. The method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 1, characterized in that: The receiving end performs integrity verification, ordered data block reassembly, and decompression on the decoded data packets, and finally outputs the original transmission file, including: Receive valid parsed text, perform escape character restoration and text binary decoding layer by layer, and restore the original data packet binary carrier; Each field is split according to a unified data packet structure. First, the unique identifier of the data packet is verified. If the identifier does not match, the packet is discarded and an exception record is retained. The data packet service payload verification value is checked separately. If the verification fails, the original screen log is retained for problem tracing. If the verification passes, the file classification, encryption, and error correction configuration information attached to the packet header is read. Different transmission tasks are distinguished by session identifiers, compliant data packets are temporarily stored in memory cache, the collection progress is statistically analyzed in real time, and data stream splicing is triggered after all data arrives. All payloads are integrated in sequence according to data block number, and the corresponding decryption strategy is automatically adapted according to the file security level. The encryption layer is stripped to obtain the compressed raw data stream. The compressed stream is decompressed without loss to obtain the original file's binary content. The accompanying file metadata is read, and after being stored, the file is confirmed to be undamaged and without missing data through hash verification. After the file is verified to be correct, a complete transmission archive list is generated, the original file is stored synchronously, and the transmission information throughout the entire process is preserved. Automatically clean up session memory after file archiving; record missing fragments if not all data is received within a timeout and supplement the missing data in subsequent transmission cycles. All verification, reorganization, archiving, and abnormal event logs are formatted in a unified manner, supporting batch automated reconciliation and verification.
9. The method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 1, characterized in that: The receiving end establishes a timing transmission error prediction model, using frame quality scores, data packet CRC error rate, and number of lost blocks over multiple consecutive periods as model input features. The model predicts the decoding failure risk value for the next transmission period. When the risk value exceeds the warning threshold, it automatically pushes a transmission anomaly alarm to the operation and maintenance platform and adaptively adjusts the receiving end's acquisition window duration and triggers a multi-round repeated decoding retry mechanism, including: During the initialization phase of the receiving system, a ring buffer for time-series features is allocated, the maximum number of cache entries is set to N transmission cycles, the loading of the time-series transmission error prediction model is completed synchronously, the model weight file after offline training and fixed-point quantization is read, an independent model inference memory buffer is opened, minimum and maximum normalization operators are configured for numerical mapping of three types of input features, and global risk warning thresholds and multi-level up-adjustment gradient parameters of the acquisition window are preset. After all frame decoding and data packet verification processes are completed in each complete transmission cycle, the three types of time-series feature values for the current period are collected in batches. The image quality discrimination purity score of all valid frames in the current period is summarized and the average value is taken as the frame image quality feature. The total number of CRC check failures in all data packets in the current period is divided by the total number of packets in the current period to obtain the data packet CRC error rate feature. The total number of missing data blocks in data packets that pass the verification in the current period and cannot be repaired by FEC is taken as the number of lost blocks feature. Write the three sets of feature values for the current period to the end of the circular time-series cache. If the cache storage limit is reached, the feature data of the earliest period will be automatically discarded to ensure that the cache only retains time-series samples of recent consecutive periods. The three sets of original feature sequences of a continuous complete cycle in the circular buffer are read periodically. The frame quality mean, CRC error rate and number of lost blocks are subjected to minimum-maximum normalization processing respectively. The three types of features are uniformly mapped to the 0-1 value range and concatenated in a fixed order to form a one-dimensional standard time-series feature vector as the model input. The normalized time-series feature vector is fed into the time-series transmission error prediction model to perform forward inference. The model outputs a floating-point decoding failure risk prediction value in the 0-1 range. The risk prediction value output by the model is compared with the preset global warning threshold in real time. When the risk value is less than or equal to the threshold, the current acquisition window duration and single-round decoding strategy remain unchanged, and the feature acquisition process of the next transmission cycle is directly entered. When the predicted risk value exceeds the warning threshold, a standardized abnormal alarm message is assembled. The message carries the current timestamp, continuous multi-period characteristic curves, risk prediction value, total session statistics, and missing block details. It is then synchronously reported to the operation and maintenance monitoring platform through the backend data push interface to generate a visual abnormal alarm record. Based on the magnitude of risk exceeding the standard, a multi-level duration adjustment gradient is matched. If the exceedance is small, the duration of the t_capture acquisition window is slightly extended. If the exceedance is large, the acquisition window range is widened to the maximum extent. The acquisition window configuration parameters stored locally are updated synchronously. The acquisition logic of the next cycle directly loads the updated duration parameters to expand the effective frame capture time window. Simultaneously, a multi-round repeated decoding retry mechanism is enabled. Instead of performing only one round of parallel decoding for all valid video frames cached in the current period, multiple rounds of decoding tasks are started in a loop. After each round, multi-frame voting verification is performed independently. The output results of multiple rounds of decoding are cross-compared, and the barcode parsing text with the highest recurrence frequency is selected as the trusted data packet content, thereby improving the data restoration capability of distorted frames and low-quality frames. Continuously track the trend of risk prediction values over multiple subsequent periods. If the risk value output by the model falls back to within the warning threshold for multiple consecutive periods, automatically revert the collection window duration to the system default baseline value, disable the multi-round decoding retry logic, and switch back to the lightweight single-round decoding normal operation mode. All periodic features, risk prediction values, alarm records, and data collection window adjustment records are uniformly written into a structured JSON log, archived and stored monthly, and used as a supplementary sample data source for time series model iteration to optimize model prediction accuracy over the long term.
10. A method for HDMI linear unidirectional data transmission based on black and white pixel encoding according to claim 9, characterized in that: The process involves feeding the normalized temporal feature vector into the temporal transmission error prediction model for forward inference. The model outputs a floating-point predicted value for decoding failure in the 0-1 range. This predicted value is then compared in real-time with a preset global warning threshold. If the risk value is less than or equal to the threshold, the current acquisition window duration and single-round decoding strategy remain unchanged, and the process directly proceeds to the feature acquisition phase of the next transmission cycle. This includes: Read the continuous periodic time-series feature vector after unified normalization processing, complete the compliance verification of vector dimension and numerical range, remove abnormal dirty data of features, send the standardized feature vector into the inference buffer of the time-series transmission error prediction model, load the static quantization weight of the model, start the gradient-free forward inference calculation process, the model completes risk fitting based on the historical multi-period image quality, verification error, and block loss time-series pattern, outputs the floating-point decoding failure risk assessment value in the range of 0 to 1, and releases the feature temporary memory after the inference is completed; Retrieve the global risk warning threshold parameters stored persistently in the system, compare the risk prediction value output by the model with the threshold in real time, and generate a branch scheduling identifier. If the comparison result shows that the risk prediction value is less than or equal to the warning threshold, it is determined that the next cycle of transmission decoding is stable and has no high probability of failure. No acquisition and decoding parameter adjustment logic is triggered. The current acquisition window duration and basic single-round decoding operation mode are retained unchanged. The temporary features and risk value cache data generated by this round of inference are cleared. The process jumps directly to the time-series feature acquisition stage of the next round of transmission cycle and executes the complete process of cycle feature statistics, normalization, model inference, and threshold comparison in a loop. Simultaneously, all time-series features, model output risk values, and threshold comparison results of this round are written to a structured time-series log. The log includes the current period timestamp and serves as sample material for long-term model iteration and optimization. The operating parameters of the acquisition and decoding modules are not changed throughout the process, maintaining the system's lightweight and routine operation.
