Local area network image transmission method based on two-dimensional code session guidance
By using QR code session guidance and RTCP feedback mechanism, the cumbersome connection and latency issues of traditional image transmission solutions are solved, achieving fast, secure and stable local area network image transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-21
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional image transmission solutions are cumbersome in the initial connection phase, have high system coupling, and accumulate latency when the network fluctuates, affecting the real-time preview experience.
A local area network image transmission method based on QR code session guidance is adopted. The QR code carries session guidance information to achieve fast connection and secure authentication. Combined with RTCP feedback, adaptive transmission control is performed to reduce the impact of latency and packet loss.
It achieves fast and secure image transmission connection, reduces manual configuration steps, improves system scalability and stability in weak network environments, and reduces latency and lag.
Smart Images

Figure CN121864767A_ABST
Abstract
Description
[Technical Field] This invention relates to the field of bonding equipment roller technology, and in particular to a local area network image transmission method based on QR code session guidance. [Background Technology] Traditional image transmission solutions typically require users to manually search for and connect to the device's hotspot during the initial connection phase. This process is cumbersome, and some mobile phones will have their internet connection cut off after connecting to the hotspot, affecting the user experience.
[0001] At the protocol design level, some early solutions mixed video data streams and control signals on the same channel, lacking clear standard interfaces, resulting in high system coupling, poor scalability, and difficulty for third-party secondary development.
[0002] At the transmission level, some solutions rely too heavily on TCP transmission. When the network fluctuates, packet loss and retransmission can cause head-of-line congestion, resulting in video stuttering and accumulated latency, which impairs the real-time preview experience.
[0003] Therefore, a video transmission solution is needed that can achieve fast connection in local area network scenarios, facilitate secondary development, and maintain low latency and stability in weak network conditions. [Summary of the Invention] To overcome the above problems, this invention proposes a local area network image transmission method based on QR code session guidance, which can effectively solve the above problems.
[0004] The present invention provides a technical solution to solve the above-mentioned technical problems: a local area network image transmission method based on QR code session guidance, comprising: step S1, the image transmission device connects to a network, wherein the network is a router WiFi or a hotspot provided by a user terminal device; after the image transmission device successfully connects to the network, it starts an HTTP control service and an audio / video streaming service, wherein the audio / video streaming service includes a streaming service based on RTP or UDP and / or an RTSP session service; wherein the image transmission device encapsulates H.264 or H.265 NAL units or AAC or G.711 audio frames into RTP packets and transmits them via UDP. The socket is sent to the client to negotiate the port; Step S2: The image transmission device obtains its own IP address in the local area network and constructs a control URI and a media URI by combining the preset or dynamically allocated port number, and encapsulates the access information, which includes at least the IP address, HTTP control port, media port, control URI, and media URI, into a JSON string; Step S3: A session guidance field is further added to the JSON string, which includes at least: a one-time session token, token validity period, device public key commitment value, and transmission policy parameter set policy; wherein, the policy includes at least congestion control configuration and packet loss recovery configuration; Step S4: A QR code is generated and output using the JSON string as input; the QR code generation includes bitstream encoding of the JSON string and generating an error correction code based on a set error correction level to improve the recognition rate when the QR code is damaged; Step S5: The user application scans the QR code and parses it to obtain the session guidance field; the user application verifies the... After verifying the validity of the token and authenticating and binding the identity information of the image transmission device based on the commitment, a secure session is established with the image transmission device; Step S6: After the secure session is established, the user application establishes a control channel with the image transmission device based on the control URI. The control channel is upgraded to a WebSocket bidirectional persistent channel after the HTTP handshake, used to transmit control commands and media negotiation parameters; Step S7: The user application establishes a media channel with the image transmission device based on the media URI to receive RTP or UDP media streams and sends RTCP feedback to the image transmission device; The RTCP feedback includes at least statistics on packet loss rate and one-way latency change; Step S8: The image transmission device performs adaptive low-latency transmission control based on the RTCP feedback: Congestion control: Filter and estimate the one-way latency change and compare it with an adaptive threshold, output the target transmission rate and link the encoding parameters; Packet loss recovery: Adaptively select a combination strategy of NACK and / or FEC according to the round-trip latency and packet loss rate, and adjust the jitter buffer target delay to suppress latency accumulation and stuttering under weak network conditions.
[0005] Preferably, the HTTP control service is a lightweight server implemented based on the CivetWeb framework, which allows the registration of specific URIs and processing functions, and routes the request to the corresponding processing function when an HTTP request is received.
[0006] Preferably, the RTSP session service is a lightweight server that listens for and processes standard RTSP commands sent by clients on port 554.
[0007] Preferably, the RTP package meets the H.264 or H.265 RTP payload packaging specification, and the RTP header includes at least a serial number and a timestamp.
[0008] Preferably, the commitment is a digest value obtained by hashing the public key or certificate fingerprint of the image transmission device; the user application obtains the public key or certificate from the image transmission device and verifies that its hash digest is consistent with the commitment before establishing a secure session, thereby resisting impersonation and man-in-the-middle attacks.
[0009] Preferably, the token in the JSON string is a one-time token, and it is bound to the IP address, port, timestamp or random number nonce and signed by the image transmission device or a message authentication code is generated to prevent replay.
[0010] Preferably, the secure session establishes a shared key through elliptic curve Diffie-Hellman key negotiation, and uses the shared key to encrypt and protect the integrity of WebSocket control messages and media negotiation parameters.
[0011] Preferably, the policy includes a congestion control configuration, which includes at least: a delay-varying filter type, a threshold adaptive parameter, and an update step size for the target transmission rate; wherein the delay-varying filter is a Kalman filter.
[0012] Preferably, the RTCP feedback further includes receiver jitter, arrival interval variation, and packet loss sequence distribution; the sender adaptively adjusts the encoder's bitrate, frame rate, resolution, or GOP length based on the feedback.
[0013] Preferably, the packet loss recovery adopts an adaptive hybrid NACK or FEC strategy: when the round-trip time is lower than the first threshold, NACK is preferred; when the round-trip time is higher than the second threshold or the packet loss rate is higher than the packet loss threshold, the FEC redundancy ratio is increased and the redundancy overhead is deducted in the bandwidth estimation.
[0014] Preferably, the span of the FEC protection group is adaptively adjusted according to the frame rate and round-trip delay to improve the recovery capability under sudden packet loss.
[0015] Preferably, the target delay of the receiver jitter buffer is adaptively calculated based on the proportion of unrecoverable packet loss, jitter estimation, and round-trip delay, and fed back to the transmitter through the control channel to coordinately adjust the transmission rate and coding parameters.
[0016] Preferably, the QR code generation includes using Reed-Solomon error correction codes and layout to generate a QR code matrix containing a positioning pattern, a timing pattern, an alignment pattern, and a data area.
[0017] Preferably, in scenarios where the device has no screen or scanning is inconvenient, the image transmission device broadcasts basic connection information via Bluetooth. The user application obtains the basic connection information by listening to the broadcast or receiving signals through the microphone and then completes the subsequent connection.
[0018] This invention also provides a local area network image transmission system based on QR code session guidance, comprising: a network connection module, a control service module, a push streaming service module, an address acquisition and URI construction module, a session guidance encapsulation module, a QR code generation and output module, a QR code parsing and authentication module, a WebSocket control module, an RTCP feedback module, a congestion control module, and a packet loss recovery module; wherein, each module collaboratively executes the steps described herein.
[0019] The present invention also provides an image transmission device, including a processor, a memory, and a program stored in the memory and executable by the processor, wherein the program implements the method described thereon when executed.
[0020] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described thereon.
[0021] Compared with existing technologies, the local area network image transmission method based on QR code session guidance of the present invention has the following advantages: 1. High connection efficiency: Scan the code to obtain complete session guidance information, reducing manual input and configuration steps.
[0022] 2. User-friendly for secondary development: HTTP or WebSocket control and RTSP or RTP or UDP media transmission are all standardized interfaces, reducing integration costs.
[0023] 3. Low latency and robust to weak networks: Through RTCP closed-loop congestion control and hybrid packet loss recovery, queue expansion, freezing and congestion are suppressed, reducing the accumulation of end-to-end latency.
[0024] 4. Enhanced connection security: The QR code carries a device identity commitment value and a one-time token. Users can authenticate and bind the token before the blockchain is established, reducing the risk of impersonation and man-in-the-middle attacks. [Attached Image Description] Figure 1This is a schematic diagram of the implementation framework of the local area network image transmission method based on QR code session guidance of the present invention. Figure 2 This is a flowchart of the local area network image transmission method based on QR code session guidance according to the present invention.
Detailed Implementation Methods
[0025] It should be noted that in the embodiments of the present invention, all directional indications (such as up, down, left, right, front, back, etc.) are limited to relative positions on the specified view, rather than absolute positions.
[0026] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0027] Please see Figure 1 and Figure 2 The local area network image transmission method based on QR code session guidance of the present invention is applicable to scenarios such as drone image transmission, security cameras, VR or AR head-mounted displays, and thermal imaging inspection. After the method starts, the image transmission device and the user terminal connect to the same network. The image transmission device opens HTTP and streaming services, generates a link QR code, and the user terminal scans the QR code to connect to the image transmission device. The image transmission device then begins streaming and receiving control.
[0028] Specifically, the local area network image transmission method based on QR code session guidance of the present invention includes: Step S1: The image transmission device connects to the network, which is either a router's WiFi or a hotspot provided by the user terminal device. After successfully connecting to the network, the image transmission device starts the HTTP control service and the audio / video streaming service. The audio / video streaming service includes streaming services based on RTP or UDP and / or RTSP session services. The image transmission device encapsulates H.264 or H.265 NAL units or AAC or G.711 audio frames into RTP packets and sends them to the client's negotiation port via UDP Socket. Step S2: The image transmission device obtains its own IP address in the local area network and constructs a control URI and a media URI by combining the preset or dynamically allocated port number. The access information, which includes at least the IP address, HTTP control port, media port, control URI, and media URI, is encapsulated into a JSON string. Step S3: Further add a session guidance field to the JSON string. The session guidance field includes at least: a one-time session token, a token validity period, a device public key commitment value, and a transmission policy parameter set (policy). The policy includes at least congestion control configuration and packet loss recovery configuration. Step S4: Generate a QR code using the JSON string as input and output it; the QR code generation includes bitstream encoding of the JSON string and generating an error correction code based on a set error correction level to improve the recognition rate when the QR code is damaged. Step S5: The user application scans the QR code and parses it to obtain the session guidance field; the user application verifies whether the token is valid, and after authenticating and binding the identity information of the image transmission device based on the commitment, establishes a secure session with the image transmission device. Step S6: After the secure session is established, the user application establishes a control channel with the image transmission device based on the control URI. The control channel is upgraded to a WebSocket bidirectional persistent channel after the HTTP handshake, which is used to transmit control commands and media negotiation parameters. Step S7: The user terminal application establishes a media channel with the image transmission device based on the media URI to receive RTP or UDP media streams, and sends RTCP feedback to the image transmission device; the RTCP feedback includes at least statistics on packet loss rate and one-way latency changes; Step S8: The image transmission device performs adaptive low-latency transmission control based on the RTCP feedback: Congestion control: The one-way delay change is filtered and estimated and compared with the adaptive threshold, the target transmission rate is output and the encoding parameters are linked; Packet loss recovery: The combination strategy of NACK and or FEC is adaptively selected according to the round-trip delay and packet loss rate, and the jitter buffer target delay is adjusted to suppress delay accumulation and stuttering under weak network conditions.
[0029] The HTTP control service is a lightweight server implemented based on the CivetWeb framework, which allows the registration of specific URIs and processing functions, and routes requests to the corresponding processing functions when an HTTP request is received.
[0030] The RTSP session service is a lightweight server that listens on port 554 and processes standard RTSP commands sent by clients.
[0031] The RTP encapsulation conforms to the H.264 or H.265 RTP payload encapsulation specification, and the RTP header includes at least a serial number and a timestamp.
[0032] The commitment is a digest value obtained by hashing the public key or certificate fingerprint of the image transmission device. Before establishing a secure session, the user application obtains the public key or certificate from the image transmission device and verifies that its hash digest is consistent with the commitment, thereby resisting impersonation and man-in-the-middle attacks.
[0033] The token in the JSON string is a one-time token, which is bound to the IP address, port, timestamp or random number nonce and signed by the image transmission device or generated as a message authentication code to prevent replay.
[0034] The secure session establishes a shared key through elliptic curve Diffie-Hellman key negotiation, and uses the shared key to encrypt and protect the integrity of WebSocket control messages and media negotiation parameters.
[0035] The policy includes a congestion control configuration, which includes at least: a delay-varying filter type, a threshold adaptive parameter, and an update step size for the target transmission rate; wherein the delay-varying filter is a Kalman filter.
[0036] The RTCP feedback further includes receiver jitter, arrival interval changes, and packet loss sequence distribution; the sender adaptively adjusts the encoder's bit rate, frame rate, resolution, or GOP length based on the feedback.
[0037] The packet loss recovery adopts an adaptive hybrid NACK or FEC strategy: when the round-trip time is lower than the first threshold, NACK is preferred; when the round-trip time is higher than the second threshold or the packet loss rate is higher than the packet loss threshold, the FEC redundancy ratio is increased and the redundancy overhead is deducted in the bandwidth estimation.
[0038] The span of the FEC protection group is adaptively adjusted according to the frame rate and round-trip latency to improve the recovery capability under sudden packet loss.
[0039] The target delay of the receiver's jitter buffer is adaptively calculated based on the proportion of unrecoverable packet loss, jitter estimation, and round-trip delay, and fed back to the transmitter through the control channel to coordinate the adjustment of the transmission rate and coding parameters.
[0040] The QR code generation includes using Reed-Solomon error correction codes and layout to generate a QR code matrix containing positioning patterns, timing patterns, alignment patterns, and data areas.
[0041] In scenarios where the device has no screen or scanning is inconvenient, the image transmission device broadcasts basic connection information via Bluetooth. The user application obtains the basic connection information by listening to the broadcast or receiving the signal through the microphone and then completes the subsequent connection.
[0042] This invention also provides a local area network image transmission system based on QR code session guidance, comprising: a network connection module, a control service module, a push streaming service module, an address acquisition and URI construction module, a session guidance encapsulation module, a QR code generation and output module, a QR code parsing and authentication module, a WebSocket control module, an RTCP feedback module, a congestion control module, and a packet loss recovery module; wherein, each module collaboratively executes the steps described herein.
[0043] The present invention also provides an image transmission device, including a processor, a memory, and a program stored in the memory and executable by the processor, wherein the program implements the method described thereon when executed.
[0044] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described thereon.
[0045] The present invention will be further described below with reference to specific embodiments. Example 1: QR code session guidance and dual-channel connection establishment After the image transmission device connects to the router's WiFi or the user's hotspot, it starts the following services: HTTP control service and audio / video streaming service. The streaming service includes RTP or UDP streaming and optional RTSP session service. The RTSP server can listen on port 554 and process standard RTSP commands.
[0046] The image transmission device obtains the local area network IP through system calls, constructs a control URI and a media URI by combining a preset or dynamic port, and encapsulates them in a JSON structure.
[0047] To improve connection security and scalability, JSON further includes: token, expire_ts, nonce, commitment, and policy. The commitment can be a hash (PK_device); the policy includes congestion control mode, filter parameters, packet loss recovery mode, and redundancy limits.
[0048] The image transmission device generates a QR code from a JSON string; the QR code generation library converts the string into a bitstream and generates Reed-Solomon error correction codes according to the error correction level, and then generates positioning patterns, timing patterns, alignment patterns and data area matrices, which are then displayed on the device screen.
[0049] After the user scans the QR code, the JSON is parsed. First, the token validity period and signature or MAC are verified. Then, the public key is obtained from the device and Hash(PK_device) = commitment is verified. If the verification is successful, a shared key based on ECDH is established and a session key is derived.
[0050] The control channel uses HTTP to establish a connection and upgrades to a WebSocket bidirectional persistent channel after the handshake, avoiding the overhead and latency of HTTP polling. Control messages can be further encrypted and protected for integrity.
[0051] Example 2: RTP or UDP streaming with RTCP closed-loop low-latency congestion control The image transmission device encapsulates H.264 or H.265 NAL units or AAC or G.711 audio frames in RTP format, adds header information such as serial number and timestamp, and then sends them to the client's negotiation port via UDP Socket.
[0052] The receiving end periodically sends RTCP feedback, which includes at least statistics on packet loss rate, arrival interval change, and one-way delay change.
[0053] The sending end performs filtering estimation (e.g., Kalman filtering) on the one-way delay change based on RTCP feedback, and compares it with the adaptive threshold to obtain congestion judgment and output the target transmission rate; at the same time, it adjusts the coding bit rate, frame rate, resolution or GOP in a coordinated manner to suppress the end-to-end delay increase caused by queue expansion.
[0054] Example 3: Adaptive Hybrid NACK or FEC Packet Loss Recovery and Jitter Buffering Collaboration When the receiver detects a missing sequence number, it sends a retransmission request if the NACK condition is met; the sender performs selective retransmission within the allowed range.
[0055] When the RTT is large or the packet loss rate is high, the sender increases the FEC redundancy ratio and deducts the redundancy overhead in the bandwidth estimation; the protection group span is adaptively set according to the frame rate and RTT to improve the ability to recover from sudden packet loss.
[0056] The receiver's jitter buffer target delay is adaptively calculated based on jitter estimation, the proportion of unrecoverable packet loss, and RTT, and can be transmitted back to the transmitter through the control channel to collaboratively optimize the "stuttering-delay" trade-off.
[0057] Example 4: Alternatives for screenless or difficult-to-scan QR codes In scenarios where the device has no screen or is fixedly installed, or where scanning QR codes is inconvenient, the image transmission device broadcasts basic connection information (such as device name and initial IP) via Bluetooth; the user end automatically completes the subsequent connection after listening to the broadcast or receiving the signal through the microphone.
[0058] Compared with existing technologies, the local area network image transmission method based on QR code session guidance of the present invention has the following advantages: 1. High connection efficiency: Scan the code to obtain complete session guidance information, reducing manual input and configuration steps.
[0059] 2. User-friendly for secondary development: HTTP or WebSocket control and RTSP or RTP or UDP media transmission are all standardized interfaces, reducing integration costs.
[0060] 3. Low latency and robust to weak networks: Through RTCP closed-loop congestion control and hybrid packet loss recovery, queue expansion, freezing and congestion are suppressed, reducing the accumulation of end-to-end latency.
[0061] 4. Enhanced connection security: The QR code carries a device identity commitment value and a one-time token. Users can authenticate and bind the token before the blockchain is established, reducing the risk of impersonation and man-in-the-middle attacks.
[0062] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any modifications, equivalent substitutions and improvements made within the concept of the present invention should be included within the patent protection scope of the present invention.
Claims
1. A local area network image transmission method based on QR code session guidance, characterized in that, include: Step S1: The image transmission device connects to the network, which is either router WiFi or a hotspot provided by the user terminal device; After the image transmission device successfully connects to the network, it starts the HTTP control service and the audio and video streaming service. The audio and video streaming service includes streaming services based on RTP or UDP and / or RTSP session services. The image transmission device encapsulates H.264 or H.265 NAL units or AAC or G.711 audio frames into RTP packets and sends them to the client negotiation port via UDP Socket. Step S2: The image transmission device obtains its own IP address in the local area network and constructs a control URI and a media URI by combining the preset or dynamically allocated port number. The access information, which includes at least the IP address, HTTP control port, media port, control URI, and media URI, is encapsulated into a JSON string. Step S3: Further add a session guidance field to the JSON string. The session guidance field includes at least: a one-time session token, a token validity period, a device public key commitment value, and a transmission policy parameter set (policy). The policy includes at least congestion control configuration and packet loss recovery configuration. Step S4: Generate a QR code using the JSON string as input and output it; the QR code generation includes bitstream encoding of the JSON string and generating an error correction code based on a set error correction level to improve the recognition rate when the QR code is damaged. Step S5: The user application scans the QR code and parses it to obtain the session guidance field; the user application verifies whether the token is valid, and after authenticating and binding the identity information of the image transmission device based on the commitment, establishes a secure session with the image transmission device. Step S6: After the secure session is established, the user application establishes a control channel with the image transmission device based on the control URI. The control channel is upgraded to a WebSocket bidirectional persistent channel after the HTTP handshake, which is used to transmit control commands and media negotiation parameters. Step S7: The user terminal application establishes a media channel with the image transmission device based on the media URI to receive RTP or UDP media streams, and sends RTCP feedback to the image transmission device; the RTCP feedback includes at least statistics on packet loss rate and one-way latency changes; Step S8: The image transmission device performs adaptive low-latency transmission control based on the RTCP feedback: Congestion control: The one-way delay change is filtered and estimated and compared with the adaptive threshold, the target transmission rate is output and the encoding parameters are linked; Packet loss recovery: The combination strategy of NACK and or FEC is adaptively selected according to the round-trip delay and packet loss rate, and the jitter buffer target delay is adjusted to suppress delay accumulation and stuttering under weak network conditions.
2. The local area network image transmission method based on QR code session guidance as described in claim 1, characterized in that, The HTTP control service is a lightweight server implemented based on the CivetWeb framework, which allows the registration of specific URIs and processing functions, and routes requests to the corresponding processing functions when an HTTP request is received.
3. The local area network image transmission method based on QR code session guidance according to claim 1, characterized in that, The RTSP session service is a lightweight server that listens on port 554 and processes standard RTSP commands sent by clients.
4. The local area network image transmission method based on QR code session guidance according to claim 1, characterized in that, The RTP encapsulation conforms to the H.264 or H.265 RTP payload encapsulation specification, and the RTP header includes at least a serial number and a timestamp.
5. The local area network image transmission method based on QR code session guidance according to claim 1, characterized in that, The commitment is a digest value obtained by hashing the public key or certificate fingerprint of the image transmission device. Before establishing a secure session, the user application obtains the public key or certificate from the image transmission device and verifies that its hash digest is consistent with the commitment, thereby resisting impersonation and man-in-the-middle attacks.
6. The local area network image transmission method based on QR code session guidance according to claim 1, characterized in that, The token in the JSON string is a one-time token, which is bound to the IP address, port, timestamp or random number nonce and signed by the image transmission device or generated as a message authentication code to prevent replay.
7. The local area network image transmission method based on QR code session guidance according to claim 1, characterized in that, The secure session establishes a shared key through elliptic curve Diffie-Hellman key negotiation, and uses the shared key to encrypt and protect the integrity of WebSocket control messages and media negotiation parameters.
8. The local area network image transmission method based on QR code session guidance according to claim 1, characterized in that, The policy includes a congestion control configuration, which includes at least: a delay-varying filter type, a threshold adaptive parameter, and an update step size for the target transmission rate; wherein the delay-varying filter is a Kalman filter.
9. The local area network image transmission method based on QR code session guidance according to claim 1, characterized in that, The RTCP feedback further includes receiver jitter, arrival interval changes, and packet loss sequence distribution; the sender adaptively adjusts the encoder's bitrate, frame rate, resolution, or GOP length based on the feedback.
10. The local area network image transmission method based on QR code session guidance according to claim 1, characterized in that, The packet loss recovery adopts an adaptive hybrid NACK or FEC strategy: when the round-trip time is lower than the first threshold, NACK is preferred; when the round-trip time is higher than the second threshold or the packet loss rate is higher than the packet loss threshold, the FEC redundancy ratio is increased and the redundancy overhead is deducted in the bandwidth estimation.