Apparatus for controlling a GCL of an ethernet switch and a method thereof
An apparatus for controlling a GCL of an Ethernet switch and a method thereof are provided. A controller area network (CAN) message is transformed to an Ethernet frame, a queue corresponding to a transmission type of the CAN message is determined, and a time to open or close a transmission gate of the queue is updated over a gate control list (GCL), thereby effectively scheduling (lowering the complexity of scheduling) a plurality of CAN messages transmitted to the Ethernet, and improving transmission reliability of the CAN message.
1 . An apparatus comprising:
a storage configured to store a gate control list (GCL) associated with an Ethernet switch; and
a controller configured to:
transform a controller area network (CAN) message to an Ethernet frame;
determine a queue corresponding to a transmission type of the CAN message, wherein the queue comprises:
a first queue configured to transmit a first Ethernet frame corresponding to an aperiodic CAN message; and
a second queue configured to transmit a second Ethernet frame corresponding to a periodic CAN message; and
update, in the GCL, a time to open or close a transmission gate of the queue by:
based on the transmission type of the CAN message being an aperiodic transmission type, updating, in the GCL, a time to open or close a transmission gate of the first queue; or
based on the transmission type of the CAN message being a periodic transmission type, updating, in the GCL, a time to open or close a transmission gate of the second queue.
2 . The apparatus of claim 1 , wherein the controller is configured to:
based on a quantity of consecutive reception failures of the CAN message having the periodic transmission type being greater than a configured threshold value, reset, in the GCL, the time to open or close the transmission gate of the second queue.
3 . The apparatus of claim 1 , wherein the controller is configured to:
perform time-synchronization between a CAN and an Ethernet.
4 . The apparatus of claim 1 , wherein the controller is configured to:
transform a plurality of CAN messages having a same period to one Ethernet frame.
5 . The apparatus of claim 1 , wherein the controller is configured to:
based on a first CAN message of a plurality of CAN messages for a same Ethernet frame having a higher priority than a second CAN message of the plurality of CAN messages, update the GCL such that the first CAN message is transmitted prior to transmission of the second CAN message.
6 . The apparatus of claim 1 , wherein the controller is configured to:
determine whether to route the CAN message through an Ethernet.
7 . The apparatus of claim 1 , further comprising:
a receiving device configured to receive the CAN message from an electronic control unit (ECU) associated with a CAN.
8 . The apparatus of claim 1 , wherein the Ethernet switch is configured to:
transmit, based on the GCL, the Ethernet frame.
9 . A method comprising:
storing, in a storage, a gate control list (GCL) associated with an Ethernet switch;
transforming, by a controller, a controller area network (CAN) message to an Ethernet frame;
determining, by the controller, a queue corresponding to a transmission type of the CAN message, wherein the queue comprises:
a first queue configured to transmit a first Ethernet frame corresponding to an aperiodic CAN message; and
a second queue configured to transmit a second Ethernet frame corresponding to a periodic CAN message; and
updating, by the controller and in the GCL, a time to open or close a transmission gate of the queue, wherein the updating comprises:
based on the transmission type of the CAN message being an aperiodic transmission type, updating, in the GCL, a time to open or close a transmission gate of the first queue; or
based on the transmission type of the CAN message being a periodic transmission type, updating, in the GCL, a time to open or close a transmission gate of the second queue.
10 . The method of claim 9 , wherein the updating comprises:
based on a quantity of consecutive reception failures of the CAN message having the periodic transmission type being greater than a configured threshold value, resetting, in the GCL, the time to open or close the transmission gate of the second queue.
11 . The method of claim 9 , further comprising:
prior to the transforming, performing, by the controller, time-synchronization between a CAN and an Ethernet.
12 . The method of claim 9 , wherein the transforming comprises:
transforming a plurality of CAN messages having a same period to one Ethernet frame.
13 . The method of claim 9 , wherein the updating comprises:
based on a first CAN message of a plurality of CAN messages for a same Ethernet frame having a higher priority than a second CAN message of the plurality of CAN messages, updating, by the controller, the GCL such that the first CAN message is transmitted prior to transmission of the second CAN message.
14 . The method of claim 9 , further comprising:
prior to the transforming, determining, by the controller, whether to route the CAN message to an Ethernet.
15 . The method of claim 9 , further comprising:
prior to the transforming, receiving, by a receiving device, the CAN message from an electronic control unit (ECU) associated with a CAN.
16 . The method of claim 9 , further comprising:
after the updating, transmitting, by the Ethernet switch and based on the GCL, the Ethernet frame.
17 . An apparatus comprising:
a storage configured to store a gate control list (GCL) associated with an Ethernet switch;
a memory storing at least one instruction; and
a processor configured to execute the at least one instruction to cause the apparatus to:
transform a controller area network (CAN) message to an Ethernet frame;
determine a queue corresponding to a transmission type of the CAN message;
update, in the GCL, a time to open or close a transmission gate of the queue; and
based on a first CAN message of a plurality of CAN messages for a same Ethernet frame having a higher priority than a second CAN message of the plurality of CAN messages, update the GCL such that the first CAN message is transmitted prior to transmission of the second CAN message.
18 . The apparatus of claim 17 , wherein the processor is configured to execute the at least one instruction to cause the apparatus to update the time to open or close the transmission gate of the queue by:
based on the transmission type of the CAN message being an aperiodic transmission type, updating, in the GCL, a time to open or close a transmission gate of a first queue associated with the aperiodic transmission type; or
based on the transmission type of the CAN message being a periodic transmission type, updating, in the GCL, a time to open or close a transmission gate of a second queue associated with the periodic transmission type.
19 . The apparatus of claim 18 , wherein the processor is configured to execute the at least one instruction to cause the apparatus to:
based on a quantity of consecutive reception failures of the CAN message having the periodic transmission type being greater than a configured threshold value, reset, in the GCL, the time to open or close the transmission gate of the second queue.
20 . The apparatus of claim 18 , wherein the first queue is configured to transmit a first Ethernet frame corresponding to an aperiodic CAN message; and
wherein the second queue is configured to transmit a second Ethernet frame corresponding to a periodic CAN message.