Vehicle-mounted ethernet data frame transmission method, device and electronic equipment

By receiving and storing Ethernet data frames on the TC3xx series chips and transmitting them when the target time slot slice arrives, the problem of the lack of support for the IEEE 802.1Qbv protocol on the TC3xx series chips is solved, and the smooth transmission of Ethernet data frames is achieved.

CN116633876BActive Publication Date: 2026-07-21CHONGQING CHANGAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING CHANGAN TECH CO LTD
Filing Date
2023-05-31
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

The IEEE 802.1Qbv protocol is not supported on the TC3xx series chips, which causes Ethernet data frames to fail to be sent successfully.

Method used

By receiving Ethernet data frames and determining their data priorities, storing them in the corresponding transmission queues, and transmitting them when the target time slot slice arrives, time-division transmission of different data priorities is achieved using direct memory access channels and time synchronization mechanisms.

Benefits of technology

It enables time-division multiplexing of Ethernet data frames with different data priorities, ensuring the smooth transmission of Ethernet data frames.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116633876B_ABST
    Figure CN116633876B_ABST
Patent Text Reader

Abstract

The application relates to a vehicle-mounted Ethernet data frame transmission method, a device and electronic equipment, wherein the Ethernet data frame transmission method comprises the following steps: receiving an Ethernet data frame to be transmitted, and determining a data priority corresponding to the Ethernet data frame; storing the Ethernet data frame into a transmission queue corresponding to the data priority; determining a target time slot slice corresponding to the data priority; and transmitting the Ethernet data frame in the transmission queue to a second device when the target time slot slice arrives. After receiving the Ethernet data frame, the application can store the Ethernet data frame in a corresponding transmission queue according to the data priority, and transmit the Ethernet data frame in the corresponding transmission queue to the second device when the target time slot slice corresponding to the data priority arrives, so that the time division transmission of Ethernet data frames with different data priorities is realized, and the smooth transmission of the Ethernet data frame is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive electronics technology, specifically to a method, apparatus, and electronic device for transmitting in-vehicle Ethernet data frames. Background Technology

[0002] With the development of automotive EE architecture, Time-Sensitive Networking (TSN) is playing an increasingly important role in the new automotive EE architecture. The IEEE 802.1 Qbv protocol is one of the important sub-protocols of TSN, and it is a method for scheduling Ethernet data frame output. However, the functionality of the Qbv protocol can only be implemented on some hardware; the TC3xx series chips do not support the relevant functions of the Qbv protocol, resulting in the inability to successfully send Ethernet data frames. Summary of the Invention

[0003] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this application provides a method, apparatus and electronic device for transmitting vehicle Ethernet data frames.

[0004] In a first aspect, this application provides an Ethernet data frame transmission method, applied to a first device, comprising:

[0005] Receive the Ethernet data frame to be transmitted and determine the data priority corresponding to the Ethernet data frame;

[0006] The Ethernet data frame is stored in a transmission queue corresponding to the data priority;

[0007] Determine the target time slot slice corresponding to the data priority;

[0008] When the target time slot slice arrives, the Ethernet data frame in the transmission queue is transmitted to the second device.

[0009] Optionally, storing the Ethernet data frame in a transmission queue corresponding to the data priority includes:

[0010] Determine the target direct memory access channel corresponding to the data priority;

[0011] The Ethernet data frame is stored in a transmission queue corresponding to the data priority using the target direct memory access channel.

[0012] Optionally, storing the Ethernet data frame in a transmission queue corresponding to the data priority using the target direct memory access channel includes:

[0013] If the data priority is the first priority, the Ethernet data frame is stored in the transmission queue corresponding to the first priority using the direct memory access channel corresponding to the first priority;

[0014] Alternatively, if the data priority is the second priority, the Ethernet data frame is stored in the transmission queue corresponding to the second priority using the direct memory access channel corresponding to the second priority.

[0015] Optionally, the method further includes:

[0016] Synchronize its own time with the second device;

[0017] The time slot in which time synchronization is completed is determined as the first time slot slice, and the correspondence between the first slice identifier and the first priority of the first time slot slice is constructed;

