Data transmission method and device based on vehicle-mounted Ethernet protocol, and storage medium
By detecting and verifying frame loss and integrity in the on-board Ethernet protocol, resend abnormal data frames, and adopting single-packet and multi-packet transmission mechanisms, the problem of packet loss and delay in big data transmission by on-board Ethernet is solved. , improves the reliability and real-timeness of data transmission.
Patent Information
- Application Number
- CN202411211473.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The existing in-vehicle Ethernet has packet loss and delay problems when handling large data transmission, especially when UDP protocol-IP subcontracting and TCP protocol-IP subcontracting and application layer packet grouping, the data cannot be effectively guaranteed. Integrity and real-time.
Using the data transmission method based on the on-board Ethernet protocol, the abnormal data frames are determined by detecting and verifying the drop-out and integrity of the target data, and requesting resend from the server. The single packet and multi-packet transmission mechanism are used to cover different data The transmission of large quantities can avoid IP layer sharding and reduce transmission delay.
It improves the reliability and real-time nature of data transmission, ensures data integrity, reduces data incompleteness caused by packet loss, and improves the reliability of transmission.
Smart Images

Figure CN119211374A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent automobile controller software development, and in particular to a data transmission method, device and storage medium based on an in-vehicle Ethernet protocol. Background Art
[0002] With its high transmission rate and strong scalability, automotive Ethernet is gradually being widely used in the fields of intelligent driving and intelligent cockpit. In the context of the future trend of centralized domain, central control domain, and cloud control domain of EE architecture, automotive Ethernet is also an indispensable key communication transmission method.
[0003] Automotive Ethernet evolved from industrial Ethernet. The middle part of its protocol architecture still uses the TCP / IP framework. Therefore, when transmitting large amounts of data, the main ideas of automotive Ethernet include: (1) UDP protocol-IP packetization: The maximum length of a UDP data packet is 1480-8 (UDP packet header) = 1472 bytes, and the IP layer protocol automatically completes the packetization of the message; (2) TCP protocol-IP packetization: The maximum length of a TCP data packet is 1460 (the difference from the UDP header), and the IP layer protocol automatically completes the packetization; but TCP is a reliable connection. When a packet is lost, the TCP protocol will retransmit the lost packet; (3) Application layer packetization: The SOME / IP-TP protocol will split data larger than 1392 bytes (the bytes after UDP removes the SOMEIP header). Its protocol is mainly based on the unpacking and packetization of the UDP protocol.
[0004] Existing automotive Ethernet has the following defects when handling large data transmissions: (1) UDP protocol-IP packetization: The IP layer protocol automatically completes packetization, and its real-time performance is good (low latency), but UDP is an unreliable connection. Packet loss during network transmission will cause the IP layer to directly lose all data.
[0005] (2) TCP protocol-IP packet subpacketization: TCP is a reliable connection. Packet loss during network transmission will trigger the retransmission mechanism of the TCP protocol, thereby ensuring the integrity of data transmission. However, the real-time performance of the TCP protocol is poor.
[0006] (3) Application layer packet assembly: The SOMEP / IP-TP (based on UDP) protocol defines the fragmented data size (less than 1392) at the application layer, thereby avoiding data fragmentation at the IP layer, improving data reliability and having a certain degree of real-time performance. However, the message is fragmented in time series. When some fragments are lost, the protocol still cannot be assembled into complete data, resulting in data loss. Summary of the invention
[0007] 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 over the vehicle Ethernet.
[0008] In order to solve the above problems, the present invention provides a data transmission method based on the vehicle Ethernet protocol, comprising: Receiving target data sent by the server through 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 a single-packet vehicle Ethernet protocol and a multi-packet vehicle Ethernet protocol; Based on the protocol type, performing frame loss detection and integrity check on the target data; In case of frame loss or integrity check failure, determine abnormal data frames; Request the server to resend the abnormal data frame.
[0009] In a possible implementation, the fields of the single-packet vehicle Ethernet protocol include: protocol type, message ID, packet sequence number, packet length, transmission 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 check, frame sequence number, total number of frames, sent data and check.
[0010] In a possible implementation, the protocol type is determined in the following manner: When the length of the target data is less than or equal to the preset length byte, determining that the protocol type is a single-packet vehicle Ethernet protocol; When the length of the target data is greater than a preset length byte, it is determined that the protocol type is a multi-packet in-vehicle Ethernet protocol.
[0011] In a possible implementation manner, the performing frame loss detection and integrity check on the target data based on the protocol type includes: When the protocol type is a single-packet in-vehicle Ethernet protocol, monitoring a packet sequence number of the in-vehicle Ethernet protocol; Performing frame loss detection on the target data based on the packet sequence number; The target data is checked for integrity by CRC16.
[0012] In a possible implementation manner, the performing frame loss detection and integrity check on the target data based on the protocol type includes: When the protocol type is a multi-packet vehicle Ethernet protocol, monitoring a frame sequence number of the vehicle Ethernet protocol; Performing frame loss detection on the target data based on the frame sequence number; The target data is integrity checked by CRC16 and CRC32.
[0013] In a possible implementation, the requesting the server to resend the abnormal data frame includes: Sending a request packet message to the server within a preset time period; the request packet message includes a packet sequence number or a frame sequence number corresponding to the abnormal data frame.
[0014] In a possible implementation, the in-vehicle Ethernet protocol is located on an upper layer of the UDP protocol.
[0015] The present invention also provides a data transmission device based on the vehicle-mounted Ethernet protocol, comprising: A receiving module, used for receiving target data sent by the server through 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 a single-packet vehicle Ethernet protocol and a multi-packet vehicle Ethernet protocol; A detection module, used for performing frame loss detection and integrity check on the target data based on the protocol type; A determination module, used to determine abnormal data frames in case of frame loss or integrity check failure; The request module is used to request the server to resend the abnormal data frame.
[0016] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the data transmission method based on the in-vehicle Ethernet protocol described in any of the above implementations.
[0017] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the data transmission method based on the vehicle Ethernet protocol described in any of the above implementations is implemented.
[0018] The beneficial effects of the present invention are as follows: the data transmission method, device and storage medium based on the vehicle Ethernet protocol provided by the present 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 two transmission mechanisms, single-packet and multi-packet. When the length of the target data is short, the single-packet transmission mechanism is adopted, and when the length of the target data is long, the multi-packet transmission mechanism is adopted. The transmission of different data sizes can be covered to avoid IP layer fragmentation, thereby reducing transmission delay, and frame loss detection and integrity verification are performed on the target data according to the protocol type. In the event of frame loss or integrity verification failure, the abnormal data frame is determined, and the abnormal data frame is requested to be resent to the server, that is, when data frame loss occurs or the verification fails, a frame loss retransmission mechanism is established to avoid data incompleteness due to packet loss and improve transmission reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the 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 work.
[0020] Figure 1 A method flow chart of an embodiment of a data transmission method based on an in-vehicle Ethernet protocol provided by the present invention; Figure 2 A schematic diagram of the vehicle-mounted Ethernet protocol provided by the present invention; Figure 3 A schematic diagram of verification of single-packet data reception and transmission provided by the present invention; Figure 4 A schematic diagram of verification of multi-packet data reception and transmission provided by the present invention; Figure 5 A schematic diagram of the structure of an embodiment of a data transmission device based on an in-vehicle Ethernet protocol provided by the present invention; Figure 6 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0022] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.
[0023] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0024] Figure 1 A method flow chart of an embodiment of a data transmission method based on an in-vehicle Ethernet protocol provided by the present invention is as follows: Figure 1 As shown, the data transmission method based on the vehicle Ethernet protocol includes: S101, receiving target data sent by a server through an in-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 a single-packet in-vehicle Ethernet protocol and a multi-packet in-vehicle Ethernet protocol; S102, performing frame loss detection and integrity check on the target data based on the protocol type; S103, in case of frame loss or integrity check failure, determining abnormal data frames; S104: Request the server to resend the abnormal data frame.
[0025] The execution subject of the data transmission method based on the vehicle Ethernet protocol provided by the present invention may be a client, and the client may be an ECU, a domain controller, etc. of the vehicle, for example, an intelligent cockpit (In-Vehicle Infotainment, IVI) or an automated domain control unit (ADCU), etc. The server may be other ECUs, domain controllers, etc. of the vehicle, for example, an ADCU or a laser radar, etc.
[0026] It should be noted that the server can determine the protocol type of the vehicle Ethernet protocol according to the length of the target data, and select the corresponding protocol type to send the target data to the client.
[0027] Compared with the prior art, the data transmission method based on the vehicle Ethernet protocol provided by the embodiment of the present invention receives 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 single-packet and multi-packet transmission mechanisms. When the length of the target data is short, the single-packet transmission mechanism is adopted, and when the length of the target data is long, the multi-packet transmission mechanism is adopted. The transmission of different data sizes can be covered to avoid IP layer fragmentation, thereby reducing transmission delay, and frame loss detection and integrity verification are performed on the target data according to the protocol type. In the event of frame loss or integrity verification failure, the abnormal data frame is determined, and the abnormal data frame is requested to be resent to the server, that is, when data frame loss occurs or the verification fails, a frame loss retransmission mechanism is established to avoid incomplete data due to packet loss and improve transmission reliability.
[0028] In some embodiments of the present invention, the in-vehicle Ethernet protocol is located on an upper layer of the UDP protocol.
[0029] The automotive Ethernet protocol is an application layer transmission protocol designed based on the TCP / IP protocol cluster, such as Figure 2 As shown, Figure 2 A schematic diagram of the in-vehicle Ethernet protocol provided by the present invention.
[0030] The automotive Ethernet protocol is located on the upper layer of the UDP protocol, which is defined on the port corresponding to the TCP / IP socket.
[0031] The Automotive Ethernet Protocol is a protocol used for internal network communications in vehicles. It is located on the upper layer of the UDP protocol. That is, the Automotive Ethernet Protocol uses the UDP protocol as its underlying transmission mechanism and transmits data through UDP data packets.
[0032] 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 ports corresponding to the TCP / IP socket, and uses specific port numbers to identify and distinguish different services or processes in the vehicle network.
[0033] The data transmission method based on the vehicle Ethernet protocol provided by the embodiment of the present invention is an upper layer protocol based on the UDP protocol. The vehicle Ethernet protocol can use UDP data packets for data transmission and distinguish different network services or processes through the ports of the TCP / IP socket. This enables the vehicle network to achieve efficient and reliable data transmission and communication. The vehicle Ethernet protocol is defined on the upper layer of the UDP protocol and does not need to rely on other basic protocols. It is simple to implement and has good scalability.
[0034] 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, transmission 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 check, frame sequence number, total number of frames, sent data and check.
[0035] 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.
[0036] The main fields of the multi-packet automotive Ethernet protocol header include: protocol type, message ID, packet sequence number, packet length, packet mask, packet check, frame sequence number, total number of frames, sent data and check, etc. Among them, the packet length, packet mask and packet check of the multi-packet protocol only exist in the protocol type of "multi-packet protocol-first frame".
[0037] Furthermore, Table 1 is the field definition of the automotive Ethernet protocol. The verification algorithm mainly completes the integrity check of the message frame or the packet of the packet, which is defined here as CRC8 and CRC16 respectively, and can be adjusted during actual use.
[0038] Table 1: Custom Ethernet protocol field definitions
[0039] In some embodiments of the present invention, the protocol type is determined by: When the length of the target data is less than or equal to the preset length byte, determining that the protocol type is a single-packet vehicle Ethernet protocol; When the length of the target data is greater than a preset length byte, it is determined that the protocol type is a multi-packet in-vehicle Ethernet protocol.
[0040] Optionally, the preset length byte may 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 as shown in Table 1 above) is adopted for sending.
[0041] 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 sending, thereby avoiding the fragmentation of large data at the IP layer. In addition, the field length can be adjusted according to the usage instantiation.
[0042] The data transmission method based on the vehicle Ethernet protocol provided by the embodiment of the present invention adopts two transmission mechanisms, single-packet and multi-packet, through the vehicle Ethernet protocol, which can cover the transmission of different data sizes, while avoiding IP layer fragmentation and reducing transmission delay.
[0043] In some embodiments of the present invention, the performing frame loss detection and integrity check on the target data based on the protocol type includes: When the protocol type is a single-packet in-vehicle Ethernet protocol, monitoring a packet sequence number of the in-vehicle Ethernet protocol; Performing frame loss detection on the target data based on the packet sequence number; The target data is checked for integrity by CRC16.
[0044] The data frame verification mechanism includes frame loss and integrity verification. After receiving the bus data, the client needs to perform frame loss verification and data packet integrity verification on the data.
[0045] Figure 3 A schematic diagram of the verification of single-packet data reception and transmission provided by the present invention is shown in FIG. Figure 3 As shown, when the protocol type is single packet, the client continuously receives data packets from the server and monitors their packet sequence numbers.
[0046] The packet sequence number is used to identify the order of the data packets, which can ensure that the data packets are received and processed in the correct order. The client can detect whether there is data packet loss based on the packet sequence number. If the client finds that the packet sequence number is not continuous, it will determine that there is data packet loss, that is, frame loss has occurred.
[0047] The client can use a cyclic redundancy check (CRC16) to perform an integrity check on the received target data. By calculating and comparing the CRC16 value, the client can verify whether the data remains intact during transmission.
[0048] For example, before sending a data packet, the server will calculate a CRC16 checksum based on the content of the data packet and append it to the end of the data packet. After receiving the data packet, the client will recalculate the CRC16 checksum based on the content of the data packet (excluding the CRC16 checksum itself). Then compare the calculated CRC16 checksum with the CRC16 checksum provided in the data packet to see if they are consistent. If they are consistent, it is considered that no error occurred during the transmission of the data packet and the data integrity is guaranteed. If they are inconsistent, it is considered that an error occurred during the transmission of the data packet.
[0049] Furthermore, when the packet sequence number is discontinuous and the lost packet has not been received for more than t2 (t2 can be defined according to the data usage time characteristic point), data frame loss is detected. And frame check is performed only at the end of the message for single packet data.
[0050] The data transmission method based on the vehicle Ethernet protocol provided by the embodiment of the present invention performs frame loss detection through packet sequence numbers and uses CRC16 to perform data integrity check to ensure that the received data is accurate and complete, which helps to improve the reliability and security of data transmission in the vehicle Ethernet.
[0051] In some embodiments of the present invention, the performing frame loss detection and integrity check on the target data based on the protocol type includes: When the protocol type is a multi-packet vehicle Ethernet protocol, monitoring a frame sequence number of the vehicle Ethernet protocol; Performing frame loss detection on the target data based on the frame sequence number; The target data is integrity checked by CRC16 and CRC32.
[0052] Figure 4 A schematic diagram of the verification of multi-packet data reception and transmission provided by the present invention, such as 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 numbers and frame sequence numbers.
[0053] The frame sequence number is used to identify the sequence of data frames, which can ensure that the data frames are received and processed in the correct order. The client can detect whether there is data frame loss based on the frame sequence number. If the client finds that the frame sequence number is not continuous, it will determine that there is data frame loss, that is, frame loss has occurred.
[0054] The client can use cyclic redundancy check (CRC16 and CRC32) to check the integrity of the received target data. By calculating and comparing the CRC value, the receiver can verify whether the data remains intact during the transmission process.
[0055] For example, for a multi-packet automotive Ethernet protocol, a CRC16 check is used within each data packet, and a CRC32 check is also used at the level of the entire data sequence (or message, packet).
[0056] For example, within each data packet, the server calculates the CRC16 checksum of the data content and appends it to the end of the data packet. After 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 single data packet.
[0057] At the data sequence level, the server will calculate the CRC32 checksum for the contents of the entire data sequence after all data packets are ready, and attach the checksum to the last data packet or send it as a separate control message. After receiving all data packets, the client will recalculate the CRC32 of the entire data sequence and compare it with the checksum provided by the server to verify the integrity of the entire data sequence. The CRC32 check is usually not performed when each data packet is received, but only when all data packets are received and ready to be reassembled into a complete data sequence.
[0058] Furthermore, when the protocol type is multi-packet, the monitored object is the frame sequence number. In addition, if the first frame of the multi-packet protocol is lost, the remaining data corresponding to the multi-packet sequence number is discarded. Multi-packet data needs to be frame checked at the end of each frame. After receiving a complete set of data, the integrity of the data packet needs to be checked according to the check mask and packet check value defined in the first packet.
[0059] The data transmission method based on the vehicle Ethernet protocol provided by the embodiment of the present invention performs frame loss detection through frame sequence numbers, and uses CRC16 and CRC32 to perform 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 the vehicle Ethernet.
[0060] In some embodiments of the present invention, the requesting the server to resend the abnormal data frame includes: Sending a request packet message to the server within a preset time period; the request packet message includes a packet sequence number or a frame sequence number corresponding to the abnormal data frame.
[0061] When the client detects data frame loss or integrity check failure, it will request the server to resend the specified abnormal data frame. The client should re-initiate the missed frame retransmission request within the t2 time limit, and the server should send the requested data frame within the t1 time limit.
[0062] Accordingly, the server should cache the data frames sent within the last t1 time after sending the data. In addition to initiating a re-request within the t2 time limit, the client should also ensure that the retransmitted data is successfully received within a time greater than t1, otherwise the data packet reception fails and the server packet sequence number needs to be re-requested, thereby discarding the received frame content and receiving it again.
[0063] Exemplarily, when performing frame loss detection and integrity check, the client can determine abnormal data frames when frame loss or integrity check failure occurs, i.e., lost data frames or data frames that fail to be checked, and record the packet sequence number or frame sequence number corresponding to the abnormal data frame.
[0064] And send a request packet message to the server within a preset time. The request packet message is used to request resending 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 resent.
[0065] After receiving the request packet message, the server resends the data frame, so that the client can receive the resent data frame to ensure the integrity and reliability of data transmission.
[0066] The data transmission method based on the vehicle Ethernet protocol provided by the embodiment of the present invention can continuously monitor the loss or inspection failure of (single-packet and multi-packet) Ethernet data frames and establish a retransmission mechanism for lost frames, thereby maximizing transmission reliability.
[0067] The data transmission method based on the vehicle-mounted Ethernet protocol provided by the present invention is described in detail below in conjunction with specific embodiments.
[0068] Embodiment 1: Single packet protocol and transmission mechanism.
[0069] The automated domain control unit (ADCU) acts as a server and sends the identified lane line data to the in-vehicle infotainment (IVI). The frame definition is shown in Table 2 below.
[0070] Table 2: Lane data Ethernet frame definition
[0071] IVI continuously receives lane line Ethernet data packets from ADCU, so as time changes, the main changes in the frame definition are that the packet sequence number is +1 every cycle (lane line update cycle is 30ms), the serialized data changes with the environment, and the check value changes with the sent data.
[0072] When the packet sequence numbers of the two frames of messages within the 50ms time interval are not in an increasing relationship of +1 or the check value of a frame of message is not equal to the CRC16 check value calculated by IVI, the message frame of the packet sequence number is judged to be abnormal. At this time, IVI immediately requests ADCU to send the abnormal message frame again. Its definition is shown in Table 3.
[0073] After receiving the request from IVI, ADCU shall retransmit the lost frame data according to Table 2 within no more than 20ms.
[0074] As mentioned above, the time limit of the frame loss check retransmission mechanism should be defined according to the actual application requirements.
[0075] Table 3: IVI request retransmission frame definition
[0076] Embodiment 2: Multi-packet protocol and transmission mechanism.
[0077] As a server, Lidar sends detected point cloud data to the intelligent driving controller. The frame definition is shown in Table 4 below.
[0078] Table 4: Point cloud data Ethernet frame definition
[0079] The point cloud data sent by Lidar to ADCU is 5051 (more than 1400 bytes) and needs to be sent in multiple packages. After each group of 5051 bytes of data is sent, the packet number 0x00004021 is increased by 1, and the data packet period is 50ms.
[0080] A group of data packets requires 5 frames to be sent, namely frame numbers 1 (multi-frame - first frame), 2 (multi-frame - middle frame), 3 (multi-frame - middle frame), 4 (multi-frame - middle frame), 5 (multi-frame - last frame). Except for the last frame, the data length of each frame should be 1024 bytes, and the data frame period is 5ms.
[0081] After ADCU receives the point cloud data sent by Lidar, in addition to performing CRC16 check on each frame of data, it also needs to perform CRC32 packet check (combined with packet mask + check value) on the combined data packet after receiving a group of data packets.
[0082] Similarly, when the ADCU receives the middle frame or the last frame within 40ms after the first frame and cannot form a data packet or fails to verify, it requests the Lidar to send the frame sequence number of the supplementary transmission, as shown in Table 5. The Lidar should respond to the supplementary transmission request within 30ms, otherwise the packet sequence number will be discarded. If the first frame of a group of data is lost or fails to pass the verification, the frame supplementary transmission fails or even the packet verification fails, the ADCU will directly request the IVI to supplement the data packet (a group of data), and its request packet sequence number is the sequence number corresponding to the abnormal packet and the frame sequence number is 0.
[0083] In addition, after ADCU requests to retransmit the packet sequence number, some frames originally received will be discarded.
[0084] Table 5: ADCU request retransmission frame definition
[0085] The data transmission method based on the vehicle Ethernet protocol provided by the present invention has the following advantages: 1. The in-vehicle Ethernet protocol provided by the present invention adopts two transmission mechanisms: single-packet and multi-packet, which can cover the transmission of different data sizes, while avoiding IP layer fragmentation and reducing transmission delay.
[0086] 2. The in-vehicle Ethernet protocol provided by the present invention can continuously monitor (single-packet, multi-packet) Ethernet data frame loss or inspection failure and establish a retransmission mechanism for lost frames, thereby maximizing transmission reliability.
[0087] 3. The in-vehicle Ethernet protocol provided by the present invention is defined on the upper layer of the UDP protocol, does not need to rely on other basic protocols, is simple to implement, and has good scalability.
[0088] In order to better implement the data transmission method based on the vehicle Ethernet protocol in the embodiment of the present invention, on the basis of the data transmission method based on the vehicle Ethernet protocol, the embodiment of the present invention also provides a data transmission device based on the vehicle Ethernet protocol. Figure 5 The structure diagram of an embodiment of a data transmission device based on the vehicle Ethernet protocol provided by the present invention is as follows: Figure 5 As shown, the data transmission device 500 based on the vehicle Ethernet protocol includes: The receiving module 510 is used to receive target data sent by the server through 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 a single-packet vehicle Ethernet protocol and a multi-packet vehicle Ethernet protocol; A detection module 520, configured to perform frame loss detection and integrity check on the target data based on the protocol type; A determination module 530, configured to determine an abnormal data frame in case of frame loss or integrity check failure; The request module 540 is used to request the server to resend the abnormal data frame.
[0089] The data transmission device 500 based on the vehicle Ethernet protocol provided in the above embodiment can implement the technical solution described in the above embodiment of the data transmission method based on the vehicle Ethernet protocol. The specific implementation principles of the above modules or units can refer to the corresponding contents in the embodiment of the data transmission method based on the vehicle Ethernet protocol, which will not be repeated here.
[0090] 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 of the components shown, and more or fewer components may be implemented instead.
[0091] In some embodiments, the processor 601 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes stored in the memory 602 or process data, such as the data transmission method based on the vehicle Ethernet protocol in the present invention.
[0092] In some embodiments, the processor 601 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 601 may be local or remote. In some embodiments, the processor 601 may be implemented in a cloud platform. In some embodiments, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0093] In some embodiments, the memory 602 may be an internal storage unit of the electronic device 600, such as a hard disk or memory of the electronic device 600. In other embodiments, the memory 602 may also be an external storage device of the electronic device 600, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 600.
[0094] Furthermore, the memory 602 may include both an internal storage unit of the electronic device 600 and an external storage device. The memory 602 is used to store application software installed in the electronic device 600 and various data.
[0095] In some embodiments, the display 603 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (OLED) touch device, etc. The display 603 is used to display information on the electronic device 600 and to display a visual user interface. The components 601-603 of the electronic device 600 communicate with each other via a system bus.
[0096] 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 may be implemented: Receiving target data sent by the server through 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 a single-packet vehicle Ethernet protocol and a multi-packet vehicle Ethernet protocol; Based on the protocol type, performing frame loss detection and integrity check on the target data; In case of frame loss or integrity check failure, determine abnormal data frames; Request the server to resend the abnormal data frame.
[0097] 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 above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0098] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 600 mentioned, and the electronic device 600 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may 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 present invention, the electronic device 600 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0099] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the data transmission method based on the in-vehicle Ethernet protocol provided in the above-mentioned method embodiments.
[0100] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0101] The data transmission method, device and storage medium based on the vehicle Ethernet protocol provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A data transmission method based on an in-vehicle Ethernet protocol, characterized in that: include: Receive target data sent by the server through 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, performing frame loss detection and integrity check on the target data; In case of frame loss or integrity check failure, determine abnormal data frames; Request the server to resend the abnormal data frame.
2. The data transmission method based on the vehicle 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, transmission 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 check, frame sequence number, total number of frames, sent data and check.
3. The data transmission method based on the vehicle Ethernet protocol according to claim 2, characterized in that: The protocol type is determined by: When the length of the target data is less than or equal to the preset length byte, determining that the protocol type is a single-packet vehicle-mounted Ethernet protocol; When the length of the target data is greater than the preset length byte, it is determined that the protocol type is a multi-packet in-vehicle Ethernet protocol.
4. The data transmission method based on the vehicle Ethernet protocol according to claim 3 is characterized in that: The performing frame loss detection and integrity check on the target data based on the protocol type includes: When the protocol type is a single-packet vehicle-mounted Ethernet protocol, monitoring a packet sequence number of the vehicle-mounted Ethernet protocol; Performing frame loss detection on the target data based on the packet sequence number; The target data is checked for integrity by CRC16.
5. The data transmission method based on the vehicle Ethernet protocol according to claim 4, characterized in that: The performing frame loss detection and integrity check on the target data based on the protocol type includes: When the protocol type is a multi-packet vehicle Ethernet protocol, monitoring a frame sequence number of the vehicle Ethernet protocol; Performing frame loss detection on the target data based on the frame sequence number; The target data is integrity checked by CRC16 and CRC32.
6. The data transmission method based on the vehicle Ethernet protocol according to claim 1, characterized in that: The requesting the server to resend the abnormal data frame comprises: Sending a request packet message to the server within a preset time period; the request packet message includes a packet sequence number or a frame sequence number corresponding to the abnormal data frame.
7. The data transmission method based on the vehicle Ethernet protocol according to claim 1, characterized in that: The in-vehicle Ethernet protocol is located on the upper layer of the UDP protocol.
8. A data transmission device based on the vehicle Ethernet protocol, characterized in that: include: A receiving module, used to receive target data sent by the server through 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 a single-packet vehicle Ethernet protocol and a multi-packet vehicle Ethernet protocol; A detection module, used for performing frame loss detection and integrity check on the target data based on the protocol type; A determination module, used to determine abnormal data frames in case of frame loss or integrity check failure; The request module is used to request the server to resend the abnormal data frame.
9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory, and is used to execute the program stored in the memory to implement the data transmission method based on the in-vehicle Ethernet protocol as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data transmission method based on the in-vehicle Ethernet protocol as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data transmission method based on vehicle bus
CN105847101A
Video data transmission method and device
CN106792262A
A vehicle data transmission system and method
CN110191439A
Vehicle CAN bus data interaction system and interaction method thereof
CN110324222A
In-vehicle infotainment terminal CAN message transmission method
CN112751737A
Cited By
Ethernet link data transmission method and device, electronic equipment and storage medium
CN121283574A
