A two-dimensional code one-way transmission method and system based on infrared light intensity adjustment

CN122932810APending Publication Date: 2026-10-16SHENZHEN BOYUAN ELECTRIC POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611417890.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-14
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

这种机制未顾及数据流中不同逻辑片段在重要性上的本质差异,无法结合实时信道衰减状态及历史传输表现来评估每一数据帧的当前发送价值

Benefits of technology

[0019]This invention improves data integrity and anti-interference capabilities by segmenting the data to be transmitted and encapsulating it with forward error correction codes, position offsets, and logical meaning levels. The transmission value of data packets is reliably assessed by combining the logical meaning level, data segment length, and expected success rate based on historical transmission and channel model iteration updates. Before executing the transmission task, the instantaneous transmission priority is calculated by integrating this transmission value, time compensation factor, and transmission gain parameters of the light intensity mode, matching the optimal transmission order and infrared light intensity for each QR code image. By mapping the QR code's brightness module to specific infrared light intensity levels for modulation and transmission, not only is resource waste caused by indiscriminate transmission reduced, but the transmission success rate and system reliability under complex channels are also improved, ensuring rapid delivery of important data and optimizing one-way transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122932810A_ABST
    Figure CN122932810A_ABST
Patent Text Reader

Abstract

The application provides a one-way transmission method of two-dimensional code based on infrared light intensity adjustment, and belongs to the field of two-dimensional code. A set of infrared light intensity modes with multiple discrete intensities is set in advance, and each mode is bound to a corresponding transmission gain; a binary data stream is segmented, each segment is attached to an error correction code, an absolute position offset and a logic meaning level to encapsulate a data packet, and each packet independently generates a two-dimensional code to constitute a basic frame set; the logic meaning level, the data segment length, the transmission success rate expectation value based on the historical light intensity selection record and the channel attenuation model iterative update are combined to calculate the dynamic transmission value of each frame; before transmission, the two-dimensional code and the light intensity mode combination are traversed, the transmission value, the time compensation factor and the gain parameter are combined to calculate the instantaneous transmission priority, and the optimal combination is selected as the target frame and the transmission mode; when modulating and emitting, the dark modules of the two-dimensional code are mapped to zero infrared light intensity, and the bright modules are matched to the selected intensity level to output, so that the one-way data transmission is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of QR codes, and in particular relates to a one-way transmission method and system for QR codes based on infrared light intensity modulation. Background Technology

[0002] With the deepening of information security and the construction of physically isolated networks, the application of one-way data transmission technology is becoming increasingly widespread in fields such as confidential institutions, financial systems, and industrial control. QR codes, as a high-density data carrier, have become a common means of one-way data transfer across networks due to their flexible encoding and high fault tolerance. Traditional continuous QR code transmission relies heavily on visible light display devices. Visible light communication is highly susceptible to interference from ambient light, and the information display process is open, posing a security risk of being intercepted or illegally recorded. Infrared light-based data transmission possesses the characteristics of being invisible, highly concealed, and naturally resistant to visible light interference, meeting the communication needs of high-security scenarios. When faced with large-capacity data streams, limited by the capacity of a single carrier, the data to be transmitted must be divided into multiple logical blocks and converted into a continuous QR code sequence for one-way broadcast.

[0003] In existing one-way infrared QR code transmission schemes, the lack of receiver acknowledgment and active retransmission mechanisms means the transmission link relies entirely on continuous one-way pushing from the transmitter. When encountering channel attenuation, dynamic environmental interference, or brief device offset, some data frames are lost. To combat the high packet loss problem in one-way channels, traditional strategies typically employ equal-priority cyclical transmission or blind fixed-number retransmissions. This mechanism fails to consider the fundamental differences in importance between different logical segments in the data stream and cannot assess the current transmission value of each data frame by combining real-time channel attenuation status and historical transmission performance. Existing infrared transmitters often use a single, fixed radiation intensity, unable to flexibly allocate light intensity according to the urgency of data frames and environmental conditions. This results in critical core data not receiving sufficient signal protection under adverse conditions, while secondary data causes ineffective consumption of system resources and power. This rigid mode, lacking coordination between priority scheduling and infrared light intensity adjustment, leads to low communication efficiency, insufficient delivery rate of critical information, and a severe imbalance in transmission resource allocation, failing to meet the reliable one-way communication requirements in extremely complex environments. Summary of the Invention

[0004] To improve the core data delivery rate of one-way cross-network transmission of infrared QR codes under complex channel conditions, this invention provides a one-way QR code transmission method and system based on infrared light intensity modulation.

[0005] According to one aspect of the present invention, a one-way transmission method for QR codes based on infrared light intensity squaring is provided, comprising the following steps: The system pre-sets an infrared light intensity mode set containing multiple discrete intensity levels, with each mode associated with a corresponding transmission gain parameter; it scans the binary data stream to be transmitted and divides it into multiple logical data segments; it adds forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment and encapsulates it to generate a data packet to be encoded. A corresponding QR code image is generated independently for each data packet, thus forming a basic frame set; the transmission value is calculated based on the logical meaning level of the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process. The expected transmission success rate is iteratively updated based on the optical intensity mode and channel attenuation model selected from historical transmissions. Before each system transmission task is executed, each QR code image in the basic frame set is combined with each light intensity mode in the light intensity mode set. The instantaneous transmission priority is calculated using dynamic transmission value, time compensation factor, and transmission gain parameter matching the light intensity mode. The combination with the highest priority is selected as the target frame and transmission mode. Infrared light modulation processing is performed on the target frame. Specifically, the dark modules in the target frame image are mapped to zero infrared light intensity, and the bright modules are modulated to the intensity level corresponding to the selected specific transmission mode for infrared light emission.

