A method for dynamic image transmission of wifi visual products
By dynamically adjusting the image frame transmission in wifi visual products, the data loss and frame loss caused by fixed transmission frames is solved, and more stable image transmission is achieved and image lag is reduced.
Patent Information
- Application Number
- CN202210030531.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-01-12
AI Technical Summary
The image transmission method with fixed transmission frames in existing wifi visual products can easily lead to data loss and frame drop, affecting the use effect.
The mobile client counts the received complete and missing image frame data every 1 second, calculates the expected transmission frame number, and sends it to the device end. The device end adjusts the image frame number transmission according to the expected transmission frame number, and dynamically adjusts the The number of frames sent per second to reduce data loss and frame drops.
By dynamically adjusting the image frame transmission, data loss and frame loss are reduced, image lags visible to the naked eye, and the stability and use effect of image transmission are improved.
Smart Images

Figure CN114363576B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image transmission, and in particular to a method for dynamic image transmission of a wifi visual product. Background Art
[0002] In wifi visual products, the mobile client and the device are directly connected via wifi. The device acts as an AP (access point) and the mobile client acts as a STA (station). There is a camera on the device, and the images captured by the camera can be transmitted to the mobile client's APP for display to the user.
[0003] Currently, devices generally use a fixed number of frames to transmit images, for example, 20 frames per second, and the camera collects and transmits images with a fixed resolution of 640*480. However, due to differences in color, details, etc., the size of compressed images may vary, ranging from 10kB to 30kB, which results in different amounts of data transmitted per second.
[0004] Due to the influence of transmission distance, antenna performance, etc., when transmitting images using a fixed number of transmission frames, if the data volume is large, serious problems such as data loss and frame drops will occur, resulting in visible lag.
[0005] Therefore, there is an urgent need for a dynamic image transmission method for wifi visual products, which can solve the problem that the existing method of transmitting images using a fixed number of transmission frames is prone to data loss and frame drops, which affects the use effect. Summary of the invention
[0006] The purpose of the present invention is to provide a method for dynamic image transmission of wifi visual products to solve the problem that the existing method of transmitting images using a fixed number of transmission frames is prone to data loss and frame drop, which affects the use effect.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] The present invention provides a method for dynamic image transmission of a wifi visual product, comprising the following steps:
[0009] S1. The mobile client starts a timer to count the number of complete image frames and missing image frames received from the device every 1 second;
[0010] S2. The mobile client calculates the expected number of frames to be transmitted in the next second based on the image frame data counted in step S1;
[0011] S3. The mobile client sends the expected number of transmission frames calculated in step S2 to the device end;
[0012] S4. After receiving the expected number of transmission frames sent by the mobile client, the device adjusts and transmits the image frame number according to the expected number of transmission frames.
[0013] Preferably, in step S1, the device splits a complete frame of image into multiple packets of data and sends them to the mobile client, each packet of data carries the current frame sequence number, the total number of packets and the current packet sequence number.
[0014] Preferably, step S1 specifically includes:
[0015] S11. After receiving a packet of data, the mobile client determines whether it is the first packet of data of a frame of image. If the current packet sequence number of the packet of data is 1, the frame sequence number FrameNumber, the total number of packets, the current packet sequence number and the current packet data of the packet of data are recorded; if the current packet sequence number of the packet of data is not 1, it is determined whether the frame sequence number of the packet of data is consistent with FrameNumber. If the frame sequence number of the packet of data is consistent with FrameNumber, the current packet sequence number and the current packet data of the packet of data are recorded. If the frame sequence number of the packet of data is inconsistent with FrameNumber, it is recorded as receiving a frame of missing image data;
[0016] S12. Determine whether the current packet sequence number is equal to the total number of packets. If the current packet sequence number is equal to the total number of packets, calculate whether the packet sequence number increases from 1 to the total number of packets. If the packet sequence number increases from 1 to the total number of packets, record it as receiving a complete frame of image data. If the packet sequence number does not increase from 1 to the total number of packets, record it as receiving a frame of missing image data.
[0017] Preferably, in step S2, the method for calculating the expected number of transmission frames is: limit the upper limit of the number of frames transmitted within 1 second to 25, and the lower limit to 8. Assume that the number of complete image frames received within 1 second in step S1 is wholeFrameNum, and the number of missing image frames is lossFrameNum. Then the expected number of transmission frames in the next second is expectFrameNum=wholeFrameNum+lossFrameNum / 2.
[0018] Preferably, if the calculated expectFrameNum is less than 8, the expected number of transmission frames in the next second is 8; if the calculated expectFrameNum is greater than 25, the expected number of transmission frames in the next second is 25; if the calculated expectFrameNum is less than 25 and lossFrameNum is less than 2, the expected number of transmission frames in the next second is expectFrameNum+1.
[0019] Preferably, the device end includes a frame number adjustment module and an image transmission module.
[0020] Compared with the prior art, the present invention has achieved the following beneficial technical effects:
[0021] The present invention provides a method for dynamic image transmission of a wifi visual product, comprising the following steps: S1. a mobile client starts a timer to count complete image frame data and missing image frame data received from a device end every 1 second; S2. the mobile client calculates the expected transmission frame number for the next 1 second according to the image frame data counted in step S1; S3. the mobile client sends the expected transmission frame number calculated in step S2 to the device end; S4. after receiving the expected transmission frame number sent by the mobile client, the device end adjusts and transmits the image frame number according to the expected transmission frame number; the mobile client is used to analyze the current data loss and frame drop situation, dynamically sends instructions to the device end, adjusts the frame number sent per second, adjusts the image data volume sent per second, reduces data loss, reduces frame drop situation, and prevents the occurrence of image freeze situation visible to the naked eye. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0023] Figure 1 A block diagram of a method for dynamic image transmission of a wifi visual product provided by the present invention; DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] The purpose of the present invention is to provide a method for dynamic image transmission of wifi visual products, so as to solve the problem that the existing method of transmitting images by using a fixed number of transmission frames is prone to data loss and frame drop, which affects the use effect.
[0026] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] Embodiment 1:
[0028] This embodiment provides a method for dynamic image transmission of a wifi visual product, such as Figure 1 As shown, the following steps are included:
[0029] 1. The mobile client starts a timer to count the number of complete image frames and missing image frames received from the device every 1 second.
[0030] Since the amount of data of a complete image frame collected by the device is large, it will be split into several packets for transmission. Each packet of data will carry the current frame number, the total number of packets, and the current packet number.
[0031] Specifically: a. The mobile client receives a packet of data and determines whether it is the first packet of a frame of image, that is, the current packet sequence number is 1, representing the beginning of a new frame of image.
[0032] b. If the current packet number is 1, record the current frame number FrameNumber, the total number of packets, the current packet number, and the current packet data. If the last packet of data of the previous frame image is not received and step f cannot be entered, it means that the data of the previous frame image is missing.
[0033] c. If the current packet sequence number is not 1, determine whether the current frame sequence number is consistent with FrameNumber.
[0034] d. If the current frame number is consistent with FrameNumber, it means that this is the data of the same frame image, and the current packet number and current packet data are recorded.
[0035] e. Determine whether the current packet number is equal to the total number of packets.
[0036] f. If the current packet number is equal to the total number of packets, it means that one frame of image has been transmitted. Calculate whether the data of the same frame of image recorded in step b and step d is complete, that is, whether the packet number is incremented from 1 to the total number of packets. If the packet number is incremented from 1 to the total number of packets, it means that a complete frame of image data has been received. If the packet number is not incremented from 1 to the total number of packets, it means that a frame of missing image data has been received.
[0037] g. If the current frame number is inconsistent with FrameNumber, it means that this is the data of the next frame of image, and the first packet of data of this frame is lost, which means that a frame of missing image data is received.
[0038] 2. Based on the image frame data counted in step 1, calculate the number of transmission frames expected by the device in the next second.
[0039] The upper limit of the number of frames transmitted within 1 second is limited to 25, and the lower limit is 8. Assume that the number of complete image frames received within 1 second calculated in step 1 is wholeFrameNum, and the number of missing image frames is lossFrameNum.
[0040] The expected number of transmission frames of the device in the next second is expectFrameNum=wholeFrameNum+lossFrameNum / 2.
[0041] If the calculated expectFrameNum is less than 8, expectFrameNum = 8;
[0042] If the calculated expectFrameNum is greater than 25, expectFrameNum = 25;
[0043] If the calculated expectFrameNum is less than 25 and lossFrameNum is less than 2, then expectFrameNum = expectFrameNum + 1;
[0044] 3. Send the expected number of transmission frames calculated in step 2 to the device.
[0045] The expectFrameNum calculated in step 2 is assembled into a command according to the protocol and sent to the client.
[0046] 4. After receiving the number of transmission frames expected by the mobile client, the device adjusts the number of transmission frames.
[0047] After the device parses the expected number of transmission frames according to the protocol, it adjusts the number of frames transmitted per second.
[0048] The present invention uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for dynamic image transmission of a wifi visual product, characterized in that: The following steps are involved: S1. The mobile client starts a timer to count the number of complete image frames and missing image frames received from the device every 1 second; S2. The mobile client calculates the expected number of frames to be transmitted in the next second based on the image frame data counted in step S1; S3. The mobile client sends the expected number of transmission frames calculated in step S2 to the device end; S4. After receiving the expected number of transmission frames sent by the mobile client, the device adjusts and transmits the image frames according to the expected number of transmission frames; In step S1, the device splits a complete frame of image into multiple packets and sends them to the mobile client. Each packet carries the current frame number, the total number of packets and the current packet number. Step S1 specifically includes: S11. After receiving a packet of data, the mobile client determines whether it is the first packet of data of a frame of image. If the current packet sequence number of the packet of data is 1, the frame sequence number FrameNumber, the total number of packets, the current packet sequence number and the current packet data of the packet of data are recorded; if the current packet sequence number of the packet of data is not 1, it is determined whether the frame sequence number of the packet of data is consistent with FrameNumber. If the frame sequence number of the packet of data is consistent with FrameNumber, the current packet sequence number and the current packet data of the packet of data are recorded. If the frame sequence number of the packet of data is inconsistent with FrameNumber, it is recorded as receiving a frame of missing image data; S12. Determine whether the current packet sequence number is equal to the total number of packets. If the current packet sequence number is equal to the total number of packets, calculate whether the packet sequence number increases from 1 to the total number of packets. If the packet sequence number increases from 1 to the total number of packets, record it as receiving a complete frame of image data. If the packet sequence number does not increase from 1 to the total number of packets, record it as receiving a frame of missing image data.
2. The method for dynamic image transmission of wifi visual products according to claim 1, characterized in that: In step S2, the method for calculating the expected number of transmission frames is: limit the upper limit of the number of frames transmitted within 1 second to 25, and the lower limit to 8. Assume that the number of complete image frames received within 1 second in step S1 is wholeFrameNum, and the number of missing image frames is lossFrameNum. Then the expected number of transmission frames in the next second is expectFrameNum = wholeFrameNum + lossFrameNum / 2.
3. The method for dynamic image transmission of wifi visual products according to claim 2, characterized in that: If the calculated expectFrameNum is less than 8, the expected number of frames to be transmitted in the next second is 8; if the calculated expectFrameNum is greater than 25, the expected number of frames to be transmitted in the next second is 25; if the calculated expectFrameNum is less than 25 and lossFrameNum is less than 2, the expected number of frames to be transmitted in the next second is expectFrameNum+1.
4. The method for dynamic image transmission of a wifi visual product according to any one of claims 1 to 3, characterized in that: The device side includes a frame number adjustment module and an image transmission module.
Citation Information
Patent Citations
Method and device of adjusting image quality of video based on network environment
CN104202614A
Anti-error code method and system of multi-channel video conference system based on H264
CN105681342A
Video adjusting method and device
CN107743275A
Video packet loss resistance method and system irrelevant to coding and decoding
CN113630597A
Transmission system for facsimile equipment
JP1990140056A
