A method and system for monitoring data transmitted by a network protocol

By setting up a detection device in the network protocol transmission data, a counter and a timeout counter parsing the serial number field, directly determining whether the data is wrong, solving the problem of difficulty in accurately determining the location and type of error in the prior art, and achieving efficient and accurate data transmission error detection without increasing bandwidth consumption.

CN115622918BActive Publication Date: 2025-05-30HEFEI I TEK OPTOELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202211284643.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2025-05-30
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

The prior art is difficult to accurately determine the error position and type of data transmitted by network protocol cameras in complex customer application environments, and additional sequence information or anchor information is required to be inserted, resulting in bandwidth waste and deviations in actual transmission situations.

Method used

By setting up a detection device in the network protocol transmission data, counting and time recording data frames and network packets are used to use multiple counters and timeout counters to analyze the sequence number field and directly determine whether the data is wrong, without additional sequence information being inserted.

Benefits of technology

It realizes accurate detection of errors in network protocol transmission data without increasing bandwidth consumption, including lost and repeated network packets, and provides error location information, which improves customer on-site inspection and debugging efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115622918B_ABST
    Figure CN115622918B_ABST
Patent Text Reader

Abstract

A method and system for monitoring data transmitted by a network protocol. A detection card is provided before the data enters the host computer, and the same data detection steps are performed in the host computer and the detection card: counting the data frames and network packets to obtain a count value; parsing the data frame number and network packet number of each data to obtain a parsing value; recording the transmission time between adjacent network packets in each data frame; if the parsing value is the same as the count value and the transmission time between adjacent network packets does not exceed a preset timeout threshold, it is determined that the data transmission is error-free, and if the parsing value is different from the count value and / or the transmission time between adjacent network packets exceeds the preset timeout threshold, it is determined that the data transmission is in error; judging the type and location of the data error according to the error information in the detection device and the host computer. The present invention can automatically detect whether there is a data transmission error, judge the type of the data error, and provide the location of the data error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network protocol data transmission, and particularly to a method and system for monitoring network protocol data transmission. Background Art

[0002] With the rapid development of network technology, the transmission of network data is more efficient and fast. Among them, the data transmission method based on network protocol is widely used, such as being widely used in network protocol industrial cameras. When the application environment of the network protocol camera is relatively stable, image transmission without frame loss can be carried out stably. However, in complex customer application environments, due to different reasons such as the power supply, network card, and computer processing power used by customers, the network protocol camera will exhibit frame loss phenomena, affecting the customer experience.

[0003] Most of the existing frame loss detection technologies are detected on the server. For example, in the existing technical solution CN114528171A, frame loss is detected on the upper computer such as the server, and it is impossible to determine which link in the network transmission generates the frame loss and make improvements in complex network transmissions. In Patent CN104717491A and Patent CN111131878A, sequence information or anchor information needs to be inserted additionally, which will generate redundant information and cause waste of bandwidth, and is quite different from the actual transmission situation. Patent CN20071016069 is applied to frame loss detection in the base station, and the method used is not applicable to the complex frame structure of network protocols.

[0004] The purpose of the present invention is to restore the actual transmission situation as much as possible, detect the network protocol data transmission without inserting sequence information additionally, especially detect and record frame loss and receive duplicate frame detection in the network protocol camera transmission system, and provide error location information for troubleshooting and debugging at the customer site. Summary of the Invention

[0005] A method and system for monitoring network protocol data transmission proposed by the present invention can solve at least one of the above technical problems.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for monitoring network protocol data transmission, wherein the network protocol data transmission includes a plurality of data frames, each data frame includes a plurality of network packets, and the network packet contains the data frame number and network packet number of the current network packet. The method includes:

[0008] After the detection device set in front of the upper computer receives the network protocol data transmission, the following operations are performed:

[0009] S1. Count the data frames and network packets in the data transmitted by the network protocol to obtain the count value of each data frame and the count value of each network packet in the same data frame; parse the data frame number and network packet number in each network packet to obtain the parsed values of each data frame number and network packet number; record the transmission time between adjacent network packets in each data frame.

[0010] S2. If the parsed value is the same as the count value and the transmission time between the adjacent network packets does not exceed the preset timeout threshold, it is determined that the data transmission is error-free; if the parsed value is different from the count value and / or the transmission time between the adjacent network packets exceeds the preset timeout threshold, it is determined that the data transmission is in error.

[0011] The detection device sends the data transmitted by the network protocol to the host computer, and the same operations in steps S1 and S2 are performed in the host computer.