[0006] Optionally, the step of scanning the binary data stream to be transmitted and dividing it into multiple logical data segments includes: A specific synchronization word sequence without zero-bit padding is set as a data structure feature. One of the data structure features is inserted before the start bit at the very beginning of the binary data stream to be transmitted, after the end bit at the very end, and at intervals of a preset segment length within the data stream. Perform bit-by-bit sliding window matching from the start bit of the binary data stream; When the data structure feature is matched, the current matching termination position is marked as a split point; Extract the bitstream data between two adjacent split points as the logical data segment.

[0007] Optionally, the step of adding forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment and encapsulating it to generate a data packet to be encoded includes: The Reed-Solomon coding algorithm is used to calculate and generate a forward error correction sequence based on the content of the logical data segment, which is then appended to the end of the logical data segment as the forward error correction code. Calculate the absolute sequence index number of the first bit of the logical data segment in the original binary data stream, and convert it into a binary sequence as the absolute position offset to be inserted into the beginning of the logical data segment; According to the preset attribute dictionary, the corresponding position importance value is matched according to the absolute position offset of the logical data segment, and the value is inserted as the logical meaning level before the absolute position offset to form the data packet.

[0008] Optionally, the step of calculating the dynamically changing transmission value based on the logical meaning level corresponding to the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process includes: Extract the numerical value of the logical meaning level and convert it into a decimal value. Multiply the decimal value by the first weight constant to obtain the first reference value. Obtain the number of bytes contained in the data segment, calculate the absolute value of the difference between the baseline capacity constant and the number of bytes, and multiply the difference by the second weight constant to obtain the second reference value; Extract the expected transmission success rate under the current state, subtract the expected transmission success rate from 1 to obtain the remaining error margin, and multiply the remaining error margin by the third weight constant to obtain the third reference value. The first reference value and the third reference value are added together, and the second reference value, which is used as a size penalty, is subtracted to obtain the evaluation value. The evaluation value is used as the transmission value of the dynamic changes of the QR code image.

[0009] Optionally, the expected transmission success rate is iteratively updated based on the historical transmission selection of optical intensity mode and channel attenuation model, including: Get the duty cycle value of the light intensity mode selected when this frame was last sent out; Acquire the ambient light intensity measurement value at the transmitter; The product of the ambient light intensity measurement and the decay slope constant with inverse dimensions is processed using a preset negative exponential decay function to calculate the channel attenuation basis in the interval from 0 to 1. Extract the expected historical value of transmission success rate saved in the previous generation of the frame. If it is the first generation, initialize the value to 0. Subtract the expected historical value from 1 to get the remaining failure probability. Multiply the remaining failure probability, the normalized duty cycle value, and the channel attenuation basis to calculate the expected increment. Add the expected increment to the expected historical value to generate the updated expected transmission success rate value and save it to the parameter space.

[0010] Optionally, the calculation of instantaneous transmission priority using dynamic transmission value, time compensation factor, and transmission gain parameters of matched light intensity mode includes: The absolute number of seconds in which the time elapsed since the last scheduled transmission of the target QR code image is obtained. If the QR code image is being scheduled for the first time, then the absolute number of seconds of the empty window is assigned to the preset maximum time value, according to the formula. The time compensation factor is calculated. Represents a positive real constant with dimensions that are inversely proportional to time; Multiply the dynamic transmission value of the frame by the time compensation factor to obtain the transmission demand baseline value; calculate the absolute value of the difference between the transmission demand baseline value and the transmission gain parameter corresponding to the matching light intensity mode; subtract the absolute value from the transmission demand baseline value, and use the calculated value as the instantaneous transmission priority of this combination.

[0011] Optionally, the preset includes a set of infrared light intensity modes with multiple discrete intensity levels, each mode being associated with a corresponding transmission gain parameter, including: The duty cycle of the infrared emission control square wave is set to at least four different constant levels to form the plurality of discrete intensity levels; A unique identifier sequence is assigned to each discrete intensity level to form the infrared light intensity pattern set; Extract the percentile integer of the duty cycle value corresponding to each light intensity mode, and use it as the transmission gain parameter associated with the light intensity mode.

[0012] According to another aspect of the present invention, a one-way QR code transmission system based on infrared light intensity modulation is provided, comprising the following modules: The generation module is used to preset an infrared light intensity pattern set containing multiple discrete intensity levels, with each mode associated with a corresponding transmission gain parameter; scan the binary data stream to be transmitted and divide it into multiple logical data segments; add forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment, and encapsulate it to generate a data packet to be encoded. The calculation module is used to independently generate a corresponding QR code image for each data packet, thereby forming a basic frame set. Based on the logical meaning level of the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process, the module calculates the dynamically changing transmission value. The expected transmission success rate is iteratively updated based on the optical intensity mode and channel attenuation model selected from historical transmissions. The transmission module is used to combine each QR code image in the basic frame set with each light intensity mode in the light intensity mode set before each system transmission task is executed. It calculates the instantaneous transmission priority using dynamic transmission value, time compensation factor, and transmission gain parameters matching the light intensity mode. The combination with the highest priority is selected as the target frame and transmission mode. The target frame is then subjected to infrared light modulation processing. Specifically, the dark modules in the target frame image are mapped to zero infrared light intensity, and the bright modules are modulated to the intensity level corresponding to the selected specific transmission mode for infrared light emission.

[0013] Preferably, the step of scanning the binary data stream to be transmitted and dividing it into multiple logical data segments includes: A specific synchronization word sequence without zero-bit padding is set as a data structure feature. One of the data structure features is inserted before the start bit at the very beginning of the binary data stream to be transmitted, after the end bit at the very end, and at intervals of a preset segment length within the data stream. Perform bit-by-bit sliding window matching from the start bit of the binary data stream; When the data structure feature is matched, the current matching termination position is marked as a split point; Extract the bitstream data between two adjacent split points as the logical data segment.

