Vehicle-mounted Ethernet data transmission method and device, vehicle and storage medium
By allowing the receiver to directly judge and parse application layer data based on the Ethernet frame header during in-vehicle Ethernet data transmission, the problem of low data transmission efficiency in traditional in-vehicle Ethernet technology is solved, and efficient application layer data transmission is achieved.
Patent Information
- Application Number
- CN202410239637.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-04
- Publication Date
- 2025-09-12
AI Technical Summary
Traditional in-vehicle Ethernet technology requires identification information processing through multiple layers of communication protocols during data transmission, resulting in reduced data transmission efficiency.
After the receiver receives the Ethernet data packet, it determines whether it is the target receiver based on the Ethernet frame header, and directly parses the application layer data from the data packet when it is the target receiver, reducing the processing and encapsulation of data at each layer.
It achieves efficient transmission of application layer data, reduces the time for data encapsulation and parsing, and improves data transmission efficiency.
Smart Images

Figure CN120639884A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a vehicle-mounted Ethernet data transmission method, device, vehicle, and storage medium. Background Art
[0002] As the data transmitted within vehicles becomes increasingly complex and diverse, traditional bus communication methods are no longer able to meet the needs of in-vehicle data transmission in many scenarios. In recent years, Ethernet, a computer network communication technology that far outperforms bus communication methods, has been gradually introduced into in-vehicle networks and has become one of the mainstream in-vehicle data communication technologies.
[0003] Among them, in-vehicle Ethernet technology needs to be implemented in accordance with the OSI model (Open System Interconnection Reference Model, open system interconnection communication reference model), which has multiple layers from bottom to top, including the physical layer, data link layer, network layer, transport layer, and application layer. In addition, different layers have different standards and protocols, and the upper layer needs to use the services and interfaces provided by the lower layer to realize network transmission functions. In other words, when data is transmitted through in-vehicle Ethernet, the data needs to be encapsulated, parsed, and processed according to the identification information corresponding to the above-mentioned multi-layer communication protocols before data interaction between various devices in the car can be realized.
[0004] However, because the network connections and topology between various devices in a car are simpler, the sender, receiver, and the data transmission path between them are all known. Therefore, using traditional in-vehicle Ethernet technology requires encapsulating, parsing, and processing data through the corresponding identification information of the aforementioned multiple communication protocols before sending it to the receiver, which reduces data transmission efficiency. Summary of the Invention
[0005] The embodiments of the present application provide a method, device, vehicle, and storage medium for transmitting data via an in-vehicle Ethernet, which can solve the problem of low data transmission efficiency when using traditional in-vehicle Ethernet technology for data transmission.
[0006] In a first aspect, an embodiment of the present application provides a method for in-vehicle Ethernet data transmission, the method comprising:
[0007] The receiver receives the Ethernet data packet; the Ethernet data packet includes an Ethernet frame header, a data header, and application layer data; the Ethernet frame header carries the destination physical address of the target receiver;
[0008] The receiver determines whether it is the target receiver based on the Ethernet frame header; if it is the target receiver, it parses the application layer data from the Ethernet data packet.
[0009] In a second aspect, an embodiment of the present application provides an in-vehicle Ethernet data transmission device, the device comprising:
[0010] A receiving module is used for receiving an Ethernet data packet at a receiving end; the Ethernet data packet includes an Ethernet frame header, a data header, and application layer data; the Ethernet frame header carries the destination physical address of the target receiver;
[0011] The first processing module is used for the receiver to determine whether it is the target receiver according to the Ethernet frame header; if it is the target receiver, the application layer data is parsed from the Ethernet data packet.
[0012] In a third aspect, an embodiment of the present application provides a vehicle comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of the first aspect described above when executing the computer program.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method of the first aspect described above.
[0014] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a vehicle, enables the vehicle to execute the method of the first aspect described above.
[0015] Compared to the prior art, the embodiments of the present application offer the following advantages: Because in-vehicle networks differ from traditional computer networks, the network connection method and topology between various in-vehicle devices are simpler, and the sender, receiver, and data transmission paths between them are all known. Therefore, when a vehicle sender needs to send application-layer data to a receiver, the sender can simply encapsulate the receiver's destination physical address in the Ethernet frame header and directly send the encapsulated Ethernet packet to the receiver based on the destination physical address. Upon receiving the Ethernet packet, the receiver can determine the intended recipient based on the Ethernet frame header and parse the application-layer data from the Ethernet packet. This eliminates the need for the data to be processed at each layer and then accurately select the appropriate transmission path or port for transmission to the receiver. This reduces the number of layers required for data encapsulation and processing during Ethernet transmission, achieving efficient transmission of application-layer data. Furthermore, because application-layer data is not passed through various layers and processed by multiple standards and protocols, the sender cannot directly parse and process the application-layer data based on the standards and protocols of each layer. Therefore, to enable the receiver to directly and properly parse and process application-layer data, the sender can pre-define the parsing and processing methods for application-layer data in the data header. Based on this, by encapsulating application-layer data only once during transmission, and only encapsulating the application-layer data processing protocol in the data header, it is no longer necessary to re-parse and encapsulate the data according to the standards and protocols of each layer. This can further reduce the encapsulation time of application-layer data at the sender and the parsing and processing time at the receiver. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0017] Figure 1 This is a schematic diagram of traditional Ethernet data packet encapsulation;
[0018] Figure 2 This is a flowchart of an implementation method of an in-vehicle Ethernet data transmission method provided by an embodiment of the present application;
[0019] Figure 3 This is a schematic diagram of the encapsulation format of an Ethernet data packet in a method for in-vehicle Ethernet data transmission provided by an embodiment of the present application;
[0020] Figure 4This is a schematic diagram of the format of a data header in a method for in-vehicle Ethernet data transmission provided by an embodiment of the present application;
[0021] Figure 5 This is a structural diagram of an in-vehicle Ethernet data transmission device provided by one embodiment of the present application;
[0022] Figure 6 It is a structural schematic diagram of a vehicle provided in one embodiment of the present application. DETAILED DESCRIPTION
[0023] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0024] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0025] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0026] With the increasing complexity and diversity of data transmission within vehicles, traditional vehicle bus communication methods are no longer able to meet the needs of in-vehicle data transmission in many scenarios. Traditional vehicle bus communication methods, including but not limited to CAN (Controller Area Network) and LIN (Local Interconnect Network), are no longer able to meet the needs of in-vehicle data transmission in many scenarios.
[0027] In recent years, Ethernet, as a computer network communication technology that is far superior to bus communication, has been gradually introduced into in-vehicle networks and has become one of the mainstream data communication technologies in vehicles.
[0028] In-vehicle Ethernet technology must be implemented according to the OSI model, which consists of multiple layers from bottom to top, including the physical layer, data link layer, network layer, transport layer, and application layer. Furthermore, different layers have different standards and protocols, and the upper layers must use the services and interfaces provided by the lower layers to implement network transmission functions.
[0029] Specifically, the physical layer and data link layer primarily adhere to standards established by the IEEE (Institute of Electrical and Electronics Engineers), such as IEEE 802.3bw (100BASE-T1, 100M automotive Ethernet physical layer standard), IEEE 802.3bp (1000BASE-T1, Gigabit automotive Ethernet physical layer standard), and IEEE 802.3 (Common Ethernet Standard). The network layer, transport layer, and application layer primarily adhere to industry specifications established and maintained by the IETF and AUTOSAR, such as RFC 791 (Internet Protocol), RFC 793 (Transmission Control Protocol), and SOME / IP Protocol Specification (Scalable Service-Oriented Middleware over IP).
[0030] When data is transmitted within the vehicle via in-vehicle Ethernet, the aforementioned standards and underlying protocols are used for data encapsulation, parsing, and processing. The upper layer selects the appropriate protocol based on the application, enabling functional scenarios such as data exchange, diagnostics, flashing, audio / video, and big data transmission between various devices within the vehicle.
[0031] Specifically, when the sender transmits data between layers, data starts at the application layer and moves downwards, encapsulating the layer's identification information with each layer. Conversely, when the receiver transmits data between layers, data starts at the physical layer and moves upwards, stripping the layer's identification information with each layer.
[0032] Specifically, refer to Figure 1 , Figure 1 This is a diagram of traditional Ethernet packet encapsulation. When the sender encapsulates data, the Ethernet protocol adds an Ethernet frame header, the IP protocol adds an IP header, the TCP protocol adds a TCP or UDP header, and the application layer adds identifying information such as a SOME, IP, or DoIP header. Conversely, as data is exchanged between layers, the receiver strips off the identifying information at each layer. Ultimately, the data received by the receiver is the data generated by the sender, and all other identifying information used for data transmission is stripped off.
[0033] Among them, because the physical layer mainly uses the transmission medium to provide a physical connection for the data link layer, there is no need to encapsulate identification information in the Ethernet data packet.
[0034] It's important to note that Ethernet, as a computer network communication technology, is a traditional computer network technology where the links between data senders and receivers are long and complex. Data typically needs to pass through several intermediate devices, such as switches and routers, and undergo complex path selection and link transmission before reaching the receiver. In this scenario, a processing method that encapsulates and parses data layer by layer and adds identification information to each layer helps accurately select and transmit data, improving transmission accuracy.
[0035] For example, in a traditional Ethernet data packet, it is usually necessary to select a transmission path for the Ethernet data packet through identification information of the network layer, and it is necessary to select a transmission port for the Ethernet data packet through identification information of the transport layer.
[0036] However, unlike traditional computer networks, in-vehicle networks feature simpler connections and topologies between various devices. The sender, receiver, and data transmission paths between them are all known. Therefore, the use of in-vehicle Ethernet technology requires data to be encapsulated, parsed, and processed using the corresponding identification information from the aforementioned multiple layers of communication protocols before it can be sent to the receiver, resulting in lower data transmission efficiency.
[0037] Based on this, when a vehicle uses Ethernet data for transmission, in order to improve data transmission efficiency and ensure that the receiving party can parse and process the data in the received Ethernet data packet, this embodiment provides an in-vehicle Ethernet data transmission method. This method can be applied to various senders within the vehicle. For example, it can be applied to devices such as vehicle controllers, electronic control units, and intelligent driving controllers. The embodiments of this application do not impose any restrictions on the specific type of sender. For ease of explanation, the sender is an example of a device in a vehicle that needs to send data.
[0038] See also Figure 2 , Figure 2 The following is a flowchart illustrating an implementation method of an in-vehicle Ethernet data transmission method provided by an embodiment of the present application, which includes the following steps:
[0039] S201. A receiver receives an Ethernet data packet. The Ethernet data packet includes an Ethernet frame header, a data header, and application layer data. The Ethernet frame header carries a destination physical address of a target receiver.
[0040] In one embodiment, as can be seen from the above description, the sender and receiver are devices in the vehicle, and the sender and receiver can be converted to each other. For example, for two devices, the vehicle controller and the engine, the vehicle controller needs to collect driver control information, such as vehicle driving information and feedback from various devices such as the engine, motor, and transmission. Then, after calculation, it sends control commands to each device, thereby achieving control of the entire vehicle.
[0041] At this point, it can be assumed that when the vehicle controller receives feedback from various devices, such as the engine, motor, and gearbox, each device is the sender of application-layer data, and the vehicle controller is the receiver. Subsequently, when the vehicle controller needs to send control instructions to various devices, the vehicle controller becomes the sender of application-layer data, and the engine, motor, gearbox, and other devices are the receivers.
[0042] It should be noted that a sender can generate one or more different application layer data. When the sender changes, the application layer data to be transmitted will also change. Also, when the receiver changes, the corresponding application layer data will also change accordingly.
[0043] For example, when the sender is a vehicle controller, it can generate control instructions corresponding to each device such as the engine, motor, gearbox, etc. as application layer data to be sent.
[0044] In one embodiment, the network connection method and topology between various devices within the vehicle are described above as being simpler, with the sender, receiver, and the data transmission path between them all being known. Traditional in-vehicle Ethernet technology requires encapsulating, parsing, and processing data before sending it to the receiver, using the corresponding identification information from multiple layers of communication protocols, resulting in lower data transmission efficiency.
[0045] Based on this, in this embodiment, the encapsulation format of the Ethernet data packet is different from the encapsulation format of the traditional Ethernet data packet.
[0046] Specifically, because the transmission path between the sender and receiver is known, the sender simply encapsulates the target receiver's destination physical address in the Ethernet packet to send the Ethernet packet to the target receiver. Furthermore, the receiver is typically a node or controller, and both the physical layer and the application layer are part of the receiver. Therefore, after the target receiver parses the application layer data from the Ethernet packet, it can directly send it to the target receiver's application layer for processing. Therefore, the application layer data does not need to be processed by the physical layer and application layer standards and protocols during transmission. Consequently, the application layer data can reach the target receiver's application layer from the target sender's application layer at the fastest speed.
[0047] It should be noted that because the application layer data has not been parsed and encapsulated according to the standards and protocols of each layer of Ethernet, when the sender directly encapsulates the application layer data into an Ethernet data packet and sends it to the target receiver, the target receiver cannot parse the application layer data based on the Ethernet protocol.
[0048] Based on this, in order to enable the target receiver to process the application layer data normally, the sender needs to encapsulate the processing protocol that can parse the application layer data in the Ethernet data packet when encapsulating the application layer data. That is, the Ethernet data packet at least includes an Ethernet frame header carrying the destination physical address of the target receiver, a data header carrying the processing protocol that can parse the application layer data, and the application layer data. For details, refer to Figure 3 , Figure 3 This is a schematic diagram of the encapsulation format of an Ethernet data packet in a vehicle-mounted Ethernet data transmission method provided by an embodiment of the present application.
[0049] In another embodiment, the Ethernet frame header may also carry the source physical address of the sender, which is not limited.
[0050] The processing protocol for parsing application layer data may be pre-defined by the staff and is not limited thereto.
[0051] As an example, the data header carries the field values corresponding to multiple fields such as data packet identification, data packet length, data packet type, target counter, offset identification and offset. Figure 4 , Figure 4 This is a schematic diagram of the format of a data header in a vehicle-mounted Ethernet data transmission method provided by an embodiment of the present application.
[0052] The packet identifier can be used to uniquely identify Ethernet packets. For example, when a vehicle's body controller is the sender, it typically needs to control the opening and closing of devices such as doors, windows, and air conditioning. In this case, if the application layer data is an open command, the packet identifier can be used to uniquely identify the object being opened to further clarify the object. In other words, the packet identifier can also be used to identify the application scenario of application layer data.
[0053] The packet identifier can be represented by numbers or letters, and the size of the packet identifier in the Ethernet packet can be set according to actual conditions and is not limited thereto. For example, the packet identifier can be represented by numbers and can occupy 16 bits. For example, the packet identifier can be identified by a combination of 0s and 1s occupying 16 bits.
[0054] The packet length described above can be used to describe the total bytes of the data header and application layer data. For example, the byte size required for each field can be predefined. For example, the packet identifier is stored in 16 bits, the packet length is stored in 16 bits, the packet type is stored in 8 bits, the destination counter is stored in 8 bits, the offset identifier is stored in 2 bits, and the offset is stored in 14 bits. Furthermore, a preset bit size can also be predefined for storage of application layer data.
[0055] If the application layer data exceeds the preset bit size, it must be fragmented and transmitted, i.e., sent using multiple Ethernet packets. In this case, the current Ethernet packet will record the offset of the initial bit of the application layer data, which is equivalent to the original application layer data, and an offset identifier. The offset and offset identifier are described in detail below.
[0056] When the data packet header also includes other types of fields, the bit sizes occupied by them may also be defined in advance, and there is no limitation on this.
[0057] The offset identifier is used to describe whether the Ethernet data packet is fragmented; the offset is used to describe the offset of the current application layer data relative to the initial bit in the original application layer data when the original application layer data is fragmented and sent.
[0058] The types represented by the offset identifier include: application layer data is not fragmented; application layer data is fragmented; application layer data is fragmented and the current application layer data is not the last fragment; application layer data is fragmented and the current application layer data is the last fragment. Different types can also be represented by different offset identifiers.
[0059] For example, the offset identifier when the application layer data is not fragmented can be Bit 00, the offset identifier when the application layer data is fragmented can be Bit01, the offset identifier when the application layer data is fragmented and the current application layer data is not the last fragment can be Bit10, and the offset identifier when the application layer data is fragmented and the current application layer data is the last fragment can be Bit11, and there is no limitation on this.
[0060] The reason for fragmentation is that when the sender determines that the size of the original application layer data to be sent exceeds the preset bit size of application layer data in a predefined Ethernet packet, it needs to fragment the original application layer data to generate multiple fragments of the original application layer data. Each fragment is then encapsulated into an Ethernet packet. At this point, each Ethernet packet contains a portion of the original application layer data, as well as the corresponding offset identifier and offset.
[0061] Exemplarily, when the original application layer data is divided into three fragments, the offset identifier of the partial original application layer data corresponding to the first fragment will be Bit10, and the partial original application layer data of the first fragment usually includes the initial bit in the original application layer data. Therefore, the offset is usually 0. The offset identifier of the partial original application layer data corresponding to the second fragment will also be Bit10, and the offset of the partial original application layer data of the second fragment relative to the initial bit will usually be the size of the partial original application layer data of the first fragment. And, the offset identifier of the partial original application layer data corresponding to the third fragment will be Bit11, and the offset of the partial original application layer data of the third fragment relative to the initial bit will usually be the sum of the size of the partial original application layer data of the first fragment and the size of the partial original application layer data of the second fragment.
[0062] After the sender sends the Ethernet data packets corresponding to each fragment to the receiver, the receiver may reassemble the portions of the original application layer data corresponding to all fragments if it determines based on the offset identifier that the application layer data is the last fragment. Otherwise, if it determines based on the offset identifier that the application layer data is not the last fragment, it waits for the Ethernet data packet corresponding to the last fragment to arrive before reassembling the data.
[0063] The reassembly method is as follows: the receiver calculates the positions of the parts of the original application layer data corresponding to each fragment in the original application layer data according to the offset relative to the initial position, and then reassembles them into the original application layer data before fragmentation.
[0064] The above packet types are used to describe the processing types of Ethernet packets, including but not limited to request type, no response request type, notification type, response type, and unused type, which are not limited to this.
[0065] The request type indicates that the Ethernet packet is requesting data from the receiver and can be represented by 0X00 in the Ethernet packet. The no-response-required request type indicates that the receiver does not need to respond to the sender and only needs to receive the Ethernet packet. The no-response-required request type can be represented by 0X01 in the target Ethernet. The notification type also indicates that the Ethernet packet is an event notification packet and does not require the receiver to respond to the sender. The notification type can be represented by 0X02 in the target Ethernet. The reply type indicates that the receiver must respond to the sender based on the application layer data. The reply type can be represented by 0X80 in the target Ethernet. The unused type indicates that the application layer data is invalid and the receiver does not need to process the application layer data. The unused type can be represented by other field values in the target Ethernet, for example, 000X.
[0066] The target counter is used to describe the number of Ethernet packets currently being sent from the sender to the receiver. For example, the initial value of the counter in the Ethernet packet may be 1. Each time an Ethernet packet is sent to the same receiver, the field value in the target counter may be incremented by a preset value. For example, the target counter in the last Ethernet packet sent may be incremented by 1. Because the packet counter occupies 8 bits and represents counts using 0s and 1s, after reaching its maximum value of 255, the next time an Ethernet packet is sent to the receiver, its field value may be represented by 1 again, and the count may be restarted.
[0067] Based on the above description, when the sender encapsulates the application layer data to be sent, generates an Ethernet data packet, and sends it to the receiver, the sender can determine the target counter in the previously generated Ethernet data packet carrying the same destination physical address based on the destination physical address of the current target receiver. Then, the sender determines the target counter in the currently generated Ethernet data packet based on the target counter in the previously generated Ethernet data packet. Finally, the destination physical address of the current target receiver is written into the Ethernet frame header, the target counter in the currently generated Ethernet data packet is encapsulated into the data header, and the application layer data to be sent is encapsulated in the data area following the data header, thereby generating an Ethernet data packet.
[0068] It should be noted that when the sender sends a target Ethernet data packet to receiver A, it needs to look up and determine the target counter in the last Ethernet data packet sent to receiver A based on the destination physical address of receiver A. In other words, it does not look up the target counter in the last Ethernet data packet sent to other receivers, nor does it look up the total counter of all Ethernet data packets sent by the sender.
[0069] Next, the target counter in the currently generated Ethernet packet is determined based on the target counter in the previously generated Ethernet packet. For example, the target counter in the currently generated Ethernet packet can be obtained by adding 1 to the target counter in the previously sent Ethernet packet, as described above. Finally, the sender can write the destination physical address into the Ethernet frame header, encapsulate the target counter in the data header, and encapsulate the application layer data in the data area following the data header, thereby generating the Ethernet packet.
[0070] In another embodiment, the data header may further include a reserved field of preset bytes. The preset bytes may be set according to actual conditions and are not limited thereto. It should be noted that when calculating the length of the above-mentioned data packet, the preset bytes should also be counted. For example, the size of the above-mentioned preset bytes may be 16 bits. For details, please refer to Figure 4 Schematic diagram of the encapsulation format of an Ethernet data packet, which includes a reserved field.
[0071] It should be noted that the setting of the reserved field allows the field value of the corresponding field type to be written into the reserved field when the application layer data transmission scenario changes in the future, so as to diversify the usage scenarios of application layer data transmission.
[0072] Exemplarily, the reserved field may also be the lifetime of the Ethernet packet. After exceeding the lifetime, the Ethernet packet will be discarded. At this point, it can be considered that the type of the Ethernet packet will be converted into an unused type.
[0073] In another embodiment, the data packet header may also carry a timestamp, which is used to describe the time when the Ethernet data packet is sent. The unit of the sending time may be seconds or nanoseconds, which is not limited. Figure 4 Figure 1 shows the format of the data header, which contains timestamps in different units. The sender can select the appropriate timestamp to encapsulate the sending time based on the application scenario of the application layer data.
[0074] It is understandable that for application layer data transmission scenarios with high data real-time requirements, the Ethernet data packet must include the transmission time of the application layer data in order to process the application layer data accordingly. For example, for vehicle autonomous driving scenarios, the intelligent driving controller usually needs to control the driving state of the vehicle in real time based on the positioning information uploaded by the positioning device. At this time, the positioning device, as the sender of the application layer data, usually needs to write the corresponding transmission time into the timestamp when uploading the positioning information to generate the Ethernet data packet.
[0075] In one embodiment, the bytes occupied by the timestamp can also be pre-defined and included in the calculation of the packet length. For example, the timestamp can be defined in accordance with the IEEE 802.1AS protocol, occupying a total of 10 bytes.
[0076] In another embodiment, the data header further includes verification information for the target receiver to verify the integrity of the received Ethernet data packet.
[0077] For example, the sender can encrypt the non-checksum field values in the data header and the application layer data using a preset encryption method to generate the checksum information. The sender can then write the destination physical address into the Ethernet frame header, encapsulate the checksum information into the data header, and encapsulate the application layer data into the data area following the data header, thereby generating an Ethernet data packet.
[0078] The field values corresponding to the non-check information are the values corresponding to the aforementioned fields such as the packet identifier, packet length, packet type, target counter, offset identifier, and offset. It is understood that when the data header includes other fields, the values corresponding to these other fields should also participate in the encryption process. For example, the values corresponding to the aforementioned reserved fields and timestamp are included.
[0079] It should be noted that since the Ethernet frame header does not contain information describing the application layer data, when generating the above-mentioned verification information, it can be generated only based on the data header and application layer data, thereby reducing the amount of data generated for the verification information and improving the generation rate of the verification information.
[0080] The encryption processing method may be a checksum generation method, a parity check method, or the like, which is not limited thereto. In this embodiment, the checksum generation method may be used to generate the verification information. Exemplarily, the calculation method may be to add the field values corresponding to each field in the data header and the application layer data in groups of 16 bits. Bits less than 16 bits are padded with 0s, and any carry is padded to the last bit to obtain the summed result. Finally, the summed result is negated to obtain the verification information.
[0081] When the receiver receives the Ethernet packet, it can re-encrypt it using the same encryption method based on the values of the non-checksum fields in the data header and the application-layer data to generate checksum information. If the two checksums match, the receiver can assume that the Ethernet packet has been received intact. Otherwise, if the two checksums differ, the receiver can assume that the Ethernet packet was lost during transmission.
[0082] In summary, this is an example of encapsulating application layer data to generate Ethernet data packets. Figure 1 and Figure 3 By comparison, the Ethernet data packet only retains the Ethernet frame header in the traditional Ethernet data packet, and there is no need to encapsulate the corresponding identification information at each layer, which reduces the time for application layer data encapsulation and improves the transmission efficiency of application layer data.
[0083] S202: The receiver determines whether it is the target receiver based on the Ethernet frame header; if it is the target receiver, it parses the application layer data from the Ethernet data packet.
[0084] In one embodiment, the Ethernet frame header includes the destination physical address of the intended recipient. Therefore, the recipient can match its own physical address with the destination physical address. If they match, it can be determined to be the intended recipient. Otherwise, it is determined not to be the intended recipient and does not need to process the Ethernet packet.
[0085] In addition, the above description has been used to illustrate that application layer data can be parsed based on the data header, which will not be further explained.
[0086] In this embodiment, because the in-vehicle network differs from traditional computer networks, the network connection method and topology between various in-vehicle devices are simpler. The sender, receiver, and the data transmission paths between them are all known. Therefore, when a sender in a vehicle needs to send application-layer data to a receiver, the sender can simply encapsulate the receiver's destination physical address in the Ethernet frame header and directly send the encapsulated Ethernet packet to the receiver based on the destination physical address. Upon receiving the Ethernet packet, the receiver can determine the intended recipient based on the Ethernet frame header and parse the application-layer data from the Ethernet packet. This eliminates the need for the data to be processed at each layer and then accurately select the appropriate transmission path or port for transmission to the receiver. This reduces the number of layers required for data encapsulation and processing during Ethernet transmission, achieving efficient transmission of application-layer data. Furthermore, because application-layer data is not passed through various layers and processed according to multiple standards and protocols, the sender cannot directly parse and process the application-layer data based on the standards and protocols at each layer. Therefore, to enable the receiver to directly and properly parse and process application-layer data, the sender can pre-define the parsing and processing methods for application-layer data in the data header. Based on this, by encapsulating application-layer data only once during transmission, and only encapsulating the application-layer data processing protocol in the data header, it is no longer necessary to re-parse and encapsulate the data according to the standards and protocols of each layer. This can further reduce the encapsulation time of application-layer data at the sender and the parsing and processing time at the receiver.
[0087] In another embodiment, as described in S201 above, the Ethernet frame header also includes the sender's source physical address, and the request type also includes the response type to which the receiver must respond to the sender. Therefore, when the receiver needs to respond to the sender based on application layer data, the application layer data to be responded to can be encapsulated based on the sender's source physical address and sent to the sender.
[0088] In another embodiment, when the Ethernet frame header includes a source physical address, the target receiver can also determine the destination counter in the previously received Ethernet packet carrying the same source physical address based on the source physical address of the sender of the currently received Ethernet packet. The target receiver can then compare the destination counter in the previously received Ethernet packet with the destination counter in the currently received Ethernet packet to determine whether an Ethernet packet has been lost. Finally, if it is determined that an Ethernet packet has been lost, a response signal corresponding to the destination counter of the lost Ethernet packet is fed back to the corresponding sender. In this case, the sender can resend the corresponding Ethernet packet to the receiver or generate an alarm based on the response signal.
[0089] Based on the above explanation of the destination counter, it is understood that it is used to describe the count of Ethernet packets received by the target receiver. Therefore, after receiving an Ethernet packet, the target receiver can determine the destination counter carried in the data header of the last Ethernet packet received from the sender with the same source physical address based on the source physical address.
[0090] It is understood that the target counter in this Ethernet packet is generated by the sender based on the target counter in the previous Ethernet packet sent to the receiver. Therefore, if the target receiver can normally receive each Ethernet packet sent by the same sender, the target counters in two adjacent Ethernet packets received by the target receiver should differ by a preset value, for example, a difference of 1.
[0091] Based on this, a method for determining whether an Ethernet packet has been lost can be as follows: the target receiver can calculate the difference between the target counters in two adjacent received Ethernet packets. If the difference is not a preset value (e.g., 1), the target receiver can determine that an Ethernet packet has been lost. Furthermore, the target counters located between the target counters corresponding to the two adjacent Ethernet packets can be determined, and the Ethernet packets corresponding to the target counters between them can be determined to have been lost. Based on this, the target receiver can feed back a response signal corresponding to the target counter of the lost Ethernet packet to the corresponding sender.
[0092] Upon receiving the response signal from the intended recipient, the sender can execute a pre-defined policy. For example, this policy may include resending the corresponding Ethernet packet to the intended recipient or generating an alert, though these policies are not limited to specific ones. Furthermore, if the sender determines that an error exists in the in-vehicle Ethernet data transmission, it can resend the lost Ethernet packet to the intended recipient, enabling timely remediation or early warning.
[0093] For example, if the destination counter in the last received Ethernet packet is 10 and the destination counter in the currently received Ethernet packet is 13, it can be considered that the destination counter values between the two destination counters are 11 and 12. Therefore, the destination receiver can feed back a response signal corresponding to the destination counters (11 and 12) of the lost Ethernet packet to the corresponding sender.
[0094] Furthermore, when it is determined that no Ethernet data packet is lost, the target receiver may consider that all Ethernet data packets previously sent by the sender are not lost.
[0095] See also Figure 5 , Figure 5 This is a structural block diagram of a vehicle-mounted Ethernet data transmission device provided in an embodiment of the present application. The vehicle-mounted Ethernet data transmission device in this embodiment includes modules for executing Figure 2 Each step in the corresponding embodiment. Please refer to Figure 2 as well as Figure 2 For the convenience of explanation, only the parts related to this embodiment are shown. Figure 5 The vehicle-mounted Ethernet data transmission device 500 may include: a receiving module 510 and a first processing module 520, wherein:
[0096] The receiving module 510 is used for the receiver to receive the Ethernet data packet; the Ethernet data packet includes an Ethernet frame header, a data header and application layer data; the Ethernet frame header carries the destination physical address of the target receiver.
[0097] The first processing module 520 is used for the receiver to determine whether it is the target receiver according to the Ethernet frame header; if it is the target receiver, the application layer data is parsed from the Ethernet data packet.
[0098] In one embodiment, the data header carries a packet identifier, a packet length, a packet type, a target counter, an offset identifier, and an offset; the packet identifier is used to identify the uniqueness of the Ethernet packet; the packet length is used to describe the total bytes of the data header and application layer data; the packet type is used to describe the processing type of the Ethernet packet; the target counter is used to describe the count of Ethernet packets currently sent by the sender to the receiver; the offset identifier is used to describe whether the Ethernet packet is fragmented; and the offset is used to describe the offset of the current application layer data relative to the initial bit in the original application layer data when the original application layer data is fragmented and sent.
[0099] In one embodiment, the Ethernet data transmission device 500 further includes:
[0100] The second processing module is used for the sender to encapsulate the application layer data to be sent, generate an Ethernet data packet, and send it to the receiver;
[0101] The second processing module is further configured to:
[0102] According to the destination physical address of the current target recipient, the target counter in the last generated Ethernet data packet carrying the same destination physical address is determined; according to the target counter in the last generated Ethernet data packet, the target counter in the current Ethernet data packet to be generated is determined; the destination physical address of the current target recipient is written into the Ethernet frame header, and the target counter in the current Ethernet data packet to be generated is encapsulated into the data header, and the application layer data to be sent is encapsulated in the data area after the data header to generate an Ethernet data packet.
[0103] In one embodiment, the Ethernet frame header further includes a source physical address of the sender; the Ethernet data transmission device 500 further includes:
[0104] The determination module is used for the target receiver to determine the target counter in the last received Ethernet data packet carrying the same source physical address according to the source physical address of the sender in the currently received Ethernet data packet.
[0105] The judging module is used to compare the target counter in the last received Ethernet data packet with the target counter in the currently received Ethernet data packet to judge whether there is a situation of Ethernet data packet loss.
[0106] The feedback module is used to feed back a response signal corresponding to the target counter of the lost Ethernet data packet to the corresponding sender when it is determined that the Ethernet data packet is lost.
[0107] The sending module is used for the sender to resend the corresponding Ethernet data packet to the receiver or generate alarm information according to the response signal.
[0108] In one embodiment, the data header further includes verification information for the target receiver to verify the integrity of the received Ethernet data packet; the Ethernet data transmission device 500 further includes:
[0109] The third processing module is used for the sender to encapsulate the application layer data to be sent, generate an Ethernet data packet, and send it to the receiver.
[0110] The third processing module is further configured to:
[0111] After encrypting the data packet identifier, data packet length, data packet type, target counter, offset identifier, offset and application layer data according to the preset encryption method, verification information is generated; the destination physical address is written into the Ethernet frame header, and the verification information is encapsulated into the data header, and the application layer data is encapsulated in the data area after the data header to generate an Ethernet data packet.
[0112] In one embodiment, the data header carries a reserved field of preset bytes.
[0113] In one embodiment, the data header carries a timestamp, which is used to describe the sending time of the Ethernet data packet.
[0114] When it is understood that Figure 5 In the structural block diagram of the vehicle-mounted Ethernet data transmission device shown, each module is used to perform Figure 2 The steps in the corresponding embodiments, and Figure 2 Each step in the corresponding embodiment has been explained in detail in the above embodiment. Figure 2 as well as Figure 2 The relevant descriptions in the corresponding embodiments will not be repeated here.
[0115] Figure 6 This is a structural block diagram of a vehicle provided by an embodiment of the present application. Figure 6 As shown, the vehicle 600 of this embodiment includes: a processor 610, a memory 620, and a computer program 630 stored in the memory 620 and executable on the processor 610, such as a program for the vehicle Ethernet data transmission method. When the processor 610 executes the computer program 630, the steps in each embodiment of the vehicle Ethernet data transmission method described above are implemented, such as Figure 2 Alternatively, the processor 610 executes the computer program 630 to implement the above Figure 5 The functions of each module in the corresponding embodiment are, for example, Figure 5 For details on the functions of each module, please refer to Figure 5 Related description in the corresponding embodiment.
[0116] Exemplarily, computer program 630 may be divided into one or more modules, one or more of which are stored in memory 620 and executed by processor 610 to implement the in-vehicle Ethernet data transmission method provided in embodiments of the present application. One or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of computer program 630 in vehicle 600. For example, computer program 630 may implement the in-vehicle Ethernet data transmission method provided in embodiments of the present application.
[0117] The vehicle 600 may include, but is not limited to, a processor 610 and a memory 620. It will be understood by those skilled in the art that Figure 6 This is merely an example of vehicle 600 and does not constitute a limitation on vehicle 600 . It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the sender may also include input and output devices, network access devices, buses, etc.
[0118] The processor 610 may be a central processing unit, or other general-purpose processor, a digital signal processor, an application-specific integrated circuit, an off-the-shelf programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0119] The memory 620 may be an internal storage unit of the vehicle 600, such as a hard drive or memory of the vehicle 600. The memory 620 may also be an external storage device of the vehicle 600, such as a plug-in hard drive, smart memory card, flash memory card, etc. equipped on the vehicle 600. Furthermore, the memory 620 may include both an internal storage unit of the vehicle 600 and an external storage device.
[0120] An embodiment of the present application provides a computer-readable storage medium, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the vehicle-mounted Ethernet data transmission method described in each of the above embodiments is implemented.
[0121] An embodiment of the present application provides a computer program product. When the computer program product is run on a vehicle, the vehicle executes the in-vehicle Ethernet data transmission method in each of the above embodiments.
[0122] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A vehicle-mounted Ethernet data transmission method, characterized in that: The method comprises: The receiver receives an Ethernet data packet; the Ethernet data packet includes an Ethernet frame header, a data header, and application layer data; the Ethernet frame header carries a destination physical address of the target receiver; The receiver determines whether it is the target receiver based on the Ethernet frame header; if it is the target receiver, the application layer data is parsed from the Ethernet data packet.
2. The method according to claim 1, characterized in that The data header carries a packet identifier, packet length, packet type, target counter, offset identifier and offset; the packet identifier is used to identify the uniqueness of the Ethernet packet; the packet length is used to describe the total bytes of the data header and the application layer data; the packet type is used to describe the processing type of the Ethernet packet; the target counter is used to describe the count of the Ethernet packets currently sent by the sender to the receiver; the offset identifier is used to describe whether the Ethernet packet is fragmented; and the offset is used to describe the offset of the current application layer data relative to the initial bit in the original application layer data when the original application layer data is sent in fragments.
3. The method according to claim 2, characterized in that The method further comprises: The sender encapsulates the application layer data to be sent, generates the Ethernet data packet, and sends it to the receiver; The sender encapsulates the application layer data to be sent to generate the Ethernet data packet, including: determining, according to the current destination physical address of the target recipient, a destination counter in the last generated Ethernet data packet carrying the same destination physical address; determining a target counter in the Ethernet data packet to be generated currently according to a target counter in the Ethernet data packet generated last time; The destination physical address of the current target recipient is written into the Ethernet frame header, the target counter in the Ethernet data packet to be generated is encapsulated into the data header, and the application layer data to be sent is encapsulated in the data area position after the data header to generate the Ethernet data packet.
4. The method according to claim 3, characterized in that The Ethernet frame header also includes a source physical address of the sender; the method further includes: The target receiver determines, according to the source physical address of the sender in the currently received Ethernet data packet, a target counter in the last received Ethernet data packet carrying the same source physical address; Comparing the target counter in the last received Ethernet data packet with the target counter in the currently received Ethernet data packet to determine whether there is a loss of Ethernet data packet; When it is determined that there is a situation where the Ethernet data packet is lost, feeding back a response signal corresponding to the target counter of the lost Ethernet data packet to the corresponding sender; The sender resends the corresponding Ethernet data packet to the receiver or generates alarm information according to the response signal.
5. The method according to claim 2, characterized in that The data header also includes verification information for the target receiver to verify the integrity of the received Ethernet data packet; The method further comprises: The sender encapsulates the application layer data to be sent, generates the Ethernet data packet, and sends it to the receiver; The sender encapsulates the application layer data to be sent to generate the Ethernet data packet, including: Encrypting the data packet identifier, the data packet length, the data packet type, the target counter, the offset identifier, the offset, and the application layer data according to a preset encryption method to generate the verification information; The destination physical address is written into the Ethernet frame header, the check information is encapsulated into the data header, and the application layer data is encapsulated in the data area after the data header to generate the Ethernet data packet.
6. The method according to any one of claims 1 to 5, characterized in that The data header carries a reserved field of preset bytes.
7. The method according to any one of claims 1 to 5, characterized in that The data header carries a timestamp, and the timestamp is used to describe the sending time of the Ethernet data packet.
8. An in-vehicle Ethernet data transmission device, characterized in that: The device comprises: A receiving module, configured to receive an Ethernet data packet at a receiving end; the Ethernet data packet includes an Ethernet frame header, a data header, and application layer data; the Ethernet frame header carries a destination physical address of a target recipient; The first processing module is used for the receiver to determine whether it is the target receiver according to the Ethernet frame header; if it is the target receiver, the application layer data is parsed from the Ethernet data packet.
9. A vehicle comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Data communication method and system for a vehicle
CN122437895A