[0018] In the data interaction cycle where the first time slot slice is located, the remaining time slot is determined as the second time slot slice, and the correspondence between the second slice identifier and the second priority of the second time slot slice is constructed.

[0019] The correspondence between the first slice identifier of the first time slot slice and the first priority, and the correspondence between the second slice identifier of the second time slot slice and the second priority, are determined as the correspondence between priority and slice identifier.

[0020] Optionally, determining the target time slot slice corresponding to the data priority includes:

[0021] If the data priority is the first priority, the first time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier;

[0022] Alternatively, if the data priority is the second priority, the second time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier.

[0023] Optionally, when the target time slot slice arrives, transmitting the Ethernet data frame in the transmission queue to the second device includes:

[0024] If the target time slot slice is the first time slot slice, the Ethernet data frame in the transmission queue corresponding to the first priority will be transmitted to the second device;

[0025] Alternatively, if the target time slot slice is the second time slot slice, the Ethernet data frame in the transmission queue corresponding to the second priority is transmitted to the second device.

[0026] Optionally, determining the data priority corresponding to the Ethernet data frame includes:

[0027] Extract preset fields from the Ethernet data frame;

[0028] In the correspondence between preset fields and data priorities, the data priority corresponding to the preset field is determined as the data priority corresponding to the Ethernet data frame.

[0029] Secondly, this application provides an Ethernet data frame transmission apparatus, applied to a first device, comprising:

[0030] A receiving module is used to receive Ethernet data frames to be transmitted and determine the data priority corresponding to the Ethernet data frames;

[0031] A storage module is used to store the Ethernet data frames into a transmission queue corresponding to the data priority;

[0032] The first determining module is used to determine the target time slot slice corresponding to the data priority;

[0033] The transmission module is used to transmit the Ethernet data frames in the transmission queue to the second device when the target time slot slice arrives.

[0034] Optionally, the storage module includes:

[0035] The first determining unit is used to determine the target direct memory access channel corresponding to the data priority;

[0036] A storage unit is used to store the Ethernet data frame into a transmission queue corresponding to the data priority using the target direct memory access channel.

[0037] Optionally, the storage unit is further used for:

[0038] If the data priority is the first priority, the Ethernet data frame is stored in the transmission queue corresponding to the first priority using the direct memory access channel corresponding to the first priority;

[0039] Alternatively, if the data priority is the second priority, the Ethernet data frame is stored in the transmission queue corresponding to the second priority using the direct memory access channel corresponding to the second priority.

[0040] Optionally, the device further includes:

[0041] The synchronization module is used to synchronize its own time with the second device;

[0042] The first determination construction module is used to determine the time slot where the time synchronization is completed as the first time slot slice, and to construct the correspondence between the first slice identifier and the first priority of the first time slot slice.

[0043] The second determination construction module is used to determine the remaining time slots in the data interaction cycle where the first time slot slice is located as the second time slot slice, and to construct the correspondence between the second slice identifier and the second priority of the second time slot slice;

[0044] The second determining module is used to determine the correspondence between the first slice identifier of the first time slot slice and the first priority, and the correspondence between the second slice identifier of the second time slot slice and the second priority, as the correspondence between priority and slice identifier.

[0045] Optionally, the first determining module is further configured to:

[0046] If the data priority is the first priority, the first time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier;

[0047] Alternatively, if the data priority is the second priority, the second time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier.

[0048] Optionally, the transmission module is further configured to:

[0049] If the target time slot slice is the first time slot slice, the Ethernet data frame in the transmission queue corresponding to the first priority will be transmitted to the second device;

[0050] Alternatively, if the target time slot slice is the second time slot slice, the Ethernet data frame in the transmission queue corresponding to the second priority is transmitted to the second device.

[0051] Optionally, the receiving module includes:

[0052] An extraction unit is used to extract a preset field from the Ethernet data frame;

[0053] The second determining unit is used to determine the data priority corresponding to the preset field as the data priority corresponding to the Ethernet data frame in the correspondence between the preset field and the data priority.

[0054] Thirdly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0055] Memory, used to store computer programs;

