Time and event based message transmission
11157429 · 2021-10-26
Assignee
Inventors
Cpc classification
International classification
Abstract
A system, apparatus and method for efficient utilization of available band-width on the system's bus connection. The system includes a scheduler configured to receive a virtual schedule that provides at least one slot for sending a message over the communication bus. A module is configured to send a message over the communication bus.
Claims
1. A network system scheduler configured to: receive a schedule for use in ordering and timing transmission of messages from multiple nodes over a communication bus in an automotive vehicle based, at least in part, on timing that assumes ideal conditions; send a first message according to the schedule; and if a corrupt transmission of the first message, a noise activity, or a collision with the first message occurs: discard the first message being sent before it is terminated and retransmit it prior to transmitting any other message; and delay sending of a next message scheduled for transmission according to the schedule.
2. The network system scheduler of claim 1, wherein the first message is provided with a message identifier.
3. The network system scheduler of claim 1, wherein the network system scheduler is coupled to a virtual clock on which the schedule is based.
4. The network system scheduler of claim 1, further comprising an actual clock, wherein the network system scheduler is configured to determine an actual time for sending the first message in accordance with the actual clock.
5. The network system scheduler of claim 4, wherein the actual time is based, at least in part, on less than ideal conditions occurring in real time or near-real time.
6. The network system scheduler of claim 4, wherein the network system scheduler is coupled to a first clock on which the schedule is based, and wherein the system further comprises a second clock, wherein the actual time is further determined in accordance with the second clock.
7. The network system scheduler of claim 1, wherein the communication bus is configured to operate according to one of a Local Interconnect Network (LIN) protocol or a controller area network (CAN) protocol.
8. The network system scheduler of claim 1, wherein the network system scheduler is further configured to issue synchronization messages.
9. The network system scheduler of claim 1, wherein the first message is sent from a first one of the multiple nodes, and wherein the next message is sent from a second one of the multiple nodes, which is different from the first one of the multiple nodes.
10. The network system scheduler of claim 1, wherein, if the retransmitting of the first message is failed, the next message is delayed again irrespective of the next message's relative priority to the first message.
11. The network system scheduler of claim 1, wherein, if the retransmitting of the first message is failed, the network system scheduler is further configured to determine whether to retransmit the first message based at least in part, on the first message's priority relative to the next message.
12. The network system scheduler of claim 1, further comprising one of the multiple nodes.
13. A method implemented in a node of multiple nodes, comprising: determining a schedule for use in ordering and timing transmission of messages from the multiple nodes over a communication bus in an automotive vehicle based, at least in part, on timing that assumes ideal conditions; sending a first message according to the schedule; and if a corrupt transmission of the first message, a noise activity, or a collision with the first message occurs: discarding the first message being sent before it is terminated and retransmitting it prior to transmitting any other message; and delaying sending of a second message scheduled for transmission according to the schedule.
14. The method of claim 13, wherein the first message is provided with an identifier.
15. The method of claim 13, wherein the schedule is based on a virtual clock.
16. The method of claim 13, further comprising: determining an actual time for sending the first message in relation to an actual clock.
17. The method of claim 13, further comprising: operating the communication bus according to a Local Interconnect Network (LIN) protocol or a controller area network (CAN) protocol.
18. The method of claim 13, further comprising: monitoring the communication bus and issuing synchronization messages in response to at least one of corrupt transmission of a message, noise activity on the communications bus, or colliding messages.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) A currently proposed embodiment of an arrangement that has the significant characteristics of the invention will be described below, with reference to the attached drawings in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
DETAILED DESCRIPTION
(10)
(11)
(12)
(13)
(14) In order to avoid the requirement for accurate clocks, the CAN characteristic is utilized to resolve collisions of messages without discarding and to deliberately put forward the transmission in the module schedules. This is shown in 45. Here the respective messages have been scheduled to be transmitted almost 50% in the previous time slot according to the virtual schedule. The module A starts its transmission even earlier, as its clock is fast. The transmission of message Z is carried out in this time slot and the message AI will not go onto the bus until this is completed. In the example shown, this is carried out at the same time as AI goes out onto the bus in the example 44. The module B attempts to send its message almost 50% in the time slot T1 but, as its clock is slow, the message AI has already been sent and a small time slot arises between AI and BI. In the same way, C sends out CI and, on account of the relative effects of the clock deviations, CI goes out onto the bus immediately upon the attempt at transmission. A2 goes out immediately thereafter, while there is a larger slot to B2.
(15) In both examples, we have used the same virtual schedule as the starting point. With the traditional method, the highest possible bandwidth has been utilized. With the new method, large margins have been created and the messages are sent more quickly.
(16) In
(17)
(18)
(19) The example 71 shows in principle the same virtual scheduling as above. In this case, the fact has been taken into account that there is a certain delay after a message has been received correctly by a module before this triggers a transmission of a message by the module in question. Here the message AI is set in relation to the virtual clock. In the module B, the message B1 is set to be sent when AI is received and in the module C, the message CI is set to be sent when B1 is received. In the module A, A2 is set to be sent when CI is received. As is shown by the figure, the messages go out onto the bus better synchronized than with the use of the traditional method represented by 44″. It can easily be seen that the method has a disadvantage in that one omitted message can stop all further transmission. In order to overcome this problem, each message is allocated two or more messages that trigger transmission. This is shown in the example 72. Here AI has been set to trigger both B1 and CI, B1 to trigger CI and A2, CI to trigger A2 and B2, A2 to trigger B2 and C2, and B2 to trigger A3 and C3. Now AI fails to trigger B1 but as it also triggers CI, this goes out instead of BI. The whole schedule is thereby displaced one step to the left. This does not matter, as each message has a unique identity.
(20) The example above shows that, using the invention, not only do we achieve a better utilization of the bus's bandwidth and the use of simpler clocks, but also that the communication can be constructed to be fault-tolerant with completely predictable maximum delays and that these can be optimized according to the system's real-time requirements by means of suitable choice of identifiers and priorities, maximum number of permitted retransmissions, choice of accuracy of the clocks in the respective modules, choice of setting in relation to the virtual clock for the respective module and message, etc., and that modules can be given special rules for how the communication is to be carried out. Taken as a whole, these rules give a predictable appearance on the bus for each message. If any module should infringe any given rule, this is easily discovered by one or more system-monitoring modules and the communication does not break down. System-monitoring nodes can always issue correcting command messages, for example according to CanKingdom, by these messages being given higher priority than other messages. Traditional methods such as “bus guardians” used in traditional time-controlled systems can be used without problems, if considered necessary.
(21) In certain cases, it cannot be tolerated that messages are sent one or more time slots earlier than scheduled. The case described above where a displacement arises due to a node not sending its message, can be avoided by one or more modules being scheduled to send a dummy message with lower priority. If these find that they do not go out onto the bus during the first half of the time slot as a result of this being occupied, the transmission attempt is discontinued.
(22) ISO 11898-4 is a standard for scheduling of messages in a CAN bus. The standard describes two levels for the clock function, Level 1 and Level 2. Level 1 is characterized by the total time schedule being made up of shorter partial schedules which are introduced by time synchronization messages being sent from a time master. In order to ensure that the system does not fail as a result of the time master failing, there is a complex set of rules that enable one or more reserve time masters to take over in a secure way. In addition, there is a complex set of rules in the standard for how the local clocks are to be synchronized with the time master and how the respective module is to be able to determine whether it is synchronized or not. All time measurement in Level 1 is related to the bit rate on the bus. Using the invention described, a system can be constructed with much simpler means for obtaining an identical appearance of messages on the bus, without the modules having special clock functions that are synchronized with special time masters. This can be carried out by the virtual clock being set in relation to one or more messages via a selected event, for example indication of a position of a motor's flywheel. When one or more modules indicate this position, this triggers the transmission of a special message. If this message is identical for all the modules that send it, it will be understood as being owned by all the modules that send it out within the first bit, Start Of Frame. If the deviation is larger than one bit length, the message will be put in a queue in the losing module. A local time-out terminates the transmission attempt after a time that is shorter than the length of message after the indication. An alternative to this is to put the first message in the schedule after the start message at a higher priority than this. The start messages that are in a queue will then lose out in the arbitration which makes it possible to let the application in the respective module terminate the transmission attempt after the receipt of the start message. Subsequent messages can then be scheduled with the start message as a reference to a local clock which is started upon the receipt of the start message or by using some later message in the schedule as a clock reference or by using one or more previous messages in the schedule which directly trigger the transmission attempt in the way described above.
(23) By means of the invention, the problem with the scheduling is changed from following rules laid down that require all the modules to be synchronized with a given time master in the system or with a given set of rules applicable for all the modules for obtaining timing that is common to the system for a planned virtual scheduling which is converted in practice by local rules in each module which are coordinated in a design process which is unique for the system. By this means, the characteristics of the system can be optimized both with regard to cost and features, by means of, among other things, eliminating the earlier basic rule that messages must not collide on the bus in time-scheduled systems. In addition, modules without clocks can be integrated into systems based on time-scheduled communication.
(24) Many time-controlled communication systems rely on a selected edge in the bit flow on the bus for the synchronization of the local clocks within the system. CAN utilizes falling edges for hard and soft synchronization of the clocks that are used for the synchronization of the time for interpreting the individual bits in the bit flow on the bus. The first edge, SOF, is often proposed to be used for clocks for other purposes, for example for scheduling of messages. However, in order to distinguish this falling edge from a falling edge caused by an interference, SOF is not indicated until at the sampling point. ISO 11898-4 (TTCAN) utilizes this delayed indication of SOF in order to distinguish easily false edges from real ones. A disadvantage of this method is that the distance between the edge and the sampling point can be different in different modules within the system, which leads to an inexact synchronization of the clocks. This can, however, be corrected easily at local level if, for the clocks' synchronization, reference is made to the edge and not to the sampling point, as this local deviation is known in the respective nodes.
(25) For the invention, it is, on the other hand, an advantage to utilize the sampling point as a reference. In this way, it is possible easily to integrate modules that are developed for event-driven CAN systems in time-controlled systems. When the message two time slots before is correctly received, the transmission trigger is set to be activated at the next SOF. When SOF in the message in the preceding time slot is detected, then the CAN controller is activated for transmission. As the message has then already passed the arbitration stage, it will be sent immediately after the preceding message has been terminated, irrespective of the message's priority. In this way, a module without a clock can be set in relation to a virtual clock and a virtual schedule with a high degree of precision.
(26) It can easily be seen that if the method above is combined with a suitable choice of priorities, then several messages can have one and the same trigger message and also each message can have several trigger messages and in normal circumstances the messages will go out at the correct time. If any message is not sent, for example due to a module fault, then all the other messages will still go out, displaced, however, by one time slot.
(27) An alternative to using the sampling point as a reference is to use the falling edge in the RTR bit after the CAN identifier. This is indicated by all the CAN Controllers for soft synchronization and is thereby just as precise as SOF but has the advantage of being reliably identified.
(28)
(29) 101 shows schematically the functions comprised in the respective module. The module is connected to the bus via a connector 101 which can be a contact or a wireless connection, for transferring the bus signals i4 to and from the module. The signals pass through signal-adapting means 102, for example a CAN transceiver, which in turn is connected to a protocol circuit 103, for example a CAN Controller. This is connected to a CPU 104 with requisite peripherals and application software 105 for the module function. In addition, the module has at least software 107 which can set received messages 108 on the bus in relation to messages 109 which are to be sent. The module has an actual clock 110 which is set in relation to at least one edge on message signals on the bus, for example the falling edge 111 at Start of Frame in a CAN message. In its simplest form, the clock 110 consists of the clock incorporated in a CAN Controller for bit synchronization and interpretation. The module can be arranged to handle time-controlled means symbolized by the unit 112 and the outgoing and incoming signal connections 113. The controls i5 can be related to the clock 110 and/or a clock 114 with a second time base, for example a time base that varies with the engine speed. The module can also be arranged to handle event-driven or event-controlling means symbolized by the unit 115 and the outgoing and incoming signal connections 116. Signals i6 from events or triggering of events are coordinated with the time-related signals i5 and with the actual schedule (the actual schedules) in the module and with the messages' identities according to the arrangement 117 and 118. Activities in the module trigger transmission of a message 119 on the bus according to the actual schedule which collides with the message 108. If the collision takes place in Start of Frame then, if it has a higher priority than 108, the module's message will appear on the bus instead of the message 108. The sender of message 108 will receive 119 and then again commence transmission of 108. If 108 has the highest priority, the module will wait until 108 has been received and then send 119. If SoF has already been received, then the module waits to send 119 until 108 has been received. The transfer or exchange of information or signals between the virtual schedule and the system tool is symbolized by i7.
(30) The invention is not limited to the embodiments described above, but can be modified within the framework of the following patent claims and concept of the invention.