Image transmission method and device in WiFi communication system
By decapsulating data packets, performing image recovery and characteristic value judgment in WiFi image transmission, the problem of difficult to balance image quality and delay in WiFi image transmission is solved, and high-quality image transmission is achieved while reducing latency.
Patent Information
- Application Number
- CN202411525721.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-10-30
AI Technical Summary
While ensuring low latency, WiFi image transmission is difficult to improve the image quality received by the receiving device, especially when the network is unstable, packet loss problems are prone to occur, resulting in image distortion.
By receiving the transmitted data packets, decapsulate them into multiple TCP packets, and image recovery is performed when the packet loss rate is low. Determine whether it is necessary to request retransmission of the lost TCP packet based on the characteristic value of the image, or use the TCP packet at the nearest position of the lost TCP packet to perform image reconstruction, and perform anisotropic diffusion filtering on the image to improve quality.
While ensuring that the WiFi image transmission delay is low, the image quality received by the receiving device is improved, the amount of data retransmission is reduced, and the data transmission delay is reduced.
Smart Images

Figure CN119052384B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information transmission, and in particular to an image transmission method and device in a WiFi communication system. Background Art
[0002] In recent years, the Internet of Things technology has received more and more attention in the application field. Wireless Fidelity (WiFi) technology, as one of the basic technologies of the Internet of Things, has developed rapidly and is widely used in IoT application scenarios such as smart homes. With the popularization of WiFi devices and the ubiquity of WiFi networks, WiFi image transmission technology has also developed rapidly.
[0003] WiFi image transmission has certain requirements for the real-time, stability and anti-interference of image transmission. The biggest advantage of WiFi image transmission technology is its low cost and the ability to be redeveloped according to its own needs to achieve customized effects; but it also has obvious disadvantages: the network must remain very stable during data transmission, otherwise there will be serious packet loss problems, resulting in the loss of some pixel data of the image, and the image received by the receiving end is missing or distorted; although the WiFi protocol can retransmit data, it will also cause a certain communication delay.
[0004] Therefore, how to improve the image quality received by the receiving device while ensuring low latency in WiFi image transmission has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, it is necessary to provide an image transmission method and device in a WiFi communication system to solve the problem that it is difficult to balance the image transmission quality and the image transmission delay in the current WiFi image transmission.
[0006] In order to solve the above problems, the present invention provides an image transmission method in a WiFi communication system, which is applied to a first network unit and includes:
[0007] receiving a first data packet sent by the second network unit, wherein the first data packet includes a starting pixel position and a number of pixels of a target image;
[0008] Decapsulating the first data packet to obtain a plurality of TCP packets, and determining a first image based on the plurality of TCP packets when a packet loss rate of the plurality of TCP packets is less than or equal to a first threshold;
[0009] Extracting features of the first image and calculating feature values of the first image;
[0010] When the characteristic value of the first image is greater than or equal to the second threshold, a block confirmation message is sent to the second network unit, where the block confirmation message is used to request the TCP packet lost in the first data packet.
[0011] In a possible implementation, the method further includes:
[0012] When the characteristic value of the first image is less than the second threshold, the second image is determined based on the TCP packet whose pixel position index has the smallest Euclidean distance with the pixel position index of the lost TCP packet among the multiple TCP packets, and the multiple TCP packets, and the lost TCP packet is the TCP packet lost in the first data packet.
[0013] In a possible implementation, determining the second image based on the TCP packet having the smallest Euclidean distance between a pixel position index and a pixel position index of a lost TCP packet among the multiple TCP packets and the multiple TCP packets includes:
[0014] The pixel value in the lost TCP packet is replaced by the pixel value in the TCP packet whose pixel position index has the smallest Euclidean distance with the pixel position index of the lost TCP packet in the multiple TCP packets, and the second image is determined based on the pixel values in the multiple TCP packets.
[0015] In a possible implementation, the method further includes:
[0016] After determining the second image, anisotropic diffusion filtering is performed on the second image to obtain a third image.
[0017] In a possible implementation, the method further includes:
[0018] When the packet loss rate of the multiple TCP packets is greater than the first threshold, a retransmission request message is sent to the second network unit, where the retransmission request message is used to request the second network unit to resend the first data packet.
[0019] The present invention also provides an image transmission method in a WiFi communication system, which is applied to a second network unit and includes:
[0020] Determine the number of pixels in a single TCP packet based on the image type of the target image and the payload of the TCP packet;
[0021] Encapsulating the pixel values corresponding to the target image into a plurality of TCP packets, and generating a first data packet based on the plurality of TCP packets encapsulated with the pixel values corresponding to the target image, wherein the first data packet includes a starting pixel position and a number of pixels of the target image;
[0022] The first data packet is sent to the first network unit.
[0023] In a possible implementation, the method further includes:
[0024] receiving a block confirmation message sent by the first network unit;
[0025] Based on the block confirmation message, the TCP packets lost in the first data packet are sent to the first network element.
[0026] In a possible implementation, the method further includes:
[0027] receiving a retransmission request message sent by the first network unit;
[0028] Based on the retransmission request message, the first data packet is resent to the first network element.
[0029] The present invention also provides an image transmission device in a WiFi communication system, comprising:
[0030] A receiving module, configured to receive a first data packet sent by a second network unit, wherein the first data packet includes a starting pixel position and a number of pixels of a target image;
[0031] A first determining module, configured to decapsulate the first data packet to obtain a plurality of TCP packets, and determine a first image based on the plurality of TCP packets when a packet loss rate of the plurality of TCP packets is less than or equal to a first threshold;
[0032] An extraction module, used to extract features of the first image and calculate feature values of the first image;
[0033] The first sending module is used to send a block confirmation message to the second network unit when the characteristic value of the first image is greater than or equal to the second threshold, wherein the block confirmation message is used to request the TCP packet lost in the first data packet.
[0034] The present invention also provides an image transmission device in a WiFi communication system, comprising:
[0035] A second determination module is used to determine the number of pixels in a single TCP packet based on the image type of the target image and the payload of the TCP packet;
[0036] A generating module, configured to encapsulate the pixel values corresponding to the target image into a plurality of TCP packets, and generate a first data packet based on the plurality of TCP packets encapsulated with the pixel values corresponding to the target image, wherein the first data packet includes a starting pixel position and a number of pixels of the target image;
[0037] The second sending module is used to send the first data packet to the first network unit.
[0038] The beneficial effects of the present invention are as follows: the image transmission method and device in the WiFi communication system provided by the present invention, after receiving the image data sent by the sending device, the receiving device first decapsulates the image data into multiple TCP packets, and then performs preliminary image recovery when the multiple TCP packets are not seriously lost. When the characteristic values of the recovered image are large, the sending device is requested to retransmit the lost TCP packet, which ensures the quality of image transmission and reduces the amount of data retransmission, thereby reducing the delay of data transmission. The present invention improves the quality of the image received by the receiving device while ensuring a low delay in WiFi image transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a structure of a BSS mode of a WiFi network topology structure provided by the present invention;
[0040] Figure 2 A schematic flow chart of an embodiment of an image transmission method in a WiFi communication system provided by the present invention;
[0041] Figure 3 A schematic flow chart of another embodiment of the image transmission method in a WiFi communication system provided by the present invention;
[0042] Figure 4 A schematic diagram of a flow chart of an embodiment of a WiFi network image transmission process provided by the present invention;
[0043] Figure 5 A schematic diagram of a flow chart of an embodiment of a sending end image transmission process provided by the present invention;
[0044] Figure 6 A schematic diagram of a flow chart of an embodiment of a receiving end image transmission process provided by the present invention;
[0045] Figure 7 A structural schematic diagram of an embodiment of a pixel position when performing anisotropic diffusion filtering provided by the present invention;
[0046] Figure 8 A schematic diagram of the structure of an embodiment of an A-MSDU aggregation format provided by the present invention;
[0047] Fig. 9 A schematic diagram of the structure of an embodiment of an A-MPDU aggregation format provided by the present invention;
[0048] Fig.10 A schematic diagram of the structure of an embodiment of a digital image transmission format provided by the present invention;
[0049] Fig.11A schematic diagram of a flow chart of an embodiment of a block confirmation request message transmission process provided by the present invention;
[0050] Fig.12 A structural schematic diagram of an embodiment of an image transmission device in a WiFi communication system provided by the present invention;
[0051] Fig.13 This is a schematic structural diagram of another embodiment of the image transmission device in the WiFi communication system provided by the present invention. DETAILED DESCRIPTION
[0052] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0053] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0054] In the description of the present invention, reference to an "embodiment" means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the described embodiments may be combined with other embodiments.
[0055] WiFi image transmission has certain requirements for the real-time, stability and anti-interference of image transmission. WiFi image transmission technology has obvious disadvantages: the network must remain very stable during data transmission, otherwise there will be serious packet loss problems, resulting in the loss of some pixel data of the image, and the image received by the receiving end is missing or distorted; although the WiFi protocol can retransmit data, it will also cause a certain communication delay.
[0056] The IEEE802.11 wireless network is mainly composed of access points (AP), workstations (STA), wireless medium (Wireless medium) and distribution systems (DS). STA is a terminal electronic device that can access the wireless network, such as mobile phones, laptops, etc. AP is a device that can provide wireless network access function for STA, and also has wireless to wired bridging function. The data frames in the wireless network must be converted by AP before they can be forwarded to other different types of networks. The main topology of IEEE802.11 wireless network is the Basic Service Set (BSS) mode. Generally, an AP and several STAs form a BSS. The STA and AP in the BSS need to establish a connection before they can communicate with each other. Combined with Figure 1 Come and see, Figure 1 This is a structural diagram of an embodiment of a BSS mode of a WiFi network topology structure provided by the present invention.
[0057] The transport layer protocols used in the data image transmission process between AP and STA are mainly Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). However, the high frame error rate of WiFi wireless channels and the rapid attenuation of long-distance wireless signals, which lead to the degradation of transmission performance, are still problems that cannot be fundamentally solved. The congestion control mechanism of the TCP protocol cannot adapt to the unstable characteristics of the wireless link and has a large limitation on the transmission rate of TCP services. Although the UDP protocol has good real-time performance, it is a connectionless and unreliable protocol, which is prone to packet loss and disorder during long-distance data transmission. Although WiFi networks can achieve reliable transmission through the Media Access Control (MAC) layer confirmation and retransmission mechanism, frequent retransmission of data packets will lead to high communication delays in the case of high packet loss rate and throughput.
[0058] In order to solve the above problems, the present invention provides an image transmission method in a WiFi communication system.
[0059] The specific embodiments are described in detail below:
[0060] A specific embodiment of the present invention discloses an image transmission method in a WiFi communication system, which is applied to a first network unit, combined with Figure 2 Come and see, Figure 2The flowchart of an embodiment of the image transmission method in the WiFi communication system provided by the present invention includes steps S201 to S204, wherein:
[0061] In step S201, a first data packet sent by a second network unit is received, wherein the first data packet includes a starting pixel position and a number of pixels of a target image;
[0062] In step S202, the first data packet is decapsulated to obtain a plurality of TCP packets, and when a packet loss rate of the plurality of TCP packets is less than or equal to a first threshold, a first image is determined based on the plurality of TCP packets;
[0063] In step S203, the features of the first image are extracted, and the feature values of the first image are calculated;
[0064] In step S204, when the characteristic value of the first image is greater than or equal to the second threshold, a block confirmation message is sent to the second network unit, where the block confirmation message is used to request the TCP packet lost in the first data packet.
[0065] During implementation, the first network unit (the image transmission receiving device in the WiFi communication system, which may be the AP or STA in the BSS) may first receive the first data packet sent by the second network unit (the image transmission sending device in the WiFi communication system, which may be the AP or STA in the BSS), and the first data packet may be a MAC service data unit (MPDU) or an aggregation MAC service data unit (A-MPDU). When the image to be transmitted (i.e., the target image) is transmitted in the WiFi communication system, the pixel value of each pixel in the target image is transmitted, and the first data packet may carry the starting pixel position and the number of pixels of the target image, thereby facilitating image reconstruction of the first network unit.
[0066] After receiving the first data packet, the first network unit may first decapsulate the first data packet into MAC Service Data Unit (MSDU) data, and then decapsulate the MSDU data into TCP packets, thereby obtaining multiple TCP packets.
[0067] Then the first network unit can determine the packet loss rate of multiple TCP packets. When the packet loss rate of these multiple TCP packets is less than or equal to the first threshold, it indicates that the information of the target image is not lost too much. At this time, the image can be restored based on these multiple TCP packets to obtain the first image.
[0068] After obtaining the first image, feature extraction may be performed on the first image. For example, feature extraction may be performed through a conventional convolutional neural network. Of course, feature extraction may also be performed through other networks, and the present invention does not specifically limit this.
[0069] After extracting the features of the first image, a feature value of the first image can be calculated based on the features of the first image. When the feature value of the first image is greater than or equal to the second threshold, it means that the target image contains more details, and the TCP packets lost during the image transmission process will affect the quality of image recovery. At this time, the first network unit can send a block confirmation message to the second network unit, requesting the second network unit to retransmit the lost TCP packets in the first data packet, thereby ensuring the quality of image transmission.
[0070] At the same time, when the information of the target image is not lost too much, only requesting to retransmit the lost TCP packets in the first data packet can reduce the amount of retransmitted data, thereby reducing the transmission delay.
[0071] The image transmission method in the WiFi communication system provided by the present invention can be applied to the image transmission scenario within the same BSS, and can also be applied to the image transmission scenario between different BSSs, which is not specifically limited by the present invention.
[0072] Compared with the prior art, in the image transmission method in the WiFi communication system provided by the present embodiment, after receiving the image data sent by the sending device, the receiving device first decapsulates the image data into multiple TCP packets, and then performs preliminary image recovery when the multiple TCP packets are not seriously lost. When the characteristic value of the recovered image is large, the sending device is requested to retransmit the lost TCP packet, thereby ensuring the quality of image transmission and reducing the amount of data retransmission, thereby reducing the delay of data transmission. The present invention improves the quality of the image received by the receiving device while ensuring a low delay in WiFi image transmission.
[0073] Exemplarily, the method further includes:
[0074] When the characteristic value of the first image is less than the second threshold, the second image is determined based on the TCP packet whose pixel position index has the smallest Euclidean distance with the pixel position index of the lost TCP packet among the multiple TCP packets, and the multiple TCP packets, and the lost TCP packet is the TCP packet lost in the first data packet.
[0075] Specifically, when the characteristic value of the first image is less than the second threshold, it means that there are fewer details in the target image, and the lost TCP packet will not seriously affect the quality of image recovery. At this time, the TCP packet closest to the lost TCP packet, that is, the TCP packet with the smallest Euclidean distance between the pixel position index and the pixel position index of the lost TCP packet, can be used to replace the lost TCP packet, and the image is restored by combining the multiple TCP packets obtained by decapsulating the first data packet to obtain the second image. The pixel position index of the TCP packet can be determined based on the starting pixel position and the number of pixels in each TCP packet, and is used to indicate the pixel position corresponding to the pixel value in the TCP packet in the target image.
[0076] Exemplarily, determining the second image based on the TCP packet having the smallest Euclidean distance between the pixel position index and the pixel position index of the lost TCP packet among the multiple TCP packets and the multiple TCP packets includes:
[0077] The pixel value in the lost TCP packet is replaced by the pixel value in the TCP packet whose pixel position index has the smallest Euclidean distance with the pixel position index of the lost TCP packet in the multiple TCP packets, and the second image is determined based on the pixel values in the multiple TCP packets.
[0078] Specifically, when determining the second image based on the TCP packet whose pixel position index has the smallest Euclidean distance with the pixel position index of the lost TCP packet among the multiple TCP packets obtained by decapsulating the first data packet, and these multiple TCP packets, the pixel value in the TCP packet whose pixel position index has the smallest Euclidean distance with the pixel position index of the lost TCP packet among the multiple TCP packets can be used to replace the pixel value in the lost TCP packet, and the image restoration can be performed in combination with the pixel values in the multiple TCP packets to obtain the second image.
[0079] Exemplarily, the method further includes:
[0080] After determining the second image, anisotropic diffusion filtering is performed on the second image to obtain a third image.
[0081] Specifically, since the pixel values in other TCP packets are used to replace the pixel values in the lost TCP packets, in order to avoid the block effect of the image, after obtaining the second image, anisotropic diffusion filtering can be performed on the second image to enhance the detail information in the image to obtain a third image, and the third image can be used as the final received image.
[0082] Exemplarily, the method further includes:
[0083] When the packet loss rate of the multiple TCP packets is greater than the first threshold, a retransmission request message is sent to the second network unit, where the retransmission request message is used to request the second network unit to resend the first data packet.
[0084] Specifically, when the packet loss rate of multiple TCP packets obtained by decapsulating the first data packet is greater than the first threshold, it indicates that a lot of image information has been lost during the image transmission, and it will be difficult to ensure the image transmission quality by restoring the image based on these multiple TCP packets. At this time, the first network unit can send a retransmission request message to the second network unit, requesting the second network unit to resend the first data packet to ensure the image transmission quality.
[0085] A specific embodiment of the present invention also discloses an image transmission method in a WiFi communication system, which is applied to a second network unit and combined with Figure 3 Come and see, Figure 3 A schematic flow chart of another embodiment of the image transmission method in the WiFi communication system provided by the present invention includes steps S301 to S303, wherein:
[0086] In step S301, the number of pixels in a single TCP packet is determined based on the image type of the target image and the payload of the TCP packet;
[0087] In step S302, the pixel values corresponding to the target image are encapsulated into a plurality of TCP packets, and a first data packet is generated based on the plurality of TCP packets encapsulated with the pixel values corresponding to the target image, wherein the first data packet includes a starting pixel position and a number of pixels of the target image;
[0088] In step S303, the first data packet is sent to the first network unit.
[0089] During implementation, the second network unit (the image transmission sending end device in the WiFi communication system, which can be the AP or STA in the BSS) can first determine the number of pixels in a single TCP packet according to the image type of the target image and the payload of the TCP packet. The image type of the target image will affect the size of the pixel value data, for example, the pixel value data of the grayscale image is small, while the pixel value data of the color image is large. The payload of the TCP packet determines the amount of data that can be accommodated in a single TCP.
[0090] After determining the number of pixels in a single TCP packet according to the image type of the target image and the payload of the TCP packet, the pixel values corresponding to the target image can be continuously encapsulated into multiple TCP packets, and then the multiple TCP packets can be encapsulated into MPDU packets or A-MSDU packets as the first data packet, and a field for recording the starting pixel position and number of pixels of the target image is added to the first data packet. For example, the TCP packet can be encapsulated into an MSDU packet first, and then aggregated to form an Aggregation MAC Service Data Unit (A-MSDU) packet, and then the A-MSDU packet can be encapsulated into an MPDU packet. Finally, it can be determined whether to aggregate the MPDU packet into an A-MSDU packet depending on the amount of data. After that, the first data packet can be sent to the first network unit (the image transmission receiving device in the WiFi communication system, which can be the AP or STA in the BSS).
[0091] The image transmission method in the WiFi communication system provided by the present invention can be applied to the image transmission scenario within the same BSS, and can also be applied to the image transmission scenario between different BSSs, which is not specifically limited by the present invention.
[0092] Compared with the prior art, in the image transmission method in the WiFi communication system provided in this embodiment, the sending end device divides the target image into multiple pixel values and uses multiple TCP packets to encapsulate the image for image transmission, which can improve the situation of image information loss during image transmission and thus improve the quality of image transmission.
[0093] Exemplarily, the method further includes:
[0094] receiving a block confirmation message sent by the first network unit;
[0095] Based on the block confirmation message, the TCP packets lost in the first data packet are sent to the first network element.
[0096] Specifically, the second network unit may also receive a block confirmation message sent by the first network unit, and send the TCP packet lost in the first data packet to the first network unit according to the block confirmation message.
[0097] Exemplarily, the method further includes:
[0098] receiving a retransmission request message sent by the first network unit;
[0099] Based on the retransmission request message, the first data packet is resent to the first network element.
[0100] Specifically, the second network unit may also receive a retransmission request message sent by the first network unit, and resend the first data packet to the first network unit according to the retransmission request message.
[0101] The following is a specific application scenario to better illustrate the technical solution of the present invention:
[0102] Combination Figure 4 Come and see, Figure 4 The present invention provides a flowchart of an embodiment of a WiFi network image transmission process. During the data transmission process, both the sending end and the receiving end are provided with a data cache area, and the cache area caches TCP / UDP data packets. In order to avoid the receiving end from performing response processing on each TCP data packet, the data processing layer of the sending end re-encapsulates TCP / UDP data packets at several consecutive pixel positions into a larger data packet according to the image data content of the transport layer. The data packet is not larger than the maximum data amount limit of the 802.11 protocol MSDU. Multiple MSDUs constitute an MPDU, and the image data in the MPDU constitutes a part of an image. The image processing layer at the receiving end extracts a data packet from a data unit MPDU received by the 802.11 protocol layer and transmits it to the image transmission layer. The data packet is multiple TCP packets encapsulated by the image transmission layer. The image transmission layer decapsulates the received data packet and sends it to the TCP / Internet Protocol (IP) protocol layer. The TCP / IP protocol layer caches the received datagram. When a preset time period expires, the packet loss rate of the TCP data packets received in the cache is analyzed. If the packet loss rate is large, a retransmission request is directly sent for retransmission; otherwise, the image is restored based on the received data, and a convolutional neural network (CNN) is used for feature extraction. If the differential modulus of the eigenvalue is greater than a certain threshold, the sender is requested to retransmit the lost packet data; otherwise, the adjacent data packets of the lost packet data are used to copy the lost data packet to restore the image. In order to reduce the block effect that may be caused by the duplication of image data, anisotropic diffusion filtering can also be performed on the restored image.
[0103] Combination Figure 5 Come and see, Figure 5 This is a flow chart of an embodiment of a transmitting end image transmission process provided by the present invention, taking AP as the transmitting end and STA as the receiving end as an example:
[0104] 1. The image processing layer on the AP side determines whether to transmit a new frame of image data or retransmit the previous frame of image data based on whether it receives the retransmission request message sent by the TCP / IP transport layer; if it is to retransmit the previous frame of image data, execute step 2a; otherwise, execute step 2b.
[0105] 2a. The image processing layer determines the number of pixels of a packet image according to the image type, the underlying TCP payload and the size of the MSDU packet. For example, according to the underlying transmission requirements, a TCP packet is determined to transmit 1600 bits of payload data. The image is a grayscale image, and one pixel requires 8 bits to represent it. In this case, 1600 bits can transmit 200 pixels. The image processing layer determines to divide the image into units of 10*10 pixels from the upper left corner of the image to form a data unit and pass it to the TCP layer for encapsulation.
[0106] 2b. Retransmission request message processing.
[0107] 3. The TCP layer encapsulates the segmented image data units received in step 2 into standard TCP data packets in sequence and sends them to the image transport layer.
[0108] 4. The image transmission layer calculates the position and number of pixels of the data transmitted by each TCP data packet in the image based on the packet number of the received TCP packet, and encapsulates multiple TCP packets into an image transmission packet based on the amount of data transmitted by an MSDU packet payload of the 802.11 protocol layer. The packet header stores the starting position of the image pixels in the original image and the number of pixels in the image transmission packet to facilitate the unpacking of the received packet, and then sends the image transmission packet to the 802.11 protocol layer for transmission.
[0109] 5. The 802.11 protocol layer encapsulates multiple image transport layer packets into A-MPDU for transmission, which is implemented in two sub-steps: the first sub-step is to use the content of the image transport layer packet as a payload to form an MSDU packet, and then aggregate it to form an A-MSDU packet; the second sub-step is to use the A-MSDU packet as a payload to form an MPDU packet, and then aggregate it to form an A-MPDU packet; when forming an A-MSDU packet, the 802.11 protocol layer calculates the starting pixel position and pixel number of the image data transmitted in an A-MSDU based on the pixel position and pixel number of the image in the received image transport layer packet, and reserves enough bits in the payload of the last MSDU packet in the A-MSDU to prevent the above information from being lost.
[0110] Combination Figure 6 Come and see, Figure 6 This is a flow chart of an embodiment of a receiving end image transmission process provided by the present invention, also taking AP as a transmitting end and STA as a receiving end as an example:
[0111] 1. The STA receives the A-MPDU data and decapsulates it to obtain the MSDU data. It then decapsulates the MSDU data to obtain the image transport layer packet data and sends it to the image transport layer module.
[0112] 2. After receiving the packet data, the image transport layer decapsulates it to obtain a TCP packet and sends the TCP packet to the TCP transport layer.
[0113] 3. After receiving the TCP data packet, the TCP transport layer determines whether the packet loss rate is less than a preset threshold T1. If the packet loss rate is greater than a preset threshold T1, execute step 4a; otherwise, execute step 4.
[0114] 4a. TCP sends a retransmission request to the bottom layer, and the image transport layer sends it to the 802.11 protocol layer layer by layer. The receiving end sends a retransmission request to the sending end to request to send all the data in the MPDU.
[0115] 4. The receiving end parses the data in the received TCP packet, restores the grayscale image, uses the CNN neural network model to extract image features. The specific process is described later, and calculates the eigenvalue; if the eigenvalue is less than the preset threshold T2, it means that the image does not have too many details, and executes step 5; otherwise, executes steps 5a, 5b, and 5c in sequence.
[0116] 5. Replace the pixel value corresponding to the lost data packet with the pixel value of the nearest data packet.
[0117] 5a. Extract the lost TCP packet number and send it to the image transport layer; include retransmission indication information in the block confirmation message.
[0118] 5b. The image transport layer packages and encapsulates the lost TCP packet number in an A-MPDU and sends it to the 802.11 layer.
[0119] 5c. The 802.11 layer sends a block confirmation message to the sender.
[0120] Step 6: In order to prevent the block effect of the image, the image processed in step 5 is subjected to anisotropic diffusion filtering; the anisotropic diffusion filtering of the image can retain the detail information of the image; specifically, the filter template is derived based on a nonlinear partial differential equation, and the partial differential equation is:
[0121]
[0122] in is the input image, is the time variable, express right Find the partial derivative, is the nonlinear diffusion coefficient function, is the gradient operator, is a divergence operator. According to the equation, the Euler-Lagrange method is used to discretize it, and finally the following difference equation is obtained:
[0123]
[0124] in, is the time step, Indicates Time layers. Indicates time of The grayscale value of the image pixel at the position, combined with Figure 7 Come and see, Figure 7 It is a structural schematic diagram of an embodiment of pixel positions when performing anisotropic diffusion filtering provided by the present invention.
[0125] Starting from 802.11n, frame aggregation technology was introduced in the MAC layer. There are two types of MAC data frame aggregation methods: A-MSDU and A-MPDU. A-MSDU aggregation refers to aggregating multiple MSDUs into a larger payload in a certain way. When the 802.11 driver of the device receives a data frame from the protocol stack, it will first encapsulate the data with an Ethernet header, and then form an MSDU frame. When sending over the air interface, the Ethernet frame header of the MSDU will be converted into the 802.11 format for transmission. Figure 8 Come and see, Figure 8 A schematic diagram of the structure of an embodiment of the A-MSDU aggregation format provided by the present invention.
[0126] A-MPDU aggregation is to aggregate multiple MPDUs in a certain way. When MSDU or A-MSDU is converted into 802.11 frame, an MPDU is formed. Aggregating multiple MPDUs together for transmission can reduce the Physical Layer Convergence Protocol (PLCP) preamble required to send each 802.11 message, reduce PLCP header overhead, and thus improve system throughput. Fig. 9 Come and see, Fig. 9 The structure diagram of an embodiment of the A-MPDU aggregation format provided by the present invention is as follows: The frame check sequence is the tail field of the protocol data unit (frame) of the computer network data link layer, and is a 4-byte cyclic redundancy check code.
[0127] The present invention also proposes to use a dynamic frame format to transmit WiFi images, thereby digitizing the images. Currently, most images transmitted in wireless communications are digital images. Digital images are mainly composed of pixels. These pixels represent image information through a specific data structure and format. Grayscale images are usually represented by the grayscale value of pixels, and color images are represented by the grayscale values of the three channels of red, blue, and green. During the transmission process, the image transmits the grayscale value data of the image pixels, and the grayscale values of multiple pixels constitute a transmission data unit. For example, one frame of image can constitute one transmission data unit. Fig.10 Come and see, Fig.10 This is a structural schematic diagram of an embodiment of a digital image transmission format provided by the present invention.
[0128] The present invention also proposes a transmission method for image processing based on local features. During the image processing process, if the packet loss rate of a transmission unit image data is less than a preset threshold after the receiving end receives it, the data features can be analyzed. For example, the receiving end can use a convolutional neural network (CNN) to analyze the image features based on the image features. The specific implementation steps are as follows:
[0129] 1. Input image data, usually two-dimensional (grayscale image) or three-dimensional (color image, with red, green and blue channels) image data. Preprocess the input image, such as normalization or standardization, so that the pixel values fall within the range [0, 1].
[0130] 2. Use multiple convolution kernels (filters / kernels) to perform convolution operations on the input image. Each convolution kernel slides on the input image and calculates the weighted sum of the local area (i.e., convolution operation) to generate a feature map. The purpose of the convolution operation is to extract local features in the input image, such as edges, corners, textures, etc.
[0131] 3. The output of the convolutional layer usually passes through a nonlinear activation function, such as the Rectified Linear Unit (ReLU) function, which converts the linear output into a nonlinear one and increases the network's expressive power. The ReLU function converts all negative values to 0 and keeps positive values unchanged.
[0132] 4. After each convolutional layer, a pooling layer is usually used to downsample the feature map to reduce the size of the feature map while retaining the most important features. Common pooling methods include maximum pooling and average pooling. For example, in maximum pooling, the maximum value in the local window is taken as the output.
[0133] 5. The combination of convolution and pooling is usually repeated multiple times to extract more complex and abstract features layer by layer. The initial layer may extract simple edge features, while subsequent layers extract more complex shapes or patterns.
[0134] 6. After multiple layers of convolution and pooling, the final feature map is usually flattened into a one-dimensional vector so that it can be connected to the fully connected layer.
[0135] 7. The fully connected layer connects the flattened feature vector with the classifier (such as the Softmax function) to generate the final classification result or feature representation.
[0136] 8. When using CNN for feature extraction, you can ignore the last classification layer (Softmax layer) and directly use the output vector of the last fully connected layer as the feature representation of the image.
[0137] The modulus of the vector obtained after performing a differential operation on the image feature vector is calculated, and a threshold value T2 is preset. When the modulus of the differential vector is less than the threshold value T2, it means that the image contains fewer detailed features, and no retransmission is performed. The lost data is supplemented with the nearest received pixel value. At the same time, in order to avoid the block effect of the image, the pixel points of the lost data can be smoothed by anisotropic diffusion filtering; conversely, when the modulus of the differential vector is greater than or equal to the threshold value T2, it means that there are more image feature details in a data transmission unit, and retransmission is performed.
[0138] To ensure the reliability of data transmission, the 802.11 protocol stipulates that each time a unicast data frame is received, an acknowledgment (ACK) frame must be responded to immediately. After receiving the MPDU, the receiving end of the MPDU needs to process each of the MPDUs, so it needs to send a response frame for each MPDU. The block confirmation mechanism uses one ACK to complete the response to multiple MPDUs to reduce the number of ACK frames in this case. In the present invention, after the receiving end receives the MPDU formed by the image pixel value data, it performs image feature analysis, determines the image content that needs to be retransmitted based on the image analysis results, feeds back an indication of the need for retransmission in the ACK, and returns the position of the image pixel points that need to be retransmitted in a frame of the image. After receiving the response message, the sending end selects the image blocks that need to be retransmitted to form an MSDU, and the frame format contains the actual position of the retransmitted image fragments in a frame of the image. Combined with Fig.11 Come and see, Fig.11 A schematic diagram of a flow chart of an embodiment of a block confirmation request message transmission process provided by the present invention.
[0139] The embodiment of the present invention also provides an image transmission device in a WiFi communication system, Fig.12 Come and see, Fig.12 This is a structural schematic diagram of an embodiment of an image transmission device in a WiFi communication system provided by the present invention. The image transmission device 1200 in the WiFi communication system includes:
[0140] The receiving module 1201 is used to receive a first data packet sent by a second network unit, wherein the first data packet includes a starting pixel position and a number of pixels of a target image;
[0141] A first determining module 1202 is configured to decapsulate the first data packet to obtain a plurality of TCP packets, and determine a first image based on the plurality of TCP packets when a packet loss rate of the plurality of TCP packets is less than or equal to a first threshold;
[0142] An extraction module 1203 is used to extract features of the first image and calculate feature values of the first image;
[0143] The first sending module 1204 is configured to send a block confirmation message to the second network unit when the characteristic value of the first image is greater than or equal to the second threshold, wherein the block confirmation message is used to request the lost TCP packet in the first data packet.
[0144] The specific implementation of each module of the image transmission device in the WiFi communication system can refer to the description of the image transmission method in the above WiFi communication system, and has similar beneficial effects, which will not be repeated here.
[0145] It should be noted that the image transmission device in the WiFi communication system can be set on the STA or on the AP, and the present invention does not make any specific limitation on this.
[0146] The embodiment of the present invention also provides an image transmission device in a WiFi communication system, Fig.13 Come and see, Fig.13 This is a structural schematic diagram of another embodiment of the image transmission device in the WiFi communication system provided by the present invention. The image transmission device 1300 in the WiFi communication system includes:
[0147] The second determination module 1301 is configured to determine the number of pixels in a single TCP packet based on the image type of the target image and the payload of the TCP packet;
[0148] A generating module 1302 is used to encapsulate the pixel values corresponding to the target image into a plurality of TCP packets, and generate a first data packet based on the plurality of TCP packets encapsulated with the pixel values corresponding to the target image, wherein the first data packet includes a starting pixel position and a number of pixels of the target image;
[0149] The second sending module 1303 is configured to send the first data packet to the first network unit.
[0150] The specific implementation of each module of the image transmission device in the WiFi communication system can refer to the description of the image transmission method in the above WiFi communication system, and has similar beneficial effects, which will not be repeated here.
[0151] It should be noted that the image transmission device in the WiFi communication system can be set on the STA or on the AP, and the present invention does not make any specific limitation on this.
[0152] The present invention discloses an image transmission method and device in a WiFi communication system. After receiving the image data sent by the sending device, the receiving device first decapsulates the image data into multiple TCP packets, and then performs preliminary image recovery when the multiple TCP packets are not seriously lost. When the characteristic value of the recovered image is large, the sending device is requested to retransmit the lost TCP packet, thereby ensuring the quality of image transmission and reducing the amount of data retransmission, thereby reducing the delay of data transmission. The present invention improves the quality of the image received by the receiving device while ensuring a low delay in WiFi image transmission.
[0153] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. An image transmission method in a WiFi communication system, characterized in that: Applied to a first network unit, comprising: receiving a first data packet sent by the second network unit, wherein the first data packet includes a starting pixel position and a number of pixels of a target image; Decapsulating the first data packet to obtain a plurality of Transmission Control Protocol TCP packets, and determining a first image based on the plurality of TCP packets when a packet loss rate of the plurality of TCP packets is less than or equal to a first threshold; Extracting features of the first image and calculating feature values of the first image; When the characteristic value of the first image is greater than or equal to the second threshold, sending a block confirmation message to the second network unit, wherein the block confirmation message is used to request the TCP packet lost in the first data packet; The method further comprises: When the characteristic value of the first image is less than the second threshold, the second image is determined based on the TCP packet whose pixel position index has the smallest Euclidean distance with the pixel position index of the lost TCP packet among the multiple TCP packets, and the multiple TCP packets, and the lost TCP packet is the TCP packet lost in the first data packet.
2. The image transmission method in the WiFi communication system according to claim 1, characterized in that: The determining of the second image based on the TCP packet having the smallest Euclidean distance between the pixel position index and the pixel position index of the lost TCP packet among the multiple TCP packets and the multiple TCP packets comprises: The pixel value in the lost TCP packet is replaced by the pixel value in the Euclidean distance between the pixel position index in the multiple TCP packets and the pixel position index in the lost TCP packet, and the second image is determined based on the pixel values in the multiple TCP packets.
3. The image transmission method in the WiFi communication system according to claim 1, characterized in that: The method further comprises: After determining the second image, anisotropic diffusion filtering is performed on the second image to obtain a third image.
4. The image transmission method in the WiFi communication system according to claim 1, characterized in that: The method further comprises: When the packet loss rate of the multiple TCP packets is greater than the first threshold, a retransmission request message is sent to the second network unit, where the retransmission request message is used to request the second network unit to resend the first data packet.
5. An image transmission method in a WiFi communication system, characterized in that: Applied to the second network unit, comprising: Determine the number of pixels in a single TCP packet based on the image type of the target image and the payload of the TCP packet; Encapsulating the pixel values corresponding to the target image into a plurality of TCP packets, and generating a first data packet based on the plurality of TCP packets encapsulated with the pixel values corresponding to the target image, wherein the first data packet includes a starting pixel position and a number of pixels of the target image; Sending the first data packet to a first network unit; The first network unit is used to execute the image transmission method in the WiFi communication system according to any one of claims 1 to 4.
6. The image transmission method in the WiFi communication system according to claim 5, characterized in that: The method further comprises: receiving a block confirmation message sent by the first network unit; Based on the block confirmation message, the TCP packets lost in the first data packet are sent to the first network element.
7. The image transmission method in the WiFi communication system according to claim 5, characterized in that: The method further comprises: receiving a retransmission request message sent by the first network unit; Based on the retransmission request message, the first data packet is resent to the first network element.
8. An image transmission device in a WiFi communication system, characterized in that: include: A receiving module, configured to receive a first data packet sent by a second network unit, wherein the first data packet includes a starting pixel position and a number of pixels of a target image; A first determining module, configured to decapsulate the first data packet to obtain a plurality of TCP packets, and determine a first image based on the plurality of TCP packets when a packet loss rate of the plurality of TCP packets is less than or equal to a first threshold; An extraction module, used to extract features of the first image and calculate feature values of the first image; A first sending module, configured to send a block confirmation message to the second network unit when the characteristic value of the first image is greater than or equal to a second threshold, wherein the block confirmation message is used to request a TCP packet lost in the first data packet; The device also includes: The third determination module is used to determine the second image based on the TCP packet whose pixel position index has the smallest Euclidean distance with the pixel position index of the lost TCP packet among the multiple TCP packets, and the multiple TCP packets when the characteristic value of the first image is less than the second threshold, and the lost TCP packet is the TCP packet lost in the first data packet.
9. An image transmission device in a WiFi communication system, characterized in that: include: A second determination module is used to determine the number of pixels in a single TCP packet based on the image type of the target image and the payload of the TCP packet; A generating module, configured to encapsulate the pixel values corresponding to the target image into a plurality of TCP packets, and generate a first data packet based on the plurality of TCP packets encapsulated with the pixel values corresponding to the target image, wherein the first data packet includes a starting pixel position and a number of pixels of the target image; A second sending module, used for sending the first data packet to a first network unit; The first network unit is used to execute the image transmission method in the WiFi communication system according to any one of claims 1 to 4.
Citation Information
Patent Citations
Data receiving and transmitting methods and devices and data transmission system
CN101656597A
Camera device, server device, image monitoring system, control method of image monitoring system, and control program of image monitoring system
US20140313415A1