[0056] When a processor executes a program stored in memory, it implements the Ethernet data frame transmission method described in any of the first aspects.

[0057] Fourthly, this application provides a computer-readable storage medium storing a program for an Ethernet data frame transmission method, wherein when the program for the Ethernet data frame transmission method is executed by a processor, it implements the steps of the Ethernet data frame transmission method described in any of the first aspects.

[0058] The beneficial effects of this invention are:

[0059] In this embodiment of the application, after receiving an Ethernet data frame, the Ethernet data frame can be stored in the corresponding transmission queue according to its data priority. When the target time slot slice corresponding to its data priority arrives, the Ethernet data frame in the corresponding transmission queue is transmitted to the second device, thereby realizing the time-division transmission of Ethernet data frames with different data priorities and ensuring the smooth transmission of Ethernet data frames. Attached Figure Description

[0060] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0062] Figure 1 A flowchart illustrating an Ethernet data frame transmission method provided in this application embodiment;

[0063] Figure 2 This application provides a schematic diagram of a hardware topology in a real-world application scenario.

[0064] Figure 3 A flowchart of step S102 provided in an embodiment of this application;

[0065] Figure 4 A schematic diagram illustrating an exemplary Ethernet data frame transmission process provided in this application embodiment;

[0066] Figure 5 A flowchart illustrating another Ethernet data frame transmission method provided in this application embodiment;

[0067] Figure 6 A structural diagram of an Ethernet data frame transmission device provided in an embodiment of this application;

[0068] Figure 7 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0069] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0070] Because the QBV protocol functionality can only be implemented on certain hardware components, and the TC3xx series chips do not support related QBV functions, Ethernet data frames cannot be transmitted successfully. Therefore, this application provides a method, apparatus, and electronic device for transmitting vehicular Ethernet data frames, enabling time-division multiplexing of Ethernet data frames with different data priorities.

[0071] This application provides an Ethernet data frame transmission method, which can be applied to a first device installed in a vehicle. For example, the first device can be a microcontroller (MCU), or a TC3xx series chip applicable to the field of intelligent driving. The first device can also be an in-vehicle switch, etc. In one embodiment of this application, when the first device is a microcontroller, the second device can be an in-vehicle switch.

[0072] The first device can transmit Ethernet data frames to the second device in a time-division multiplexing manner according to different data priorities, thereby implementing a Qbv-like protocol function. The second device can also be configured to transmit Ethernet data frames to the data receiving end in a time-division multiplexing manner according to different data priorities.

[0073] like Figure 1 As shown, the Ethernet data frame transmission method may include the following steps:

[0074] Step S101: Receive the Ethernet data frame to be transmitted and determine the data priority corresponding to the Ethernet data frame;

[0075] In the embodiments of this application, such as Figure 2 As shown, Ethernet data frames can originate from data frame generation points, such as radar or other devices capable of generating Ethernet data frames. Real-world automotive Ethernet systems may include more nodes and links, comprising several data frame generation and receiving points. Figure 2 This is merely a simplified illustration, and the embodiments of the present invention are not intended to limit the scope of the invention.

[0076] Figure 2In this process, both the first and second devices are configured with QBV-like protocol functionality. Ethernet data frames generated at the data frame generation point are transmitted to the first device. The first device determines the data priority of the Ethernet data frame and, based on different data priorities, transmits it to the second device in a time-division multiplexing manner through different time slot slices. The second device will then also determine the data priority of the Ethernet data frame and, based on different data priorities, transmit it to the subsequent data frame receiving point through different time slot slices.

[0077] In one embodiment of this application, step S101, determining the data priority corresponding to the Ethernet data frame, includes:

[0078] Extract a preset field from the Ethernet data frame; in the correspondence between the preset field and the data priority, the data priority corresponding to the preset field is determined as the data priority corresponding to the Ethernet data frame.

[0079] Ethernet data frames may include fields for determining data priority, such as a priority field or a task cycle identifier field. The priority field can directly indicate the data priority of the Ethernet data frame. For example, a priority identifier of 1 in the priority field indicates that the data priority of the Ethernet data frame is the first priority, and a priority identifier of 2 in the priority field indicates that the data priority of the Ethernet data frame is the second priority.