[0014] Preferably, the step of adding forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment and encapsulating it to generate a data packet to be encoded includes: The Reed-Solomon coding algorithm is used to calculate and generate a forward error correction sequence based on the content of the logical data segment, which is then appended to the end of the logical data segment as the forward error correction code. Calculate the absolute sequence index number of the first bit of the logical data segment in the original binary data stream, and convert it into a binary sequence as the absolute position offset to be inserted into the beginning of the logical data segment; According to the preset attribute dictionary, the corresponding position importance value is matched according to the absolute position offset of the logical data segment, and the value is inserted as the logical meaning level before the absolute position offset to form the data packet.

[0015] Preferably, the step of calculating the dynamically changing transmission value based on the logical meaning level corresponding to the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process includes: Extract the numerical value of the logical meaning level and convert it into a decimal value. Multiply the decimal value by the first weight constant to obtain the first reference value. Obtain the number of bytes contained in the data segment, calculate the absolute value of the difference between the baseline capacity constant and the number of bytes, and multiply the difference by the second weight constant to obtain the second reference value; Extract the expected transmission success rate under the current state, subtract the expected transmission success rate from 1 to obtain the remaining error margin, and multiply the remaining error margin by the third weight constant to obtain the third reference value. The first reference value and the third reference value are added together, and the second reference value, which is used as a size penalty, is subtracted to obtain the evaluation value. The evaluation value is used as the transmission value of the dynamic changes of the QR code image.

[0016] Preferably, the expected transmission success rate is iteratively updated based on the historical transmission selection of optical intensity mode and channel attenuation model, including: Get the duty cycle value of the light intensity mode selected when this frame was last sent out; Acquire the ambient light intensity measurement value at the transmitter; The product of the ambient light intensity measurement and the decay slope constant with inverse dimensions is processed using a preset negative exponential decay function to calculate the channel attenuation basis in the interval from 0 to 1. Extract the expected historical value of transmission success rate saved in the previous generation of the frame. If it is the first generation, initialize the value to 0. Subtract the expected historical value from 1 to get the remaining failure probability. Multiply the remaining failure probability, the normalized duty cycle value, and the channel attenuation basis to calculate the expected increment. Add the expected increment to the expected historical value to generate the updated expected transmission success rate value and save it to the parameter space.

[0017] Preferably, the calculation of instantaneous transmission priority using dynamic transmission value, time compensation factor, and transmission gain parameters of the matching light intensity mode includes: The absolute number of seconds in which the time elapsed since the last scheduled transmission of the target QR code image is obtained. If the QR code image is being scheduled for the first time, then the absolute number of seconds of the empty window is assigned to the preset maximum time value, according to the formula. The time compensation factor is calculated. Represents a positive real constant with dimensions that are inversely proportional to time; Multiply the dynamic transmission value of the frame by the time compensation factor to obtain the transmission demand baseline value; calculate the absolute value of the difference between the transmission demand baseline value and the transmission gain parameter corresponding to the matching light intensity mode; subtract the absolute value from the transmission demand baseline value, and use the calculated value as the instantaneous transmission priority of this combination.

[0018] Preferably, the preset includes a set of infrared light intensity modes with multiple discrete intensity levels, each mode being associated with a corresponding transmission gain parameter, including: The duty cycle of the infrared emission control square wave is set to at least four different constant levels to form the plurality of discrete intensity levels; A unique identifier sequence is assigned to each discrete intensity level to form the infrared light intensity pattern set; Extract the percentile integer of the duty cycle value corresponding to each light intensity mode, and use it as the transmission gain parameter associated with the light intensity mode.

[0019] This invention improves data integrity and anti-interference capabilities by segmenting the data to be transmitted and encapsulating it with forward error correction codes, position offsets, and logical meaning levels. The transmission value of data packets is reliably assessed by combining the logical meaning level, data segment length, and expected success rate based on historical transmission and channel model iteration updates. Before executing the transmission task, the instantaneous transmission priority is calculated by integrating this transmission value, time compensation factor, and transmission gain parameters of the light intensity mode, matching the optimal transmission order and infrared light intensity for each QR code image. By mapping the QR code's brightness module to specific infrared light intensity levels for modulation and transmission, not only is resource waste caused by indiscriminate transmission reduced, but the transmission success rate and system reliability under complex channels are also improved, ensuring rapid delivery of important data and optimizing one-way transmission efficiency. Attached Figure Description

[0020] Figure 1 This is a block diagram of the hardware system architecture for infrared QR code optical transmission. Figure 2 This is a schematic diagram of the infrared light intensity levels and the QR code scanning surface. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0022] like Figure 1 As shown, from left to right, the data source to be transmitted, the four-way collaborative processing unit, the PWM current drive and GPIO control module, and the infrared LED emitting array are arranged sequentially. The unidirectional data flow between modules is marked by arrows. In the first embodiment, this invention proposes a unidirectional QR code transmission method based on infrared light intensity modulation, including the following steps: S1, a preset set of infrared light intensity modes containing multiple discrete intensity levels, each mode being associated with a corresponding transmission gain parameter; scans the binary data stream to be transmitted, dividing it into multiple logical data segments; adds forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment, and encapsulates it to generate a data packet to be encoded.