[0012] If it is determined that the data is in error at both the detection device and the host computer, it is finally determined that the data was in error before being passed to the detection device; if it is determined that the data is error-free at the detection device and in error at the host computer, it is finally determined that the data is in error at the host computer.

[0013] Further, the data transmitted by the network protocol is sent by a network protocol camera. In this case:

[0014] If it is determined that the data is in error at both the detection device and the host computer, it is finally determined that the data is in error at the camera; if it is determined that the data is error-free at the detection device and in error at the host computer, it is finally determined that the data is in error at the host computer.

[0015] Further, counting the data frames and network packets in the data transmitted by the network protocol includes:

[0016] Use a first counter to count the data frames in the data transmitted by the network protocol, and use a second counter to count the network packets in the data frames.

[0017] Further, the data transmission error includes network packet loss and receiving duplicate network packets. In the same data frame, when the count value of the network packets is less than the parsed value of the network packets, it is determined that a network packet is lost; in the same data frame, when the count value of the network packets is greater than the parsed value of the network packets, it is determined that a duplicate network packet is received.

[0018] On the other hand, the present invention also discloses a monitoring system for data transmitted by a network protocol. The data transmitted by the network protocol includes a plurality of data frames, and each data frame includes a plurality of network packets. The network packets contain the data frame number and network packet number of the current network packet. The monitoring system includes:

[0019] Detection card: It is used to perform the operations described in the aforementioned steps S1 and S2 after receiving the data transmitted by the network protocol, and transmit the data transmitted by the network protocol to the host computer;

[0020] Host computer: After receiving the data transmitted by the network protocol sent by the detection card, perform the operations described in the aforementioned steps S1 and S2;

[0021] Summarization module: Located in the host computer, it is used to collect the judgment results of the detection card and the host computer on the data transmitted by the network protocol, and make a comparison: If both the detection card and the host computer judge that the data is incorrect, it is finally judged that the data is incorrect before being transmitted to the detection card; If the detection card judges that the data is not incorrect and the host computer judges that the data is incorrect, it is finally judged that the data is incorrect at the host computer.

[0022] Furthermore, both the detection card and the host computer include:

[0023] A first counter for counting the data frames in the data transmitted by the network protocol; A second counter for counting the network packets in the data frame; A timeout counter for recording the transmission time between adjacent network packets in the data frame;

[0024] A judgment module for comparing the counted value and the parsed value. If the parsed value is the same as the counted value and the transmission time between the adjacent network packets does not exceed the preset timeout threshold, it is judged that the data transmission is not incorrect. If the parsed value is different from the counted value and / or the transmission time between the adjacent network packets exceeds the preset timeout threshold, it is judged that the data transmission is incorrect;

[0025] Furthermore, when the judgment module judges that the data transmission is incorrect, it further includes:

[0026] In the same data frame, when the counted value of the network packet is less than the parsed value of the network packet, it is judged that a network packet is lost; In the same data frame, when the counted value of the network packet is greater than the parsed value of the network packet, it is judged that a duplicate network packet is received.

[0027] Furthermore, the monitoring system further includes:

[0028] A network protocol camera, which is connected to the detection card and is used to send image data based on the network protocol to the detection card;

[0029] When the summarization module judges that the data is incorrect before being transmitted to the detection card, it is judged that the data is incorrect at the camera by the summarization module.

[0030] The advantages of the present invention are as follows:

[0031] 1. The present invention does not require additional insertion of frame numbers or anchor information, nor does it waste bandwidth to retain redundant sequence information. By parsing the network transmission protocol, it is possible to directly determine whether data is in error based on the sequence number field in the network packet.

[0032] 2. The present invention uses multiple counters for the network packet sequence, which can handle image frames and network packet structures in complex network protocols.

[0033] 3. Applied to the monitoring of network protocol transmission data of network protocol cameras, the present invention is provided with detection devices both at the data generation device and the host computer, which can automatically monitor the transmitted image data, obtain various reasons and locations for data errors, with high accuracy and strong reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is a flowchart of the method for detecting network protocol transmission data of the present invention;

[0035] Figure 2 is a schematic diagram of the system for detecting network protocol transmission data of the present invention;

[0036] Figure 3 is a schematic diagram of the data assembly method of the GigE Vision protocol of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention.

[0038] This embodiment discloses a method and a system for monitoring network protocol transmission data of a network protocol camera; it can be used to determine the reasons and locations of data errors in network protocol transmission.

