Data traffic monitoring method, computer equipment and program product
By crawling the connection data packets during the TCP connection process, determining the target handshake packets and ending packets, and using their serial number to count data traffic, the problem of vehicle and cloud data traffic statistics under IPA technology is solved, and accurate statistics are achieved in the TCAM domain.
Patent Information
- Application Number
- CN202411580305.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-14
AI Technical Summary
When using Internet Protocol packet accelerator (IPA) technology to interact with the vehicle and the cloud, it is impossible to count the data traffic between the vehicle and the cloud in the telematics and connection antenna module (TCAM) domain.
By grabbing the connection packets transmitted by the vehicle end and the cloud during each transmission control protocol (TCP) connection, the target handshake packet and the target end packet are determined, and the start and end sequence numbers of the data packets are determined by using the sequence numbers of these packets, so as to Accurately determine the data traffic between the vehicle and the cloud within the TCAM domain.
It realizes that when using IPA technology, it can still accurately count the data traffic between the vehicle and the cloud in the TCAM domain, solving the problem of data traffic statistics.
Smart Images

Figure CN119449645A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of vehicle engineering technology, and in particular to a data flow monitoring method, a computer device, and a program product. Background Art
[0002] As vehicles move toward intelligence and automation, they need to frequently interact with the cloud. In order to improve the data throughput during data interaction, Internet Protocol Packet Accelerator (IP Packet Accelerator, IPA) technology is gradually being used to send and receive data.
[0003] However, when using IPA technology, a large number of data packets transmitted between the vehicle and the cloud will not pass through the core of the Telematics & Connectivity Antenna Module (TCAM) domain, making it impossible to count the data traffic between the vehicle and the cloud in the TCAM domain. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a data flow monitoring method, a computer device, and a program product.
[0005] In a first aspect, an embodiment of the present disclosure provides a data flow monitoring method, including:
[0006] When the vehicle side and the cloud side use an Internet Protocol packet accelerator IPA to transmit data packets, capture the connection data packets transmitted by the vehicle side and the cloud side during each transmission control protocol TCP connection process;
[0007] For each TCP connection process, a target handshake packet and a target end packet are determined from the connection data packet; the target end packet includes a target wave packet or a target reset packet;
[0008] Using the target handshake packet to obtain a data packet start sequence number, and using the target end packet to obtain a data packet end sequence number;
[0009] The data flow between the vehicle end and the cloud end during the TCP connection process is determined according to the data packet start sequence number and the data packet end sequence number.
[0010] In this implementation mode, the connection data packet at least includes the handshake packet and the wave packet corresponding to the TCP connection between the vehicle end and the cloud, so by capturing the connection data packet during the TCP connection, the target handshake packet and the target end packet corresponding to each TCP connection can be determined in the TCAM domain. Since a TCP connection between the vehicle end and the cloud can realize the transmission of multiple other data packets between the two ends except the target handshake packet and the target end packet, and the sequence numbers of each transmitted data packet are sequentially changed, the start sequence number and the end sequence number of each data packet transmitted by a TCP connection (i.e., the data packet start sequence number and the data packet end sequence number) can be determined by the target handshake packet and the target end packet. Furthermore, using the data packet start sequence number and the data packet end sequence number, the data flow corresponding to a TCP connection can be accurately determined in the TCAM domain. Using the data flow corresponding to each TCP connection, the total data flow between the vehicle and the cloud can be accurately determined.
[0011] In a possible implementation manner, the data packet start sequence number includes a first sequence number and a first confirmation sequence number of a connection data packet transmitted between the vehicle end and the cloud end; the data packet end sequence number includes a second sequence number and a second confirmation sequence number of a connection data packet transmitted between the vehicle end and the cloud end;
[0012] Determining the data flow between the vehicle end and the cloud end during the TCP connection process according to the data packet start sequence number and the data packet end sequence number includes:
[0013] Determining the initial sending flow of the vehicle end according to the second confirmation sequence number and the first confirmation sequence number;
[0014] Determining the initial receiving flow of the vehicle end according to the second sequence number and the first sequence number;
[0015] The data flow between the vehicle end and the cloud end during the TCP connection process is determined according to the initial sending flow and the initial receiving flow.
[0016] In this implementation, the sequence number and confirmation sequence number in the data packet can represent the number of data packets received and sent by the vehicle, so the first sequence number, the first confirmation sequence number, the second sequence number, and the second confirmation sequence number can be used to accurately determine the sending flow and receiving flow of the vehicle. The sending flow and receiving flow can be used to accurately determine the total data flow between the vehicle and the cloud.
[0017] In a possible implementation, determining the data flow between the vehicle end and the cloud in the TCP connection process according to the initial sending flow and the initial receiving flow includes:
[0018] Determine the target sending flow of the vehicle end according to the maximum message length corresponding to the TCP connection between the vehicle end and the cloud end, the initial receiving flow, the initial sending flow, and the data length of each handshake packet and each wave packet actively sent by the vehicle end to the cloud end in the connection data packet;
[0019] Determine the target receiving flow of the vehicle end according to the maximum message length, the initial sending flow, the initial receiving flow, the data length of the target handshake packet, and the data length of each handshake packet actively sent by the cloud to the vehicle in the connection data packet;
[0020] The data flow between the vehicle end and the cloud end during the TCP connection process is determined according to the target sending flow and the target receiving flow.
[0021] In this implementation, the calculated initial vehicle-side sending flow is adjusted by using the data length of the handshake packet and the wave packet sent by the vehicle-side, so that a more accurate and reasonable target sending flow can be calculated; the calculated initial vehicle-side receiving flow is adjusted by using the data length of the wave packet sent by the cloud and the data length of the target handshake packet, so that a more accurate and reasonable target receiving flow can be calculated. Using the target sending flow and the target receiving flow, a more accurate and reasonable data flow can be calculated.
[0022] In a possible implementation manner, determining the initial sending flow of the vehicle end according to the second confirmation sequence number and the first confirmation sequence number includes:
[0023] If the second sequence number is greater than the first sequence number, determining the initial sending flow rate according to the difference between the second confirmation sequence number and the first confirmation sequence number; or,
[0024] If the second sequence number is less than or equal to the first sequence number, the initial sending flow is determined according to a difference between the second confirmation sequence number and the first confirmation sequence number and a target offset value.
[0025] In this implementation, since the sequence numbers of each data packet sent during the TCP connection process are sequential cyclic numbers, the influence of sequential cyclic numbers on the accuracy of data flow statistics can be reduced by comparing the size relationship between the first confirmation number and the second confirmation number and using the size relationship to determine the sending flow.
[0026] In a possible implementation manner, determining a target handshake packet from the connection data packet includes:
[0027] For any current data packet in the connection data packets, determining each data flag bit present in the current data packet;
[0028] In a case where each data flag bit in the current data packet includes at least one first preset flag bit, determining whether there is a stored data packet related to the current data packet in the data table according to the address information and port information of the current data packet;
[0029] If so, in a case where the data flags include the second preset flag, the stored data packet is replaced by the current data packet, and the current data packet is used as the target handshake packet.
[0030] In this implementation manner, since the data flag bits included in the handshake packet sent from the cloud to the vehicle are fixed, the target handshake packet can be accurately determined by using the data flag bits included in the current data packet.
[0031] In a possible implementation, the method further includes:
[0032] If there is no stored data packet related to the current data packet, then when each data flag bit in the current data packet includes a second preset flag bit, the current data packet is used as the target handshake packet and stored in the data table.
[0033] This implementation manner stores the target handshake packet in the data table, thereby facilitating subsequent determination of the unique target handshake packet corresponding to each TCP connection from the data table.
[0034] In a possible implementation manner, determining the target end packet from the connection data packet includes:
[0035] For any current data packet in the connection data packet, if there is a stored data packet related to the current data packet in the data table, and the data flags in the current data packet do not include the second preset flag, if the data flags include a reset flag, then the current data packet is used as the target reset packet; or,
[0036] For any current data packet in the connection data packet, if there is a stored data packet related to the current data packet in the data table, and the data flags in the current data packet do not include the second preset flag, if the data flags include an end flag, determine whether there is a target data packet in the captured connection data packet whose address information and port information are consistent with the current data packet and include the end flag; if so, use the current data packet as the target wave packet.
[0037] In this implementation, when two data packets including an end flag are captured consecutively or a data packet including a reset flag is captured, it indicates that a TCP connection is completed. At this time, the current data packet is used as the target end packet for data flow statistics, which can realize timely statistics of the data flow corresponding to a TCP connection.
[0038] In a possible implementation, determining the data flow between the vehicle end and the cloud in the TCP connection process according to the data packet start sequence number and the data packet end sequence number includes:
[0039] Determine, according to the connection data packet transmitted during the TCP connection process, a vehicle domain corresponding to the TCP connection process; the vehicle domain includes an intelligent cockpit domain, an intelligent driving domain, or a vehicle body domain;
[0040] According to the data packet start sequence number and the data packet end sequence number, the data flow between the vehicle domain of the vehicle end and the cloud during the TCP connection process is determined.
[0041] This implementation method can achieve separate statistics of data traffic corresponding to each vehicle domain by determining the TCP connection process corresponding to each vehicle domain.
[0042] In a second aspect, an optional implementation of the present disclosure further provides a computer device, a processor, and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0043] In a third aspect, an optional implementation of the present disclosure further provides a computer program product, which, when executed, executes the steps of the above-mentioned first aspect, or any possible implementation of the first aspect.
[0044] For a description of the effects of the above-mentioned computer equipment and computer program products, please refer to the description of the above-mentioned data flow monitoring method, which will not be repeated here.
[0045] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0047] Figure 1 A flow chart of a data flow monitoring method provided by an embodiment of the present disclosure is shown;
[0048] Figure 2 A schematic diagram showing a message format of a data message corresponding to a connection data packet provided by an embodiment of the present disclosure;
[0049] Figure 3 A schematic diagram showing a data format of a TCP message segment provided by an embodiment of the present disclosure;
[0050] Figure 4 A specific implementation flow chart of a data flow monitoring method provided by an embodiment of the present disclosure is shown;
[0051] Figure 5 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0053] In addition, the terms "first", "second", etc. in the description and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein.
[0054] The "multiple or several" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0055] Research has found that when data is exchanged between vehicles and clouds, if IPA technology is not used, each data packet transmitted between the vehicle and cloud will pass through the TCAM domain kernel for network address translation (NAT), routing, etc., so each data packet transmitted between the vehicle and cloud can be captured in the TCAM domain, and then the captured data packets can be used to accurately determine the data flow between vehicles. As an independent programmable protocol processing hardware module, IPA implements NAT, routing and other functions of Internet Protocol (IP) messages in hardware, so that most of the data processing can be separated from the CPU and is no longer limited to the performance of the CPU, thereby playing a role in improving throughput. Therefore, in order to improve the data throughput during data interaction and reduce the burden on the central processing unit (CPU), IPA technology has begun to be used to assist data interaction between vehicles and clouds. But at the same time, when data is exchanged between the car and the cloud, except for the handshake packets and handshake packets during the TCP connection, most of the other data packets transmitted through the TCP connection are often processed by IPA and no longer pass through the TCAM domain core. Therefore, it is impossible to obtain all the data packets transmitted between the car and the cloud, resulting in the inability to count the data traffic between the car and the cloud. Therefore, how to complete the data traffic statistics when using IPA technology for data exchange between the car and the cloud has become a technical issue worthy of attention.
[0056] Based on the above research, the present disclosure provides a data flow monitoring method, computer equipment and program product. Even if the IPA technology is used, the handshake packet and the wave packet during the TCP connection can still be captured. Therefore, by capturing the connection data packet that at least includes the handshake packet and the wave packet during the TCP connection, the target handshake packet and the target end packet corresponding to each TCP connection can be determined in the TCAM domain. Since a TCP connection between the vehicle end and the cloud end can realize the transmission of multiple other data packets except the target handshake packet and the target end packet between the two ends, and the sequence numbers of each transmitted data packet are sequentially changed, the start sequence number and the end sequence number of each data packet transmitted by a TCP connection can be determined by the target handshake packet and the target end packet (i.e., the data packet start sequence number and the data packet end sequence number). Furthermore, using the data packet start sequence number and the data packet end sequence number, the data flow corresponding to a TCP connection can be accurately determined in the TCAM domain. Using the data flow corresponding to each TCP connection, the total data flow between the vehicle and the cloud can be accurately determined.
[0057] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0058] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0059] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0060] It should be noted that the specific terms mentioned in the embodiments of the present disclosure include:
[0061] Telematics & Connectivity Antenna Module: TCAM, also known as the Internet connection module; by integrating multiple communication technologies, it enables the vehicle to exchange real-time data with the outside world;
[0062] eBPF: Extended Berkeley Packet Filter. Generally speaking, to add new functions to the TCAM domain kernel, you need to modify the kernel source code or write kernel modules to implement it. However, eBPF allows programs to run without modifying the kernel source code or adding additional kernel modules.
[0063] eBPF with BPF_PROG_TYPE_SOCKET_FILTER: A specific type of eBPF that can capture detailed data passing through the network card. For example, it can capture data packets transmitted between the car and the cloud.
[0064] TCP: The full name is Transmission Control Protocol, which is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
[0065] To facilitate understanding of this embodiment, a data flow monitoring method disclosed in an embodiment of the present disclosure is first introduced in detail. The executor of the data flow monitoring method provided in the embodiment of the present disclosure is generally a terminal device or other processing device with certain computing capabilities, wherein the terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a personal digital assistant (PDA), a handheld device, a computer device, a vehicle, a server, etc.; in some possible implementations, the data flow monitoring method may be implemented by a processor calling computer-readable instructions stored in a memory.
[0066] The data flow monitoring method provided by the embodiment of the present disclosure is described below by taking a computer device as an example of an execution subject.
[0067] like Figure 1 As shown, it is a flow chart of a data flow monitoring method provided by an embodiment of the present disclosure, which may include the following steps:
[0068] S101: When the vehicle side and the cloud side use the Internet Protocol packet accelerator IPA to transmit data packets, capture the connection data packets transmitted by the vehicle side and the cloud side during each transmission control protocol TCP connection process.
[0069] First, the data flow monitoring method provided by the embodiment of the present disclosure is applied to the scenario of data interaction between the vehicle side and the cloud side using the IPA technology, wherein the data interaction may specifically include the transmission of data packets between the vehicle side and the cloud side through data messages. The data in the data packet sent by the vehicle side to the cloud side may be any data from the vehicle, such as vehicle operation data and vehicle status data. When the IPA technology is used, the intermediate data packets transmitted by the vehicle side and the cloud side using the TCP connection do not pass through the TCAM domain core, so it is impossible to use the intermediate data packets captured from the TCAM domain, and therefore it is impossible to use the captured data packets to perform data flow statistics. Since the eBPF of BPF_PROG_TYPE_SOCKET_FILTER can be used, the handshake packets and wave packets transmitted by the vehicle side and the cloud side when using the TCP connection for data interaction can be captured, so the embodiment of the present disclosure proposes a method for using handshake packets and wave packets to perform data flow statistics.
[0070] It is understandable that in a complete TCP connection process, there may be three handshakes and four handshakes between the vehicle and the cloud, that is, there may be three handshake packets and four handshake packets. The above connection data packet may at least include the handshake packet and the handshake packet in the TCP connection process.
[0071] In specific implementation, when using IPA technology for data exchange between the vehicle and the cloud, eBPF of BPF_PROG_TYPE_SOCKET_FILTER can be used to capture each connection data packet corresponding to each TCP connection between the vehicle and the cloud. Among them, under normal circumstances, the connection data packet can include at least three handshake packets and four wave packets. In some special cases, such as when the TCP connection between the vehicle and the cloud is abnormal or erroneous, the connection data packet may include one or more handshake packets, wave packets, reset packets, etc.
[0072] For example, in the process of establishing a TCP connection between the vehicle and the cloud and using the TCP connection for data exchange, you can use eBPF of BPF_PROG_TYPE_SOCKET_FILTER to capture each handshake packet and each wave packet that appears during the TCP connection.
[0073] The connection data packet is transmitted in the form of a data message. The message format of the data message corresponding to the connection data packet can be as follows Figure 2As shown in the figure, it includes the Internet Protocol (IP) header, TCP header and TCP data, where the TCP header and TCP data constitute a TCP segment. The data length of the IP header is 20 bytes, and the data length of the TCP header is 20 bytes. The IP header is used to indicate the source IP address and destination IP address corresponding to the connection data packet, and the TCP data is used to indicate the specific transmission data in the connection data packet. The data format of the TCP segment is as follows: Figure 3 As shown. Figure 3 In the case of excluding options, the length of the TCP header is usually 20 bytes, which may include a 16-bit source port number, a 16-bit destination port number, a 32-bit sequence number, a 32-bit acknowledgment number, a 4-bit header length, a reserved 6-bit, six flag bits, a 16-bit window size, a 16-bit checksum, and a 16-bit urgent pointer. Options are used to indicate optional fields for this data transmission, such as the maximum segment size (MSS). Figure 3 The data in is TCP data. The source port number is used to indicate the port number of the sender's application, the destination port number is used to indicate the port number of the receiver's application, the sequence number is used to indicate the sequence number of the byte stream sent by the sender, and the confirmation number is used to indicate the sequence number of the next byte that the receiver expects to receive, as well as to confirm the data that has been successfully received.
[0074] Six flags are used to control and manage the status and operation of TCP connections, including Figure 3SYN, ACK, FIN, RST, PSH and URG in it. Among them, SYN (Synchronize) is used to establish a connection. When the vehicle end wants to establish a connection with the cloud, it will set the SYN flag to 1 and send a data packet with the SYN flag. ACK (Acknowledgment) is used to confirm the receipt of data. When a TCP data packet carries the ACK flag, it means that the receiver has successfully received the previous data packet and sent a confirmation response. FIN (Finish) is used to close the connection. When one party of a TCP connection wants to close the connection, it will set the FIN flag to 1 and send a data packet with the FIN flag. RST (Reset) is used to reset the connection. When an error or exception occurs in a TCP connection, a data packet with the RST flag can be sent to reset the connection and interrupt communication. PSH (Push) is used to transmit data immediately. When a TCP data packet carries the PSH flag, it means that the sender wants to transmit data to the receiver immediately without caching or waiting for other data. URG (Urgent) is used to indicate urgent data. When a TCP data packet carries the URG flag, it means that it contains urgent data and needs to be processed first. During the TCP connection process, different connection data packets include different valid flags. For example, in a TCP connection, the handshake packet corresponding to the first handshake may include a SYN flag, the handshake packet corresponding to the second handshake may include a SYN flag and an ACK flag, and the handshake packet corresponding to the third handshake may include an ACK flag. The wave packet corresponding to the first wave may include a FIN and ACK flag, the wave packet corresponding to the second wave may include an ACK flag, the wave packet corresponding to the third wave may include a FIN and ACK flag, and the wave packet corresponding to the fourth wave may include an ACK flag.
[0075] S102: For each TCP connection process, determine a target handshake packet and a target end packet from the connection data packet; the target end packet includes a target wave packet or a target reset packet.
[0076] Here, the target handshake packet may be the second handshake packet corresponding to the TCP connection between the vehicle end and the cloud end. Among them, the three handshake packets of the TCP connection may include handshake packets corresponding to the three handshakes from the vehicle end to the cloud end. Here, the first handshake may be a handshake packet sent from the vehicle end to the cloud end (defined as the first handshake packet), and the data packet carries a SYN flag; the second handshake may be a handshake packet sent from the cloud end to the vehicle end (defined as the second handshake packet), and the data packet carries a SYN flag and an ACK flag; the third handshake may be a handshake packet sent from the vehicle end to the cloud end (defined as the third handshake packet), and the data packet carries an ACK flag.
[0077] The target end packet is a data packet used to indicate the end of the TCP connection, which data packet can be a target wave packet or a target reset packet. The target wave packet can be the third wave packet corresponding to the TCP connection between the vehicle end and the cloud. Here, the four wave packets of the TCP connection may include wave packets corresponding to the four handshakes between the vehicle end and the cloud end. Here, the first wave can be a wave packet sent by the vehicle end to the cloud end (defined as the first wave packet), and the data packet carries the FIN and ACK flags; the second wave can be a handshake packet sent by the cloud end to the vehicle end (defined as the second handshake packet), and the data packet carries the SYN flag and the ACK flag; the third wave can include the cloud end sending a handshake packet to the vehicle end (defined as the third handshake packet), and the data packet carries the ACK flag; the fourth wave can include the vehicle end sending a wave packet to the cloud end (defined as the fourth handshake packet), and the data packet carries the ACK flag.
[0078] The target reset packet can be a data packet containing the RST flag corresponding to the TCP connection between the vehicle and the cloud. This data packet can be actively sent from the vehicle to the cloud or from the cloud to the vehicle when there is an abnormality or problem with the TCP connection.
[0079] In specific implementation, for each TCP connection between the vehicle and the cloud, the target handshake packet and target end packet corresponding to the connection can be determined based on the flag bits in each connection data packet captured in the connection.
[0080] It is understandable that for each TCP connection, the data packets in the TCP connection process are sent sequentially, so the connection data packets corresponding to the TCP connection can be captured sequentially, and for each connection data packet, after the connection data packet is captured, it can be determined whether the connection data packet is a target handshake packet or a target end packet based on the data flag in the connection data packet. Moreover, when it is determined that a captured connection data packet is a target end packet, it can also be determined that the TCP connection corresponding to the connection data packet is ended.
[0081] S103: using the target handshake packet to obtain the data packet start sequence number, and using the target end packet to obtain the data packet end sequence number.
[0082] Here, the data packet start sequence number is used to represent the start sequence number of the data packet transmitted corresponding to a TCP connection (that is, the sequence number of the first data packet corresponding to the TCP connection), and the data packet end sequence number is used to represent the end sequence number of the data packet transmitted corresponding to the TCP connection (that is, the sequence number of the last data packet corresponding to the TCP connection).
[0083] In specific implementation, since the target handshake packet is the second handshake packet in a TCP connection process between the vehicle and the cloud, and the second handshake packet includes a 32-bit sequence number and a 32-bit confirmation number, the 32-bit sequence number and 32-bit confirmation number included in the target handshake packet can be used as the starting sequence number of the data packet.
[0084] Since the target end packet can be a target wave packet or a target end packet, it is necessary to determine the end sequence number of the data packet according to different situations. Specifically, in the case where the target end packet is a target wave packet, since the target wave packet is the third handshake packet in a TCP connection process between the vehicle end and the cloud end, and the third handshake packet includes a 32-bit sequence number and a 32-bit confirmation sequence number, the 32-bit sequence number and the 32-bit confirmation sequence number included in the target wave packet can be used as the end sequence number of the data packet. In the case where the target end packet is a target reset packet, the target reset packet may only include a 32-bit sequence number, but not a 32-bit confirmation sequence number, so the confirmation sequence number in the target connection data packet that was most recently captured before the target reset packet and includes a 32-bit confirmation sequence number, as well as the 32-bit sequence number included in the target reset packet, can be used to determine the end sequence number of the data packet.
[0085] S104: Determine the data flow between the vehicle and the cloud during the TCP connection process according to the data packet start sequence number and the data packet end sequence number.
[0086] In specific implementation, for any TCP connection, the data flow in the TCP connection process can be determined according to the sequence number difference between the end sequence number of the data packet corresponding to the TCP connection process and the start sequence number of the data packet.
[0087] In this way, by capturing the connection data packets including at least the handshake packet and the wave packet during the TCP connection, the target handshake packet and the target end packet corresponding to each TCP connection can be determined in the TCAM domain. Since a TCP connection between the vehicle end and the cloud can realize the transmission of multiple other data packets between the two ends except the target handshake packet and the target end packet, and the sequence numbers of each transmitted data packet are sequentially changed, the start sequence number and the end sequence number of each data packet transmitted by a TCP connection can be determined by the target handshake packet and the target end packet (that is, the data packet start sequence number and the data packet end sequence number). Furthermore, using the data packet start sequence number and the data packet end sequence number, the data flow corresponding to a TCP connection can be accurately determined in the TCAM domain. Using the data flow corresponding to each TCP connection, the total data flow between the vehicle and the cloud can be accurately determined.
[0088] Optionally, the data flow calculated when the target end packet is a target reset packet is less accurate than the data flow calculated when the target end packet is a target wave packet. Therefore, after the data flow is calculated using the target end packet, the data flow can also be marked according to the type of target end packet used to remind the data recipient of the source of the data flow and verify the accuracy of the data flow. For example, when the target end packet is a target reset packet, it can be marked that the data flow comes from the reset packet; when the target end packet is a target wave packet, it can be marked that the data flow comes from the wave packet. Alternatively, when the target end packet is a target reset packet, the calculated data flow can be ignored to ensure the accuracy of the data flow uploaded to the data recipient.
[0089] In one embodiment, the data packet start sequence number includes the first sequence number and the first confirmation sequence number of the connection data packet transmitted between the vehicle end and the cloud end; the data packet end sequence number includes the second sequence number and the second confirmation sequence number of the connection data packet transmitted between the vehicle end and the cloud end.
[0090] Here, the first sequence number and the first confirmation sequence number can specifically be the sequence number and confirmation sequence number in the target handshake packet. The first sequence number is used to represent the sequence number of the first connection data packet sent by the cloud during a TCP connection process, and the first confirmation sequence number is used to represent the sequence number of the next connection data packet that the cloud expects to receive.
[0091] The second sequence number and the second confirmation sequence number may be the sequence number and confirmation sequence number in the target wave packet, or may be the sequence number in the target reset packet and the confirmation sequence number in the target connection data packet. The second sequence number is used to represent the sequence number of the connection data packet sent by the cloud when actively waving to the vehicle for the second time during a TCP connection process, and the second confirmation sequence number is used to represent the sequence number of the next connection data packet that the cloud expects to receive.
[0092] In one embodiment, the above S104 may be implemented according to the following steps:
[0093] S104-1: Determine the initial sending flow of the vehicle end according to the second confirmation number and the first confirmation number.
[0094] Here, the data flow between the vehicle and the cloud during a TCP connection process may include the vehicle sending flow, the vehicle receiving flow, the cloud sending flow, and the cloud receiving flow, wherein the vehicle sending flow is equal to the cloud receiving flow, and the vehicle receiving flow is equal to the cloud sending flow. The vehicle sending flow can be understood as the vehicle sending application layer flow, and the vehicle receiving flow can be understood as the client receiving application layer flow.
[0095] The initial sending traffic can be the estimated vehicle-side sending traffic, which can also be equal to the initial cloud receiving traffic of the cloud. The initial cloud receiving traffic is the estimated cloud receiving traffic.
[0096] During specific implementation, the difference between the second confirmation number and the first confirmation number can be used as the initial sending traffic of the vehicle end.
[0097] S104-2: Determine the initial receiving flow at the vehicle end according to the second sequence number and the first sequence number.
[0098] Here, the initial receiving traffic may be the estimated vehicle-side receiving traffic, which may also be equal to the initial cloud sending traffic of the cloud, and the initial cloud sending traffic is the estimated cloud sending traffic.
[0099] In specific implementation, the difference between the second sequence number and the first sequence number can be used as the initial receiving flow at the vehicle end.
[0100] S104-3: Determine the data flow between the vehicle and the cloud during the TCP connection process based on the initial sending flow and the initial receiving flow.
[0101] In specific implementation, the sum of the initial sending flow and the initial receiving flow of the vehicle side can be used as the data flow between the vehicle side and the cloud side during the TCP connection process. In addition, after obtaining the data flow during the TCP connection process, the sum of the data flow during each TCP connection process can be used as the total data flow between the vehicle side and the cloud side.
[0102] In one embodiment, S104-3 may be implemented according to the following steps:
[0103] S104-3-1: Determine the target sending flow of the vehicle side according to the maximum message length, initial receiving flow, initial sending flow, and the data length of each handshake packet and each wave packet actively sent by the vehicle side to the cloud side in the connection data packet corresponding to the TCP connection between the vehicle side and the cloud side.
[0104] Here, the maximum segment size (MSS) is an option of the TCP protocol, which is used when the sender and receiver negotiate the maximum data length that each segment can carry during communication when the TCP connection is established. When the vehicle and the cloud establish a TCP connection, the sender and receiver (i.e., the vehicle and the cloud) will calculate their respective MSSs based on the Maximum Transmission Unit (MTU), and then inform each other of their MSSs through a two-way handshake. For example, the vehicle actively informs the cloud of its MSS through two handshakes to the cloud, and the cloud actively informs the vehicle of its MSS through one handshake. Then, the minimum value of the three MSSs can be used as the MSS corresponding to the current TCP connection between the vehicle and the cloud. Understandably, the MSS corresponding to different TCP connections may be different.
[0105] For a complete TCP connection, the handshake packets actively sent by the vehicle end to the cloud end may include two, the actively sent waving packets may also include two, the handshake packet actively sent by the cloud end to the vehicle end may include one, and the handshake packet is the target handshake packet, and the actively sent waving packets to the vehicle end may include two, and one of the two waving packets is the target waving packet. Exemplarily, each handshake packet actively sent by the vehicle end to the cloud end may be a handshake packet including a SYN flag, and a handshake packet including an ACK flag, and each waving packet actively sent by the vehicle end to the cloud end may be a waving packet including both a FIN flag and an ACK flag, and a waving packet including an ACK flag. The handshake packet actively sent by the cloud end to the vehicle end may be a handshake packet including both a SYN flag and an ACK flag, and the waving packet actively sent by the cloud end to the vehicle end may be a waving packet including both a FIN flag and an ACK flag, and a waving packet including an ACK flag.
[0106] If a TCP connection is sent abnormally or has problems, the number of handshake packets and wave packets actively sent by the vehicle to the cloud will be determined according to the timing of the target reset packet. The number of handshake packets and wave packets sent by the cloud to the vehicle will also be determined according to the timing of the target reset packet.
[0107] The data length of the handshake packet and the wave packet can be obtained from the data message corresponding to the data packet. The target sending traffic is the estimated final vehicle-side sending traffic, which can also be equal to the target cloud receiving traffic on the cloud. The target cloud receiving traffic is the estimated final cloud receiving traffic.
[0108] In specific implementation, for any TCP connection, the target sending flow corresponding to the TCP connection = (the initial receiving flow corresponding to the TCP connection / the MSS corresponding to the TCP connection) × packet header length + the initial sending flow corresponding to the TCP connection + the sum of the data lengths of each handshake packet + the sum of the data lengths of each wave packet. Among them, the packet header length is the sum of the data length of the IP header and the data length of the TCP header, that is, 40 bytes.
[0109] S104-3-2: Determine the target receiving flow on the vehicle side based on the maximum message length, the initial sending flow, the initial receiving flow, the data length of the target handshake packet, and the data length of each handshake packet actively sent by the cloud to the vehicle in the connection data packet.
[0110] Here, in the case where the target end packet is a target waving packet, each waving packet actively sent by the cloud to the vehicle may be a waving packet including an ACK flag bit actively sent by the cloud to the vehicle, and the waving packet actively sent by the cloud to the vehicle may be a waving packet including both a FIN flag bit and an ACK flag bit, wherein the waving packet including both a FIN flag bit and an ACK flag bit is the target waving packet. In the case where the target end packet is a target reset packet, each waving packet actively sent by the cloud to the vehicle may include only one waving packet and the target reset packet, or may not include any waving packet.
[0111] The data length of the target handshake packet can be obtained from the data message corresponding to the target handshake packet. The target receiving flow is the estimated final vehicle-side receiving and sending flow, which can also be equal to the target cloud sending flow of the cloud, and the target cloud sending flow is the estimated final cloud sending flow.
[0112] In specific implementation, for any TCP connection, the target receiving flow corresponding to the TCP connection = (the initial sending flow corresponding to the TCP connection / the MSS corresponding to the TCP connection) × packet header length + the initial receiving flow corresponding to the TCP connection + the data length of the target handshake packet + the sum of the data lengths of each handshake packet. Among them, the packet header length is 40 bytes.
[0113] S104-3-3: Determine the data flow between the vehicle and the cloud during this TCP connection process based on the target sending flow and the target receiving flow.
[0114] In specific implementation, the sum of the target sending flow and the target receiving flow of the vehicle side can be used as the final data flow between the vehicle side and the cloud side in the TCP connection process. In addition, after obtaining the final data flow in the TCP connection process, the sum of the final data flow in each TCP connection process can be used as the final total data flow between the vehicle side and the cloud side.
[0115] In one embodiment, in a TCP connection, the 32-bit sequence number included in the data packet can be used to identify the data byte stream sent from the sender to the receiver. If the byte stream is regarded as a unidirectional flow between two applications corresponding to the sender and the receiver, the TCP connection can use the sequence number to count each byte, and when the sequence number reaches 0×ffffffff, it starts from 0 again. That is, in a TCP connection process, the sequence number in the data packet is cyclical in sequence. In this case, in order to further improve the accuracy of the determined initial sending flow, the initial sending flow can also be determined according to the following steps:
[0116] If the second sequence number is greater than the first sequence number, the initial sending flow is determined based on the difference between the second confirmation sequence number and the first confirmation sequence number; or, if the second sequence number is less than or equal to the first sequence number, the initial sending flow is determined based on the difference between the second confirmation sequence number and the first confirmation sequence number and the target offset value.
[0117] For example, when determining the initial sending flow, the size relationship between the second sequence number and the first sequence number can be compared. If the second sequence number is greater than the first sequence number, it can be explained that in the current TCP connection process, the sequence number of the data packet may not have been circulated, so the data flow in the TCP connection process can be directly supplemented according to the difference between the second confirmation sequence number and the first confirmation sequence number to obtain the initial sending flow. Similarly, if the second sequence number is greater than the first sequence number, the initial receiving flow at the vehicle end can be determined according to the difference between the second sequence number and the first sequence number.
[0118] If the second sequence number is less than or equal to the first sequence number, it means that the sequence number of the data packet has been cycled during the current TCP connection process, so the difference between the second confirmation sequence number and the first confirmation sequence number can be determined first, and then the initial sending flow can be obtained based on the sum of the difference and the target offset value. Among them, the target offset value can be 0×ffffffff, which is the maximum value corresponding to the 32-bit sequence number. Similarly, if the second sequence number is less than or equal to the first sequence number, the difference between the second sequence number and the first sequence number can be determined first, and then the initial receiving flow can be obtained based on the sum of the difference and the target offset value.
[0119] Optionally, the 32-bit confirmation number of each data packet in the TCP connection process can also be cyclically sequential, so when determining the initial sending flow, the size relationship between the second confirmation number and the first confirmation number can also be judged and compared. If the second confirmation number is greater than the first confirmation number, the data flow in the TCP connection process can be directly supplemented according to the difference between the second confirmation number and the first confirmation number to obtain the initial sending flow. If the second confirmation number is less than or equal to the first confirmation number, the difference between the second confirmation number and the first confirmation number can be determined first, and then the initial sending flow can be obtained according to the sum of the difference and the target offset value.
[0120] In one embodiment, the step of determining the target handshake packet from the connection data packet in S102 may be implemented according to the following steps:
[0121] A1: For any current data packet in the connection data packet, determine each data flag bit existing in the current data packet.
[0122] Here, since for any TCP connection process, each connection data packet in the connection process is generated in sequence, when capturing data packets, each connection data packet in the connection process can also be captured in sequence. The current data packet is a connection data packet currently captured. Based on the above Figure 3 It can be seen that there are 6 flags in the connection data packet. For each connection data packet, when the connection data packet belongs to a different type of data packet, the valid flags in the connection data packet are different. For example, when the connection data packet is a handshake packet corresponding to the first handshake, the valid flag in the connection data packet is the SYN flag; when the connection data packet is a handshake packet corresponding to the second handshake, the valid flags in the connection data packet are the SYN flag and the ACK flag; when the connection data packet is a handshake packet corresponding to the third handshake, the valid flag in the connection data packet is the ACK flag; when the connection data packet is a wave packet corresponding to the first wave, the valid flags in the connection data packet are the FIN and ACK flags; when the connection data packet is a wave packet corresponding to the second wave, the valid flag in the connection data packet is the ACK flag; when the connection data packet is a wave packet corresponding to the third wave, the valid flags in the connection data packet are the FIN and ACK flags; when the connection data packet is a wave packet corresponding to the fourth wave, the valid flag in the connection data packet is the ACK flag.
[0123] The data flag bits existing in the current data packet are the valid flag bits in the current data packet.
[0124] In specific implementation, for any TCP connection, eBPF of BPF_PROG_TYPE_SOCKET_FILTER can be used to capture each connection data packet corresponding to the TCP connection in sequence. For any current data packet captured, each data flag bit in the data packet can be determined according to the data message of the data packet.
[0125] A2: When each data flag bit in the current data packet includes at least one first preset flag bit, determine whether there is a stored data packet related to the current data packet in the data table according to the address information and port information of the current data packet.
[0126] Here, the first preset flag bit may be a SYN flag bit, a FIN flag bit, and a RST flag bit. The address information may include a source IP address and a destination IP address, and the port information may include a source port and a destination port. The stored data packet associated with the current data packet may be a data packet having the same address information and the same port information as the current data packet. The data table is used to store the target handshake packet corresponding to each TCP connection.
[0127] In a specific implementation, for the current data packet, it can be determined whether there is a flag bit in the data flag bit in the current data packet that is the same as the first preset flag bit. If so, the port information and address information corresponding to the current data packet can be determined based on the data message of the current data packet. According to the port information and address information, it is determined whether there is a stored data packet in the data table that has the same address information and the same port information as the current data packet. If the data flag bit in the current data packet is not the same as any of the first preset flag bits, the current data packet can be ignored.
[0128] A3: If yes, then in the case that each data flag bit includes the second preset flag bit, the stored data packet is replaced with the current data packet, and the current data packet is used as the target handshake packet.
[0129] Here, the second preset flag bit may be an ACK flag bit and a SYN flag bit.
[0130] In specific implementation, if there is a stored data packet related to the current data packet in the data table, it can be further determined whether the current data packet includes both the ACK flag and the SYN flag. If so, it can be explained that the target handshake packet corresponding to the current TCP connection needs to be updated to the current data packet. Therefore, the stored data packet can be replaced with the current data packet, and the current data packet can be used as the target handshake packet. After that, the next captured connection data packet can be determined according to the above A1 to A3 and the steps in the following text.
[0131] In another embodiment, if there is no stored data packet related to the current data packet, then when each data flag bit in the current data packet includes a second preset flag bit, the current data packet is taken as a target handshake packet and stored in the data table.
[0132] In specific implementation, if there is no stored data packet related to the current data packet in the data table, it can be said that the target handshake packet related to the current TCP connection has not been obtained yet, and it can be further determined whether the current data packet is the target handshake packet. Specifically, it can be determined whether the current data packet includes both the ACK flag and the SYN flag. If so, the current data packet can be used as the target handshake packet and stored in the data table, and the data packet start number can be determined based on the sequence number and confirmation number in the current data packet. After that, the next captured connection data packet can be judged according to the above A1 to A3 and the steps in the following text.
[0133] In another embodiment, the step of determining the target handshake packet from the connection data packet in S102 may be implemented according to the following steps:
[0134] For any current data packet in the connection data packet, if there is a stored data packet related to the current data packet in the data table, and the data flags in the current data packet do not include the second preset flag, if the data flags include a reset flag, the current data packet will be used as the target reset packet.
[0135] Here, the reset flag may be a RST flag.
[0136] Exemplarily, when the data table includes stored data packets related to the current data packet, and the data flags in the current data packet do not include both the ACK flag and the SYN flag, it can be further determined whether the data flags of the current data packet include the RST flag. If so, the current data packet can be used as the target reset packet to determine the end of the current TCP connection, and the current data packet can be used to determine the data packet end sequence number.
[0137] Alternatively, for any current data packet in the connection data packet, if there is a stored data packet related to the current data packet in the data table, and the data flags in the current data packet do not include the second preset flag, if the data flags include an end flag, then determine whether there is a target data packet in the captured connection data packet whose address information and port information are consistent with the current data packet and include an end flag; if so, take the current data packet as the target wave packet.
[0138] Here, the end flag may be a FIN flag. The target data packet may be a data packet that includes the same address information and the same port information as the current data packet and includes a FIN flag.
[0139] Exemplarily, when the data table includes stored data packets related to the current data packet, and each data flag bit in the current data packet does not include both the ACK flag bit and the SYN flag bit, it can be further determined whether the data flag bit of the current data packet includes the FIN flag bit. If so, it can be determined whether the target data packet exists in each captured connection data packet. That is, it is determined whether the current data packet is the third wave packet corresponding to the current TCP connection. If so, the current data packet can be used as the target wave packet corresponding to the current TCP connection to determine the end of the current TCP connection, and the data packet end sequence number can be determined using the current data packet. If not, the next captured connection data packet can be judged.
[0140] Optionally, if the data flag bits of the current data packet do not include the RST flag bit, it can be determined whether these data flag bits include the end flag bit. If so, it can be determined whether there is a target data packet. If there is a target data packet, the current data packet can be used as the target wave packet. If there is no target data packet, the judgment can continue on the next captured connection data packet.
[0141] It is understandable that for each captured connection data packet, it is possible to determine whether each connection data packet corresponds to the same TCP connection based on the port information and address information of the connection data packet. For example, if the port information and address information are consistent, each connection data packet corresponds to the same TCP connection, otherwise it corresponds to different TCP connections.
[0142] like Figure 4 As shown, a specific implementation flow chart of a data flow monitoring method provided by an embodiment of the present disclosure may include the following steps:
[0143] S401: for a currently captured data packet, determine each data flag bit existing in the current data packet.
[0144] S402: If the data flags in the current data packet include at least one of the SYN flag, the FIN flag and the RST flag, determine whether there is a stored data packet related to the current data packet in the data table according to the address information and port information of the current data packet.
[0145] If yes, then execute S405 to S413; if no, then execute S403 to S404. If the data flags in the current data packet do not include any of the SYN flag, the FIN flag, and the RST flag, then the current data packet can be ignored and the next captured connection data packet can be processed.
[0146] S403: Determine whether the current data packet includes both the ACK flag bit and the SYN flag bit.
[0147] If yes, execute S404; if no, end the determination of the type of the current data packet and continue to process the next connection data packet.
[0148] S404: taking the current data packet as the target handshake packet and storing it in the data table, and determining the data packet start sequence number according to the sequence number and confirmation sequence number in the current data packet.
[0149] S405: Determine whether the current data packet includes both the ACK flag bit and the SYN flag bit.
[0150] If yes, execute S406 and continue to process the next connection data packet; if no, execute S407.
[0151] S406: Use the current data packet to replace the stored data packet, use the current data packet as the target handshake packet, and determine the data packet start sequence number according to the sequence number and confirmation sequence number in the current data packet.
[0152] S407: Determine whether the current data packet includes a FIN flag.
[0153] If yes, execute S408; if no, execute S410.
[0154] S408: Determine whether there is a target data packet in the captured connection data packet, whose address information and port information are consistent with the current data packet and includes a FIN flag.
[0155] If yes, execute S409; if no, end the determination of the type of the current data packet and continue to process the next connection data packet.
[0156] S409: taking the current data packet as the target handshake packet, and determining the data packet end sequence number according to the current data packet.
[0157] After executing S409, S412 may be executed instead.
[0158] S410: Determine whether the current data packet includes a RST flag.
[0159] If yes, execute S411; if no, end the determination of the type of the current data packet and continue to process the next connection data packet.
[0160] S411: Use the current data packet as the target reset packet, and use the current data packet to determine the end sequence number of the data packet.
[0161] After executing S411, S412 may be executed instead.
[0162] S412: Determine the data flow between the vehicle and the cloud during the current TCP connection process according to the data packet start sequence number and the data packet end sequence number.
[0163] Regarding the specific execution steps of the above S401 to S412, reference may be made to the above embodiments and will not be repeated here.
[0164] In one embodiment, under the domain control architecture, the vehicle can be divided into multiple vehicle domains, and each vehicle domain is controlled by a corresponding domain controller. Such as the autonomous driving control unit (AD Control Unit, ACU) corresponding to the autonomous driving domain, the cockpit domain controller (Cockpit Domain Controller, CDC) corresponding to the cockpit domain, and the body gateway module (Body Gateway Module, BGM) corresponding to the body domain. Data is interacted with the cloud under the control of the domain controller, so the data flow monitoring method provided in the embodiment of the present disclosure can realize the statistics of data flow in different vehicle domains. Specifically, for S104, it can be implemented according to the following steps:
[0165] According to the connection data packet transmitted during the TCP connection process, a vehicle domain corresponding to the TCP connection process is determined; the vehicle domain includes an intelligent cockpit domain, an intelligent driving domain, or a vehicle body domain;
[0166] According to the data packet start sequence number and the data packet end sequence number, the data flow between the vehicle domain on the vehicle side and the cloud during the TCP connection process is determined.
[0167] When using IPA technology to interact with the cloud for data, the domain controller of the vehicle domain realizes data interaction by establishing a TCP connection with the cloud, and the wave packets and handshake packets in the TCP connection established by any vehicle domain can be captured in the TCAM domain, so the embodiment of the present disclosure can monitor the data traffic of any vehicle domain within the TCAM domain.
[0168] Different vehicle domains correspond to different address information and port information, so the vehicle domain for establishing a TCP connection can be accurately determined by using the port information and address information.
[0169] During specific implementation, for any TCP connection process, the vehicle domain corresponding to the TCP connection process can be determined based on the address information and port information in at least one connection data packet transmitted during the TCP connection process, that is, the vehicle domain that initiated the TCP connection process. Then, the data flow between the vehicle domain on the vehicle side and the cloud during the TCP connection process can be determined based on the data packet start sequence number and data packet end sequence number corresponding to the TCP connection process. The total data flow corresponding to the vehicle domain in each TCP connection process can be determined using the data flow corresponding to the vehicle domain. Based on the total data flow corresponding to each vehicle domain, the data flow of the entire vehicle can be determined.
[0170] In this way, using eBPF to capture handshake packets and waving packets and using handshake packets and waving packets to perform traffic statistics can not only reduce the load pressure on the vehicle CPU, but also monitor the traffic of each vehicle domain in the TCAM domain.
[0171] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0172] Based on the same technical concept, the embodiment of the present application also provides a computer device. Figure 5 FIG. 1 is a schematic diagram of a computer device provided in an embodiment of the present application, including:
[0173] Processor 501, memory 502 and bus 503. The memory 502 stores machine-readable instructions executable by the processor 501, and the processor 501 is used to execute the machine-readable instructions stored in the memory 502. When the machine-readable instructions are executed by the processor 501, the processor 501 performs the following steps: S101: When the vehicle side and the cloud side use the Internet Protocol packet accelerator IPA to transmit data packets, capture the connection data packets transmitted by the vehicle side and the cloud side during each transmission control protocol TCP connection process; S102: For each TCP connection process, determine the target handshake packet and the target end packet from the connection data packet; the target end packet includes a target handshake packet or a target reset packet; S103: Use the target handshake packet to obtain the data packet start sequence number, and use the target end packet to obtain the data packet end sequence number; and S104: According to the data packet start sequence number and the data packet end sequence number, determine the data flow between the vehicle side and the cloud side during the TCP connection process.
[0174] The above-mentioned memory 502 includes a memory 5021 and an external memory 5022; the memory 5021 here is also called an internal memory, which is used to temporarily store the calculation data in the processor 501, as well as the data exchanged with the external memory 5022 such as a hard disk. The processor 501 exchanges data with the external memory 5022 through the memory 5021. When the computer device is running, the processor 501 communicates with the memory 502 through the bus 503, so that the processor 501 executes the execution instructions mentioned in the above method embodiment.
[0175] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data flow monitoring method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0176] The computer program product of the data flow monitoring method provided in the embodiment of the present disclosure includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the data flow monitoring method described in the above method embodiment. Please refer to the above method embodiment for details, which will not be repeated here.
[0177] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0179] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0180] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0181] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0182] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A data flow monitoring method, characterized in that: include: When the vehicle side and the cloud side use an Internet Protocol packet accelerator IPA to transmit data packets, capture the connection data packets transmitted by the vehicle side and the cloud side during each transmission control protocol TCP connection process; For each TCP connection process, determining a target handshake packet and a target end packet from the connection data packet; The target end packet includes a target wave packet or a target reset packet; Using the target handshake packet to obtain a data packet start sequence number, and using the target end packet to obtain a data packet end sequence number; The data flow between the vehicle end and the cloud end during the TCP connection process is determined according to the data packet start sequence number and the data packet end sequence number.
2. The method according to claim 1, characterized in that: The data packet start sequence number includes the first sequence number and the first confirmation sequence number of the connection data packet transmitted between the vehicle end and the cloud end; the data packet end sequence number includes the second sequence number and the second confirmation sequence number of the connection data packet transmitted between the vehicle end and the cloud end; Determining the data flow between the vehicle end and the cloud end during the TCP connection process according to the data packet start sequence number and the data packet end sequence number includes: Determining the initial sending flow of the vehicle end according to the second confirmation sequence number and the first confirmation sequence number; Determining the initial receiving flow of the vehicle end according to the second sequence number and the first sequence number; The data flow between the vehicle end and the cloud end during the TCP connection process is determined according to the initial sending flow and the initial receiving flow.
3. The method according to claim 2, characterized in that The determining, according to the initial sending flow and the initial receiving flow, the data flow between the vehicle end and the cloud in the TCP connection process includes: Determine the target sending flow of the vehicle end according to the maximum message length corresponding to the TCP connection between the vehicle end and the cloud end, the initial receiving flow, the initial sending flow, and the data length of each handshake packet and each wave packet actively sent by the vehicle end to the cloud end in the connection data packet; Determine the target receiving flow of the vehicle end according to the maximum message length, the initial sending flow, the initial receiving flow, the data length of the target handshake packet, and the data length of each handshake packet actively sent by the cloud to the vehicle in the connection data packet; The data flow between the vehicle end and the cloud end during the TCP connection process is determined according to the target sending flow and the target receiving flow.
4. The method according to claim 2, characterized in that: The determining, according to the second confirmation sequence number and the first confirmation sequence number, the initial sending flow of the vehicle end includes: If the second sequence number is greater than the first sequence number, determining the initial sending flow rate according to the difference between the second confirmation sequence number and the first confirmation sequence number; or, If the second sequence number is less than or equal to the first sequence number, the initial sending flow is determined according to a difference between the second confirmation sequence number and the first confirmation sequence number and a target offset value.
5. The method according to claim 1, characterized in that: Determining a target handshake packet from the connection data packet includes: For any current data packet in the connection data packets, determining each data flag bit present in the current data packet; In a case where each data flag bit in the current data packet includes at least one first preset flag bit, determining whether there is a stored data packet related to the current data packet in the data table according to the address information and port information of the current data packet; If so, in a case where the data flags include the second preset flag, the stored data packet is replaced by the current data packet, and the current data packet is used as the target handshake packet.
6. The method according to claim 5, characterized in that The method further comprises: If there is no stored data packet related to the current data packet, then when each data flag bit in the current data packet includes a second preset flag bit, the current data packet is used as the target handshake packet and stored in the data table.
7. The method according to claim 5, characterized in that Determining a target end packet from the connection data packet includes: For any current data packet in the connection data packet, if there is a stored data packet related to the current data packet in the data table, and the data flags in the current data packet do not include the second preset flag, if the data flags include a reset flag, then the current data packet is used as the target reset packet; or, For any current data packet in the connection data packet, if there is a stored data packet related to the current data packet in the data table, and the data flags in the current data packet do not include the second preset flag, if the data flags include an end flag, determine whether there is a target data packet in the captured connection data packet whose address information and port information are consistent with the current data packet and include the end flag; if so, use the current data packet as the target wave packet.
8. The method according to claim 1, characterized in that Determining the data flow between the vehicle end and the cloud end during the TCP connection process according to the data packet start sequence number and the data packet end sequence number includes: Determine, according to the connection data packet transmitted during the TCP connection process, a vehicle domain corresponding to the TCP connection process; the vehicle domain includes an intelligent cockpit domain, an intelligent driving domain, or a vehicle body domain; According to the data packet start sequence number and the data packet end sequence number, the data flow between the vehicle domain of the vehicle end and the cloud during the TCP connection process is determined.
9. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the data flow monitoring method as described in any one of claims 1 to 8.
10. A computer program product, which, when executed by a computer device, executes the steps of the data traffic monitoring method according to any one of claims 1 to 8.
Citation Information
Cited By
Network data transmission monitoring method and device
CN120110809A