[0023] A one-dimensional array structure is pre-constructed to store at least four discrete intensity levels as an infrared light intensity mode set. Each discrete intensity level corresponds to a different pulse width modulation duty cycle parameter. For each infrared light intensity mode, the percentile integer of the corresponding duty cycle value is pre-extracted as the corresponding transmission gain parameter and stored in the structure array. Data from the input file or buffer is read cyclically, and the binary data stream to be transmitted is scanned using pointer offset, truncating and dividing the data stream into multiple continuous logical data segments. For each logical data segment, a forward error correction sequence is calculated based on the content of the logical data segment using the Reed-Solomon coding algorithm as the forward error correction code. An accumulator records the absolute sequence index of the first bit of the current logical data segment in the original binary data stream as the absolute position offset. The data segment is divided into three discrete integers from high to low as logical meaning levels by parsing the characteristics of the logical data segment content to identify the file header or core payload. A memory copy operation is performed in the order of logical meaning level, absolute position offset, data payload, and forward error correction code, concatenating all bytes into a specific frame structure to generate the data packet to be encoded.

[0024] In an optional embodiment, scanning the binary data stream to be transmitted and dividing it into multiple logical data segments includes: A specific synchronization word sequence without zero-bit padding is set as a data structure feature. One of the data structure features is inserted before the start bit at the very beginning of the binary data stream to be transmitted, after the end bit at the very end, and at intervals of a preset segment length within the data stream. Perform bit-by-bit sliding window matching from the start bit of the binary data stream; When the data structure feature is matched, the current matching termination position is marked as a split point; Extract the bitstream data between two adjacent split points as the logical data segment.

[0025] When segmenting the binary data stream to be transmitted, a standard synchronization word sequence is preset as the frame delimiter, for example, an 8-bit sequence "01111110" is selected as the specific synchronization word sequence. To prevent misjudgment caused by the presence of the same sequence as the specific synchronization word sequence in the binary data stream to be transmitted, zero-bit padding is performed before generating the binary data stream to be transmitted. That is, a "0" is inserted after five consecutive "1"s are detected to ensure that there are no six consecutive "1"s in the binary data stream to be transmitted. The 8-bit "01111110" without padding is set as a data structure feature. After the zero-bit padding, it is impossible for the binary data stream to contain six consecutive "1"s, thus avoiding conflicts with the sequence of the data structure feature. Before scanning and segmenting, a concatenated data structure feature is inserted before the start bit at the very beginning of the entire binary data stream to be transmitted, after the end bit at the very end, and at positions within the data stream that are no more than 1784 bits apart, to form multiple continuous and closed delimited intervals. An 8-bit shift register with the same length as the data structure feature is set as a sliding window. Starting from the beginning of the binary data stream to be transmitted, one bit is read into the shift register each time, and the shift register slides backward in steps of one bit. After each slide, the 8 bits of data in the shift register are XORed with the data structure feature "01111110" to determine if they match completely. If they match successfully, the absolute position coordinates of the last bit of the shift register in the binary data stream to be transmitted are recorded, and these coordinates are saved as a split point in a singly linked list structure.

[0026] By continuously scanning the binary data stream to be transmitted, a series of segmentation points consisting of continuous coordinates are generated. The binary data stream to be transmitted is sequentially truncated according to the segmentation point linked list. The bitstream data between the nth and (n+1)th adjacent segmentation points is extracted, and the padding zero bits are removed to form the dynamically changing logical data segment. The length of the generated logical data segment is determined; if it is less than 128 bits, zero-bit padding is performed at the end of the data segment until the total length reaches 128 bits. The length of the logical data segment extracted between adjacent segmentation points is controlled between 128 bits and 1784 bits, for example, set to 1784 bits, or 223 bytes, to ensure that the pixel matrix density of the subsequently generated single QR code image is within a suitable visual decoding range.

[0027] In an optional embodiment, the step of attaching forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment and encapsulating it to generate a data packet to be encoded includes: The Reed-Solomon coding algorithm is used to calculate and generate a forward error correction sequence based on the content of the logical data segment, which is then appended to the end of the logical data segment as the forward error correction code. Calculate the absolute sequence index number of the first bit of the logical data segment in the original binary data stream, and convert it into a binary sequence as the absolute position offset to be inserted into the beginning of the logical data segment; According to the preset attribute dictionary, the corresponding position importance value is matched according to the absolute position offset of the logical data segment, and the value is inserted as the logical meaning level before the absolute position offset to form the data packet.

[0028] When encapsulating the data packet to be encoded, Reed-Solomon (RS) encoding is performed on each logical data segment, for example, using the RS(255,223) standard. The logical data segment is divided into blocks of 8 bits (1 byte) as the sign unit. The length of the current logical data segment is determined; if it is less than 223 bytes, a sequence of all-zero bytes is padded to the end of the data segment until the total length is strictly equal to 223 bytes. For each input information block with a length not exceeding 223 bytes, 32 check bytes are calculated and generated. This 32-byte check sequence constitutes the forward error correction code and is appended to the end of the logical data segment. The first bit of the current logical data segment is mapped back to the absolute sequence index number in the original data stream before zero-bit padding, and the index number is converted into a fixed-length 32-bit unsigned integer binary sequence. For example, if the current logical data segment is the third segment of the binary data stream to be transmitted, and the length of the first two segments is a total of 512 bytes, then the absolute sequence index number is 4096, which is 512 × 8 bits. Converted to a 32-bit binary sequence, it is 0000000000000000001000000000000; this 32-bit sequence is inserted as the absolute position offset into the beginning of the logical data segment.

[0029] The system matches the corresponding positional importance value according to a preset attribute dictionary, which maps the relationship between absolute positional offset ranges and logical significance levels in key-value pairs. For example, the preset attribute dictionary specifies that logical data segments with absolute positional offsets between 0 and 1023 correspond to a positional importance value of 5, while regular logical data segments with absolute positional offsets greater than 1023 correspond to a positional importance value of 2. The system uses a binary search method to locate the current absolute positional offset range, extracts the matching positional importance value, and converts the value into a 1-byte binary feature code (e.g., value 5 corresponds to 00000101), which is then inserted as the logical significance level before the absolute positional offset. The logical significance level (1 byte), absolute positional offset (4 bytes), logical data segment (maximum 223 bytes), and forward error correction code (32 bytes) are then concatenated in sequence to generate a data packet with a fixed format and a total length of 260 bytes.