[0039] The method for monitoring network protocol transmission data of the network protocol camera in this embodiment uses a network protocol camera that transmits data based on the GigE Vision protocol and complies with the data assembly method in this protocol. As Figure 3 shown, the attribute information segment in the network packet contains the image frame number and the network packet number.

[0040] The main steps of the method for monitoring network protocol transmission data of the network protocol camera in this embodiment are as Figure 1 shown, and are:

[0041] Obtain the sensor image, and form a network packet queue for image transmission according to the image frame number and network packet number of the GigE Vision protocol.

[0042] The detection device is set between the network protocol camera and the host computer, and the data first passes through the detection device.

[0043] The detection device counts the data frames in the data and the network packets in the data frames to obtain the count value of each data frame and the count value of each network packet in the same data frame; parses the data frame number and network packet number in each network packet to obtain the parsed values of each data frame number and network packet number; records the transmission time between adjacent network packets in each data frame.

[0044] If the parsed value is the same as the count value and the transmission time between the adjacent network packets does not exceed the preset timeout threshold, the detection device determines that the data transmission is error-free. If the parsed value is different from the count value and / or the transmission time between the adjacent network packets exceeds the preset timeout threshold, the detection device determines that the data transmission is in error. This step does not add additional sending fields and flag information, providing a method to extract the sequence information in the transmission protocol from the camera sensor image frames and detect error conditions, reducing the consumption of transmission bandwidth by additional sequence numbers.

[0045] Among them, data transmission errors include network packet loss and receiving duplicate network packets. In the same data frame, when the count value of the network packet is less than the parsed value of the network packet, it is determined as network packet loss; in the same data frame, when the count value of the network packet is greater than the parsed value of the network packet, it is determined as receiving duplicate network packets.

[0046] The detection device sends the determined data error information to the host computer.

[0047] The data is transmitted to the host computer through the detection device, and the same detection and error judgment operations on the data are performed in the host computer as in the detection device.

[0048] The host computer judges the error position: If both the detection device and the host computer determine that the data is in error, it is finally determined that the data is in error before entering the detection device. If the detection device determines that the data is error-free and the host computer determines that the data is in error, it is finally determined that the data is in error at the host computer.

[0049] Among them, the host computer records the comparison results transmitted from the detection device and the host computer in the log, which can be used as a record of data transmission errors. The host computer contains a comparison module that compares the data error information in the detection device and the host computer one by one. If there are records in both the frame loss detection board and the host computer, it is determined that a data transmission error has occurred at the camera; if it only appears in the host computer, it is determined that there is a frame loss situation in the host computer.

[0050] The network protocol transmission data monitoring system for a network protocol camera in this embodiment includes the following modules:

[0051] A network protocol camera, which is connected to a detection card and is used to send image data based on the network protocol to the detection card.

[0052] Detection card: After receiving the data transmitted by the network protocol, it counts the data frames and network packets in the data to obtain the count values of each data frame number and each network packet number; parses the data frame number and network packet number in each network packet to obtain the parsed values of each data frame number and network packet number; records the transmission time between adjacent network packets in each data frame.

[0053] If the parsed value is the same as the count value and the transmission time between adjacent network packets does not exceed the preset timeout threshold, the detection card determines that the data transmission is error-free. If the parsed value is different from the count value and / or the transmission time between adjacent network packets exceeds the preset timeout threshold, the detection card determines that the data transmission is in error; the detection card sends the judgment result to the summary module. The detection card uses two detection methods: sequence number detection and timeout detection, and provides multiple counters to cope with complex network data packet framing structures.

[0054] Host computer: After receiving the network protocol transmission data sent by the detection card, it performs the same detection and error judgment operations on the data as those in the detection card; and sends the judgment result to the summary module.

[0055] Summary module: Located in the host computer, it is used to collect the judgment results of whether the network protocol transmission data is in error by the detection card and the host computer respectively, and compare them: if both the detection device and the host computer judge that the data is in error, it is finally determined that the data is in error before being transmitted to the detection card. If the detection device judges that the data is error-free and the host computer judges that the data is in error, it is finally determined that the data is in error at the host computer.

[0056] Furthermore, both the detection card and the host computer include a first counter, a second counter, a timeout counter, and a judgment module. The first counter is used to record the order of image frames, and the second counter is used to record the order of network packets inside the image frames. Every time the header packet of an image frame is received, the first counter is incremented, and the first counter is not incremented when the remaining network packets arrive. Every time the tail packet of an image frame is received, the second counter is cleared and incremented as the remaining network packets arrive. The judgment module parses the current network packet to obtain the current image frame number and network packet number, and compares them with the first counter and the second counter. In the same data frame, when the count value of the network packet is less than the parsed value of the network packet, it is judged that a network packet is lost; in the same data frame, when the count value of the network packet is greater than the parsed value of the network packet, it is judged that a duplicate network packet is received.

