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) FIG. 1 shows schematically a CAN system with the nodes A and B and additional nodes C, D and Z and a traditional scheduling of some messages from A and B,

(3) FIG. 2 shows time slots in a virtual schedule with associated virtual clock and how the modules insert their messages in accordance with their actual clocks,

(4) FIG. 3 shows a traditional system operating with TTP and a corresponding system operating with the invention,

(5) FIG. 4 shows a virtual schedule, applicable for all the following examples, an actual schedule in a respective module and resulting actual schedule on the bus for all modules for scheduling according to traditional principles. In addition, it shows resulting actual schedules from the use of the invention without pre-ignition and a comparison of the two methods,

(6) FIG. 5 shows corresponding actual schedules with pre-ignition and a discard bus with retransmission of messages in comparison with a non-discard bus according to the traditional solution,

(7) FIG. 6 shows corresponding actual schedules for a high-discard bus with retransmission of messages in comparison with a non-discard bus according to the traditional solution,

(8) FIG. 7 shows corresponding actual schedules where a message is set in relation to the virtual clock and where other messages are indirectly set in relation to the virtual clock by the respective messages being the trigger for one or more other messages, and

(9) FIG. 8 shows the construction of the system in the form of a schedule.

DETAILED DESCRIPTION

(10) FIG. 1 shows schematically a network with the modules A and B connected to a few-core serial connection 1. The network can contain additional connected modules which have been indicated by C, D and Z. Each module can transmit and receive messages. The transmission of messages is time-scheduled. This scheduling is symbolized by 2, where 3 shows how messages appear on the few-core connection, consecutively in time. The time is divided into time slots and the starting points for the respective slots are indicated by 4, 5, 6, 7 and 8. According to traditional scheduling, each module is now allocated smaller slots. Module A receives 5A to 6A for the message AI and 7A to 8A for the message A2. In the same way, module B receives 4B to 5B for B1 and 6B to 7B for B2. Now the clocks in A and B are not synchronized, for which reason the messages AI, BI, A2 and B2 in reality come within the nominal slots 4-5-6-7-8 but not according to the allocated slot. In the figure, the clock in A runs slower than the clock in B, for which reason the gap between AI and B1 becomes greater than the gap between AI and B2. During the scheduling, buffer zones 5B-5A, 6A-6B, etc., must be inserted between the messages in order that these will not collide as a result of the relative deviations between the module clocks. In the example described above according to traditional thinking, the actual correct time is taken as the starting point and buffer zones are scheduled in order to compensate for local deviations from the correct time.

(11) FIG. 2 now shows the new thinking. The scheduling is carried out against a virtual clock. In the virtual schedule 22, the messages AI, BI, CI, A2, B2, C2, etc., are now inserted at the required times. In FIG. 2, the messages have been tightly packed for the sake of clarity. The times of transmission of the respective messages are transmitted to the respective modules. Locally each module thus receives an actual schedule for its messages: A receives an actual schedule for messages AI and A2, B for B1 and B2 and C for CI and C2. Each module has an actual clock which is set is relation to the virtual clock, 21A, 21B, and 21C respectively, to which their schedules are related. Now the clock 21A happens to coincide with the virtual clock and the message AI is sent out at the correct time. The clock in B runs fast and attempts to transmit before the transmission of AI is completed. The collision detection in CAN means that B1 is retained automatically until AI is finished and is then sent out immediately. In spite of the fact that the clock 21B is wrong, the message will be sent out correctly according to the virtual schedule. In the same way, the messages A2 and B2 will be sent out correctly. The clock 21C is slow, so that a gap is created between B2 and C1. This would have been able to be prevented if the actual local schedules had been put forward in relation to the virtual schedule, that is if there was deliberate scheduling for collision. In traditional thinking, the schedule is stationary in time while the messages oscillate (jump forward and back) in time. With the new thinking, the whole of the actual schedule will oscillate in time.

(12) FIG. 3 shows schematically a system 31 with the protocol TTP/C and an identical schematically drawn-up system 32 according to the invention with the protocol CAN. The TTP system has the modules 31′, 31″ and 31′″ which are connected to the bus. Each module has a usual application with requisite hardware, symbolized by HA, and the communication between these is carried out via the communication units 33′, 33″ and 33.sup.m. These communication units are specially developed for TTP and contain a protocol processor with associated ROM data, symbolized by PP and two Bus Guardians designated BG (only one is illustrated). Each PP and PG has a clock, symbolized by C. The description of TTP is greatly simplified, but the key feature for the comparison between TTP and a system according to the invention is the existence and placing of clocks. TTP is based on the correct time being maintained. Therefore PP and BG each have their own clocks. PP handles the transmission and reception of messages according to a time schedule. BG has a smaller part of this schedule, namely at which times the module is entitled to transmit. Only at these times can PP physically send signals on the bus. At other times BG prevents this. The time schedule is constructed by a system designer outside the system and this is downloaded to the system using a tool, symbolized by the unit V. TTP requires the special communication units which provide a common time in the system and check that messages are transmitted at the correct times and that message collision is avoided. In contrast to this is shown the system 32 according to the invention. Each module has also an application with hardware, H′, H″ and H.sup.m. The communication is carried out according to the CAN protocol and standard circuits for this are used in the modules 32″ and 32.sup.m. The module 32′ is assumed to have a CAN controller specially developed for the system according to the invention, with an integrated clock. The module 32″ has a clock that is handled by the application, while 32′″ does not have a clock at all. As for TTP, a system designer constructs scheduling for the system, but this is broken down and modified for each module, which receives a local schedule. These local schedules can be completely different in essence, but taken as a whole they form a well coordinated schedule for the system. The local schedules are downloaded to the respective modules from a common unit symbolized by VV. This can be temporarily or permanently connected to the system, or alternatively can be incorporated as a module in the system which has other tasks in addition to the scheduling of messages.