[0030] In an optional embodiment, the preset includes a set of infrared light intensity modes with multiple discrete intensity levels, each mode being associated with a corresponding transmission gain parameter, including: The duty cycle of the infrared emission control square wave is set to at least four different constant levels to form the plurality of discrete intensity levels; A unique identifier sequence is assigned to each discrete intensity level to form the infrared light intensity pattern set; Extract the percentile integer of the duty cycle value corresponding to each light intensity mode, and use it as the transmission gain parameter associated with the light intensity mode.

[0031] When setting the infrared light intensity mode set, the duty cycle of the infrared emission control square wave is set to at least four different constant levels, such as 20%, 40%, 60%, and 80% respectively; these different duty cycle levels constitute four discrete intensity levels of emitted infrared light. A unique identifier sequence is assigned to the duty cycle of each discrete intensity level, for example, the identifier "0x01A1" is assigned to 20%, and the identifier "0x01A4" is assigned to 80%, thereby forming the infrared light intensity mode set. The percentile integers of the duty cycle values ​​corresponding to each infrared light intensity mode are extracted, that is, the four percentile integers 20, 40, 60, and 80 are extracted; these four extracted integers are respectively set as the transmission gain parameters associated with each infrared light intensity mode. The extracted transmission gain parameters and their corresponding infrared light intensity mode identifiers are encapsulated and stored for matching during instantaneous transmission priority calculation.

[0032] S2 generates a corresponding QR code image for each data packet independently, thus forming a basic frame set; based on the logical meaning level of the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process, the dynamically changing transmission value is calculated, and the expected transmission success rate is iteratively updated based on the optical intensity mode and channel attenuation model selected from historical transmissions.

[0033] The core encoding functions of the qrencode open-source QR code generation library are used to set error correction levels and version parameters for the encapsulated data packets. The data packets are converted into a two-dimensional pixel matrix array composed of black and white modules, generating a single QR code image. A linked list data structure is used to link all the two-dimensional pixel matrix arrays to form a basic frame set. A one-dimensional floating-point array is established to record the expected transmission success rate of each QR code image, initially set to 100%. The first reference value derived from the logical significance level is added to the third reference value calculated from the expected transmission success rate, and then the second reference value, calculated as a size penalty based on the logical data segment length, is subtracted to calculate the dynamically changing transmission value. After each transmission task is completed, the expected transmission success rate is updated using an exponentially weighted moving average algorithm. The update process involves calculating the current theoretical success rate based on the ambient light intensity measurement and normalized duty cycle value at the transmitter, and then calculating the latest expected transmission success rate based on the weighted average of the historical expected transmission success rate and the current theoretical success rate. This ensures that the dynamically changing transmission value increases with the number of transmissions and the decrease in the expected transmission success rate.

[0034] In an optional embodiment, the step of calculating the dynamically changing transmission value based on the logical meaning level corresponding to the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process includes: Extract the numerical value of the logical meaning level and convert it into a decimal value. Multiply the decimal value by the first weight constant to obtain the first reference value. Obtain the number of bytes contained in the data segment, calculate the absolute value of the difference between the baseline capacity constant and the number of bytes, and multiply the difference by the second weight constant to obtain the second reference value; Extract the expected transmission success rate under the current state, subtract the expected transmission success rate from 1 to obtain the remaining error margin, and multiply the remaining error margin by the third weight constant to obtain the third reference value. The first reference value and the third reference value are added together, and the second reference value, which is used as a size penalty, is subtracted to obtain the evaluation value. The evaluation value is used as the transmission value of the dynamic changes of the QR code image.

[0035] When calculating the dynamically changing transmission value, the logical meaning level is extracted and converted from binary format to decimal value; the value range of the first weight constant is set to 5.0 to 20.0, for example, set to 10.0; if the extracted logical meaning level decimal value is 5, the first reference value is 50.0. The length of the logical data segment is obtained; a baseline capacity constant is preset, for example, set to 128 bytes; if the obtained logical data segment length is 223 bytes, the absolute value of the difference between the baseline capacity constant 128 and the logical data segment length 223 is calculated to obtain 95, and the absolute value is positive to prevent negative feedback; the value range of the second weight constant is set to 0.05 to 0.5, for example, set to 0.1; the absolute value 95 is multiplied by the second weight constant 0.1 to obtain the second reference value 9.5. In an optional embodiment, the first reference value, the second reference value, and the third reference value are normalized first and then accumulated.

[0036] Obtain the expected transmission success rate under the current state, with a value range of [0.0, 1.0]. Subtract this expected transmission success rate from the constant 1.0 to obtain the remaining error margin. For example, if the current expected transmission success rate is 0.2, then the remaining error margin is 0.8. Set the value range of the third weight constant to 30.0 to 80.0, for example, set it to 50.0. Multiply the remaining error margin 0.8 by the third weight constant 50.0 to obtain the third reference value of 40.0. Add the independently calculated first reference value 50.0 to the third reference value 40.0, and subtract the second reference value 9.5 to calculate the dynamically changing transmission value of 80.5. Use 80.5 as the dynamically changing transmission value of the QR code image.