[0057] In addition, a timeout counter is used to determine the timeout image frames in the current image queue, and is used to record the transmission time between adjacent packets. If it is higher than the set timeout threshold, the current data frame is determined to have an error in data transmission. The preset timeout threshold is the maximum allowable image frame delay time preset based on the camera requirements and application scenarios. If it is exceeded, it is determined that an error has occurred in the data transmission.

[0058] In the prior art, when an industrial camera transmits image data to a host computer, once an error occurs in the data for various reasons, on the one hand, it is impossible to automatically determine whether the data is in error, on the other hand, it is difficult to determine the type of data error, and finally it is even more difficult to determine the location of the data error. In actual operation, data errors at the camera often occur because the camera generates data loss or sends duplicate data in a complex working environment. In this embodiment, it is the loss of data packets or the reception of duplicate data packets. The general shortcoming of data errors in the host computer lies in the CPU, usually due to the CPU not having enough time to process, resulting in packet loss. The present invention can automatically detect whether a data transmission error occurs by setting a detection card between the host computer and the camera. Through the design of the first counter and the second counter, it can also determine the type of data error. Finally, by performing the same data detection and judgment operations in the host computer and the detection card, it can provide the location of the data error, which greatly facilitates the operation of installers or maintenance personnel in the actual installation and testing of industrial cameras and improves work efficiency.

[0059] The detection and judgment of data by the detection card and the host computer specifically include the following steps:

[0060] S1. Obtain data; the received data includes a frame header and a data payload.

[0061] S2. The detection card parses and judges the frame header of the received data for the image frame number and the network packet number, and stores the data to be received in the network packet queue according to the frame number and the network packet number to obtain an updated network packet queue.

[0062] S3. In the updated network packet queue of the detection card, every time the first packet of an image frame is received, the first counter performs an increment operation, and no operation is performed on the first counter when the other network packets arrive. Every time the last packet of an image frame is received, the second counter is cleared and increments as the other network packets arrive;

[0063] The timeout counter is used to determine the timeout image frames in the current image queue and is used to record the transmission time between adjacent packets.

[0064] S4. The detection card judges whether there is a data error according to the counting of the counter and the timeout timer, and then updates the first counter and the second counter according to the rules:

[0065] If the image frame number of the currently received network packet is the same as the value of the first counter; and the network packet number is not equal to the value of the second counter, it is determined that a data transmission error has occurred. Specifically, when the network packet number is greater than the value of the second counter, it is determined that a duplicate network packet has been received; when the network packet number is less than the value of the second counter, it is determined that a network packet has been lost;

[0066] The transmission time between adjacent packets recorded by the timeout counter, if it is higher than the set timeout threshold, the current data frame is determined to have a data transmission error; if it does not exceed the set timeout threshold, the current data frame is determined to have no data transmission error.

[0067] S5. The detection card sends the judgment result to the host computer, and at the same time updates the values in the first counter and the second counter to the latest values in the network packet queue. Then it starts waiting for the next received network packet sequence.

[0068] S6. The host computer obtains the current image data network packet sequence:

[0069] Specifically, the host computer can use a thread A to decode the current image data according to the network protocol, and write it into the received image frame queue in sequence according to the sequence number in the network packet; and remove the successfully sent image frames from the image frame queue.

[0070] S7. Determine the data error situation in the current image frame queue:

[0071] Specifically, an error judgment module is provided in the host computer. The error judgment module has the same first counter, second counter, and timeout counter as in step S4; and uses a thread B to perform the same data error judgment as the detection card in step S5.

[0072] S8. The host computer summarizes the current frame loss situation and judges the data error location:

[0073] Specifically, the host computer can use a thread C to receive the data error information in steps S4 and S7. If both the detection card and the host computer judge that there is a data error, it is finally determined that the data is in error at the camera. If the detection card judges that there is no data error and the host computer judges that there is a data error, it is finally determined that the data is in error at the host computer; record the data error time, error type, and error location in the log respectively.