[0080] For ease of understanding, in the embodiments of this application, the first priority can represent a high priority, the second priority can represent a low priority, and in practical applications, the data priority can also include a third priority and a fourth priority, etc. The specific number of data priorities can be set according to actual needs, and the embodiments of this application do not limit it.

[0081] The task cycle identifier in the task cycle identifier field can indicate the task cycle in which the Ethernet data frame is generated. Then, the data priority of the Ethernet data frame can be determined according to the preset correspondence between the task cycle and the data priority. For example, if the Ethernet data frame is generated in an odd-numbered task cycle, the data priority of the Ethernet data frame is the first priority. If the Ethernet data frame is generated in an even-numbered task cycle, the data priority of the Ethernet data frame is the second priority.

[0082] Step S102: Store the Ethernet data frame in the transmission queue corresponding to the data priority;

[0083] In this embodiment of the application, corresponding transmission queues can be set up in advance for different data priorities, that is, the correspondence between data priorities and transmission queues can be established in advance.

[0084] In this step, Ethernet data frames can be stored in the corresponding transmission queue according to their data priority.

[0085] Step S103: Determine the target time slot slice corresponding to the data priority;

[0086] In this embodiment of the application, a pre-set correspondence between priority and slice identifier can be used to determine the target time slot slice corresponding to the data priority based on the correspondence between priority and slice identifier.

[0087] In one embodiment of this application, step S103, determining the target time slot slice corresponding to the data priority, includes:

[0088] If the data priority is the first priority, the first time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier;

[0089] Alternatively, if the data priority is the second priority, the second time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier.

[0090] Step S104: When the target time slot slice arrives, the Ethernet data frame in the transmission queue is transmitted to the second device.

[0091] In this step, the built-in counter of the first device counts continuously over time, with each count value corresponding to a time slot slice. When the internal counter matches the count value corresponding to the target time slot slice, it is determined that the target time slot slice has arrived.

[0092] In one embodiment of this application, step S104, when the target time slot slice arrives, transmits the Ethernet data frame in the transmission queue to the second device, including:

[0093] If the target time slot slice is the first time slot slice, the Ethernet data frame in the transmission queue corresponding to the first priority will be transmitted to the second device;

[0094] Alternatively, if the target time slot slice is the second time slot slice, the Ethernet data frame in the transmission queue corresponding to the second priority is transmitted to the second device.

[0095] like Figure 2 As shown, after receiving an Ethernet data frame, the second device can transmit the Ethernet data frame to the data frame receiving point.

[0096] As an example, if the data interaction period between the radar and the microcontroller is 5 milliseconds, then 5 milliseconds can be set as a data transmission period. The period can be divided into 16 time slots using a time slot slicing function. Each time slot lasts for 312.5 microseconds. One of the time slots is set as the first time slot and used to send high-priority data to the second device. The remaining 15 second time slots are used to send low-priority data to the second device.

[0097] In this embodiment of the application, after receiving an Ethernet data frame, the Ethernet data frame can be stored in the corresponding transmission queue according to its data priority. When the target time slot slice corresponding to its data priority arrives, the Ethernet data frame in the corresponding transmission queue is transmitted to the second device, thereby realizing the time-division transmission of Ethernet data frames with different data priorities and ensuring the smooth transmission of Ethernet data frames.

[0098] In yet another embodiment of this application, as Figure 3 As shown, step S102 stores the Ethernet data frame into a transmission queue corresponding to the data priority, including:

[0099] Step S201: Determine the target direct memory access channel corresponding to the data priority;

[0100] In this embodiment of the application, the direct memory access channel, i.e. the DMA channel, can be pre-set with a corresponding direct memory access channel for each data priority. For example, the first priority corresponds to the first direct memory access channel, and the second priority corresponds to the second direct memory access channel. Each direct memory access channel is used to place Ethernet data frames in the corresponding transmission queue according to the different data priorities.

[0101] Step S202: Use the target direct memory access channel to store the Ethernet data frame into a transmission queue corresponding to the data priority.