[0037] In an optional embodiment, the expected transmission success rate is iteratively updated based on the historical transmission selected optical intensity mode and channel attenuation model, including: Get the duty cycle value of the light intensity mode selected when this frame was last sent out; Acquire the ambient light intensity measurement value at the transmitter; The product of the ambient light intensity measurement and the decay slope constant with inverse dimensions is processed using a preset negative exponential decay function to calculate the channel attenuation basis in the interval from 0 to 1. Extract the expected historical value of transmission success rate saved in the previous generation of the frame. If it is the first time it is generated, initialize the value to a preset initial reference value, such as 1.0. Multiply the normalized duty cycle value with the channel attenuation base to calculate the current theoretical success rate. According to the preset smoothing weight coefficient, calculate the weighted average of the expected historical value and the current theoretical success rate to generate an updated expected transmission success rate value and save it in the parameter space.

[0038] When iteratively updating the expected transmission success rate, the duty cycle value of the infrared light intensity mode selected when the QR code image was last sent is obtained, for example, a 50% duty cycle, and the duty cycle value is normalized to obtain 0.5; optionally, if the QR code image is the first time it is scheduled, the duty cycle value is set by default to the highest initial value in the light intensity mode set, for example, an 80% duty cycle. The ambient light intensity measurement value of the transmitter is obtained, for example, an ambient light intensity of 500 Lux. A preset decay slope constant is set, for example, 0.0021 / Lux, and the ambient light intensity measurement value of 500 is multiplied by the decay slope constant 0.002 to obtain a product of 1.0; the product is processed using a preset negative exponential decay function, that is, the negative of the product -1.0 is used as the exponent of the natural base e to calculate the... It is approximately equal to 0.368; the calculation result is used as the channel attenuation basis, and the value of the basis is restricted to the interval [0,1].

[0039] Extract the expected transmission success rate value saved from the previous generation of the QR code image; if the QR code image is generated for the first time, initialize the expected transmission success rate value to 1.0; if the obtained expected transmission success rate value is 0.8, multiply the normalized duty cycle value of 0.5 by the channel attenuation basis of 0.368 to calculate the current theoretical success rate of approximately 0.184. Introduce a preset smoothing weight coefficient, for example, set to 0.5, and perform a weighted average calculation of the expected transmission success rate value of 0.8 and the current theoretical success rate of 0.184 to obtain an updated expected transmission success rate value of 0.492; save this value for subsequent instantaneous transmission priority calculation in scheduling allocation.

[0040] S3, before each system transmission task is executed, each QR code image in the basic frame set is combined with each light intensity mode in the light intensity mode set, and the instantaneous transmission priority is calculated using dynamic transmission value, time compensation factor and transmission gain parameter of matching light intensity mode; the combination with the highest priority is selected as the target frame and transmission mode; infrared light modulation processing is performed on the target frame, specifically, the dark modules in the target frame image are mapped to zero infrared light intensity, and the bright modules are modulated to the intensity level corresponding to the selected specific transmission mode for infrared light emission.

[0041] In the main loop program of the transmitter, a two-level nested for loop structure is established. The outer loop iterates through each QR code image in the basic frame set, and the inner loop iterates through all infrared intensity patterns in the infrared intensity pattern set to form all mapping combinations. The system timer is used to obtain the absolute number of seconds of the empty window converted from the time elapsed since the last round of scheduling transmission of the current QR code image. The product of the absolute number of seconds of the empty window and the time inverse constant is calculated by setting the exponent of the natural constant base e to negative. The result of the exponent calculation is subtracted from the constant 1 to obtain the time compensation factor. The transmission value of the dynamic change of the current QR code image is multiplied by the time compensation factor to obtain the transmission demand benchmark value. The absolute value of the difference between the transmission demand benchmark value and the transmission gain parameter of the matching infrared intensity pattern is calculated. The absolute value is multiplied by a preset decimal penalty coefficient (e.g., 0.1) to obtain the penalty term. The transmission demand benchmark value is subtracted from the penalty term to obtain the instantaneous transmission priority of this combination. Set a maximum value comparison variable with an initial value of negative infinity. In the loop, compare the calculated instantaneous transmission priorities sequentially, retain the image memory pointer and mode array index corresponding to the largest value, and confirm the image memory pointer and mode array index as the target frame and infrared light intensity mode in the current transmission period.

[0042] In the driver layer of the infrared emission module, two layers of loops scan the element values ​​of the target frame's two-dimensional pixel matrix row by row and column by column. When a dark module with an element value of one is read, the general-purpose input / output port is controlled to output a continuous low-level signal to turn off the infrared LED and achieve zero infrared light intensity. When a bright module with an element value of zero is read, the hardware pulse width modulation control register is called to adjust the operating current of the infrared LED to a specific duty cycle corresponding to the infrared light intensity mode for high-frequency infrared light emission. After the target frame pixels have been traversed and sent, the next system transmission task begins. The receiving end uses an optical sensor array to capture the light signal and perform exposure integration, reconstructing the light intensity distribution into a two-dimensional pixel matrix. Through reverse mapping, error correction, and decoding, the original binary data stream is finally restored. Figure 2 As shown, the left side of the figure shows the waveforms of the infrared light intensity mode set with four duty cycles and the corresponding transmission gain parameter bars, while the right side shows the row and column scanning emission surface pixel matrix, with unidirectional arrows pointing from the left to the matrix for each row scanning path.

[0043] In an optional embodiment, calculating the instantaneous transmission priority using dynamic transmission value, time compensation factor, and transmission gain parameters matching the light intensity mode includes: The absolute number of seconds in which the time elapsed since the last scheduled transmission of the target QR code image is obtained. If the QR code image is being scheduled for the first time, then the absolute number of seconds of the empty window is assigned to the preset maximum time value, according to the formula. The time compensation factor is calculated. Represents a positive real constant with dimensions that are inversely proportional to time; Multiply the dynamic transmission value of the frame by the time compensation factor to obtain the transmission demand baseline value; calculate the absolute value of the difference between the transmission demand baseline value and the transmission gain parameter corresponding to the matching light intensity mode; subtract the absolute value from the transmission demand baseline value, and use the calculated value as the instantaneous transmission priority of this combination.