[0074] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0075] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for monitoring data transmitted by a network protocol, characterized in that, the data transmitted by the network protocol includes a number of data frames, and each data frame includes a number of network packets. The network packet contains the data frame number and the network packet number of the current network packet. The method includes: After the detection device placed in front of the upper computer receives the data transmitted by the network protocol, it performs the following operations: S1. Count the data frames and the network packets in the data frames in the data transmitted by the network protocol to obtain the count value of each data frame and the count value of each network packet in the same data frame; parse the data frame number and the network packet number in each network packet to obtain the parsed values of each data frame number and each network packet number; record the transmission time between adjacent network packets in each data frame; S2. If the parsed value is the same as the count value and the transmission time between the adjacent network packets does not exceed the preset timeout threshold, it is determined that the data transmission is error-free. If the parsed value is different from the count value and / or the transmission time between the adjacent network packets exceeds the preset timeout threshold, it is determined that the data transmission is in error; The detection device sends the data transmitted by the network protocol to the upper computer, and the same operations in step S1 and step S2 are performed in the upper computer; If it is determined that the data is in error at both the detection device and the upper computer, it is finally determined that the data is in error before entering the detection device. If it is determined that the data is error-free at the detection device and the data is determined to be in error at the upper computer, it is finally determined that the data is in error at the upper computer; Among them, counting the data frames and the network packets in the data transmitted by the network protocol includes: using a first counter to count the data frames in the data transmitted by the network protocol, and using a second counter to count the network packets in the data frames.

2. The method for monitoring data transmitted by a network protocol according to claim 1, characterized in that, the data transmitted by the network protocol is sent by a network protocol camera. At this time: If it is determined that the data is in error at both the detection device and the upper computer, it is finally determined that the data is in error at the camera. If it is determined that the data is error-free at the detection device and the data is determined to be in error at the upper computer, it is finally determined that the data is in error at the upper computer.

3. The method for monitoring data transmitted by a network protocol according to claim 1, characterized in that, the data transmission error includes network packet loss and receiving duplicate network packets. In the same data frame, when the count value of the network packet is less than the parsed value of the network packet, it is determined that a network packet is lost; In the same data frame, when the count value of the network packet is greater than the parsed value of the network packet, it is determined that a duplicate network packet is received.

4. A network protocol data transmission monitoring system for implementing the network protocol data transmission monitoring method according to claim 1, characterized in that, the data transmitted by the network protocol includes a number of data frames, and each data frame includes a number of network packets. The network packet contains the data frame number and the network packet number of the current network packet. The monitoring system includes: Detection card: used to perform the operations described in step S1 and step S2 after receiving the data transmitted by the network protocol, and transmit the data transmitted by the network protocol to the upper computer; Host computer: After receiving the network protocol transmission data sent by the detection card, perform the operations described in step S1 and step S2; Summarization module: Located in the host computer, it is used to collect the judgment results of the detection card and the host computer on the network protocol transmission data and compare them: If both the detection card and the host computer judge that the data is incorrect, it is finally judged that the data is incorrect before being transmitted to the detection card; If the detection card judges that the data is not incorrect and the host computer judges that the data is incorrect, it is finally judged that the data is incorrect at the host computer.

5. The network protocol transmission data monitoring system according to claim 4, wherein, both the detection card and the host computer include: A first counter for counting data frames in the network protocol transmission data; a second counter for counting network packets in the data frame; a timeout counter for recording the transmission time between adjacent network packets in the data frame; A judgment module for comparing the counted value and the parsed value. If the parsed value is the same as the counted value and the transmission time between the adjacent network packets does not exceed a preset timeout threshold, it is judged that the data transmission is not incorrect. If the parsed value is different from the counted value and / or the transmission time between the adjacent network packets exceeds the preset timeout threshold, it is judged that the data transmission is incorrect.

6. The network protocol transmission data monitoring system according to claim 5, wherein, when the judgment module judges that the data transmission is incorrect, it further includes: In the same data frame, when the counted value of the network packet is less than the parsed value of the network packet, it is judged that a network packet is lost; in the same data frame, when the counted value of the network packet is greater than the parsed value of the network packet, it is judged that a duplicate network packet is received.

7. The network protocol transmission data monitoring system according to claim 5, wherein, the monitoring system further includes: A network protocol camera, which is connected to the detection card and is used to send image data based on the network protocol to the detection card; The summarization module judges that the data is incorrect before being transmitted to the detection card as the summarization module judges that the data is incorrect at the camera.

Citation Information

Patent Citations

  • Video frame number detecting system

    CN104717491A

  • Video preprocessing and frame loss detection method and device, electronic equipment and storage medium

    CN111131878A

  • Frame loss judgment method and device, storage server and readable storage medium

    CN114528171A

  • Radar data fan number accounting and monitoring method

    CN101419280A

  • RTP packet loss detection method

    CN108683555A