[0102] like Figure 4 As shown in the example, after receiving an Ethernet data frame, the microcontroller can temporarily store the Ethernet data frame in a data buffer, determine the data priority corresponding to the Ethernet data frame, and select one of Direct Memory Access Channel 1 and Direct Memory Access Channel 2 as the target Direct Memory Access Channel based on the data priority. Then, the target Direct Memory Access Channel is used to store the Ethernet data frame in the corresponding transmission queue. When the target time slot slice arrives, the Ethernet data frame in the transmission queue is transmitted to the switch.

[0103] In one embodiment of this application, if the data priority is the first priority, the Ethernet data frame is stored in the transmission queue corresponding to the first priority using the direct memory access channel corresponding to the first priority, so that the direct memory access channel can transmit the Ethernet data frame by calling the Transmit interface.

[0104] In another embodiment of this application, if the data priority is the second priority, the Ethernet data frame is stored in the transmission queue corresponding to the second priority using the direct memory access channel corresponding to the second priority, so that the direct memory access channel can transmit the Ethernet data frame by calling the Transmit interface.

[0105] After storing Ethernet data frames into the corresponding transmission queue, the transmission queue can enable the time slot slicing function of the first device, that is, enable the time slot slicing function of the first device.

[0106] This application embodiment can store Ethernet data frames into corresponding transmission queues according to the data priority of the Ethernet data frames, so as to store Ethernet data frames with different data priorities separately, thereby facilitating the subsequent time-division sending of Ethernet data frames with corresponding data priorities from different transmission queues.

[0107] In yet another embodiment of this application, as Figure 5 As shown, the method further includes:

[0108] Step S301: Synchronize the time between itself and the second device;

[0109] In this embodiment of the application, in order to ensure that Ethernet data frames can be successfully transmitted from the first device to the second device, the Qbv-like protocol function can be integrated into the time synchronization protocol stack, so that the Qbv-like protocol function performs data scheduling and output based on the time axis of time synchronization.

[0110] Step S302: Determine the time slot where the time synchronization is completed as the first time slot slice, and construct the correspondence between the first slice identifier and the first priority of the first time slot slice;

[0111] In this embodiment of the application, the time slot slice where the time synchronization is completed is set as the first time slot slice. The first time slot slice is responsible for sending high-priority data frames. After the time synchronization is completed, the time-division sending function of Ethernet data frames with different data priorities can be enabled.

[0112] Furthermore, the transmission time of Ethernet data frames from the first device to the second device can be collected, measured, and calculated. The activation time of the time slot slicing function of the second device is slightly later than that of the first device, ensuring that no frames are lost during the data transmission process.

[0113] Step S303: In the data interaction period where the first time slot slice is located, the remaining time slot is determined as the second time slot slice, and the correspondence between the second slice identifier and the second priority of the second time slot slice is constructed.

[0114] Step S304: The correspondence between the first slice identifier of the first time slot slice and the first priority, and the correspondence between the second slice identifier of the second time slot slice and the second priority, are determined as the correspondence between priority and slice identifier.

[0115] Based on the time synchronization between the first device and the second device, the embodiments of this application can pre-build the correspondence between priority and slice identifier, so as to use it when determining the target time slot slice corresponding to the data priority, thereby ensuring that Ethernet data frames can be successfully sent from the first device to the second device.

[0116] In another embodiment, an Ethernet data frame transmission device is also provided, applied to the first device, such as... Figure 6 As shown, it includes:

[0117] The receiving module 11 is used to receive the Ethernet data frame to be transmitted and determine the data priority corresponding to the Ethernet data frame.

[0118] Storage module 12 is used to store the Ethernet data frame into a transmission queue corresponding to the data priority;

[0119] The first determining module 13 is used to determine the target time slot slice corresponding to the data priority;

[0120] The transmission module 14 is used to transmit the Ethernet data frame in the transmission queue to the second device when the target time slot slice arrives.

[0121] Optionally, the storage module includes:

[0122] The first determining unit is used to determine the target direct memory access channel corresponding to the data priority;

[0123] A storage unit is used to store the Ethernet data frame into a transmission queue corresponding to the data priority using the target direct memory access channel.