[0044] When calculating the instantaneous transmission priority, the absolute number of seconds of the empty window is obtained, which is the time elapsed since the QR code image was transmitted in the previous round of scheduling. For example, if 2.5 seconds have elapsed since the last transmission, the absolute number of seconds of the empty window is determined to be the first time the QR code image is scheduled. If the QR code image is determined to be the first time the QR code image is scheduled, the absolute number of seconds of the empty window is assigned a preset maximum time value, for example, 9999.0 seconds. After obtaining the absolute number of seconds of the empty window, a positive real constant with a time inverse dimension is read, with the range set between 0.1 and 1.0, for example, 0.4. The currently effective absolute number of seconds of the empty window, taking 2.5 seconds as an example, is multiplied by the positive real constant 0.4 to obtain a product of 1.0.

[0045] The result is approximately 0.368. Subtracting this exponential value from the constant 1 yields approximately 0.632, which is used as the time compensation factor. The dynamically changing transmission value corresponding to the QR code image is extracted, for example, a value of 93.3. This value is multiplied by the time compensation factor 0.632 to obtain a transmission demand baseline value of approximately 58.97. At this point, the absolute value of the difference between the transmission gain parameters corresponding to each infrared light intensity mode is compared. For example, when the current traversal reaches 60% luminous intensity (gain parameter 60), the absolute value of the difference between the transmission demand baseline value 58.97 and parameter 60 is calculated to be 1.03. This is multiplied by a preset penalty coefficient of 0.1 to obtain a penalty term of 0.103. Subtracting the penalty term 0.103 from the transmission demand baseline value 58.97 yields a result of 58.867. This ensures the global scheduling priority of high-demand, urgent data; simultaneously, the penalty term is used for deduction to ensure that a single target frame can accurately match the infrared light intensity mode with the smallest difference. For example, if the mode with gain parameter 40 is matched, the absolute value deviation is 18.97, the corresponding penalty term is 1.897, and its priority score is 57.073, which is lower than the 58.867 calculated for accurately matching the mode with gain parameter 60. This calculation result is used as the instantaneous transmission priority in the current loop.

[0046] In a second embodiment, the present invention also provides a QR code one-way transmission system based on infrared light intensity modulation, comprising the following modules: The generation module is used to preset an infrared light intensity pattern set containing multiple discrete intensity levels, with each mode associated with a corresponding transmission gain parameter; scan the binary data stream to be transmitted and divide it into multiple logical data segments; add forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment, and encapsulate it to generate a data packet to be encoded. The calculation module is used to independently generate a corresponding QR code image for each data packet, thereby forming a basic frame set. Based on the logical meaning level of the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process, the module calculates the dynamically changing transmission value. The expected transmission success rate is iteratively updated based on the optical intensity mode and channel attenuation model selected from historical transmissions. The transmission module is used to combine each QR code image in the basic frame set with each light intensity mode in the light intensity mode set before each system transmission task is executed. It calculates the instantaneous transmission priority using dynamic transmission value, time compensation factor, and transmission gain parameters matching the light intensity mode. The combination with the highest priority is selected as the target frame and transmission mode. The target frame is then subjected to infrared light modulation processing. Specifically, the dark modules in the target frame image are mapped to zero infrared light intensity, and the bright modules are modulated to the intensity level corresponding to the selected specific transmission mode for infrared light emission.

[0047] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A one-way transmission method for QR codes based on infrared light intensity modulation, characterized in that, Includes the following steps: The system pre-sets an infrared light intensity mode set containing multiple discrete intensity levels, with each mode associated with a corresponding transmission gain parameter; it scans the binary data stream to be transmitted and divides it into multiple logical data segments; it adds forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment and encapsulates it to generate a data packet to be encoded. A corresponding QR code image is generated independently for each data packet, thus forming a basic frame set; the transmission value is calculated based on the logical meaning level of the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process. The expected transmission success rate is iteratively updated based on the optical intensity mode and channel attenuation model selected from historical transmissions. Before each system transmission task is executed, each QR code image in the basic frame set is combined with each light intensity mode in the light intensity mode set. The instantaneous transmission priority is calculated using dynamic transmission value, time compensation factor, and transmission gain parameter matching the light intensity mode. The combination with the highest priority is selected as the target frame and transmission mode. Infrared light modulation processing is performed on the target frame. Specifically, the dark modules in the target frame image are mapped to zero infrared light intensity, and the bright modules are modulated to the intensity level corresponding to the selected specific transmission mode for infrared light emission.

2. The method according to claim 1, characterized in that, The process of scanning the binary data stream to be transmitted and dividing it into multiple logical data segments includes: A specific synchronization word sequence without zero-bit padding is set as a data structure feature. One of the data structure features is inserted before the start bit at the very beginning of the binary data stream to be transmitted, after the end bit at the very end, and at intervals of a preset segment length within the data stream. Perform bit-by-bit sliding window matching from the start bit of the binary data stream; When the data structure feature is matched, the current matching termination position is marked as a split point; Extract the bitstream data between two adjacent split points as the logical data segment.

3. The method according to claim 1, characterized in that, The process of adding forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment and encapsulating it to generate a data packet to be encoded includes: The Reed-Solomon coding algorithm is used to calculate and generate a forward error correction sequence based on the content of the logical data segment, which is then appended to the end of the logical data segment as the forward error correction code. Calculate the absolute sequence index number of the first bit of the logical data segment in the original binary data stream, and convert it into a binary sequence as the absolute position offset to be inserted into the beginning of the logical data segment; According to the preset attribute dictionary, the corresponding position importance value is matched according to the absolute position offset of the logical data segment, and the value is inserted as the logical meaning level before the absolute position offset to form the data packet.

