Communication gateway for communicating data frames for a motor vehicle
11599459 · 2023-03-07
Assignee
Inventors
Cpc classification
H04L12/66
ELECTRICITY
International classification
G06F12/14
PHYSICS
G06F12/06
PHYSICS
H04L12/66
ELECTRICITY
Abstract
A communication gateway for communicating data frames for a motor vehicle, the gateway being intended to be connected to a plurality of electronic control units in order to exchange data frames, the gateway including: as many management modules as there are electronic control units; a memory in which are stored a lookup table including an index list, with each of the indices of which is associated a memory space, a level-zero addressing table, a level-one addressing table, a level-two addressing table and an address table of levels; a space manager for managing spaces of the lookup table that is configured to determine a free index in the lookup table, and when a memory space of the lookup table is freed or is filled, to modify the byte stored in each memory region of each addressing table associated with the index.
Claims
1. A communication gateway for communicating data frames for a motor vehicle, said gateway being intended to be connected to a plurality of electronic control units in order to exchange data frames, each electronic control unit of the plurality of electronic control units being connected to said gateway via a communication bus, said gateway comprising: as many management modules as there are electronic control units, each management module being associated with one and only one electronic control unit; a memory in which the following are stored: a lookup table comprising an index list, with each of the indices of which is associated a memory space, in each of which may be recorded a payload of a data frame received by the gateway and at least one indicator for identifying at least one communication bus that is the recipient of said received data frame; an addressing table, referred to as a “level-zero” addressing table, comprising one memory region characterized by a memory address; an addressing table, referred to as a “level-one” addressing table, comprising eight memory regions each characterized by a memory address; an addressing table, referred to as a “level-two” addressing table, comprising sixty-four memory regions each characterized by a memory address, each memory region of each addressing table comprising a byte, each bit of a byte in a memory region being defined in the following way: each bit of the byte of the memory region of the level-zero addressing table is associated with a memory region of the level-one addressing table; each bit of each byte of a memory region of the level-one addressing table is associated with a memory region of the level-two addressing table; each bit of each byte of a memory region of the level-two addressing table is associated with an index of the lookup table; an address table of levels comprising, for each possible byte value, with the exception of the zero byte, a level-zero memory address of the level-zero addressing table, a level-one memory address of the level-one addressing table and a level-two memory address of the level-two addressing table; a space manager for managing spaces of the lookup table, said space manager being configured to: determine a free index in the lookup table on the basis of the level-zero addressing table, the level-one addressing table, the level-two addressing table and the address table; when a memory space of the lookup table is freed or is filled, modify the byte stored in each memory region of each addressing table associated with the index of the freed or newly filled memory space, for each level zero, one and two, so as to indicate that said memory space is free or occupied, respectively.
2. The gateway as claimed in claim 1, wherein: for the level-two addressing table: if a bit of a byte of a memory region is at 1, then the index associated with this bit is itself associated with a free memory space; if a bit of a byte of a memory region is at 0, then the index associated with this bit is itself associated with a filled memory space; for the level-one addressing table: if a bit of a byte of a memory region is at 1, then the byte of the memory region of the level-two addressing table associated with this bit comprises at least one bit at one; if a bit of a byte of a memory region is at 0, then the byte of the memory region of the level-two addressing table associated with this bit comprises no bits at one; for the level-zero addressing table: if a bit of the byte of the memory region is at 1, then the byte of the memory region of the level-one addressing table associated with this bit comprises at least one bit at one; if a bit of the byte of the memory region is at 0, then the byte of the memory region of the level-one addressing table associated with this bit comprises no bits at one.
3. The gateway as claimed in claim 1, wherein: for the level-two addressing table: if a bit of a byte of a memory region is at 0, then the index associated with this bit is itself associated with a free memory space; if a bit of a byte of a memory region is at 1, then the index associated with this bit is itself associated with a filled memory space; for the level-one addressing table: if a bit of a byte of a memory region is at 0, then the byte of the memory region of the level-two addressing table associated with this bit comprises at least one bit at one; if a bit of a byte of a memory region is at 1, then the byte of the memory region of the level-two addressing table associated with this bit comprises no bits at one; for the level-zero addressing table: if a bit of the byte of the memory region is at 0, then the byte of the memory region of the level-one addressing table associated with this bit comprises at least one bit at one; if a bit of the byte of the memory region is at 1, then the byte of the memory region of the level-one addressing table associated with this bit comprises no bits at one.
4. A vehicle, in particular a motor vehicle, comprising a plurality of electronic control units, each electronic control unit of the plurality of electronic control units being connected to a communication bus, allowing data frames to be exchanged, and a gateway as claimed in claim 1.
5. A method for determining a free memory space in a memory, implemented by a gateway, as claimed in claim 1, said method comprising: a) receiving a data frame; b) determining a free index in the lookup table on the basis of the level-zero addressing table, the level-one addressing table A, the level-two addressing table and the address table; and c) recording the payload of the received data frame with said determined free index.
6. The method as claimed in claim 5, comprising, after the recording, retrieving the payload recorded in the lookup table, via said communication bus, by the at least one electronic control unit that is the recipient of the data frame associated with the payload.
7. The method as claimed in claim 6, comprising, after the retrieving, deleting, from the lookup table with the index associated with the transmitted payload DATA, the payload DATA.
8. The method as claimed in claim 5, comprising, when a memory space of the lookup table is freed or is filled, modifying the byte stored in each memory region, of each level-zero, -one and -two addressing table, associated with the freed memory space so as to indicate that said memory space is free or occupied, respectively.
9. The method as claimed in claim 5, wherein the determining a free index comprises: d) determining a level-zero memory address on the basis of the address table and the level-zero addressing table; e) determining a level-one memory address on the basis of the address table and the level-one addressing table; f) determining a level-two memory address on the basis of the address table and the level-two addressing table; and g) determining the free index by summing the determined level-zero memory address, level-one memory address and level-two memory address.
10. The method as claimed in claim 5, wherein the level-zero addressing table, the level-one addressing table and the level-two addressing table are defined in the following way: for the level-two addressing table: if a bit of a byte of a memory region is at 1, then the index associated with this bit is itself associated with a free memory space; if a bit of a byte of a memory region is at 0, then the index associated with this bit is itself associated with a filled memory space; for the level-one addressing table: if a bit of a byte of a memory region is at 1, then the byte of the memory region of the level-two addressing table associated with this bit comprises at least one bit at one; if a bit of a byte of a memory region is at 0, then the byte of the memory region of the level-two addressing table associated with this bit comprises no bits at one; for the level-zero addressing table: if a bit of the byte of the memory region is at 1, then the byte of the memory region of the level-one addressing table associated with this bit comprises at least one bit at one; if a bit of the byte of the memory region is at 0, then the byte of the memory region of the level-one addressing table associated with this bit comprises no bits at one.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) Other features, details and advantages will become apparent from reading the following detailed description and from examining the appended drawings, in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
(10) One embodiment of a vehicle according to the invention will now be presented.
(11) With reference to
(12) According to the example presented here, the plurality of electronic control units 10 comprises eight electronic control units 10. However, the number of electronic control units 10 may obviously be different.
(13) A gateway 1 is used in order to ensure the transmission of data frames between a plurality of electronic control units 10, said gateway 1 being for example implemented by one of the electronic control units 10.
(14) The electronic control unit 10 implementing the gateway 1 is configured to receive, via the communication bus b1, at least one data frame to be transmitted to at least one other electronic control unit 10.
(15) A data frame comprises in particular an identifier of said data frame, a payload and information on the length of said payload.
(16) The gateway 1 allows in particular a UDS, for “Unified Diagnostic Services”, diagnostic communication protocol to be implemented.
(17) With reference to
(18) The receive module 11 is configured to receive, via the electronic control unit 10 comprising the gateway 1, the at least one data frame to be transmitted, and to transmit said data frames to the memory 12.
(19) The memory 12 is configured to store a lookup table T.sub.c, what is called a “level-zero” addressing table T.sub.0, what is called a “level-one” addressing table T.sub.1, what is called a “level-two” addressing table T.sub.2 and an address table Ta.
(20) With reference to
(21) The lookup table T.sub.c comprises an index list of indices i.sub.x, and each index i.sub.x has an associated memory space. In each memory space associated with an index i.sub.x, there may be recorded a payload DATA of a data frame received by the gateway 1, at least one indicator making it possible to determine at least one electronic control unit that is the recipient 10 of said received data frame, a length DLC, for “data length code”, and a frame identifier ID for identifying said received data frame.
(22) An index i.sub.x is said to be “free” when the associated memory space is free; in other words, when no payload DATA, length DLC or frame identifier ID is recorded in the memory space associated with this index i.sub.x.
(23) In the case that the plurality of electronic control units 10 comprises N electronic control units 10 (N being a natural integer greater than or equal to 2), the indicators also number N.
(24) In the example presented here, the indicators are therefore eight in number.
(25) Preferably and in the example below, each indicator is represented by one bit. In other words, the set of indicators, denoted by “DEST”, is advantageously represented by means of one byte, which by definition consists of eight bits.
(26) Each indicator, i.e. each bit of the set of indicators DEST, is associated with an electronic control unit 10.
(27) For a data frame whose payload DATA is recorded in the lookup table T.sub.c, when the bit of an indicator is at 0, this means that the electronic control unit 10 associated with said indicator is not the recipient of said data frame. Conversely, when a bit of an indicator is at 1, this means that the electronic control unit 10 associated with said bit is the recipient of said data frame.
(28) The length DLC of a data frame allows the number of bytes in the payload DATA to be defined.
(29) The data frame identifier ID allows the data frame associated with said index i.sub.x to be identified.
(30) In particular, the index list i.sub.x comprises 512 values, ranging from 0 to 511. Thus, the lookup table T.sub.c may comprise 512 sets comprising the payload DATA of a received data frame, the at least one indicator, in particular the set of indicators DEST, the length DLC and the frame identifier ID that are associated with said received data frame.
(31) With reference to
(32) The level-zero addressing table T.sub.0 comprises one memory region.
(33) The level-one addressing table T.sub.1 comprises eight memory regions, each characterized by a memory address, numbered from 0 to 7.
(34) The level-two addressing table T.sub.2 comprises sixty-four memory regions, each characterized by a memory address, numbered from 0 to 63.
(35) Each memory region of each addressing table comprises one byte. Each byte is read from right to left. Thus, for a given byte, the first bit is the bit on the right of the byte and the last bit is the bit on the left of the byte.
(36) Each bit of the byte of the memory region of the level-zero addressing table T.sub.0 is associated with a memory region of the level-one addressing table T.sub.1.
(37) In particular, according to the embodiment presented here, the nth (n being a natural integer between 1 and 8) bit of the memory region of the level-zero addressing table T.sub.0 denotes the nth memory region of the level-one addressing table T.sub.1.
(38) Each bit of the byte of a memory region of the level-one addressing table T.sub.1 is associated with a memory region of the level-two addressing table T.sub.2.
(39) More precisely, according to the embodiment presented here, the kth (k being a natural integer between 1 and 8) memory region of the level-one addressing table T.sub.1 denotes a kth set of eight successive memory regions of the level-two addressing table T.sub.2. In other words, the first memory region of the level-one addressing table T.sub.1 is associated with the eight first memory regions of the level-two addressing table T.sub.2, the second memory region of the level-one addressing table T.sub.1 is associated with the eight memory regions (following the eight first memory regions) of the level-two addressing table T.sub.2, . . . the eighth memory region of the level-one addressing table T.sub.1 is associated with the eight last memory regions of the level-two addressing table T.sub.2.
(40) According to the embodiment presented here, for a byte in a memory region of the level-one addressing table T.sub.1, the nth bit of said byte denotes the nth memory region of the eight memory regions of the level-two addressing table T.sub.2 that are associated with the memory region of the level-one addressing table T.sub.1 comprising said byte.
(41) Each bit of the byte of a memory region of the level-two addressing table T.sub.2 is associated with an index i.sub.x of the lookup table T.sub.c.
(42) Regarding the level-two addressing table T.sub.2, if a bit of a byte of a memory region is at 1, this means that the index i.sub.x associated with this bit is free, and therefore that the memory space associated with said index i.sub.x is free. On the other hand, if said bit is at 0, this means that the associated index i.sub.x is not free, and therefore that the memory space associated with this index i.sub.x is filled.
(43) Conversely, in another embodiment, a bit at 1 denotes an index i.sub.x that is not free and a bit at 0 denotes an index i.sub.x that is free.
(44) Regarding the level-one addressing table T.sub.1, if a bit of a byte of a memory region is at 1, this means that the byte in the memory region of the level-two addressing table T.sub.2 associated with this bit comprises at least one bit at 1. In other words, this means that at least one index i.sub.x associated with said memory region of the level-two addressing table T.sub.2 is free.
(45) On the other hand, if in the level-one addressing table T.sub.1 a bit of a byte is at 0, this means that the byte in the memory region of the level-two addressing table T.sub.2 associated with said bit comprises no bits at 1. In other words, this means that no index i.sub.x associated with said memory region of the level-two addressing table T.sub.2 is free.
(46) Lastly, regarding the level-zero addressing table T.sub.0, if a bit of the byte is at 1, this means that the byte in the memory region of the level-one addressing table T.sub.1 associated with this bit comprises at least one bit at 1.
(47) If a bit of the byte of the level-zero addressing table T.sub.0 is at 0, this means that the byte in the memory region of the level-one addressing table T.sub.1 associated with said bit comprises no bits at 1.
(48) With reference to
(49) Specifically, the zero byte means that no index i.sub.x of the lookup table T.sub.c is free.
(50) The gateway 1 comprises as many management modules 13 as there are electronic control units 10 and therefore, according to the example presented here, the gateway 1 comprises eight management modules 13. Each management module 13 is associated with one and only one electronic control unit 10 and is connected to the memory 12.
(51) The space manager 14 is connected to the memory 12.
(52) When a data frame is received by the receive module 11 and information recorded in the lookup table T.sub.c, the space manager 14 is configured to determine the first free index i.sub.x, in other words the first free memory space, in the lookup table T.sub.c.
(53) When information is recorded in a memory space of the lookup table T.sub.c, the space manager 14 is configured to modify the byte stored in each memory region of each addressing table, for each level zero, one and two, that is associated with the index i.sub.x corresponding to the newly occupied memory space so as to indicate that said memory space is no longer free.
(54) When a memory space of the lookup table T.sub.c is freed, the space manager 14 is configured to modify the byte stored in each memory region of each addressing table, for each level zero, one and two, that is associated with the index i.sub.x corresponding to the freed memory space so as to indicate that said memory space is free.
(55) In other words, when the information, previously recorded with a given index i.sub.x, is deleted, or when information is recorded with a given index i.sub.x, the space manager 14 is configured to modify the byte stored in each memory region, of each level-zero, -one and -two addressing table, associated with the index i.sub.x corresponding to the newly occupied, or newly freed, memory space.
(56) An example of modifying the content of the memory regions of each level-zero, -one and -two addressing table in the case of deleting and recording information in the lookup table T.sub.c will be presented in detail in the description of the method.
(57) The transmit module 15 is connected to the plurality of management modules 13 and to the communication bus b1 and is configured to transmit the at least one data frame to be transmitted from the plurality of management modules 13 to the at least one recipient electronic control unit 10 via the communication bus b1.
(58) With reference to
(59) In the following paragraphs, the implementation of the method for a gateway 1, for a plurality of electronic control units 10 comprising eight electronic control units 10 and for the receiving of a data frame by the gateway 1 will therefore be presented. Obviously, the number of electronic control units 10 may be other than eight, and/or the gateway 1 may receive a plurality of data frames, and reiterate the following method for each received data frame.
(60) The method first comprises a step of receiving E1 a data frame, by the receive module 11 of the gateway 1, via the electronic control unit 10 implementing the gateway 1. The electronic control unit 10 has previously received the data frame via the communication bus b1.
(61) The receive module 11 next transmits said received data frame to the memory 12.
(62) The memory 12 then receives the data frame transmitted by the receive module 11.
(63) Next, the method comprises a step of determining E2, by the space manager 14, a free index i.sub.x in the lookup table T.sub.c in order to record the payload DATA of the received data frame therein, the at least one indicator making it possible to determine at least one electronic control unit 10 that is the recipient of said received data frame, the length DLC and the frame identifier ID that are associated with said received data frame.
(64) One exemplary implementation of the determining step E2 of the method will be described with reference to
(65) The determining step E2 first comprises a substep of determining a level-zero memory address.
(66) For this, the space manager 14 compares the byte, recorded in the memory region of the level-zero addressing table T.sub.0, with the address table T.sub.a for the level zero in order to determine the level-zero memory address.
(67) For example, with reference to
(68) The determining step E2 next comprises a substep of determining a level-one memory address.
(69) For this, the space manager 14 selects the memory region, of the level-one addressing table T.sub.1, that is associated with the first bit at 1 of the byte of the memory region of the level-zero addressing table T.sub.0.
(70) Next, the space manager 14 compares the byte, in the selected memory region, with the address table T.sub.a for the level one in order to determine the level-one memory address.
(71) For example, with reference to
(72) The determining step E2 next comprises a substep of determining a level-two memory address.
(73) For this, the space manager 14 selects the memory region, of the level-two addressing table T.sub.2, that is associated with the first bit at 1 of the byte of the selected memory region of the level-one addressing table T.sub.1.
(74) Next, the space manager 14 compares the byte, in the selected memory region of the level-zero addressing table T.sub.2, with the address table T.sub.a for the level two in order to determine the level-two memory address.
(75) For example, with reference to
(76) The determining step E2 next comprises a substep of determining the free index i.sub.x, the free index i.sub.x being equal to the sum of the level-zero memory address, of the level-one memory address and of the level-two memory address.
(77) According to the example presented here, the first free index i.sub.x is equal to 64+56+0=120.
(78) Once the free index i.sub.x has been determined, the method comprises a step of recording E3 the payload DATA of the received data frame in the memory space associated with said determined free index i.sub.x.
(79) In the recording step E3, the at least one indicator making it possible to determine at least one electronic control unit that is the recipient of said received data frame, the length DLC and the frame identifier ID of said received data frame are also recorded with the determined free index i.sub.x.
(80) When the recording step E3 has been carried out, the method comprises a step E4 of modifying the byte stored in each memory region of each addressing table, for each level zero, one and two, that is associated with the index i.sub.x corresponding to the newly occupied memory space so as to indicate that said memory space is no longer free.
(81) According to the example presented here, since the memory space associated with the index i.sub.x of value 120 is newly occupied, the space manager 14 therefore modifies the bit, of the memory region of the level-two addressing table T.sub.2, that corresponds to said index i.sub.x by imposing the value 0 thereon.
(82) Additionally, if all of the bits of the byte of the level-two addressing table T.sub.2 in which a bit has been set to 0 are at 0, then the space manager 14 sets the bit, of the memory region of the level-one addressing table T.sub.1, that corresponds to the memory region of the level-two addressing table T.sub.2 in which all of the bits are now at 0, to 0.
(83) Similarly, if all of the bits of the byte of the level-one addressing table T.sub.1 in which a bit has been set to 0 are at 0, then the space manager 14 sets the bit, of the memory region of the level-zero addressing table T.sub.0, that corresponds to the memory region of the level-one addressing table T.sub.1 in which all of the bits are now at 0, to 0.
(84) For example, with reference to
(85) If the communication bus b1 is available, then the method comprises a retrieving step E5 in which the management module 13 of each electronic control unit 10 that is the recipient of the received data frame retrieves, from the lookup table T.sub.c, the payload DATA of the received data frame.
(86) To determine the length of the payload DATA to be retrieved, the length DLC recorded in the lookup table T.sub.c is used. Specifically, the length DLC, of the payload DATA of a data frame, that is recorded in the lookup table T.sub.c allows each management module 13 of an electronic control unit 10 that is the recipient of said data frame to know the length DLC of the payload DATA to be retrieved.
(87) Lastly, after retrieving the payload DATA, the management module 13 of each recipient electronic control unit 10 transmits said retrieved payload DATA to the associated recipient electronic control unit 10.
(88) For this, the payload DATA is transmitted by the management module 13 of each recipient electronic control unit 10, over the communication bus b1, via the transmit module 15, in order to be transmitted to the at least one associated recipient electronic control unit 10.
(89) When the payload DATA has been transmitted to the at least one recipient electronic control unit 10, then the method comprises a step of deleting E6, from the lookup table T.sub.c with the index i.sub.x associated with the transmitted payload DATA, the transmitted payload DATA.
(90) In this deleting step E6, the length DLC and the frame identifier ID that are associated with said data frame that relate to the retrieved payload DATA are also deleted.
(91) Thus, since the information mentioned above has been deleted, the index i.sub.x is free again.
(92) Once the index i.sub.x is free again, the method comprises a second step E7 of modifying the byte stored in each memory region of each addressing table, for each level zero, one and two, that is associated with the index i.sub.x corresponding to the newly freed memory space so as to indicate that said index i.sub.x is free again.
(93) The space manager 14 therefore modifies the bit of the level-two addressing table T.sub.2 corresponding to said index i.sub.x by imposing the value 1 thereon.
(94) If the bit, of the memory region of the level-two addressing table T.sub.2, that is set to 1 is the only bit at 1 in the memory region, the space manager 14 sets the bit, of the memory region of the level-one addressing table T.sub.1, that corresponds to the memory region of the level-two addressing table T.sub.2 in which the bit was previously set to the value 1, to 1.
(95) Similarly, if the bit, of the memory region of the level-one addressing table T.sub.1, that is set to 1 is the only bit at 1 in the memory region, the space manager 14 sets the bit, of the level-zero addressing table T.sub.0, that corresponds to the memory region of the level-one addressing table T.sub.1 in which the bit was set to the value 1 by the space manager 14, to 1.
(96) Thus, after this step, the level-zero, -one and -two addressing tables are defined like those shown with reference to
(97) Thus, advantageously, the method implemented by the gateway 1 makes it possible to rapidly determine a free space in the lookup table T.sub.c in order to record information relating to a received data frame therein. Thus, the time between the receiving of a data frame, the recording of the information relating to said received data frame, and the retrieving of these data by the at least one recipient electronic control unit is short. Thus, the transmission of data frames is accelerated.