[0124] Optionally, the storage unit is further used for:

[0125] If the data priority is the first priority, the Ethernet data frame is stored in the transmission queue corresponding to the first priority using the direct memory access channel corresponding to the first priority;

[0126] Alternatively, if the data priority is the second priority, the Ethernet data frame is stored in the transmission queue corresponding to the second priority using the direct memory access channel corresponding to the second priority.

[0127] Optionally, the device further includes:

[0128] The synchronization module is used to synchronize its own time with the second device;

[0129] The first determination construction module is used to determine the time slot where the time synchronization is completed as the first time slot slice, and to construct the correspondence between the first slice identifier and the first priority of the first time slot slice.

[0130] The second determination construction module is used to determine the remaining time slots in the data interaction cycle where the first time slot slice is located as the second time slot slice, and to construct the correspondence between the second slice identifier and the second priority of the second time slot slice;

[0131] The second determining module is used to determine the correspondence between the first slice identifier of the first time slot slice and the first priority, and the correspondence between the second slice identifier of the second time slot slice and the second priority, as the correspondence between priority and slice identifier.

[0132] Optionally, the first determining module is further configured to:

[0133] If the data priority is the first priority, the first time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier;

[0134] Alternatively, if the data priority is the second priority, the second time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier.

[0135] Optionally, the transmission module is further configured to:

[0136] If the target time slot slice is the first time slot slice, the Ethernet data frame in the transmission queue corresponding to the first priority will be transmitted to the second device;

[0137] Alternatively, if the target time slot slice is the second time slot slice, the Ethernet data frame in the transmission queue corresponding to the second priority is transmitted to the second device.

[0138] Optionally, the receiving module includes:

[0139] An extraction unit is used to extract a preset field from the Ethernet data frame;

[0140] The second determining unit is used to determine the data priority corresponding to the preset field as the data priority corresponding to the Ethernet data frame in the correspondence between the preset field and the data priority.

[0141] In another embodiment of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus.

[0142] Memory, used to store computer programs;

[0143] When a processor executes a program stored in memory, it implements the Ethernet data frame transmission method described in any of the foregoing method embodiments.

[0144] The electronic device provided in this embodiment of the invention allows the processor to execute a program stored in the memory. After receiving an Ethernet data frame, the processor can store the Ethernet data frame in a corresponding transmission queue according to its data priority. When the target time slot slice corresponding to its data priority arrives, the processor can transmit the Ethernet data frame in the corresponding transmission queue to a second device, thereby realizing time-division transmission of Ethernet data frames with different data priorities and ensuring the smooth transmission of Ethernet data frames.

[0145] The communication bus 1140 mentioned in the above-mentioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0146] The communication interface 1120 is used for communication between the above-mentioned electronic device and other devices.

[0147] The memory 1130 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0148] The processor 1110 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0149] In another embodiment of this application, a computer-readable storage medium is provided, on which a program for an Ethernet data frame transmission method is stored. When the program for the Ethernet data frame transmission method is executed by a processor, it implements the steps of the Ethernet data frame transmission method described in any of the foregoing method embodiments.

[0150] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0151] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for transmitting Ethernet data frames, characterized in that, Applied to a first device, which is an in-vehicle microcontroller or an in-vehicle switch, the first device does not support the Qbv protocol for Ethernet data frame scheduling and output in time-sensitive networks. The first device is used to determine the data priority of Ethernet data frames generated at the data frame generation point based on the task cycle of Ethernet data frame generation, and to transmit the data to a second device in a time-division multiplexing manner according to different data priorities through different time slot slices, including: Receive the Ethernet data frame to be transmitted and determine the data priority corresponding to the Ethernet data frame; Determining the data priority corresponding to the Ethernet data frame includes: Extract preset fields from the Ethernet data frame. The preset fields include: a task cycle identifier field, which indicates the task cycle in which the Ethernet data frame is generated. Determining the data priority corresponding to the preset field in the correspondence between preset fields and data priorities as the data priority corresponding to the Ethernet data frame includes: determining the data priority corresponding to the task period generated by the Ethernet data frame as the data priority corresponding to the Ethernet data frame based on the correspondence between task period and data priority. The Ethernet data frame is stored in a transmission queue corresponding to the data priority; Determine the target time slot slice corresponding to the data priority; When the target time slot slice arrives, the Ethernet data frame in the transmission queue is transmitted to the second device.

