Data transmission method and device based on vehicle-mounted ethernet protocol and storage medium
By employing single-packet and multi-packet protocols in automotive Ethernet, selecting the transmission mode based on data length, and performing frame loss detection and integrity verification, the problems of packet loss and latency in automotive Ethernet are solved, achieving efficient and reliable data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing automotive Ethernet suffers from packet loss and latency issues when handling large data transmissions, especially in UDP, TCP, and application layer packet assembly protocols, where packet loss leads to incomplete data or poor real-time performance.
The system employs single-packet and multi-packet automotive Ethernet protocols, determines the protocol type based on the target data length, performs frame loss detection and integrity verification, identifies abnormal data frames, and requests the server to resend them, thereby avoiding IP layer fragmentation and improving transmission reliability.
By using single-packet and multi-packet transmission mechanisms to cover different data volumes, transmission latency is reduced, data integrity and reliability are ensured, and the data transmission performance of in-vehicle Ethernet is improved.
Smart Images

Figure CN119211374B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent vehicle controller software development technology, and in particular to a data transmission method, device and storage medium based on the vehicle Ethernet protocol. Background Technology
[0002] Automotive Ethernet, characterized by high transmission speed and strong scalability, is increasingly being widely used in fields such as intelligent driving and smart cockpits. Given the future trend of centralized domains, central control domains, and cloud control domains in the EE architecture, automotive Ethernet remains an indispensable key communication transmission method.
[0003] Vehicle Ethernet evolved from industrial Ethernet. Its protocol architecture still uses the TCP / IP framework in the middle part. Therefore, when transmitting large amounts of data, the main ideas of vehicle Ethernet include: (1) UDP protocol-IP packet splitting: The maximum length of UDP data packets is 1480-8 (UDP packet header) = 1472 bytes. The IP layer protocol automatically completes the packet splitting; (2) TCP protocol-IP packet splitting: The maximum length of TCP data packets is 1460 (different from the UDP header). The IP layer protocol automatically completes the packet splitting; however, TCP is a reliable connection. When the packet is lost, the TCP protocol will retransmit the lost packet; (3) Application layer packet assembly: The SOME / IP-TP protocol splits data larger than 1392 bytes (the bytes after removing the SOMEIP header from UDP). Its protocol is mainly based on the packet splitting of the UDP protocol.
[0004] Existing automotive Ethernet systems have the following drawbacks when handling large data transmissions:
[0005] (1) UDP protocol-IP packet splitting: The IP layer protocol automatically completes packet splitting, which has good real-time performance (low latency). However, UDP is an unreliable connection, and packet loss during network transmission will cause the IP layer to directly lose all data.
[0006] (2) TCP protocol-IP packet splitting: TCP is a reliable connection. Packet loss during network transmission will trigger the TCP protocol retransmission mechanism to ensure the integrity of data transmission, but the real-time performance of the TCP protocol is poor.
[0007] (3) Application layer packet assembly: The SOMEP / IP-TP (based on UDP) protocol defines the fragment size (less than 1392) at the application layer, thereby avoiding data fragmentation at the IP layer, improving data reliability and providing a certain degree of real-time performance. However, since the message is fragmented according to time sequence, if some fragments are lost, the protocol still cannot assemble the packet into complete data, resulting in data loss. Summary of the Invention
[0008] In view of this, it is necessary to provide a data transmission method, device and storage medium based on the vehicle Ethernet protocol to solve the problems of packet loss and delay during large data transmission in vehicle Ethernet.
[0009] To address the above problems, this invention provides a data transmission method based on the vehicle-mounted Ethernet protocol, comprising:
[0010] The system receives target data sent by the server via the vehicle Ethernet protocol; the protocol type of the vehicle Ethernet protocol is determined based on the length of the target data; the protocol type includes single-packet vehicle Ethernet protocol and multi-packet vehicle Ethernet protocol.
[0011] Based on the protocol type, the target data is subjected to frame loss detection and integrity verification;
[0012] In the event of frame loss or integrity verification failure, identify the abnormal data frame;
[0013] The server is requested to resend the abnormal data frame.
[0014] In one possible implementation, the fields of the single-packet vehicle Ethernet protocol include: protocol type, message ID, packet sequence number, packet length, transmitted data, and checksum.
[0015] The fields of the multi-packet vehicle Ethernet protocol include: protocol type, message ID, packet sequence number, packet length, packet mask, packet checksum, frame sequence number, total number of frames, transmitted data, and checksum.
[0016] In one possible implementation, the protocol type is determined in the following way:
[0017] When the length of the target data is less than or equal to the preset length bytes, the protocol type is determined to be a single-packet vehicle Ethernet protocol.
[0018] When the length of the target data is greater than the preset length in bytes, the protocol type is determined to be a multi-packet vehicle Ethernet protocol.
[0019] In one possible implementation, the step of performing frame loss detection and integrity verification on the target data based on the protocol type includes:
[0020] When the protocol type is a single-packet automotive Ethernet protocol, monitor the packet sequence number of the automotive Ethernet protocol;
[0021] Frame loss detection is performed on the target data based on the packet sequence number;
[0022] The integrity of the target data is verified using CRC16.
[0023] In one possible implementation, the step of performing frame loss detection and integrity verification on the target data based on the protocol type includes:
[0024] When the protocol type is a multi-packet automotive Ethernet protocol, monitor the frame sequence number of the automotive Ethernet protocol;
[0025] Frame loss detection is performed on the target data based on the frame sequence number;
[0026] The target data is verified for integrity using CRC16 and CRC32.
[0027] In one possible implementation, requesting the server to resend the abnormal data frame includes:
[0028] Within a preset time period, a request packet message is sent to the server; the request packet message contains the packet sequence number or frame sequence number corresponding to the abnormal data frame.
[0029] In one possible implementation, the in-vehicle Ethernet protocol is located on top of the UDP protocol.
[0030] The present invention also provides a data transmission device based on the vehicle-mounted Ethernet protocol, comprising:
[0031] A receiving module is used to receive target data sent by the server via the vehicle Ethernet protocol; the protocol type of the vehicle Ethernet protocol is determined based on the length of the target data; the protocol type includes single-packet vehicle Ethernet protocol and multi-packet vehicle Ethernet protocol.
[0032] The detection module is used to perform frame loss detection and integrity verification on the target data based on the protocol type.
[0033] The determination module is used to identify abnormal data frames in the event of frame loss or integrity verification failure.
[0034] The request module is used to request the server to resend the abnormal data frame.
[0035] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein,
[0036] The memory is used to store programs;
[0037] The processor, coupled to the memory, is used to execute the program stored in the memory to implement the data transmission method based on the vehicle Ethernet protocol as described in any of the above implementations.
[0038] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data transmission method based on the vehicle Ethernet protocol described in any of the above implementations.
[0039] The beneficial effects of this invention are as follows: The data transmission method, apparatus, and storage medium based on the vehicle Ethernet protocol provided by this invention receive target data sent by the server through the vehicle Ethernet protocol. The protocol type of the vehicle Ethernet protocol is determined according to the length of the target data. That is, the vehicle Ethernet protocol can adopt both single-packet and multi-packet transmission mechanisms. When the target data is short, the single-packet transmission mechanism is used, and when the target data is long, the multi-packet transmission mechanism is used. This can cover the transmission of different data sizes, avoid IP layer fragmentation, and thus reduce transmission latency. Furthermore, the target data is subjected to frame loss detection and integrity verification according to the protocol type. In the event of frame loss or integrity verification failure, abnormal data frames are identified, and a request is made to the server to resend the abnormal data frames. That is, a retransmission mechanism for lost frames is established when data frame loss or verification fails, avoiding data incompleteness due to packet loss and improving transmission reliability. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart illustrating an embodiment of the data transmission method based on the vehicle Ethernet protocol provided by the present invention;
[0042] Figure 2 A schematic diagram of the in-vehicle Ethernet protocol provided by the present invention;
[0043] Figure 3 This is a schematic diagram illustrating the verification of single-packet data transmission and reception provided by the present invention;
[0044] Figure 4 This is a schematic diagram illustrating the verification of multi-packet data transmission and reception provided by the present invention.
[0045] Figure 5 This is a schematic diagram of an embodiment of the data transmission device based on the vehicle Ethernet protocol provided by the present invention;
[0046] Figure 6 A schematic diagram of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0048] In the description of the embodiments of the present invention, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0049] The terms "first," "second," etc., used in the embodiments of this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.
[0050] Figure 1 A flowchart illustrating an embodiment of the data transmission method based on the vehicle Ethernet protocol provided by the present invention is shown below. Figure 1 As shown, the data transmission method based on the vehicle Ethernet protocol includes:
[0051] S101. Receive target data sent by the server via the vehicle Ethernet protocol; the protocol type of the vehicle Ethernet protocol is determined based on the length of the target data; the protocol type includes single-packet vehicle Ethernet protocol and multi-packet vehicle Ethernet protocol.
[0052] S102. Based on the protocol type, perform frame loss detection and integrity verification on the target data;
[0053] S103. In the event of frame loss or integrity verification failure, identify the abnormal data frame.
[0054] S104. Request the server to resend the abnormal data frame.
[0055] The data transmission method based on the vehicle Ethernet protocol provided by this invention can be executed by a client, which can be a vehicle ECU, domain controller, etc., such as an in-vehicle infotainment (IVI) or an automated domain control unit (ADCU). The server can be other ECUs or domain controllers in the vehicle, such as an ADCU or a lidar system.
[0056] It should be noted that the server can determine the protocol type of the in-vehicle Ethernet protocol based on the length of the target data, and select the corresponding protocol type to send the target data to the client.
[0057] Compared with existing technologies, the data transmission method based on the vehicle Ethernet protocol provided in this invention receives target data sent by the server via the vehicle Ethernet protocol. The protocol type of the vehicle Ethernet protocol is determined according to the length of the target data. That is, the vehicle Ethernet protocol can adopt both single-packet and multi-packet transmission mechanisms. When the target data is short, the single-packet transmission mechanism is used, and when the target data is long, the multi-packet transmission mechanism is used. This can cover the transmission of different data sizes, avoid IP layer fragmentation, and thus reduce transmission latency. Furthermore, the method performs frame loss detection and integrity verification on the target data according to the protocol type. In the event of frame loss or integrity verification failure, abnormal data frames are identified, and a request is made to the server to resend the abnormal data frames. In other words, a retransmission mechanism for frame loss is established when data frame loss or verification fails, avoiding data incompleteness due to packet loss and improving transmission reliability.
[0058] In some embodiments of the present invention, the in-vehicle Ethernet protocol is located on top of the UDP protocol.
[0059] The in-vehicle Ethernet protocol is an application-layer transport protocol based on the TCP / IP protocol suite, such as... Figure 2 As shown, Figure 2 This is a schematic diagram of the in-vehicle Ethernet protocol provided by the present invention.
[0060] The automotive Ethernet protocol is located on top of the UDP protocol, which is defined on the port corresponding to the TCP / IP socket.
[0061] The vehicle Ethernet protocol is a protocol used for in-vehicle network communication. It is located above the UDP protocol, meaning that the vehicle Ethernet protocol uses the UDP protocol as its underlying transport mechanism and transmits data through UDP data packets.
[0062] In the TCP / IP model, a port is a logical structure used to distinguish different network services or processes. Each network service or process is assigned a unique port number. The automotive Ethernet protocol is defined on the port corresponding to a TCP / IP socket, using specific port numbers to identify and differentiate different services or processes in the automotive network.
[0063] The data transmission method based on the in-vehicle Ethernet protocol provided in this invention uses the in-vehicle Ethernet protocol, which is a higher-layer protocol than UDP. It can use UDP packets for data transmission and distinguish different network services or processes through TCP / IP socket ports. This enables efficient and reliable data transmission and communication in the in-vehicle network. The in-vehicle Ethernet protocol is defined on top of the UDP protocol, does not depend on other underlying protocols, is simple to implement, and has good scalability.
[0064] In some embodiments of the present invention, the fields of the single-packet vehicle Ethernet protocol include: protocol type, message ID, packet sequence number, packet length, transmitted data, and verification.
[0065] The fields of the multi-packet vehicle Ethernet protocol include: protocol type, message ID, packet sequence number, packet length, packet mask, packet checksum, frame sequence number, total number of frames, transmitted data, and checksum.
[0066] The main components of a single-packet automotive Ethernet protocol header include: protocol type, message ID, packet sequence number, packet length, transmitted data, and checksum.
[0067] The main fields of the multi-packet vehicular Ethernet protocol header include: protocol type, message ID, packet sequence number, packet length, packet mask, packet checksum, frame sequence number, total number of frames, transmitted data, and checksum. Among these, the packet length, packet mask, and packet checksum of the multi-packet protocol only exist in the protocol type "Multi-packet Protocol - First Frame".
[0068] Furthermore, Table 1 defines the fields of the vehicle Ethernet protocol. The verification algorithm mainly performs integrity verification of message frames or data packets. Here, CRC8 and CRC16 are defined respectively, which can be adjusted in actual use.
[0069] Table 1: Custom Ethernet Protocol Field Definitions
[0070]
[0071] In some embodiments of the present invention, the protocol type is determined in the following manner:
[0072] When the length of the target data is less than or equal to the preset length bytes, the protocol type is determined to be a single-packet vehicle Ethernet protocol.
[0073] When the length of the target data is greater than the preset length in bytes, the protocol type is determined to be a multi-packet vehicle Ethernet protocol.
[0074] Optionally, the preset length in bytes can be set to 1400 bytes. When the length of the target data to be sent is greater than 1400 bytes, the protocol type "multi-packet-xxx" (the protocol field definition is shown in Table 1 above) is used for transmission.
[0075] When the length of the target data to be sent is less than or equal to 1400 bytes, the protocol type "single packet" can be used for transmission, thus avoiding fragmentation at the IP layer when sending larger data. Additionally, the field length can be adjusted based on the instantiation process.
[0076] The data transmission method based on the vehicle Ethernet protocol provided in this embodiment of the invention adopts both single-packet and multi-packet transmission mechanisms through the vehicle Ethernet protocol, which can cover the transmission of different data sizes, while avoiding IP layer fragmentation and reducing transmission latency.
[0077] In some embodiments of the present invention, the step of performing frame loss detection and integrity verification on the target data based on the protocol type includes:
[0078] When the protocol type is a single-packet automotive Ethernet protocol, monitor the packet sequence number of the automotive Ethernet protocol;
[0079] Frame loss detection is performed on the target data based on the packet sequence number;
[0080] The integrity of the target data is verified using CRC16.
[0081] The data frame verification mechanism includes frame loss verification and integrity verification. After receiving bus data, the client needs to perform frame loss verification and data packet integrity verification.
[0082] Figure 3 This is a schematic diagram of the verification of single packet data transmission and reception provided by the present invention, as shown below. Figure 3 As shown, when the protocol type is single packet, the client continuously receives data packets from the server and monitors their sequence numbers.
[0083] Packet sequence numbers are used to identify the order of data packets, ensuring that packets are received and processed in the correct sequence. Clients can use sequence numbers to detect packet loss. If a client detects non-consecutive sequence numbers, it determines that data packets have been lost, indicating frame loss.
[0084] The client can use Cyclic Redundancy Check (CRC16) to verify the integrity of the received target data. By calculating and comparing the CRC16 values, the client can verify whether the data has remained intact during transmission.
[0085] For example, before sending a data packet, the server calculates a CRC16 checksum based on the packet's content and appends it to the end of the packet. Upon receiving the packet, the client recalculates the CRC16 checksum based on the packet's content (excluding the CRC16 checksum itself). It then compares the calculated CRC16 checksum with the one provided in the packet. If they match, the packet is considered to have been transmitted without error, and data integrity is guaranteed. If they do not match, the packet is considered to have been transmitted incorrectly.
[0086] Furthermore, if packet sequence numbers are discontinuous and a lost packet has not been received for more than time t2 (t2 can be defined according to the data usage time characteristic point), then data frame loss has been detected. Frame verification is only performed at the end of the message for a single packet.
[0087] The data transmission method based on the vehicle Ethernet protocol provided in this invention uses packet sequence numbers for frame loss detection and CRC16 for data integrity verification to ensure that the received data is accurate and complete, which helps to improve the reliability and security of data transmission in vehicle Ethernet.
[0088] In some embodiments of the present invention, the step of performing frame loss detection and integrity verification on the target data based on the protocol type includes:
[0089] When the protocol type is a multi-packet automotive Ethernet protocol, monitor the frame sequence number of the automotive Ethernet protocol;
[0090] Frame loss detection is performed on the target data based on the frame sequence number;
[0091] The target data is verified for integrity using CRC16 and CRC32.
[0092] Figure 4 This is a schematic diagram illustrating the verification of multi-packet data transmission and reception provided by the present invention, as shown below. Figure 4 As shown, when the protocol type is multi-packet, the client continuously receives data packets from the server and monitors their packet sequence number and frame sequence number.
[0093] Frame sequence numbers are used to identify the order of data frames, ensuring that data frames are received and processed in the correct sequence. Clients can use frame sequence numbers to detect if any data frames are lost. If a client detects discontinuous frame sequence numbers, it will determine that data frames have been lost, i.e., frame dropping has occurred.
[0094] The client can use Cyclic Redundancy Checks (CRC16 and CRC32) to verify the integrity of the received target data. By calculating and comparing the CRC values, the receiver can verify whether the data has remained intact during transmission.
[0095] For example, for multi-packet vehicular Ethernet protocols, CRC16 checksum is used within each packet, and CRC32 checksum is also used at the level of the entire data sequence (or message, packet).
[0096] For example, within each data packet, the server calculates a CRC16 checksum for the data content and appends it to the end of the packet. Upon receiving the data packet, the client recalculates the CRC16 and compares it with the checksum in the data packet to verify the integrity of the individual data packet.
[0097] At the data sequence level, the server calculates a CRC32 checksum for the entire data sequence after all data packets are ready, and appends this checksum to the last data packet or sends it as a separate control message. After receiving all data packets, the client recalculates the CRC32 of the entire data sequence and compares it with the checksum provided by the server to verify the integrity of the entire data sequence. CRC32 checking is typically not performed with each received data packet, but rather after all data packets have been received and are ready to be reassembled into a complete data sequence.
[0098] Furthermore, when the protocol type is multi-packet, the monitored object is the frame sequence number. Additionally, if the first frame of a multi-packet protocol is lost, the remaining data corresponding to that sequence number is discarded. Multi-packet data requires frame verification at the end of each frame. After receiving a complete set of data, the integrity of the data packet needs to be verified based on the checksum mask and checksum value defined in the first packet.
[0099] The data transmission method based on the vehicle Ethernet protocol provided in this invention detects frame loss by using frame sequence numbers and performs data integrity verification using CRC16 and CRC32 to ensure that the received data is accurate and complete, which helps to improve the reliability and security of data transmission in vehicle Ethernet.
[0100] In some embodiments of the present invention, requesting the server to resend the abnormal data frame includes:
[0101] Within a preset time period, a request packet message is sent to the server; the request packet message contains the packet sequence number or frame sequence number corresponding to the abnormal data frame.
[0102] When the client detects a data frame loss or an integrity check failure, it will request the server to resend the specified abnormal data frame. The client should re-initiate the missing frame retransmission request within the t2 time limit, and the server should send the requested data frame within the t1 time limit.
[0103] Accordingly, the server should cache the most recent sent data frames within the time limit t1 after sending data. The client, in addition to initiating a retransmission within the time limit t2, should also ensure successful reception of the retransmitted data within a time greater than t1. Otherwise, if data packet reception fails, the client needs to re-request the server's sequence number, thus discarding the already received frame content and re-receiving the data.
[0104] For example, when the client performs frame loss detection and integrity verification, it can identify abnormal data frames when frame loss or integrity verification failure occurs. Abnormal data frames are data frames that are lost or fail to be verified, and the packet sequence number or frame sequence number corresponding to the abnormal data frame is recorded.
[0105] Within a preset time period, a request packet message is sent to the server. The request packet message is used to request the retransmission of the data frame. The request packet message should contain the packet sequence number or frame sequence number corresponding to the abnormal data frame so that the server can accurately identify the data frame that needs to be retransmitted.
[0106] After receiving the request packet message, the server resends the data frame, so that the client can receive the resent data frame, ensuring the integrity and reliability of data transmission.
[0107] The data transmission method based on the vehicle Ethernet protocol provided in this invention can continuously monitor (single packet, multiple packet) Ethernet data frame loss or failure to pass inspection and establish a retransmission mechanism for lost frames, thereby maximizing transmission reliability.
[0108] The data transmission method based on the vehicle Ethernet protocol provided by the present invention will be described in detail below with reference to specific embodiments.
[0109] Example 1: Single Packet Protocol and Transmission Mechanism.
[0110] The Automated Domain Control Unit (ADCU) acts as a server to send the identified lane line data to the In-Vehicle Infotainment (IVI), and its frame definition is shown in Table 2 below.
[0111] Table 2: Lane Line Data Ethernet Frame Definition
[0112]
[0113] The IVI continuously receives lane line Ethernet packets from the ADCU. Therefore, as time changes, the main change in the frame definition is that the packet sequence number increases by 1 every cycle (lane line update cycle is 30ms), the serialized data changes with the environment, and the checksum changes with the transmitted data.
[0114] If the sequence numbers of two consecutive frames within a 50ms time interval are not in an increasing relationship of +1, or if the check value of a certain frame is not equal to the CRC16 check value calculated by the IVI, the frame with that sequence number is determined to be abnormal. At this time, the IVI immediately requests the ADCU to resend the abnormal frame, as defined in Table 3.
[0115] After receiving the IVI request, the ADCU should retransmit the lost frame data according to Table 2 within 20ms.
[0116] The time limit for the frame loss verification and retransmission mechanism should be defined according to the actual application requirements.
[0117] Table 3: IVI Request Retransmission Frame Definition
[0118]
[0119] Example 2: Multi-packet protocol and transmission mechanism.
[0120] The LiDAR (Light Detection and Ranging) system sends the detected point cloud data to the intelligent driving controller as a server. Its frame definition is shown in Table 4 below.
[0121] Table 4: Ethernet Frame Definitions for Point Cloud Data
[0122]
[0123] The point cloud data sent from the LiDAR to the ADCU is 5051 bytes (more than 1400 bytes), which needs to be sent in multiple packets. After each group of 5051 bytes of data is sent, the packet sequence number 0x00004021 is incremented by 1, and the data packet period is 50ms.
[0124] A set of data packets requires 5 frames to be sent, namely frame number 1 (multi-frame - first frame), 2 (multi-frame - middle frame), 3 (multi-frame - middle frame), 4 (multi-frame - middle frame), and 5 (multi-frame - last frame). Excluding the last frame, the data length of each frame should be 1024 bytes, and the data frame period is 5ms.
[0125] After receiving point cloud data sent by Lidar, the ADCU performs CRC16 verification on each frame of data and CRC32 packet verification (combining packet mask + check value) on the combined data packets after receiving a group of data packets.
[0126] Similarly, if the ADCU receives an intermediate or final frame within 40ms after the first frame that cannot form a data packet or fails verification, it requests the Lidar to send a retransmitted frame sequence number, as shown in Table 5. The Lidar should respond to the retransmission request within 30ms; otherwise, the packet sequence number will be discarded. If the first frame of a data set is lost, verification fails, frame retransmission fails, or even packet verification fails, the ADCU will directly request the IVI to retransmit the data packet (a set of data). The request packet sequence number is the sequence number corresponding to the abnormal packet, while the frame sequence number is 0.
[0127] In addition, after the ADCU requests a retransmission of the packet sequence number, the originally received portion of the frame will be discarded.
[0128] Table 5: ADCU Request Retransmission Frame Definition
[0129]
[0130] The data transmission method based on the vehicle Ethernet protocol provided by this invention has the following advantages:
[0131] 1. The vehicle Ethernet protocol provided by this invention adopts both single-packet and multi-packet transmission mechanisms, which can cover the transmission of different data sizes, while avoiding IP layer fragmentation and reducing transmission latency.
[0132] 2. The vehicle Ethernet protocol provided by this invention can continuously monitor (single packet, multiple packet) Ethernet data frame loss or failure to pass inspection and establish a retransmission mechanism for lost frames, thereby maximizing transmission reliability.
[0133] 3. The vehicle Ethernet protocol provided by this invention is defined on top of the UDP protocol, does not depend on other basic protocols, is simple to implement, and has good scalability.
[0134] To better implement the data transmission method based on the vehicle Ethernet protocol in the embodiments of the present invention, the embodiments of the present invention also provide a data transmission device based on the vehicle Ethernet protocol. Figure 5 This is a schematic diagram of an embodiment of the data transmission device based on the vehicle Ethernet protocol provided by the present invention, as shown below. Figure 5 As shown, the data transmission device 500 based on the vehicle Ethernet protocol includes:
[0135] The receiving module 510 is used to receive target data sent by the server via the vehicle Ethernet protocol; the protocol type of the vehicle Ethernet protocol is determined based on the length of the target data; the protocol type includes single-packet vehicle Ethernet protocol and multi-packet vehicle Ethernet protocol.
[0136] The detection module 520 is used to perform frame loss detection and integrity verification on the target data based on the protocol type.
[0137] The determination module 530 is used to determine abnormal data frames in the event of frame loss or integrity verification failure.
[0138] The request module 540 is used to request the server to resend the abnormal data frame.
[0139] The data transmission device 500 based on the vehicle Ethernet protocol provided in the above embodiments can realize the technical solutions described in the above embodiments of the data transmission method based on the vehicle Ethernet protocol. The specific implementation principles of each module or unit can be found in the corresponding content in the embodiments of the data transmission method based on the vehicle Ethernet protocol, and will not be repeated here.
[0140] like Figure 6 As shown, the present invention also provides an electronic device 600. The electronic device 600 includes a processor 601, a memory 602, and a display 603. Figure 6 Only some components of the electronic device 600 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0141] In some embodiments, processor 601 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 602 or process data, such as the data transmission method based on vehicle Ethernet protocol in this invention.
[0142] In some embodiments, processor 601 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 601 may be local or remote. In some embodiments, processor 601 may be implemented on a cloud platform. In some embodiments, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, internal cloud, multi-cloud, or any combination thereof.
[0143] In some embodiments, memory 602 may be an internal storage unit of electronic device 600, such as a hard disk or memory of electronic device 600. In other embodiments, memory 602 may also be an external storage device of electronic device 600, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 600.
[0144] Furthermore, the memory 602 may include both internal storage units of the electronic device 600 and external storage devices. The memory 602 is used to store application software and various types of data installed on the electronic device 600.
[0145] In some embodiments, display 603 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an organic light-emitting diode (OLED) touchscreen. Display 603 is used to display information from electronic device 600 and to display a visual user interface. Components 601-603 of electronic device 600 communicate with each other via a system bus.
[0146] In one embodiment, when the processor 601 executes the data transmission program based on the vehicle Ethernet protocol in the memory 602, the following steps can be implemented:
[0147] The system receives target data sent by the server via the vehicle Ethernet protocol; the protocol type of the vehicle Ethernet protocol is determined based on the length of the target data; the protocol type includes single-packet vehicle Ethernet protocol and multi-packet vehicle Ethernet protocol.
[0148] Based on the protocol type, the target data is subjected to frame loss detection and integrity verification;
[0149] In the event of frame loss or integrity verification failure, identify the abnormal data frame;
[0150] The server is requested to resend the abnormal data frame.
[0151] It should be understood that when the processor 601 executes the data transmission program based on the vehicle Ethernet protocol in the memory 602, in addition to the functions mentioned above, it can also perform other functions, as can be found in the description of the corresponding method embodiments above.
[0152] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 600 mentioned. Electronic device 600 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 600 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0153] Accordingly, embodiments of the present invention also provide a computer-readable storage medium for storing computer-readable programs or instructions. When the programs or instructions are executed by a processor, they can implement the steps or functions of the data transmission method based on the vehicle Ethernet protocol provided in the above-described method embodiments.
[0154] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0155] The data transmission method, apparatus, and storage medium based on the vehicle Ethernet protocol provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A data transmission method based on the vehicle-mounted Ethernet protocol, characterized in that, include: Receive target data sent by the server via the vehicle Ethernet protocol; The protocol type of the in-vehicle Ethernet protocol is determined based on the length of the target data; The protocol types include single-packet vehicle Ethernet protocol and multi-packet vehicle Ethernet protocol; Based on the protocol type, the target data is subjected to frame loss detection and integrity verification; In the event of frame loss or integrity verification failure, identify the abnormal data frame; Request the server to resend the abnormal data frame; The step of performing frame loss detection and integrity verification on the target data based on the protocol type includes: When the protocol type is a single-packet automotive Ethernet protocol, monitor the packet sequence number of the automotive Ethernet protocol; Frame loss detection is performed on the target data based on the packet sequence number; The integrity of the target data is verified using CRC16. When the protocol type is a multi-packet automotive Ethernet protocol, monitor the frame sequence number of the automotive Ethernet protocol; Frame loss detection is performed on the target data based on the frame sequence number; The target data is verified for integrity using CRC16 and CRC32.
2. The data transmission method based on the vehicle-mounted Ethernet protocol according to claim 1, characterized in that, The fields of the single-packet vehicle Ethernet protocol include: protocol type, message ID, packet sequence number, packet length, transmitted data, and checksum. The fields of the multi-packet vehicle Ethernet protocol include: protocol type, message ID, packet sequence number, packet length, packet mask, packet checksum, frame sequence number, total number of frames, transmitted data, and checksum.
3. The data transmission method based on the vehicle-mounted Ethernet protocol according to claim 2, characterized in that, The protocol type is determined in the following way: When the length of the target data is less than or equal to the preset length in bytes, the protocol type is determined to be a single-packet vehicle Ethernet protocol. When the length of the target data is greater than the preset length in bytes, the protocol type is determined to be a multi-packet vehicle Ethernet protocol.
4. The data transmission method based on the vehicle-mounted Ethernet protocol according to claim 1, characterized in that, The step of requesting the server to resend the abnormal data frame includes: Within a preset time period, a request packet message is sent to the server; the request packet message contains the packet sequence number or frame sequence number corresponding to the abnormal data frame.
5. The data transmission method based on the vehicle-mounted Ethernet protocol according to claim 1, characterized in that, The in-vehicle Ethernet protocol is located on top of the UDP protocol.
6. A data transmission device based on the vehicle-mounted Ethernet protocol, characterized in that, include: The receiving module is used to receive target data sent by the server via the vehicle Ethernet protocol; The protocol type of the in-vehicle Ethernet protocol is determined based on the length of the target data; the protocol type includes single-packet in-vehicle Ethernet protocol and multi-packet in-vehicle Ethernet protocol; The detection module is used to perform frame loss detection and integrity verification on the target data based on the protocol type. The determination module is used to identify abnormal data frames in the event of frame loss or integrity verification failure. The request module is used to request the server to resend the abnormal data frame; The step of performing frame loss detection and integrity verification on the target data based on the protocol type includes: When the protocol type is a single-packet automotive Ethernet protocol, monitor the packet sequence number of the automotive Ethernet protocol; Frame loss detection is performed on the target data based on the packet sequence number; The integrity of the target data is verified using CRC16. When the protocol type is a multi-packet automotive Ethernet protocol, monitor the frame sequence number of the automotive Ethernet protocol; Frame loss detection is performed on the target data based on the frame sequence number; The target data is verified for integrity using CRC16 and CRC32.
7. An electronic device, characterized in that, Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the data transmission method based on the vehicle Ethernet protocol as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data transmission method based on the vehicle Ethernet protocol as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data transmission method based on vehicle bus
CN105847101A
Ethernet data packaging and sending method
CN115460298A