(13) FIG. 4 shows schematically a virtual schedule represented by 41. This is created with a virtual clock 42 which generates a continuous timing whereby the time slots T1, T2, T3, T4, T5, etc., are defined. The required transmission of the messages AI, BI, CI, A2 and B2 which are to be sent from the respective modules A, B and C in the system have been inserted in these time slots. The messages do not occupy the whole of the time slots as the virtual time is interpreted by an actual clock in the respective modules. These all deviate from the virtual time. Each module will have an actual schedule for transmission of its messages, which is illustrated by 43, and these schedules will deviate from each other as a result of the clocks' deviations from the virtual clock. 43 shows that the clock in the module A is fast by the amount dA but runs at the same speed as the virtual clock. The clock in the module B is slow by the amount dB and runs at the same speed as the virtual clock. The clock in the module C is correct at the start but runs slightly too quickly, for which reason the deviation gradually increases which is indicated by dC and dC′. Each module transmits in accordance with its actual schedule and the resulting actual schedule for the system as a whole which appears on the bus is shown by 44. Here it can be seen that there are slots of varying sizes between messages and thereby a poor utilization of the bandwidth. The messages B1 and CI almost collide and will do so at the next occasion unless their clocks are adjusted relative to the virtual clock before then. If the module clocks keep poor time, they must be synchronized frequently via synchronization messages, which steals bandwidth. This bandwidth loss can be reduced if the modules are provided with more accurate clocks, which makes the module more expensive.

(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 FIG. 5, the same virtual schedule has been utilized as above and is illustrated by 41′. The example 51 shows that automatic retransmission can be utilized. It is assumed that the message AI in the example 45 has been discarded just before it was terminated and that it is sent again. The correct message goes out immediately after the corrupt message AI′. (This ignores components not directly affected by the invention in the CAN protocol's error handling such as error frames, etc., for which is only required a time analysis during the scheduling, which is simple for experts in the field and which does not affect the fundamental discussion and the result in the main.) The module B starts its transmission according to schedule with pre-ignition, but as AI has already then started, B1 will go out onto the bus immediately after AI irrespective of their relative priorities. In the same way, CI goes out immediately after B1 and thereafter A2. A comparison with the traditional, maximally utilized schedule shows that, in spite of the retransmission of AI, B2 goes out earlier by means of the invention. Both better utilization of the bandwidth and shorter maximum delay of messages have been achieved.

(17) FIG. 6 shows the same case as in FIG. 4, but in which AI is retransmitted twice and this results in a temporary 100% bus utilization, but in spite of this B2 goes out slightly delayed. In this example, it has been assumed that B1 cannot be delayed, for which reason it has been given a higher priority than AI. After two failures of almost complete AI messages, B1 goes out with a small delay, after which the correct AI goes out, followed by CI and A2.

(18) FIG. 7 shows how a time-scheduled communication can be set up with modules without clocks. Here the module A is coordinated with the virtual clock and with the modules B and C via the messages AI and A2. In addition, it shows how redundancy is achieved by means of one message triggering several messages.

(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) FIG. 8 shows schematically how the construction of a system according to the invention can be carried out. A system designer 80 designs a control system 81 to be used in a product, for example a boat 82. In the example, the system consists of a boat control unit 83 which communicates, via a bus 84, with three motors with associated auxiliary devices for course setting, raising and lowering of rigging, logs, etc., 85, 85′ and 85″. The control electronics for the boat control unit 83 are represented by 86 and for the respective motors by 87, 87′ and 87″. The system designer builds up the system in a computer-based tool 88 which can be of a type according to U.S. Pat. No. 7,188,162, issued Mar. 6, 2007, and U.S. Patent Application Publication No. 2005/0086382 AI, published Apr. 21, 2005. In addition to a selection of characteristics that are described in the documents referred to, the tool has also a part 89 for scheduling according to the invention. In a first step, the system designer develops one or more virtual schedules 90 based on one or more virtual clocks 91 for the system as described above. The tool processes the virtual schedule into one or more local actual schedules for the respective modules which are indicated by 92, 93, 94 and 95. What is important for the invention is that the schedule is associated with the correct choice of identifier and their associations with each other and their priority in the event of collision on the bus, for which reason this has been marked specially by 92′, 93′, 94′ and 95′. The tool supplies additional information i1 for settings, program codes, etc., for the respective module which is indicated by 96. The information i2 thus created and processed is transferred to a configuring tool 97 via the connection 98 which can be selected in a suitable way, for example via a diskette, file transfer in a digital network, etc. In addition to configuring the system, the information can be used for later analysis of the same and the configuring tool can advantageously be combined with an analysis tool which, among other things, can compare the virtual schedule with the actual schedule which appears on the bus during the system's operation. The configuring tool is connected to the system's bus via the connection 99 and the connector 99′ and requisite information 100 for local schedules, settings, etc., is exchanged between the modules and the tool. The virtual schedule function can also convey direct information i3 to the configuration tool 97 for requisite processing.

(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.