The present invention relates to a real-time control network used in real-time processing. The present invention is applicable to a vehicle control network or an industrial computer.
To guarantee realtime communication capability, a recent vehicle-mounted network tends to use an event-triggered communication network, or a time-synchronized communication network. For example, FlexRay mentioned in Patent Literature 1 is one of the time-synchronized communications. In FlexRay, one period of communication is called a communication cycle. A communication cycle is composed of multiple slots each of which is assigned in advance to each controller. The communication control unit of each controller, which synchronizes with other communication control units on a network, writes the frame of a specified slot into the reception buffer at the start of the slot to receive data from the network. The communication control unit reads data from the transmission buffer and transmits it to a slot, which is specified in advance, to transmit the data to the network.
PATENT LITERATURE 1: JP-A-2008-509584
The correct execution of a control task in a FlexRay-based vehicle-mounted network system requires that the reception of input data used in one control cycle and the transmission of output data generated in one control cycle be completed in one control cycle to guarantee data synchronization. Failure to guarantee data synchronization generates a sampling period deviation, generating the problem that the control task control cannot be performed.
It is an object of the present invention to guarantee data synchronization by completing the reception of input data, which is used in one control cycle, and the transmission of output data, which is generated in one control cycle, in one control cycle.
To solve the above problem, the present invention provides a vehicle-mounted network device wherein a plurality of nodes are connected to a common network, each of the node includes a transmission buffer, a reception buffer, and communication control means, communication is performed in a fixed-period communication cycle, the communication cycle includes a plurality of slots each generated by dividing the communication cycle into a pre-specified communication time, and the communication control means uses a time division multiplex communication system that transmits and receives a frame, in which vehicle control data is included, via a pre-specified slot, wherein the communication control means performs transmission by reading from a transmission buffer and transmitting to a pre-specified slot and the communication control means performs reception by writing a frame in a pre-specified slot to a reception buffer, the node has a control task and data transmission/reception means and the control task is called at a pre-specified time in a communication cycle to receive input data, to perform control, and to transmit output data, the data transmission/reception means receives input data by performing a pre-specified conversion for a frame in a pre-specified reception buffer to generate input data, the data transmission/reception means transmits output data by performing a pre-specified conversion for output data to generate a frame and writing the frame into a pre-specified transmission buffer, the plurality of slots are divided into two, a first-half slot group and a second-half slot group, each composed of a set of one or more consecutive slots, and the data transmission/reception means performs transmission of output data corresponding to the first-half slot group of a certain communication cycle during the slots in the second-half slot group of the certain communication cycle and performs transmission of output data corresponding to the second-half slot group of the certain communication cycle during a time allocated the slots of the first-half slot group of a next communication cycle of the certain communication cycle.
The present invention also provides a vehicle-mounted network device, wherein a plurality of nodes are connected to a common network, each of the node includes a transmission buffer, a reception buffer, and communication control means, communication in the network is performed in a fixed-period communication cycle, the communication cycle includes a plurality of slots each generated by dividing the communication cycle into a pre-specified communication time, and the communication control means uses a time division multiplex communication system that transmits and receives a frame, in which vehicle control data is included, via a pre-specified slot, wherein the communication control means performs transmission by reading from a transmission buffer and transmitting to a pre-specified slot and the communication control means performs reception by writing a frame in a pre-specified slot to a reception buffer, the node has a control task and data transmission/reception means, the control task is called at a pre-specified time in a communication cycle to receive input data, to perform control, and to transmit output data, the data transmission/reception means receives input data by performing a pre-specified conversion for a frame in a pre-specified reception buffer to generate input data, the data transmission/reception means transmits output data by performing a pre-specified conversion for output data to generate a frame and writing the frame into a pre-specified transmission buffer, the communication cycle has an idle time during which no frame is transmitted/received from a time in the communication cycle to the end time of the communication cycle or in which there is no slot in the idle time, and during the idle time of the certain communication cycle, the data transmission/reception means transmits all output data, generated by the control task in the certain communication cycle, in a next communication cycle of the certain communication cycle.
The vehicle-mounted network device of the present invention completes the reception of input data, which is used in one control cycle, and the transmission of output data, which is generated in the one control cycle, in the one control cycle in a FlexRay-based vehicle-mounted network system, thus guaranteeing data synchronization.
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
The following describes embodiments of the present invention in detail.
In a first embodiment, an embodiment will be described in which the control cycle and the communication cycle are made to synchronize, the slots in the communication cycle are partitioned into two slot groups, and a data transmission/reception unit 10 is executed for each slot group to transmit output data. The following describes this embodiment.
The time from the control task start time 17 of communication cycle M to the control task start time 17 of communication cycle M+1 is a control cycle 21. The partitioning point 22 is the start time of the first slot of a second-half slot group 24. The partitioning point 22 is set after a control task end time 30. The transmission of the output data of the first-half slot group is executed from the partitioning point 22 to the end of a first-half slot group data transmission/reception unit execution time 27. The transmission of the output data of the second-half slot group is executed from the communication cycle start time to the end time of a second-half slot group data transmission/reception unit execution time 25. The first-half slot group data transmission/reception unit execution time 27 is proportional to the number of transmission frames included in the first-half slot group. The second-half slot group data transmission/reception unit execution time 25 is proportional to the number of transmission frames included in the second-half slot group. A slack time TA 28 is the time from the end time of the second-half slot group data transmission/reception unit execution time 25 to the control task start time 17. A slack time TB 29 is the time from the end time of the first-half slot group data transmission/reception unit execution time 27 to the communication cycle start time.
The partitioning point 22 is determined in advance so that |slack time TA−slack time TB| is minimized as shown in
The data transmission/reception unit 10 transmits the output data 9 when called by the interrupt management unit 11.
The following describes the transmission sequence of control cycle M. When the control task start time 17 arrives, the communication control unit 4 generates a global timer interrupt (2201) and, via the interrupt management unit 11 (2202), calls the control task (2203). The control task 7 completes the control operation and, after that, writes all data to be transmitted to other controllers as the output data 9. Because the control operation is completed, the data is guaranteed to be the output data 9 of control cycle M. Next, when the partitioning point 22 is reached, the communication control unit 4 generates the global interrupt (2204) and, via the interrupt management unit 11 (2205), calls the data transmission/reception unit 10 (2206). The data transmission/reception unit 10 writes the output data 9 to the transmission buffer 6 corresponding to the transmission frames 118, 120, and 122 included in the first-half slot group. Next, when the communication cycle start time is reached, the communication control unit 4 generates a global timer interrupt (2207) and, via the interrupt management unit 11 (2208), calls the data transmission/reception unit 10 (2209). The data transmission/reception unit 10 writes the output data 9 to the transmission buffer 6 corresponding to the transmission frame 123 included in the second-half slot group. When communication cycle M+1 is started, the communication control unit 4 transmits the frames in the transmission buffer 6 from the corresponding slots (2210, 2211, 2212, 2213). The frames 118, 120, and 122 are not transmitted until the end of 2206, the frame 123 is not transmitted until the end of 2209, and the frames transmitted in 2210-2213 includes only output data generated by the control task in control cycle M. Therefore, this sequence guarantees the synchronization of output data in one communication cycle.
In a second embodiment, an embodiment will be described in which the control cycle and the communication cycle are made to synchronize, the slots in the communication cycle are partitioned into two slot groups, and a data transmission/reception unit 10 is executed for each slot group to receive input data and transmit output data. The following describes this embodiment.
The system configuration of the second embodiment is the same as that of the first embodiment shown in
The configuration of the communication cycle of the second embodiment is also the same as that of the first embodiment shown in
The partitioning point 22 is determined in advance so that |slack time TA−slack time TB| is minimized as shown in
The data transmission/reception unit 10 transmits the output data 9 when called by the interrupt management unit 11.
After that, the data transmission/reception unit 10 reads a type 132 of E2 (1406). If the type 132 is “transmission” (1407), the data transmission/reception unit 10 creates a transmission frame from the output data 9 generated by the control task 7. More specifically, the data transmission/reception unit 10 selects entry E3 corresponding to the frame ID 121, which matches the frame F, from the frame table 12 (1408).
After that, the data transmission/reception unit 10 writes output data 122-output data 123 of entry E3 to the transmission buffer of a slot ID 133 of entry E2 (1409). If the type 132 is “reception” (1407), the data transmission/reception unit 10 reads a frame from the reception buffer 5 and reads the input data 8. More specifically, the data transmission/reception unit 10 selects entry E3 corresponding to the frame ID 121, which matches the frame F, from the frame table 12. After that, the data transmission/reception unit 10 writes the reception buffer of the slot ID 133 of entry E2 to the input data 122 to input data 123 of entry E3. After all frames F are selected, the data transmission/reception unit 10 terminates the processing (1404).
The following describes the reception sequence in communication cycle M. When communication cycle M is started, the communication control unit 4 receives a frame from the corresponding slot into the reception buffer 5 (2301, 2302, 2306). Next, when the partitioning point 22 is reached, the communication control unit 4 generates a global timer interrupt (2303) and, via the interrupt management unit 11 (2304), calls the data transmission/reception unit 10 (2305). The data transmission/reception unit 10 writes data from the reception buffer 5, corresponding to the reception frames 112 and 114 included in the first-half slot group, to the input data 8. Next, when the communication cycle start time is reached, the communication control unit 4 generates a global timer interrupt (2307) and, via the interrupt management unit 11 (2308), calls the data transmission/reception unit 10 (2209). The data transmission/reception unit 10 writes data from the reception buffer 5, corresponding to the reception frame 117 included in the second-half slot group, to the input data 8. When the control task start time 17 is reached, the communication control unit 4 generates a global timer interrupt (2310) and, via the interrupt management unit 11 (2311), calls the control task (2312). Before the control operation is started, the control task 7 reads all data, received from other controllers, as the input data 8. The frames 112 and 114 are received before the start of 2305, the frame 117 is received before the start of 2309, and the frames received by 2301, 2302, and 2306 include only output data generated by the control task in control cycle M−1 of other controllers. Therefore, this sequence guarantees the input data synchronization in one communication cycle.
The transmission sequence in this embodiment, similar to that in the first embodiment, of course guarantees data synchronization.
In a third embodiment, an embodiment will be described in which the control cycle and the communication cycle are made to synchronize, an idle time 15 during which no data is transmitted/received is provided in an idle time in the communication cycle and, during the idle time, the data transmission/reception unit reads and writes all data. The idle time 15 in a communication cycle refers to a period of time from any time in the communication cycle to the end of the communication cycle. During this period, a frame is not transmitted/received using a slot in the idle time 15 or no slot is available in the idle time 15 (network idle time).
The communication control unit 4, a piece of hardware that performs time-synchronized communication, has the function equivalent to that of the FlexRay communication controller. The communication control unit 4 has a global timer, a communication cycle counter, and a slot counter. The communication control units 4 of the controller 1 and the controller 2 exchange the communication cycles to always keep the same values. The slot counter is incremented with the start time of the communication cycle being 0. The communication control unit 4 has a filtering condition, composed of a communication cycle and a slot, for use when a frame is transmitted or received using the static segment. When the filtering condition for frame transmission matches the current communication cycle and slot, the communication control unit 4 transmits the transmission buffer 6 assigned for each frame. When the filtering condition for frame reception matches the communication cycle and slot, the communication control unit 4 receives a frame from the network 3 and saves it in the reception buffer 5 statically assigned for each frame. When performing frame transmission using the dynamic segment, the communication control unit 4 transmits the transmission buffer 6 when the filtering condition is satisfied and, in addition, a transmission request is output from the data transmission/reception unit. The other detailed configuration may be implemented using a known technology.
The communication control unit 4 is able to generate an interrupt when a pre-specified global time is reached. A global timer interrupt time should be set to the time at which the control task or the data transmission/reception unit 10 will be called. For the communication control unit 4 capable of setting only one global timer interrupt time, the interrupt management unit 11 sets the next interrupt time when an interrupt occurs.
The control task 7 is a program that controls the vehicle-mounted devices such as an engine and a brake. The control task is called by the interrupt management unit 11 at a pre-specified time in the communication cycle.
The interrupt management unit 11 is an interrupt handler that calls the data transmission/reception unit 10 and the control task 7. The communication control unit 4 calls the interrupt management unit 11 when a global timer interrupt occurs.
The frame group transmission/reception table 13 is a table that specifies a frame the controller 1 will transmit or receive.
The frame table 12 is a table that specifies the configuration of a frame.
The interrupt time table 16 is a table that specifies a global time 161, at which the communication control unit 4 should generate an interrupt, and a processing type 162 at that time.
First, the following describes the transmission sequence in control cycle M. When the control task start time 17 is reached, the communication control unit 4 generates a global timer interrupt (2001) and, via the interrupt management unit 11 (2002), calls the control task (2003). After completing the control operation, the control task 7 writes all data, which will be transmitted to other controllers, as the output data 9. Because the control operation is completed, all data in control cycle M is guaranteed to be the output data 9. Next, when the idle time start time 18 is reached, the communication control unit 4 generates a global timer interrupt (2004) and, via the interrupt management unit 11 (2005), calls the data transmission/reception unit 10 (2006). The data transmission/reception unit 10 writes all output data 9 to the transmission buffer 6. When communication cycle M+1 is started, the communication control unit 4 transmits the frames, included in the transmission buffer 6, from the corresponding slots (2007, 2008, 2009, 2010). No frame is transmitted from 2004 to the end of 2006 and, in addition, the frames transmitted in 2007-2010 include only output data generated by the control task in control cycle M. In this way, the sequence guarantees the synchronization of output data in one communication cycle.
Next, the following describes the reception sequence. First, when communication cycle M is started, the communication control unit 4 receives frames of the reception buffer 5 from the corresponding slots (2101, 2102, 2103). Next, when the idle time start time 18 is reached, the communication control unit 4 generates a global timer interrupt (2104) and, via the interrupt management unit 11 (2105), calls the data transmission/reception unit 10 (2106). The data transmission/reception unit 10 writes all reception buffer 5 to the input data 8. Because no new reception frame is received during 2106, all frames in the reception buffer 5 are guaranteed to be the frames received in communication cycle M. When the control task start time 17 of communication cycle M+1 is reached, the communication control unit 4 generates a global timer interrupt (2107) and, via the interrupt management unit 11 (2108), calls the control task (2109). Before the control operation, the control task 7 reads all data, received from other controllers, as the input data 8. Because the data is read before the control operation, the input data 8 is guaranteed to be the input data 8 of the reception frames received in communication cycle M. The transmission sequence guarantees that the synchronization of reception frames can be maintained in one control cycle, thus guaranteeing the synchronization of input data in one control cycle.
In the first embodiment, second embodiment, and third embodiment, the transmission and reception of all input data and output data is executed in one control cycle to guarantee data synchronization.
In the third embodiment, the data transmission/reception unit and the communication control unit read and write data from and to the transmission buffer and the reception buffer exclusively. Therefore, input data can be read, and output can be written, reliably within one control cycle.
In particular, the first embodiment does not require the idle time 15 regardless of the data amount of input data and output data. This means that the network resources can be used efficiently. In addition, the partitioning point is determined so that |slack time TA−slack time TB| is minimized. This makes equal the deadline of the data transmission/reception unit processing of the first-half slot group and the deadline of the data transmission/reception unit processing of the second-half slot group, decreasing the possibility that the deadline of the data transmission/reception processing cannot be met due to a delay such as an interrupt.
1,2 Controller
3 Network
4 Communication control unit
5 Reception buffer
6 Transmission buffer
7 Control task
8 Input data
9 Output data
10 Data transmission/reception unit
11 Interrupt management unit
12 Frame table
13 Frame group transmission/reception table
14 Slot group transmission/reception table
15 Idle time
16 Interrupt time table
17 Control task start time
18 Idle time start time
19 Communication cycle
20 Slot
21 Control cycle
22 Partitioning point
23 First-half slot group
24 Second-half slot group
25 Second-half slot group data transmission/reception unit execution time
26 Control task execution time
27 First-half slot group data transmission/reception unit execution time
28 Slack time TA
29 Slack time TB
30 Control task end time
100 Frame
101 Transmission frame
102 Reception frame
161 Global time
162 Processing type
200 Slot group
1301, 1302, 1303, 1304, 1305, 1306, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410 Flowchart
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312 Lifeline in sequence diagram
Number | Date | Country | Kind |
---|---|---|---|
2009-246026 | Oct 2009 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2010/063824 | 8/16/2010 | WO | 00 | 4/26/2012 |