Background
The Time Triggered Protocol (TTP) bus is a high-speed, masterless and dual-redundancy field bus communication protocol for safety key embedded application in the transportation industry field, has the characteristics of low cost, strong time certainty and the like, and can be used in a distributed fault-tolerant real-time control system consisting of a plurality of intelligent nodes. TTP/C meets the requirements of the american Society of Automotive Engineers (SAE) class C automotive applications and has been incorporated into the AS6003 standard.
Under the time trigger architecture, the communication system automatically decides when to transmit and receive data according to the static scheduling information planned in advance. In the TTP/C bus cluster, these scheduling information are stored in MEDL (Message Descriptor List, message description table). In MEDL, besides the time scheduling information such as the data frame receiving and transmitting time and when to execute clock synchronization correction, physical information such as the node message buffer address and the transmission delay of data between nodes is also included, and the design of MEDL is complex due to the mutual coupling of the physical information and the time information. In order to simplify MEDL the design process, the existing development tools are mainly oriented to system design users, shield most MEDL bottom design details, bring certain convenience to system designers, bring more restrictions to TTP/C bus application, and are difficult to complete finer and more complex task planning and scheduling. In addition, the existing development tools cannot configure bus network topology information, so that it is difficult to conveniently and effectively compensate large data forwarding delay caused by the fact that the bus coupler is introduced into delay correction parameters of MEDL, and application requirements of high-precision synchronous clocks under hybrid topology cannot be met.
Disclosure of Invention
The invention aims to provide a TTP/C bus MEDL design method oriented to a hybrid topology, so that data transmission delay information between points determined by network topology and line transmission delay can be accurately configured in MEDL parameters, and meanwhile, the decoupling of physical attribute configuration and time attribute configuration of a bus network system can be realized, the design flexibility is provided, the design process of MEDL is simplified, and the consistency of transmission from the system parameters to node parameters is ensured.
The design method of the TTP/C bus MEDL oriented to the hybrid topology has the principle that MEDL design input information of the TTP/C bus is divided into three types of cluster global information, bus node information and network topology information, and coupling among various types of information is reduced. Different from the existing MEDL design tools, the method can arbitrarily divide the number and the length of slots in TDMARound, so that bus communication scheduling with higher real-time performance is realized, and the time for a user program to acquire data of other nodes in a network is shortened. By decoupling the TDMA timing schedule including global information from the node physical attribute configuration, after the node physical attribute configuration is completed, any node can be added in the slot, which means that the node occupies the time divided by the corresponding slot to perform message transmission, thereby improving the universality and flexibility of MEDL design. The network topology information of the bus is stored by adopting a numerical matrix describing the connection relation between the bus terminal and the coupler, and a user can realize network topology configuration through a graphical interface and can also directly input the connection relation between the bus terminal and the coupler in a form of a table.
The method comprises the following steps:
(1) The global attribute information of the input bus cluster comprises a TDMA Round period, a cluster Cycle period, a cluster global clock unit and a communication rate.
(2) The physical entity attribute of each node in the bus network is set, the physical entity comprises a bus terminal and a coupler, the bus terminal is a node with autonomous communication capability in the system, and the coupler is responsible for filtering and forwarding data. The physical entity attributes include bus terminal attributes including node ID, node name, application identifier, cold start identifier, permanent passive node identifier, message length, and coupler attributes including coupler ID, coupler name, port number, port correspondence membership, and data forwarding delay.
(3) And (3) setting the slot number and the corresponding length under the constraint of the bus cluster global attribute input in the step (1).
(4) And (3) adding the configured bus terminal in the step (2) under the corresponding slot.
And (4.1) randomly adjusting the slot position of the bus terminal, wherein the slot of the terminal represents the time occupied by the node for transmitting data under a time division multiplexing mechanism.
And (4.2) adding a plurality of nodes under the same slot, wherein when 2 or more nodes are added, the function of multiplexing the nodes is started, and the corresponding Round sequence numbers of the nodes under the cluster Cycle period are required to be further set.
(5) And (3) establishing the physical connection relation between the bus terminal and the coupler defined in the step (2) and configuring the bus network topology.
(5.1) Selecting a defined bus termination or coupler node to add to the cluster.
(5.2) Using a numerical matrix to preserve the connection between the bus termination and the coupler.
(5.3) Converting the connection relation of the corresponding numerical matrix into a data transmission delay correction parameter between nodes when MEDL is generated.
(6) Converting the configuration information input in the steps (1) - (5) into MEDL files required by the TTP/C bus controller.
And (6.1) storing the configuration information input by the user in a database, and generating MEDL files required by the TTP/C bus controller according to a predefined conversion relation.
And (6.2) calculating a delay correction parameter, wherein the method is that whether a transmitting node corresponding to the current slot and the transmitting node are connected to the same coupler port is inquired, if yes, the delay correction parameter is directly calculated according to the line transmission delay between the nodes, otherwise, the number of couplers connected between the transmitting node and the transmitting node is inquired, the data forwarding delay is calculated according to the number of the couplers, and the sum of the data forwarding delay and the line transmission delay is used as the delay correction parameter.
A computer storage medium having stored thereon a computer program which when executed by a processor implements a hybrid topology oriented TTP/C bus MEDL design method as described above.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a hybrid topology oriented TTP/C bus MEDL design method as described above when executing the computer program.
Compared with the prior art, the invention has the following advantages:
1. The invention decouples TTP/C bus cluster design input parameters in a time domain, a physical domain and a space domain, and reduces the complexity of MEDL configuration while considering MEDL design flexibility;
2. The invention realizes the separation of the system design and the node design, and ensures the consistency of the transmission from the system design to the node design parameters;
3. The invention describes network topology information by introducing a matrix method, provides a convenient configuration management and calculation method for data receiving and transmitting delay parameters among different nodes, and supports the realization of a high-precision clock synchronization function under hybrid topology.
Detailed Description
The technical scheme of the invention is further described below with reference to the accompanying drawings.
The network topology shown in fig. 2 includes 2 couplers and 8 bus terminals. The port 1 of the coupler A is connected with the nodes 1-3, the port 2 is connected with the port 5 of the coupler B, the port 3 is connected with the node 4, the port 4 of the coupler B is connected with the nodes 5-7, and the port 6 is connected with the node 8. Aiming at the hybrid network topology shown in fig. 2, the design method of the TTP/C bus MEDL facing the hybrid topology comprises the following steps:
(1) And configuring global parameters of the system. The method mainly comprises parameters such as cluster planning identification, TDMA Round period, cluster Cycle period, time unit, communication rate and the like. In this example, a TDMA Round period of 5ms and a cluster Cycle period of 25ms are selected.
(2) And configuring physical attributes of the nodes. The bus terminal mainly comprises parameters such as node name, cold start permission identification, passive node identification, message length and the like, and the coupler mainly comprises parameters such as name, port number, forwarding delay and the like.
(3) Programming bus timing. Under TDMARound period constraint set in the step (1), slot information is added, wherein the slot information mainly comprises parameters such as slot length, data frame type, clock synchronization correction execution identification and the like.
(4) Node location allocation. At the slot configured in step (3), the node configured in step (2) is added to indicate that the node occupies the current slot, and for the multiplexing node, a TDMA Round sequence number corresponding to the multiplexing node may be further set, as shown in fig. 3.
(5) And (5) configuring network topology. The connection relation between the nodes and the couplers is represented by a numerical matrix, the network topology configuration information is obtained as shown in table 1, a column of 'connection coupler X port number', a non-negative integer, a row of '1' represents the port serial number connected, a row of corresponding nodes are not connected with the current coupler, and data in a column of 'distance to coupler X' represents how many couplers need to be passed through for connection between the current node and the corresponding coupler.
Table 1 describes an example of network topology information using a matrix method
(6) MEDL is generated. After all the configurations in the steps (1) - (5) are completed, checking the consistency of configuration parameters according to preset rules, and generating MEDL of a format required by TTP/C bus operation after checking without errors. When the delay correction parameter is calculated according to the network topology information in the step (5), the data forwarding delay between two nodes caused by the couplers can be obtained by multiplying the number of couplers required for connecting the two nodes by the forwarding delay of a single coupler.