2. The Ethernet data frame transmission method according to claim 1, characterized in that, Storing the Ethernet data frame into a transmission queue corresponding to the data priority includes: Determine the target direct memory access channel corresponding to the data priority; The Ethernet data frame is stored in a transmission queue corresponding to the data priority using the target direct memory access channel.

3. The Ethernet data frame transmission method according to claim 2, characterized in that, Storing the Ethernet data frame in a transmission queue corresponding to the data priority using the target direct memory access channel includes: If the data priority is the first priority, the Ethernet data frame is stored in the transmission queue corresponding to the first priority using the direct memory access channel corresponding to the first priority; Alternatively, if the data priority is the second priority, the Ethernet data frame is stored in the transmission queue corresponding to the second priority using the direct memory access channel corresponding to the second priority.

4. The Ethernet data frame transmission method according to claim 1, characterized in that, The method further includes: Synchronize its own time with the second device; The time slot in which time synchronization is completed is determined as the first time slot slice, and the correspondence between the first slice identifier and the first priority of the first time slot slice is constructed; In the data interaction cycle where the first time slot slice is located, the remaining time slot is determined as the second time slot slice, and the correspondence between the second slice identifier and the second priority of the second time slot slice is constructed. The correspondence between the first slice identifier of the first time slot slice and the first priority, and the correspondence between the second slice identifier of the second time slot slice and the second priority, are determined as the correspondence between priority and slice identifier.

5. The Ethernet data frame transmission method according to claim 1, characterized in that, Determining the target time slot slice corresponding to the data priority includes: If the data priority is the first priority, the first time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier; Alternatively, if the data priority is the second priority, the second time slot slice is determined as the target time slot slice based on the preset correspondence between the priority and the slice identifier.

6. The Ethernet data frame transmission method according to claim 1, characterized in that, When the target time slot slice arrives, transmitting the Ethernet data frame in the transmission queue to the second device includes: If the target time slot slice is the first time slot slice, the Ethernet data frame in the transmission queue corresponding to the first priority will be transmitted to the second device; Alternatively, if the target time slot slice is the second time slot slice, the Ethernet data frame in the transmission queue corresponding to the second priority is transmitted to the second device.

7. An Ethernet data frame transmission device, characterized in that, Applied to a first device, which is an in-vehicle microcontroller or an in-vehicle switch, the first device does not support the Qbv protocol for Ethernet data frame scheduling and output in time-sensitive networks. The first device is used to determine the data priority of Ethernet data frames generated at the data frame generation point based on the task cycle of Ethernet data frame generation, and to transmit the data to a second device in a time-division multiplexing manner according to different data priorities through different time slot slices, including: A receiving module is configured to receive an Ethernet data frame to be transmitted and determine the data priority corresponding to the Ethernet data frame. Determining the data priority of the Ethernet data frame includes: extracting a preset field from the Ethernet data frame, the preset field including a task cycle identifier field, used to indicate the task cycle in which the Ethernet data frame is generated; and determining the data priority corresponding to the preset field in the correspondence between the preset field and data priority as the data priority corresponding to the Ethernet data frame, including: determining the data priority corresponding to the task cycle in which the Ethernet data frame is generated as the data priority corresponding to the Ethernet data frame based on the correspondence between the task cycle and data priority. A storage module is used to store the Ethernet data frames into a transmission queue corresponding to the data priority; The first determining module is used to determine the target time slot slice corresponding to the data priority; The transmission module is used to transmit the Ethernet data frames in the transmission queue to the second device when the target time slot slice arrives.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the Ethernet data frame transmission method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program for an Ethernet data frame transmission method, which, when executed by a processor, implements the steps of the Ethernet data frame transmission method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Divided type scheduling method applied to shared Ethernet

    CN108449285A

  • TSN network data transmission method and device

    CN115567457A