A wireless local area network transmission method and system for real-time video monitoring
By designing the PRUDP protocol based on the UDP protocol, it solves the problems of long delay, packet sticking and frame loss in wireless LAN transmission, achieves the smoothness and reliability of video surveillance images, provides a transmission quality evaluation method, and adapts to different network environments.
Patent Information
- Application Number
- CN202410322408.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-20
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-03-20
AI Technical Summary
Existing wireless LAN transmission protocols have long delays, packet sticking problems, frame loss risks, lack of reliability and transmission quality evaluation methods in real-time video surveillance, and cannot meet the needs of video streaming transmission.
A PRUDP protocol based on UDP protocol is designed, including real-time video sending and receiving functions, sliding window strategy, flow control, packet identification and congestion window control, through client registration, video transmission cache negative feedback mechanism and data transmission quality evaluation index , ensuring reliable transmission of key frames and dynamic adjustment of network traffic.
It improves the fluency and reliability of video surveillance images, reduces sticky packet problems, enables transmission quality evaluation and improvement, reduces resource consumption and heartbeat keep-alive overhead, and dynamically adjusts video encoding and transmission bit rates to adapt to different network environments.
Smart Images

Figure CN118158471B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wireless local area network transmission, and in particular to a wireless local area network transmission method and system for real-time video monitoring. Background Art
[0002] With the development of social economy and the improvement of people's living standards, the demand for security monitoring is growing. Traditional wired video surveillance has disadvantages such as complex wiring and difficulty in expansion, and cannot meet the needs of mobile monitoring. The development of wireless LAN technology has provided a new transmission method for real-time video monitoring. The current transmission network protocols mainly include TCP protocol and UDP protocol, but the TCP protocol has a large overhead and low efficiency for real-time video transmission. The UDP protocol is connectionless and can only deliver as much as possible, which is prone to the risk of frame loss. Therefore, a new transmission network protocol is needed to improve the quality of real-time video surveillance transmission.
[0003] For example, the invention patent with announcement number: CN105657334B discloses a video transmission method, a video surveillance platform and a video surveillance device. The video transmission method includes: obtaining performance parameters of a video surveillance device connected to the video surveillance platform; matching a video transmission strategy corresponding to the obtained performance parameters of the video surveillance device according to a preset correspondence between the performance parameters of the video surveillance device and the video transmission strategy; sending the video transmission strategy to a forwarding server of the video surveillance platform and the video surveillance device, and the forwarding server or the video surveillance device transmits the surveillance video taken by the video surveillance device according to the received video transmission strategy. This application makes full use of the processing capability of the video surveillance device itself, and realizes that while the video surveillance device performs cloud storage and live video broadcasting, it reduces the forwarding of the video stream by the video surveillance platform.
[0004] For example, the invention patent with announcement number: CN105681796B discloses a video surveillance code stream transmission method and device, which belongs to the field of communication technology. The video surveillance code stream transmission method of the present invention includes the following steps: partitioning the original hierarchical first base video screen according to certain rules; detecting in which areas of the first base video screen a specific event occurs; performing hierarchical video coding on at least part of the areas where the specific event occurs in the first base video screen to form a second base video code stream; performing hierarchical video coding on other areas to form an enhanced layer video code stream of the second base; judging whether the receiving device and bandwidth can match the code stream bundled with the second base video code stream and the enhanced layer video code stream of the second base; when a match is judged, the second base video code stream and the enhanced layer video code stream of the second base are bundled and output to the receiving device; when a mismatch is judged, the second base video code stream is output to the receiving device.
[0005] Based on the above solution, it is found that there are still some shortcomings in wireless LAN transmission, which are specifically reflected in the following aspects: (1) The handshake connection mechanism, confirmation mechanism and retransmission mechanism of the TCP protocol will increase the transmission delay. At the same time, since there is no clear boundary set for the data packet, it is easy to have a packet sticking problem. Solving the packet sticking problem consumes a lot of resources; the UDP protocol is connectionless, but lacks reliability and can only do its best to deliver. In video stream transmission, if too many key frames in the video data are lost, it will cause screen freezes, screen distortion and other phenomena. In addition, due to the lack of an effective flow control and retransmission mechanism, video frame loss is more likely to occur.
[0006] (2) Currently, there is a lack of an evaluation method for real-time video-related network data transmission protocols, and it is impossible to compare the transmission quality of different network data transmission protocols. At the same time, there is a lack of an evaluation method for transmission quality, and it is impossible to timely discover the defects of existing transmission protocols, resulting in the inability to make targeted improvements to the transmission protocols. Summary of the invention
[0007] In view of the deficiencies in the prior art, the present invention provides a wireless local area network transmission method and system for real-time video monitoring, which can effectively solve the problems involved in the above-mentioned background technology.
[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions: A first aspect of the present invention provides a wireless local area network transmission method for real-time video monitoring, including: setting a specified network data transmission protocol.
[0009] Perform transmission tests on the traditional UDP transmission protocol and the specified network data transmission protocol, collect the number of key frames received by the receiving end of the traditional UDP transmission protocol and the number of key frames received by the receiving end of the specified network data transmission protocol under each transmission test, calculate the video clarity evaluation value, and evaluate the video clarity of the specified network data transmission protocol based on the video clarity evaluation value.
[0010] The duration of video data freeze when the receiving end of the traditional UDP transmission protocol receives the video data and the duration of video data freeze when the receiving end of the specified network data transmission protocol receives the video data under each transmission test are collected, and the video smoothness evaluation value is calculated. Based on the video smoothness evaluation value, the video smoothness of the specified network data transmission protocol is evaluated.
[0011] The evaluation results of video clarity and video fluency are obtained, the transmission results are analyzed, and a data transmission quality evaluation index is calculated. The data transmission quality evaluation index is used to evaluate the quality of data transmission under a specified network data transmission protocol.
[0012] As a further method, the setting specifies the network data transmission protocol, specifically including: setting a PRUDP protocol based on the UDP protocol, including real-time video sending and receiving functions, classifying the encoded H.264 video data frames during transmission, including key frames and non-key frames, and defining the PRUDP protocol based on the UDP protocol as the specified network data transmission protocol.
[0013] The specified network data transmission protocol includes a client registration function, a flow control function, a data packet identification function, and a congestion window control function.
[0014] As a further method, the data transmission quality evaluation index is calculated using the following formula: In the formula, β represents the data transmission quality evaluation index, α 清 and α 流 They represent the video clarity evaluation value and the video smoothness evaluation value respectively, e represents a natural constant, ζ1 and ζ2 represent the data transmission quality influencing factors corresponding to the set video clarity evaluation value and video smoothness evaluation value respectively.
[0015] As a further method, the client registration function is specifically implemented as follows: the client sends a registration application message to the server through the original port number, where the registration application message contains the IP and MAC address information of the current client. The server receives the registration application and registers, and at the same time allocates an exclusive communication port number to the client.
[0016] The server detects whether the client has been registered. If the client has been registered, a warning is given. If the client has not been registered, a child process is created to handle the client and the client's IP, MAC address and corresponding new port number information are stored in the client list.
[0017] As a further method, the flow control function is specifically implemented as follows: the network data transmission protocol is specified to adopt a sliding window strategy for flow control, and the receiving end includes its own receiving window size in the ACK message replied to the sending end. When the receiving window is 0, the sender sends a probe frame to actively inquire about the window size of the receiving end. The receiving end dynamically adjusts the sending rate of the sending end by controlling the window size.
[0018] The specified network data transmission protocol introduces a video transmission cache negative feedback mechanism to control the network traffic transmission speed.
[0019] As a further method, the data packet identification function is specifically implemented as follows: the receiving end maintains an approval sequence number, a receiving buffer and a retransmission queue. When the receiving end receives a data packet, it determines whether it is an expected packet based on the sequence number of the packet header.
[0020] Collect the sequence number of the data packet sent by the sender, and obtain the approval sequence number of the receiving end from the data transmission information library. Determine whether the type of the data packet is a key frame based on the header sequence information in the data packet. If the data packet is a non-key frame, put the data packet directly into the corresponding position of the receiving buffer, and update the approval sequence number of the receiving end according to the calculation formula N=M+1, where M represents the sequence number of the data packet sent by the sender, and N represents the approval sequence number of the receiving end.
[0021] If the data packet is a key frame, a subtraction operation is performed to obtain a data packet identification index, which is calculated as follows: Y=NM, where Y represents the data packet identification index.
[0022] If Y=0, it means that the data packet is an expected data packet and can be stored normally, and the approval sequence number of the receiving end is updated synchronously according to the calculation formula N=M+1.
[0023] If Y<0, it means that the receiving end has not received the data packet, and the sending end needs to resend the data packet. At the same time, the retransmission queue records the data packet sequence number and feeds it back to the sending end, and updates the approval sequence number of the receiving end according to the calculation formula N=M-1. The data packet is also offset and stored.
[0024] If Y>0, it means that the data packet is a retransmitted data packet or a received data packet, and the data packet sequence number is queried in the retransmission queue. If the data packet sequence number exists in the retransmission queue, the data packet is judged to be a retransmitted packet, and the data packet sequence number is deleted from the retransmission queue, and the data packet is stored in the corresponding position of the receiving buffer. On the contrary, if the data packet sequence number does not exist in the retransmission queue, the data packet is defined as a duplicate packet and discarded.
[0025] As a further method, the congestion window control function is specifically implemented as follows: obtaining the number of data packets successfully received by the receiving end, collecting the maximum data packet sequence number and the minimum data packet sequence number received by the receiving end within a set time period, and comprehensively calculating the packet loss rate of the receiving end within the set time period. The calculation expression is: Where P loss Indicates the packet loss rate of the receiving end within the set time period, C indicates the number of data packets successfully received by the receiving end, and SN max Indicates the maximum data packet sequence number received by the receiver within the set time period, SN min Indicates the minimum data packet sequence number received by the receiver within the set time period.
[0026] The packet loss rate threshold is obtained from the data transmission database, and the packet loss rate of the receiving end within a set time period is compared with the packet loss rate threshold. If the packet loss rate of the receiving end is greater than the packet loss rate threshold, the network state is defined as a congestion state and congestion control is performed.
[0027] The receiving end needs to send back a packet loss rate feedback message in each time period to control traffic congestion, which also serves as a heartbeat keep-alive mark. If the sending end does not receive the packet loss rate feedback message within two time periods, it considers the connection inactive and issues a feedback warning.
[0028] As a further method, the video clarity evaluation value and the video fluency evaluation value are specifically analyzed and calculated as follows: a specified network data transmission protocol is tested and compared with a traditional UDP transmission protocol under the same network environment, and test video data is obtained for a set number of transmission tests, the number of key frames in the test video data and the number of transmission tests are extracted, and the number of key frames received by the receiving end is collected to obtain the number of key frames received by the receiving end of the traditional UDP transmission protocol and the number of key frames received by the receiving end of the specified network data transmission protocol under each transmission test.
[0029] Calculate the video clarity evaluation value, the calculation expression is: In the formula, α 清 Indicates the video clarity evaluation value, N 帧 Represents the number of key frames in the test video data, N 传 Indicates the number of transmission tests. and They respectively represent the number of key frames received by the receiving end of the traditional UDP transmission protocol and the number of key frames received by the receiving end of the specified network data transmission protocol under the i-th transmission test, ψ represents the correction factor corresponding to the set video clarity, i represents the number of each transmission test, i=1,2,3,...,n, and n represents the total number of transmission test numbers.
[0030] As a further method, the video fluency evaluation value is specifically analyzed and calculated as follows: the playback time of the test video is obtained, and at the same time, the screen freeze time when the receiving end of the traditional UDP transmission protocol receives the video data under each transmission test and the screen freeze time when the receiving end of the specified network data transmission protocol receives the video data are obtained.
[0031] Calculate the video smoothness evaluation value, the calculation expression is: In the formula, α 流 Indicates the video smoothness evaluation value, T 视 Indicates the playback time of the test video, T i U and T i P They respectively represent the freezing time when the receiving end of the traditional UDP transmission protocol receives the video data and the freezing time when the receiving end of the specified network data transmission protocol receives the video data in the i-th transmission test, and ξ represents the correction factor corresponding to the set video smoothness.
[0032] The second aspect of the present invention provides a wireless local area network transmission system for real-time video monitoring, including: a registration module, which is used to implement the registration of the client and establish a connection between the client and the server.
[0033] The flow control module is used to implement flow control.
[0034] The data packet identification module is used to identify the data packet and process the data packet according to the identification result.
[0035] The congestion control module is used to control the congestion window.
[0036] The transmission quality evaluation module is used to analyze the transmission results and calculate the data transmission quality evaluation index, which is used to evaluate the quality of data transmission under a specified network data transmission protocol.
[0037] The data transmission information base is used to store the data transmission quality assessment index threshold, the approval sequence number of the receiving end, and the packet loss rate threshold.
[0038] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects: (1) The present invention provides a wireless LAN transmission method and system for real-time video surveillance, designs a reliable PRUDP transmission protocol, including real-time video sending and receiving functions, ensures the reliable transmission of key frames, designs a sliding window strategy to perform flow control, and reasonably designs a retransmission mechanism to reduce the loss of key frames. At the same time, the protocol introduces a congestion control mechanism to dynamically adjust the video encoding bit rate and transmission bit rate for different network environments, thereby ensuring the smoothness of the monitoring screen.
[0039] (2) The present invention provides a PRUDP protocol that is completely based on the UDP protocol. Each data packet has a fixed message boundary, thereby avoiding the packet sticking problem that is prone to occur in the TCP protocol and reducing the cost problem caused by processing sticky packets.
[0040] (3) The present invention provides a transmission quality assessment method to assess the real-time video transmission of a network data transmission protocol. By quantifying the transmission quality of different network data transmission protocols, the transmission quality of different network data transmission protocols can be compared. At the same time, a transmission quality assessment method can be used to timely discover defects in a network data transmission protocol and make targeted improvements to the transmission protocol.
[0041] (4) The present invention provides a registration mechanism to replace the handshake connection mechanism in TCP. The client sends a registration application, and the server registers and allocates a fixed port number, thereby reducing the delay caused by the handshake and the resource consumption caused by maintaining the connection status. In addition, a permanent registration mechanism based on the server is adopted to greatly reduce the heartbeat keep-alive message overhead.
[0042] (5) The present invention provides a flow control and retransmission mechanism to ensure the reliable transmission of video data. The flow control is performed through a sliding window strategy to achieve real-time and dynamic adjustment of the sender's sending rate. The receiving end uses UDP multicast to notify each sending end of the frame sequence number that needs to be retransmitted, thereby ensuring the reliable transmission of the video key frames. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The present invention is further described using the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other drawings based on the following drawings without creative work.
[0044] Figure 1 It is a schematic diagram of the method flow of the present invention.
[0045] Figure 2 It is a schematic diagram of system module connection of the present invention.
[0046] Figure 3 It is a schematic diagram of the congestion control process of the present invention.
[0047] Figure 4 It is a schematic diagram of the retransmission mechanism flow of the present invention.
[0048] Figure 5 It is a schematic diagram of the data packet identification process of the present invention. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0050] Reference Figure 1 As shown, the first aspect of the present invention provides a wireless local area network transmission method for real-time video monitoring, including: setting a specified network data transmission protocol.
[0051] Specifically, the setting specifies the network data transmission protocol, including: setting a PRUDP protocol based on the UDP protocol, including a real-time video sending and receiving function, classifying the encoded H.264 video data frames during transmission, including key frames and non-key frames, to ensure reliable transmission of key frames.
[0052] It should be explained that H.264 video data frame is an international standard for audio and video encoding and decoding. It has the characteristics of high-definition video quality, strong fault tolerance, strong network adaptability and strong monitoring, and is widely used in video communication, digital video monitoring and other fields. H.264 video data frame divides images into three types: I frame, B frame and P frame. I frame is intra-frame prediction, P frame is forward prediction, and B frame is forward and backward bidirectional prediction. These frame types have different compression rates and image qualities in the H.264 encoding process. By rationally organizing and controlling these frame types, efficient video data compression and transmission can be achieved.
[0053] It should be explained that the H.264 video data frame ensures image quality and realizes efficient compression and transmission of video data by reasonably organizing and controlling key frames and non-key frames.
[0054] Key frame (I frame): A key frame is an intra-frame prediction frame that does not depend on other frames. It contains complete image data, so the image quality is the highest, but the amount of data is also the largest. The main function of a key frame is to provide a complete image reference so that a high-quality image can be restored during the decoding process. During the H.264 encoding process, a key frame is inserted every certain number of frames to maintain image quality.
[0055] Non-key frames (P frames and B frames): Non-key frames are frames predicted by referring to other frames, including forward prediction (P frames) and forward and backward bidirectional prediction (B frames). Non-key frames are compressed and encoded by comparing the difference between the current frame and the reference frame, so the amount of data is smaller than that of key frames, but the image quality is relatively low. The main function of non-key frames is to reduce the amount of data and realize the compression transmission of video data while ensuring the image quality.
[0056] In a specific embodiment, by providing a PRUDP protocol completely based on the UDP protocol, each data packet has a fixed message boundary, thereby avoiding the packet sticking problem that is prone to occur in the TCP protocol and reducing the cost problem caused by processing sticky packets.
[0057] Furthermore, the reliable transmission of the key frame includes the following specific functions: realizing the registration of the client, establishing a connection between the client and the server, and realizing the sending and receiving of data.
[0058] Implement flow control to avoid exceeding the processing speed of the receiving end.
[0059] Identify the data packet and process it according to the identification result.
[0060] Control the congestion window to avoid unsystematic retransmission that aggravates network congestion.
[0061] Specifically, the client registration function is implemented as follows: the client sends a registration application message to the server through the original port number, where the registration application message contains the IP and MAC address information of the current client. The server receives the registration application and registers, and at the same time allocates an exclusive communication port number to the client.
[0062] The server detects whether the client has been registered. If the client has been registered, a warning is given. If the client has not been registered, a child process is created to handle the client and the client's IP, MAC address and corresponding new port number information are stored in the client list.
[0063] In a specific embodiment, the client (referring to the embedded video terminal IPC) sends a registration application message to the server (referring to the network hard disk recorder NVR) through the original port number, which includes the IP and MAC address information of the current client. The server maintains a linked list for storing the registered client information. After receiving the registration message from the client, it detects whether the client has been registered. The registered client will not be processed and only the registered warning will be replied; if it is a client that has not been registered, a subprocess is created to process the client. The subprocess allocates a dedicated communication port number for the current client and returns it to the client, and then the client's IP, MAC and new port number information are stored in the linked list. After the client receives the port number replied by the server, the status variable is set to indicate that the registration has been successfully completed. The status variable is used to store the current client status. At the same time, the server maintains a keep-alive time for all registered clients. If the data of the client is not received within a certain period of time, the registration information of the client is deleted from the linked list. If the client sends data to the server at this time, it will be notified that the registration information has expired and needs to be re-registered.
[0064] In a specific embodiment, a registration mechanism is provided to replace the handshake connection mechanism in TCP. The client sends a registration application, the server registers and allocates a fixed port number, thereby reducing the delay caused by the handshake and the resource consumption caused by maintaining the connection status. In addition, a permanent registration mechanism based on the server is adopted to greatly reduce the heartbeat keep-alive message overhead.
[0065] In a specific embodiment, the message format of PRUDP is divided into data message and control message. The data message is responsible for sending video data, specifically including the header information of I / P / B frame and NALU; the control message is responsible for transmitting control information, specifically including: retransmission message, congestion control message, packet loss rate feedback message. The retransmission control message contains the sequence number of the key frame that is lost during transmission and requires retransmission. The packet loss rate feedback message is sent by the receiving end to feedback the current average packet loss rate information. The traffic congestion control message is sent by the receiving end to control the traffic or network congestion.
[0066] Specifically, the flow control function is implemented as follows: the network data transmission protocol is specified to adopt a sliding window strategy for flow control, and the receiving end includes its own receiving window size in the ACK message replied to the sending end. When the receiving window is 0, the sender sends a probe frame to actively inquire about the window size of the receiving end. The receiving end dynamically adjusts the sending rate of the sending end by controlling the window size to ensure orderly reception of data.
[0067] It should be explained that in this embodiment, the flow control is implemented by the sliding window strategy to prevent the sending speed of the sender from exceeding the receiving capacity of the receiver, resulting in data loss due to the receiver being unable to handle the data. In the flow control by the sliding window strategy, the window refers to the size of the buffer used by the receiver to receive data. The window size is dynamically adjusted by the receiver according to its own receiving capacity and buffer status. The receiver informs the sender of the window size through the window field in the TCP header, and requires the sender to reduce or increase the sending rate by reducing or increasing the window size.
[0068] It should be explained that, in this embodiment, the ACK message is a message type used to indicate that the receiver confirms the data transmission of the sender. When the receiver successfully receives the data from the sender, it will send an ACK message to the sender as confirmation.
[0069] It should be explained that in this embodiment, the sender uses a probe frame to actively inquire about the window status of the receiver. This process mainly occurs at the data link layer. The probe frame is a special frame used to obtain information about whether the receiver is currently ready to receive data. By sending a probe frame, the sender can understand the window size of the receiver and the frame sequence number that the receiver expects to receive.
[0070] The specified network data transmission protocol introduces a video transmission cache negative feedback mechanism to control the network traffic transmission speed.
[0071] It should be explained that the video transmission cache negative feedback mechanism in this embodiment refers to a mechanism for optimizing transmission performance and reducing delay by monitoring and adjusting the transmission cache during video transmission. This mechanism is usually used for real-time audio and video transmission, especially in complex or unstable network environments, and can effectively improve the stability and smoothness of transmission.
[0072] Specifically, the data packet identification function is implemented as follows: the receiving end maintains an approval sequence number, a receiving buffer and a retransmission queue. When the receiving end receives a data packet, it determines whether it is an expected packet based on the sequence number of the packet header.
[0073] In a specific embodiment, the sending end maintains three queues, namely, a queue to be sent, a queue to be confirmed, and a queue to be resent.
[0074] Queue to be sent: The encoded frames are stored in the sending buffer in the form of a linked list. The number of packets sent each time is determined by the server window size and the current congestion window size. Each node in the linked list is a structure FrameNode, which contains the frame type, frame sequence number, frame length, and frame data. Each encoded frame of data is inserted into the linked list using the tail insertion method, and is sent from the head of the linked list to ensure the first-in-first-out order.
[0075] The queue to be confirmed also maintains a linked list. Every time a frame is sent in the queue to be sent, if the frame is an IDR frame (key frame), it is stored in the queue to be confirmed by the tail insertion method. If it is not an IDR frame, the frame memory is released after sending.
[0076] Retransmission queue: It is empty in the initial state. When receiving the retransmission control message fed back by the receiving end, it is updated according to the sequence number in the message, and the corresponding frame tail insertion method in the queue to be confirmed is stored in the retransmission queue. Each time it is sent, it is checked whether the retransmission queue is empty. If it is not empty, it will be retransmitted first. The frames in the queue to be confirmed are released and deleted according to the minimum sequence number in the retransmission queue.
[0077] In a specific embodiment, multi-threaded transmission is used: main thread: 1. Encode a frame of data, store it at the end of the queue to be sent, and listen to the control message sent back by the server; 2. If a packet loss rate feedback message is received, flow control and congestion control are performed according to the packet loss rate feedback message. If a retransmission control message is received, the retransmission queue is updated according to the information in the message, and the frame with the corresponding sequence number in the queue to be confirmed is released. Sub-thread: 1. Take a frame of data from the queue to be sent, determine whether it is larger than the MTU (maximum transmission unit), and send it in groups. After the grouping is completed, add the PRUDP header, set the header field M in the last packet of each frame to 1, mark it as the end group of a frame of data, and send it using UDP; 2. Every time a packet in the queue to be sent is sent, the retransmission queue is judged. If it is not empty, the retransmission frame is sent first, and the retransmission queue is cleared after sending; 3. After a complete frame is sent, if the frame is an IDR frame, insert it to the end of the list to be confirmed, otherwise release the frame.
[0078] Collect the sequence number of the data packet sent by the sender, and obtain the approval sequence number of the receiving end from the data transmission information library. Determine whether the type of the data packet is a key frame based on the header sequence information in the data packet. If the data packet is a non-key frame, put the data packet directly into the corresponding position of the receiving buffer, and update the approval sequence number of the receiving end according to the calculation formula N=M+1, where M represents the sequence number of the data packet sent by the sender, and N represents the approval sequence number of the receiving end.
[0079] If the data packet is a key frame, a subtraction operation is performed to obtain a data packet identification index, which is calculated as follows: Y=NM, where Y represents the data packet identification index.
[0080] If Y=0, it means that the data packet is an expected data packet and can be stored normally, and the approval sequence number of the receiving end is updated synchronously according to the calculation formula N=M+1.
[0081] If Y<0, it means that the receiving end has not received the data packet, and the sending end needs to resend the data packet. At the same time, the retransmission queue records the data packet sequence number and feeds it back to the sending end, and updates the approval sequence number of the receiving end according to the calculation formula N=M-1. The data packet is also offset and stored.
[0082] If Y>0, it means that the data packet is a retransmitted data packet or a received data packet, and the data packet sequence number is queried in the retransmission queue. If the data packet sequence number exists in the retransmission queue, the data packet is judged to be a retransmitted packet, and the data packet sequence number is deleted from the retransmission queue, and the data packet is stored in the corresponding position of the receiving buffer. On the contrary, if the data packet sequence number does not exist in the retransmission queue, the data packet is defined as a duplicate packet and discarded.
[0083] In a specific embodiment, the retransmission mechanism process is as follows: Figure 4 As shown, the packet identification process is as follows Figure 5 As shown, the retransmission control message is also equivalent to a confirmation message. The ACK position in the message header is 1. The receiving end maintains a timer. When the timer times out, the server sends a retransmission control message to the sending end to confirm the received data packets and request retransmission of the lost packets. The retransmission control message may also be lost. The receiving end starts a counter. After receiving 200 packets, if a retransmission packet of an IDR frame has not been received, it is considered that the retransmission message is lost and the retransmission control message is resent.
[0084] It should be explained that different frames in H.264 video data have different functions. According to the definition of the frame, the key frame I frame can be decoded independently, and the P frame and B frame can be decoded only on the basis of the key frame, otherwise they cannot be decoded. The loss of key frame packets will cause a black screen, while the loss of P frame and B frame packets will cause temporary screen distortion or mosaic. In order to meet the low latency as much as possible, the specified network data transmission protocol only guarantees the reception of key frame data.
[0085] In a specific embodiment, a flow control and retransmission mechanism is provided to ensure reliable transmission of video data, and flow control is performed through a sliding window strategy to achieve real-time and dynamic adjustment of the sender's sending rate. The receiving end uses UDP multicast to notify each sending end of the frame number that needs to be retransmitted, thereby ensuring reliable transmission of video key frames.
[0086] Specifically, the congestion window control function is implemented by obtaining the number of data packets successfully received by the receiving end, collecting the maximum data packet sequence number and the minimum data packet sequence number received by the receiving end within a set time period, and comprehensively calculating the packet loss rate of the receiving end within the set time period. The calculation expression is: Where P loss Indicates the packet loss rate of the receiving end within the set time period, C indicates the number of data packets successfully received by the receiving end, and SN max Indicates the maximum data packet sequence number received by the receiver within the set time period, SN min Indicates the minimum data packet sequence number received by the receiver within the set time period.
[0087] The packet loss rate threshold is obtained from the data transmission database, and the packet loss rate of the receiving end within a set time period is compared with the packet loss rate threshold. If the packet loss rate of the receiving end is greater than the packet loss rate threshold, the network state is defined as a congestion state and congestion control is performed.
[0088] The receiving end needs to send back a packet loss rate feedback message in each time period to control traffic congestion, which also serves as a heartbeat keep-alive mark. If the sending end does not receive the packet loss rate feedback message within two time periods, it considers the connection inactive and issues a feedback warning.
[0089] In a specific embodiment, the congestion control process is as follows: Figure 3 As shown in Figure 1, congestion control depends on the packet loss rate feedback message. When the packet loss rate is greater than the preset maximum threshold, it proves that the network is congested, and congestion control is performed, specifying the network data transmission protocol to use the classic AIMD algorithm, that is, the slow start and fast recovery strategy.
[0090] The transmission result is analyzed and a data transmission quality evaluation index is calculated, wherein the data transmission quality evaluation index is used to evaluate the quality of data transmission under a specified network data transmission protocol.
[0091] Specifically, the data transmission quality evaluation index is calculated using the following formula: In the formula, β represents the data transmission quality evaluation index, α 清 and α 流 They represent the video clarity evaluation value and the video smoothness evaluation value respectively, e represents a natural constant, ζ1 and ζ2 represent the data transmission quality influencing factors corresponding to the set video clarity evaluation value and video smoothness evaluation value respectively.
[0092] It should be explained that the data transmission quality evaluation index in this embodiment is a quantitative index obtained by comprehensively calculating the video clarity evaluation value and the video fluency evaluation value, which is used to quantitatively evaluate the transmission quality of real-time video. The video clarity evaluation value is used to reflect the frame loss of the protocol transmission, and the video fluency evaluation value is used to reflect the phenomenon of screen distortion and black screen in the received video. The more video frames lost at the receiving end, the longer the screen freeze time, and the smaller the data transmission quality evaluation index. At the same time, the data transmission quality influencing factors corresponding to the video clarity evaluation value and the video fluency evaluation value are introduced to improve the accuracy of the transmission quality evaluation.
[0093] It should be understood that the data transmission quality evaluation index can not only be obtained through the above calculation method, but also by using network monitoring tools to monitor the network status in real time, including bandwidth, delay, packet loss rate, etc., which directly affect the video transmission quality. You can also view the relevant data of video stream transmission through server logs, such as the number of user connections, transmission errors, number of playback interruptions, etc.
[0094] A data transmission quality assessment index threshold is obtained from a data transmission information library, and the data transmission quality assessment index of a specified network data transmission protocol is compared with the data transmission quality assessment index threshold. If the data transmission quality assessment index of the specified network data transmission protocol is lower than the data transmission quality assessment index threshold, a transmission result feedback warning is given.
[0095] Furthermore, the specific analysis and calculation process of the video clarity evaluation value and the video smoothness evaluation value is as follows: the specified network data transmission protocol is tested and compared with the traditional UDP transmission protocol under the same network environment, and the test video data is obtained for a set number of transmission tests, the number of key frames in the test video data and the number of transmission tests are extracted, and the number of key frames received by the receiving end is collected to obtain the number of key frames received by the receiving end of the traditional UDP transmission protocol and the number of key frames received by the receiving end of the specified network data transmission protocol under each transmission test.
[0096] Get the playback time of the test video, and also get the duration of the screen freeze when the receiving end of the traditional UDP transmission protocol receives the video data and the duration of the screen freeze when the receiving end of the specified network data transmission protocol receives the video data under each transmission test.
[0097] Calculate the video clarity evaluation value, the calculation expression is: Calculate the video smoothness evaluation value, the calculation expression is: In the formula, α 清 and α 流 Respectively represent the video clarity evaluation value and the video smoothness evaluation value, N 帧 Represents the number of key frames in the test video data, N 传 Indicates the number of transmission tests. and They represent the number of key frames received by the receiver of the traditional UDP transmission protocol and the number of key frames received by the receiver of the specified network data transmission protocol under the i-th transmission test, ψ represents the correction factor corresponding to the set video clarity, T 视 Indicates the playback time of the test video, T i U and T i P They respectively represent the freezing time when the receiving end of the traditional UDP transmission protocol receives the video data and the freezing time when the receiving end of the specified network data transmission protocol receives the video data under the i-th transmission test, ξ represents the correction factor corresponding to the set video smoothness, i represents the number of each transmission test, i=1,2,3,...,n, and n represents the total number of transmission test numbers.
[0098] It needs to be explained that the video clarity assessment value is a quantitative data obtained by analyzing key frames, and is used to evaluate the frame loss situation of video transmission. The more video frames received by the receiving end of the specified network data transmission protocol, the closer it is to the total number of video frames transmitted, which indicates that the video transmission of the specified network data transmission protocol is more reliable and the video clarity assessment value is larger. At the same time, a correction factor corresponding to the video clarity is introduced to avoid the impact of other factors on the evaluation result, thereby improving the accuracy of the evaluation result.
[0099] It should be understood that the video clarity evaluation value can be obtained not only through the above calculation method, but also through online tools that can analyze video files and provide information such as their resolution, frame rate, bit rate, etc., or by using standard test videos to evaluate the video processing capabilities of display devices or video players, thereby indirectly understanding the video clarity.
[0100] It needs to be explained that the video smoothness evaluation value is a quantitative data obtained by analyzing the video freezing time, which is used to reflect the freezing situation of the received video. The shorter the video freezing time received by the receiving end of the specified network data transmission protocol, the greater the video smoothness evaluation value. At the same time, a correction factor corresponding to the video smoothness is introduced to avoid the impact of other factors on the evaluation result, thereby improving the accuracy of the evaluation result.
[0101] It should be understood that the video smoothness evaluation value can be obtained not only through the above calculation method, but also through the API provided by the online video analysis service to analyze the video frame rate, jitter and other indicators and give a quantitative report. It can also be provided through professional video quality assessment tools. Quantitative scores of video quality can be provided. These scores can indirectly reflect the smoothness of the video.
[0102] In a specific embodiment, 500 frames of H.264 video data are transmitted in a poor wireless network environment, of which 20 frames are key frames, to check the reception of key frame data by the receiving end. A total of 20 tests were conducted. Under the same environment, the number of key frames received by the receiving end was mostly between 13 and 15 frames when using traditional UDP for transmission, with an average value of 14.5 frames; when using a specified network data transmission protocol for transmission, the number of key frames received by the receiving end was mostly between 19 and 20 frames, and most of them were 20 frames, with an average value of 19.85 frames.
[0103] In the same environment, observe the video fluency under two transmission protocols. The tested video file is 20 seconds in total. Under traditional UDP transmission, the average screen freeze time (black screen + flower screen) is 8.55 seconds. When using the specified network data transmission protocol, the average freeze time is 2.90 seconds.
[0104] It can be seen that the specified network data transmission protocol greatly guarantees the transmission of video key frames, significantly improves the freeze and screen distortion phenomena in wireless video transmission, and improves the QOS of the monitoring screen.
[0105] In a specific embodiment, a wireless local area network transmission method for real-time video monitoring can also be implemented from the perspective of security. Specifically, several monitoring time points are deployed to collect real-time video transmission data, which includes the video transmission rate, video resolution and video frame rate at each monitoring time point, and the reference video resolution and reference video frame rate of the real-time video transmission are obtained from the data transmission information library, and the real-time video transmission security evaluation index is comprehensively calculated. The specific calculation expression is: In the formula, γ represents the real-time video transmission security evaluation index, represents the video transmission rate at the rth monitoring time point, represents the video resolution at the rth monitoring time point, represents the video frame rate at the rth monitoring time point, Indicates the reference video resolution. Indicates the reference video frame rate, Indicates the set allowable deviation video resolution, represents the set allowable deviation video frame rate, τ1 represents the security assessment impact factor corresponding to the set video transmission rate, τ2 represents the security assessment impact factor corresponding to the set video resolution, τ3 represents the security assessment impact factor corresponding to the set video frame rate, r represents the number of each monitoring time point, r = 1, 2, 3, ..., h, h represents the total number of monitoring time points.
[0106] It should be understood that the real-time video transmission security assessment index is a quantitative data obtained by analyzing the fluctuations in the video transmission rate, video resolution and video frame rate of real-time video transmission. It is used to quantitatively assess the information security of real-time video transmission and provide a data basis for the control of real-time video transmission.
[0107] It should be understood that the real-time video transmission security assessment index can be obtained not only through the above calculation method, but also by regularly analyzing the log files of servers, network devices and applications to identify abnormal behaviors or security incidents and quantify the impact of these incidents on system security. It can also be evaluated through regular security audits to see whether the security control measures of the video transmission system are effectively implemented and whether they comply with security policies and standards.
[0108] Furthermore, the real-time video transmission security assessment index is compared with the real-time video transmission security assessment index threshold in the data transmission information library. If the real-time video transmission security assessment index is lower than the real-time video transmission security assessment index threshold, the transmission of the real-time video is terminated to avoid leakage of data information and ensure the security of video data.
[0109] Reference Figure 2As shown, the second aspect of the present invention provides a wireless local area network transmission system for real-time video monitoring, including: a registration module, a flow control module, a data packet identification module, a congestion control module, a transmission quality assessment module and a data transmission information library.
[0110] The data packet identification module, the congestion control module and the transmission quality assessment module are all connected to the data transmission information library.
[0111] The registration module is used to implement the registration of the client, establish a connection between the client and the server, and implement the sending and receiving of data.
[0112] The flow control module is used to implement flow control to avoid exceeding the processing speed of the receiving end.
[0113] The data packet identification module is used to identify the data packet and process the data packet according to the identification result.
[0114] The congestion control module is used to control the congestion window to avoid aggravating network congestion due to retransmission without a mechanism.
[0115] The transmission quality evaluation module is used to analyze the transmission result and calculate the data transmission quality evaluation index, and the data transmission quality evaluation index is used to evaluate the quality of data transmission under a specified network data transmission protocol.
[0116] The data transmission information base is used to store the data transmission quality evaluation index threshold, the approval sequence number of the receiving end and the packet loss rate threshold.
[0117] In a specific embodiment, by providing a wireless LAN transmission method and system for real-time video surveillance, a reliable PRUDP transmission protocol is designed, including real-time video sending and receiving functions, which ensures the reliable transmission of key frames, and a sliding window strategy is designed to perform flow control. A retransmission mechanism is reasonably designed to reduce the loss of key frames. At the same time, the protocol introduces a congestion control mechanism, which dynamically adjusts the video encoding bit rate and transmission bit rate for different network environments to ensure the smoothness of the monitoring screen.
[0118] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. A wireless local area network transmission method for real-time video monitoring, characterized in that: include: Set the specified network data transmission protocol; Perform transmission tests on the traditional UDP transmission protocol and the specified network data transmission protocol, collect the number of key frames received by the receiving end of the traditional UDP transmission protocol and the number of key frames received by the receiving end of the specified network data transmission protocol under each transmission test, calculate the video clarity evaluation value, and evaluate the video clarity of the specified network data transmission protocol based on the video clarity evaluation value; Collect the duration of video data freeze when the receiving end of the traditional UDP transmission protocol receives the video data and the duration of video data freeze when the receiving end of the specified network data transmission protocol receives the video data under each transmission test, calculate the video fluency evaluation value, and evaluate the video fluency of the specified network data transmission protocol based on the video fluency evaluation value; Obtaining evaluation results of video clarity and video fluency, analyzing the transmission results, and calculating a data transmission quality evaluation index, wherein the data transmission quality evaluation index is used to evaluate the quality of data transmission under a specified network data transmission protocol; Set the specified network data transmission protocol, including: Set up the PRUDP protocol based on the UDP protocol, including the real-time video sending and receiving function, classify the encoded H.264 video data frames during transmission, including key frames and non-key frames, and define the PRUDP protocol based on the UDP protocol as the specified network data transmission protocol; The specified network data transmission protocol includes client registration function, flow control function, data packet identification function, and congestion window control function; The client registration function is specifically implemented as follows: The client sends a registration application message to the server through the original port number, where the registration application message contains the IP and MAC address information of the current client. The server receives the registration application and registers it, and at the same time allocates a dedicated communication port number for the client; The server detects whether the client has been registered. If the client has been registered, a warning is given. If the client has not been registered, a child process is created to handle the client and the client's IP, MAC address and corresponding new port number information are stored in the client list. The flow control function is specifically implemented as follows: The specified network data transmission protocol adopts a sliding window strategy for flow control. The receiving end includes its own receiving window size in the ACK message it replies to the sending end. When the receiving window is 0, the sender sends a probe frame to actively inquire about the window size of the receiving end. The receiving end dynamically adjusts the sending rate of the sending end by controlling the window size. The specified network data transmission protocol introduces a video transmission cache negative feedback mechanism to control the network traffic transmission speed; The data packet identification function is specifically implemented as follows: The receiving end maintains an approval sequence number, a receiving buffer, and a retransmission queue. When the receiving end receives a data packet, it determines whether it is the expected packet based on the sequence number in the packet header. Collect the sequence number of the data packet sent by the sender, and obtain the approval sequence number of the receiving end from the data transmission information library. Determine whether the type of the data packet is a key frame based on the header sequence information in the data packet. If the data packet is a non-key frame, put the data packet directly into the corresponding position of the receiving buffer, and update the approval sequence number of the receiving end according to the calculation formula N=M+1, where M represents the sequence number of the data packet sent by the sender, and N represents the approval sequence number of the receiving end; If the data packet is a key frame, a subtraction operation is performed to obtain the data packet identification index, which is calculated as follows: Y = NM, In the formula, Y represents the packet identification index; If Y=0, it means that the data packet is an expected data packet and can be stored normally, and the approval sequence number of the receiving end is updated synchronously according to the calculation formula N=M+1; If Y<0, it means that the receiving end has not received the data packet, and the sending end needs to resend the data packet. At the same time, the retransmission queue records the data packet sequence number and feeds it back to the sending end, and updates the approval sequence number of the receiving end according to the calculation formula N=M-1, and the data packet is offset and stored at the same time; If Y>0, it means that the data packet is a retransmitted data packet or a received data packet, and the data packet sequence number is queried in the retransmission queue. If the data packet sequence number exists in the retransmission queue, the data packet is determined to be a retransmitted packet, and the data packet sequence number is deleted from the retransmission queue, and the data packet is stored in the corresponding position of the receiving buffer. On the contrary, if the data packet sequence number does not exist in the retransmission queue, the data packet is defined as a duplicate packet and is discarded. The congestion window control function is specifically implemented as follows: Get the number of data packets successfully received by the receiving end, collect the maximum and minimum data packet sequence numbers received by the receiving end within the set time period, and comprehensively calculate the packet loss rate of the receiving end within the set time period. The calculation expression is: Where P loss Indicates the packet loss rate of the receiving end within the set time period, C indicates the number of data packets successfully received by the receiving end, and SN max Indicates the maximum data packet sequence number received by the receiver within the set time period, SN min Indicates the minimum data packet sequence number received by the receiving end within the set time period; Obtain a packet loss rate threshold from a data transmission database, and compare the packet loss rate of the receiving end within a set time period with the packet loss rate threshold. If the packet loss rate of the receiving end is greater than the packet loss rate threshold, the network state is defined as a congestion state, and congestion control is performed; The receiving end needs to send back a packet loss rate feedback message in each time period to control traffic congestion, which also serves as a heartbeat keep-alive mark. If the sending end does not receive the packet loss rate feedback message within two time periods, it considers the connection inactive and issues a feedback warning. The data transmission quality evaluation index is calculated using the following formula: In the formula, β represents the data transmission quality evaluation index, α 清 and α 流 denote the video clarity evaluation value and the video smoothness evaluation value respectively, e denotes a natural constant, ζ1 and ζ2 denote the data transmission quality influencing factors corresponding to the set video clarity evaluation value and video smoothness evaluation value respectively; The specific analysis and calculation process of the video clarity evaluation value and the video fluency evaluation value is as follows: The specified network data transmission protocol is tested and compared with the traditional UDP transmission protocol under the same network environment, and the test video data is obtained for a set number of transmission tests, the number of key frames in the test video data and the number of transmission tests are extracted, and the number of key frames received by the receiving end is collected to obtain the number of key frames received by the receiving end of the traditional UDP transmission protocol and the number of key frames received by the receiving end of the specified network data transmission protocol under each transmission test; Calculate the video clarity evaluation value, the calculation expression is: In the formula, α 清 Indicates the video clarity evaluation value, N 帧 Represents the number of key frames in the test video data, N 传 Indicates the number of transmission tests. and They represent the number of key frames received by the receiving end of the traditional UDP transmission protocol and the number of key frames received by the receiving end of the specified network data transmission protocol under the i-th transmission test, ψ represents the correction factor corresponding to the set video clarity, i represents the number of each transmission test, i=1,2,3,...,n, n represents the total number of transmission test numbers; The specific analysis and calculation process of the video fluency evaluation value is as follows: Get the playback time of the test video, and at the same time get the screen freeze duration when the receiving end of the traditional UDP transmission protocol receives the video data and the screen freeze duration when the receiving end of the specified network data transmission protocol receives the video data under each transmission test; Calculate the video smoothness evaluation value, the calculation expression is: In the formula, α 流 Indicates the video smoothness evaluation value, T 视 Indicates the playback time of the test video, T i U and T i P They respectively represent the freezing time when the receiving end of the traditional UDP transmission protocol receives the video data and the freezing time when the receiving end of the specified network data transmission protocol receives the video data in the i-th transmission test, and ξ represents the correction factor corresponding to the set video smoothness.
2. A wireless local area network transmission system for real-time video monitoring, using the wireless local area network transmission method for real-time video monitoring as claimed in claim 1, characterized in that: include: The registration module is used to implement the registration of the client and establish a connection between the client and the server; A flow control module, used to implement flow control; The data packet identification module is used to identify the data packet and process the data packet according to the identification result; A congestion control module, used to control the congestion window; A transmission quality evaluation module, used to analyze the transmission results and calculate a data transmission quality evaluation index, wherein the data transmission quality evaluation index is used to evaluate the quality of data transmission under a specified network data transmission protocol; The data transmission information base is used to store the data transmission quality assessment index threshold, the approval sequence number of the receiving end, and the packet loss rate threshold.