4. The method according to claim 1, characterized in that, The step of calculating the dynamically changing transmission value based on the logical meaning level corresponding to the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process includes: Extract the numerical value of the logical meaning level and convert it into a decimal value. Multiply the decimal value by the first weight constant to obtain the first reference value. Obtain the number of bytes contained in the data segment, calculate the absolute value of the difference between the baseline capacity constant and the number of bytes, and multiply the difference by the second weight constant to obtain the second reference value; Extract the expected transmission success rate under the current state, subtract the expected transmission success rate from 1 to obtain the remaining error margin, and multiply the remaining error margin by the third weight constant to obtain the third reference value. The first reference value and the third reference value are added together, and the second reference value, which is used as a size penalty, is subtracted to obtain the evaluation value. The evaluation value is used as the transmission value of the dynamic changes of the QR code image.

5. The method according to claim 1, characterized in that, The expected transmission success rate is iteratively updated based on the historical transmission optical intensity mode and channel attenuation model, including: Get the duty cycle value of the light intensity mode selected when this frame was last sent out; Acquire the ambient light intensity measurement value at the transmitter; The product of the ambient light intensity measurement and the decay slope constant with inverse dimensions is processed using a preset negative exponential decay function to calculate the channel attenuation basis in the interval from 0 to 1. Extract the expected historical value of transmission success rate saved in the previous generation of the frame. If it is the first generation, initialize the value to 0. Subtract the expected historical value from 1 to get the remaining failure probability. Multiply the remaining failure probability, the normalized duty cycle value, and the channel attenuation basis to calculate the expected increment. Add the expected increment to the expected historical value to generate the updated expected transmission success rate value and save it to the parameter space.

6. The method according to claim 1, characterized in that, The calculation of instantaneous transmission priority using dynamic transmission value, time compensation factor, and transmission gain parameters of matched optical intensity mode includes: The absolute number of seconds in which the time elapsed since the last scheduled transmission of the target QR code image is obtained. If the QR code image is being scheduled for the first time, then the absolute number of seconds of the empty window is assigned to the preset maximum time value, according to the formula. The time compensation factor is calculated. Represents a positive real constant with dimensions that are inversely proportional to time; Multiply the dynamic transmission value of the frame by the time compensation factor to obtain the transmission demand baseline value; calculate the absolute value of the difference between the transmission demand baseline value and the transmission gain parameter corresponding to the matching light intensity mode; subtract the absolute value from the transmission demand baseline value, and use the calculated value as the instantaneous transmission priority of this combination.

7. The method according to claim 1, characterized in that, The preset includes a set of infrared light intensity modes with multiple discrete intensity levels, and each mode is associated with a corresponding transmission gain parameter, including: The duty cycle of the infrared emission control square wave is set to at least four different constant levels to form the plurality of discrete intensity levels; A unique identifier sequence is assigned to each discrete intensity level to form the infrared light intensity pattern set; Extract the percentile integer of the duty cycle value corresponding to each light intensity mode, and use it as the transmission gain parameter associated with the light intensity mode.

8. A one-way QR code transmission system based on infrared light intensity modulation, characterized in that, Includes the following modules: The generation module is used to preset an infrared light intensity mode set containing multiple discrete intensity levels, with each mode associated with a corresponding transmission gain parameter; and to scan the binary data stream to be transmitted and divide it into multiple logical data segments. Forward error correction code, absolute position offset, and logical meaning level are added to each logical data segment, and the data is encapsulated to generate a data packet to be encoded. The calculation module is used to independently generate a corresponding QR code image for each data packet, thereby forming a basic frame set. Based on the logical meaning level of the QR code image, the data segment length, and the expected transmission success rate updated during the transmission process, the module calculates the dynamically changing transmission value. The expected transmission success rate is iteratively updated based on the optical intensity mode and channel attenuation model selected from historical transmissions. The transmission module is used to combine each QR code image in the basic frame set with each light intensity mode in the light intensity mode set before each system transmission task is executed. It calculates the instantaneous transmission priority using dynamic transmission value, time compensation factor, and transmission gain parameters matching the light intensity mode. The combination with the highest priority is selected as the target frame and transmission mode. The target frame is then subjected to infrared light modulation processing. Specifically, the dark modules in the target frame image are mapped to zero infrared light intensity, and the bright modules are modulated to the intensity level corresponding to the selected specific transmission mode for infrared light emission.

9. The system according to claim 8, characterized in that, The process of scanning the binary data stream to be transmitted and dividing it into multiple logical data segments includes: A specific synchronization word sequence without zero-bit padding is set as a data structure feature. One of the data structure features is inserted before the start bit at the very beginning of the binary data stream to be transmitted, after the end bit at the very end, and at intervals of a preset segment length within the data stream. Perform bit-by-bit sliding window matching from the start bit of the binary data stream; When the data structure feature is matched, the current matching termination position is marked as a split point; Extract the bitstream data between two adjacent split points as the logical data segment.

10. The system according to claim 8, characterized in that, The process of adding forward error correction codes, absolute position offsets, and logical meaning levels to each logical data segment and encapsulating it to generate a data packet to be encoded includes: The Reed-Solomon coding algorithm is used to calculate and generate a forward error correction sequence based on the content of the logical data segment, which is then appended to the end of the logical data segment as the forward error correction code. Calculate the absolute sequence index number of the first bit of the logical data segment in the original binary data stream, and convert it into a binary sequence as the absolute position offset to be inserted into the beginning of the logical data segment; According to the preset attribute dictionary, the corresponding position importance value is matched according to the absolute position offset of the logical data segment, and the value is inserted as the logical meaning level before the absolute position offset to form the data packet.