WO2021082301A1 - 一种包括车载以太网的车内混合网络的睡眠与唤醒方法 - Google Patents

一种包括车载以太网的车内混合网络的睡眠与唤醒方法 Download PDF

Info

Publication number
WO2021082301A1
WO2021082301A1 PCT/CN2020/075842 CN2020075842W WO2021082301A1 WO 2021082301 A1 WO2021082301 A1 WO 2021082301A1 CN 2020075842 W CN2020075842 W CN 2020075842W WO 2021082301 A1 WO2021082301 A1 WO 2021082301A1
Authority
WO
WIPO (PCT)
Prior art keywords
network
state
sleep
node
bus
Prior art date
Application number
PCT/CN2020/075842
Other languages
English (en)
French (fr)
Inventor
肖文平
黄飞
张航
陈柱
石川
Original Assignee
上海赫千电子科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海赫千电子科技有限公司 filed Critical 上海赫千电子科技有限公司
Publication of WO2021082301A1 publication Critical patent/WO2021082301A1/zh

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60RVEHICLES, VEHICLE FITTINGS, OR VEHICLE PARTS, NOT OTHERWISE PROVIDED FOR
    • B60R16/00Electric or fluid circuits specially adapted for vehicles and not otherwise provided for; Arrangement of elements of electric or fluid circuits specially adapted for vehicles and not otherwise provided for
    • B60R16/02Electric or fluid circuits specially adapted for vehicles and not otherwise provided for; Arrangement of elements of electric or fluid circuits specially adapted for vehicles and not otherwise provided for electric constitutive elements
    • B60R16/023Electric or fluid circuits specially adapted for vehicles and not otherwise provided for; Arrangement of elements of electric or fluid circuits specially adapted for vehicles and not otherwise provided for electric constitutive elements for transmission of signals between vehicle parts or subsystems
    • B60R16/0231Circuits relating to the driving or the functioning of the vehicle
    • B60R16/0232Circuits relating to the driving or the functioning of the vehicle for measuring vehicle parameters and indicating critical, abnormal or dangerous conditions

Definitions

  • the present invention relates to the field of smart cars, and in particular to a sleep and wake-up method for an in-vehicle hybrid network including an in-vehicle Ethernet.
  • the internal network management of the car can be stored in a variety of ways according to the bus and the protocol: one is the CAN network management based on AUTOSAR (Automotive Open System Architecture), and the second is the Ethernet network based on AUTOSAR
  • the third type is the CAN network based on OSEK (Open systems and their interfaces for electronics in automobiles). These different networks are directly or indirectly connected to the car gateway through their respective buses. It is further proposed that the car gateway device is How to coordinate and how to manage sleep and wakeup in multi-bus network management poses a challenge. However, existing cars use CAN network management or signal level methods.
  • the Ethernet ECU controller needs sleep wake-up management, and the gateway device faces the following problems: Need to support Ethernet network sleep wake management, on the other hand, a strategy is needed to coordinate with other bus sleep wake management mechanisms. Automotive gateway devices need to support both traditional CAN bus network management and Ethernet network management. At the same time, there are two protocols for CAN network management, OSEK and AUTOSAR, so that there are many protocols and multiple bus forms for car sleep wake-up, and there is no one at present. A clear method to coordinate management, the present invention is proposed to solve this problem.
  • the present invention provides a sleep and wake-up method for an in-vehicle hybrid network including an in-vehicle Ethernet, which is characterized in that it includes:
  • Step S1 the in-vehicle controllers are connected to the network through their respective buses connected to them and are managed by the network manager;
  • Step S2 When there is a sleep trigger condition in the network, the network coordinator judges whether the bus in the network is in the sleep state, if any bus is not in the sleep state, the current network keeps the network mode, if all the buses are in the sleep state Status, after a preset waiting time, the network coordinator releases the network and enters the total sleep mode;
  • the controller includes at least one or more of ECU and node gateway;
  • the network manager includes Autosar network manager, OSEK CAN network manager, Autosar network manager includes Autosar Ethernet network manager and Autosar CAN network manager;
  • the bus includes at least Autosar Ethernet bus, Autosar CAN bus, OSEK CAN bus , The network manager and its corresponding bus are managed.
  • a sleep and wake-up method for an in-vehicle hybrid network including an in-vehicle Ethernet further, the step 2 specifically includes:
  • Step S21 When the sleep is triggered, the application notifies the bus network management module, triggers the network coordination flag to coordinate the network to determine whether the bus in the current network is in a sleep state;
  • Step S22 judge whether the OSEK CAN bus is not used, if not, it means that there are nodes in the OSEK network that have a network request and keep the network mode; if yes, go to step S23;
  • Step S23 Determine whether the Autosar Ethernet bus and the Autosar CAN bus are not used. If not, it means that there are nodes in the Autosar network that have a network request and keep the network mode; if yes, perform step S24;
  • Step S24 judge whether the network coordinator flag is in the bus sleep mode, if not, it means that there is a network request in the network node, and keep the network mode; if yes, go to step S25;
  • Step S25 the network coordinator releases the network, and after a preset waiting time, the network coordinator puts the network in a sleep state.
  • a sleep and wake-up method for an in-vehicle hybrid network including an in-vehicle Ethernet further comprising: the sleep state under the Autosar bus is managed based on a distributed direct network management strategy, wherein each node sends or receives according to the communication system The received network management messages are used to perform network activities. If each network node wants to maintain communication, it will periodically send network management messages. If communication is not required, stop sending network management messages;
  • the maximum time interval for a node to send network management messages is that the second node should send a network management message before the first node sends the second network management message at the latest.
  • a sleep and wake-up method for an in-vehicle hybrid network including on-vehicle Ethernet includes bus sleep mode, network mode, and bus pre-sleep mode. According to different trigger conditions, network nodes or The operating mode of the ECU is switched between different modes, and the change of any mode is notified to the upper application through the callback function;
  • the network mode includes at least: repeated message state, normal operation state, and ready to sleep state.
  • a sleep and wake-up method for an in-vehicle hybrid network including an in-vehicle Ethernet includes: when a node needs network communication and can correctly send and receive network management messages, The repeated message state is transformed into the normal operation state; when the node receives a network management message in the repeated message state or the node itself needs to enter the repeated message state, the node transforms from the normal operation state to the repeated message state;
  • the conditions for the mutual conversion between the repeated message state and the ready-to-sleep state include:
  • the node When the timing of the repeated message state is up and the node itself does not need network communication, it will transition from the repeated message state to the ready-to-sleep state; when a network management message in the repeated message state is received or the node requires to enter the repeated message state, it will go from the ready-to-sleep state Transform into a repeated message state;
  • the conditions for the mutual conversion between the normal operating state and the ready-to-sleep state include: the node does not need to communicate, requesting to release the bus, and transforming from the normal operating state to the ready-to-sleep state; when the node needs to communicate and requesting the bus, it will transform from the ready-to-sleep state to normal operation status;
  • the network manager when the network manager times out, it switches from the ready-to-sleep mode to the bus pre-sleep mode, and enters the bus sleep mode if it is not awakened within the preset waiting time.
  • a sleep and wake-up method for an in-vehicle hybrid network including on-vehicle Ethernet is also included.
  • the network mode also includes a limp state.
  • the node When the number of sending errors or receiving errors of the node in the network mode exceeds the threshold, the node will enter the limp state and In this state, the limp status information is repeatedly sent at regular intervals. If the message sent by the node fails or the network management message cannot be received within the preset time, the node will be reported to the application layer as an error;
  • the conditions for the conversion of limp state and repeated elimination state, ready to sleep state, and normal operation state include:
  • the node sending error reaches or the receiving error exceeds the threshold, from the repeated message state to the limp state; in the limp state, the node can correctly send network management messages and can receive the network without the sleep flag Manage messages, from the limp state to the repeated message state; in the normal operation state, the node sending error reaches or the receiving error exceeds the threshold, from the normal operation state to the limp state; in the limp state, the node receives a sleep flag
  • the network management message changes from a limp state to a sleep-ready state; in the sleep-ready state, the node was in a limp state before and received a network management message without sleep, and it changes from a sleep-ready state to a limp state.
  • a sleep and wake-up method for an in-vehicle hybrid network including vehicle-mounted Ethernet is described in detail below. Further, in a limp state, when the nodes in the network do not need bus communication and enter the ready-to-sleep state, before the network management timer expires, Continue to repeatedly send network management messages with sleep flag bits;
  • a node in the network that cannot send messages normally receives the sleep message, it sets itself to enter the state of preparing to sleep. After receiving the message, other nodes will not perform network status and network management timers except for registering the information that the node is ready to sleep. Any modification;
  • the nodes When all nodes in the network send network management messages with sleep flags, the nodes enter the bus pre-sleep mode synchronously.
  • a method for sleeping and waking up a hybrid network in a vehicle including vehicle Ethernet includes: OSEK CAN bus network management method, specifically including: OSEK network management uses a token ring mechanism, and the token is from a node with a low network address To the node with the higher network address, if there is no higher node, it is passed to the node with the lowest address; the token ring is established according to the network address of the ECU, and each ECU will receive network management messages, and only the node with the same destination address will be used. Will get the token;
  • the network management mode of OSEK CAN network manager includes network mode and network wake-up.
  • OSEK CAN network wake-up includes limp state, reset state, and normal state.
  • the receiving error counter or the sending error counter exceeds the threshold, it changes from the normal state or The reset state transforms into the limp state.
  • the limp state After sending and successfully receiving the network message, it enters the reset state, and then transforms to the normal state.
  • Step S301 establish a logical ring
  • Step S302 Determine whether the node meets the sleep condition one by one according to the logical ring established by the node, if it is satisfied, perform step S303, if not, perform step S304;
  • Step S303 the node that meets the sleep condition sends a ring message with "sleel.ind” equal to 1, and jumps to step S305;
  • Step S304 the node that does not meet the sleep condition sends a ring message with "sleel.ind" equal to 0, and jumps to step S302;
  • Step S305 Determine whether all nodes in the logical ring meet the sleep state, if all nodes meet the sleep state, perform step S306, and if they do not meet the sleep state, skip to step S302;
  • Step S306 the judged node sends the sleep response position of the message in the network to 1 and sends it to the network, the node itself enters the sleep waiting state, and stops sending the message;
  • Step S307 After receiving the gateway message with the sleep response position of 1, the remaining nodes immediately enter the sleep waiting state and stop sending the message;
  • Step S308 start the timer in the sleep waiting state
  • Step S309 when the timer expires, enter the network sleep state.
  • a sleep and wake-up method for an in-vehicle hybrid network including an in-vehicle Ethernet further comprising: step S3, when the wake-up condition is triggered, the application layer calls an instruction that the current network is in the network mode when the main network management module is triggered;
  • Step S4 the network management coordinator triggers the Ethernet network and the CAN network, the AUTOSAR protocol triggers the network request, and OSEK coordinates to trigger the wake-up condition;
  • Step S5 AUTOSAR network management initiates network wake-up, including AUTOSAR Ethernet and AUTOSAR CAN, OSEK CAN network management initiates network wake-up according to its protocol, and establishes a logical ring;
  • Step S6 the bus network management wakes up the controller on the bus, and the wake-up process ends;
  • the network management coordinator triggers the Ethernet network and the CAN network, the AUTOSAR protocol triggers the network request, and the OSEK coordinates triggers the wake-up condition;
  • OSEK CAN network management mode and AUTOSAR network management mode have a one-to-one correspondence
  • the process of establishing a logical loop after the OSEK CAN network wakes up includes:
  • Step S51 After the controller wakes up, nodes that want to participate in the network will first send an Alive message to apply for joining the logical ring;
  • Step S52 After the logical ring is completed, each node sends Ring messages in order to pass the "token" to subsequent nodes.
  • the present invention provides a technical solution that can manage the sleep and wake-up states of the in-vehicle hybrid network including the vehicle Ethernet, and coordinate the management of the sleep and wake-up states including the Autosar Ethernet network, the Autosar CAN network, and the OSEK CAN network. , To save in-vehicle network resources and power saving, and improve efficiency;
  • the present invention provides a technical solution to increase the limp state in the network mode of the Autosar network manager, which can detect a node that has failed, and avoid being misjudged that the node is in a dormant state after a node fails.
  • FIG. 1 is a schematic structural diagram of an in-vehicle hybrid network architecture including an in-vehicle Ethernet in an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of the structure of a central gateway including a sleep wake-up management device in an embodiment of the present invention.
  • Figure 3 is a schematic structural diagram of a network management mode in an Autosar network manager in an embodiment of the present invention.
  • Fig. 4 is a schematic structural diagram of a network management mode in an Autosar network manager containing a limp state in an embodiment of the present invention.
  • Fig. 5 is a flowchart of a method for detecting a faulty node in an Autosar network manager with a limp state network management mode in an embodiment of the present invention.
  • Fig. 6 is a schematic structural diagram of the network management mode in the OSEK CAN network manager in an embodiment of the present invention.
  • Fig. 7 is a flow chart of the OSEK CAN network sleep state in the OSEK CAN network manager in an embodiment of the present invention.
  • FIG. 8 is a method for bus sleep management coordination under an automotive hybrid network architecture containing an in-vehicle Ethernet in an embodiment of the present invention.
  • control system functional modules and application programs (APP) are well known to those skilled in the art that they can take any appropriate form, either hardware or software, or multiple functional modules discretely arranged, or It is multiple functional units integrated into one piece of hardware.
  • the control system can be a controller, such as a combinational logic controller, a microprogram controller, etc., as long as it can implement the operations described in this application.
  • the control system can also be integrated into one physical device as different modules, which do not deviate from the basic principles and protection scope of the present invention.
  • connection includes direct connection, indirect connection, communication connection, and electrical connection, unless otherwise specified.
  • vehicle or “vehicle” or other similar terms used herein generally include motor vehicles, such as passenger cars including sport utility vehicles (SUVs), buses, trucks, and various commercial vehicles. Including all kinds of boats, ships, aircrafts, etc., and includes hybrid vehicles, electric vehicles, pluggable hybrid electric vehicles, hydrogen-powered vehicles and other alternative fuel vehicles (such as fuels derived from non-petroleum energy sources) .
  • a hybrid vehicle is a vehicle with two or more power sources, such as both gasoline-powered and electric-powered vehicles.
  • controller of the present disclosure may be embodied as a non-transitory computer-readable medium on a computer-readable medium, and the computer-readable medium contains executable program instructions executed by a processor, a controller, or the like.
  • Examples of computer readable media include, but are not limited to, ROM, RAM, compact disc (CD)-ROM, magnetic tape, floppy disk, flash drive, smart card, and optical data storage device.
  • the computer-readable recording medium may also be distributed in computer systems coupled through a network, such that the computer-readable medium is stored and executed in a distributed manner, for example, through a telematics server or a controller area network (CAN).
  • This embodiment provides a sleep and wake-up management device for an in-vehicle hybrid network that includes an in-vehicle Ethernet. See FIG. 1, including a central gateway.
  • the central gateway is connected to the corresponding ECU or node gateway through multiple buses based on different transmission protocols.
  • the bus includes at least: Autosar Ethernet (Ethernet) bus, Autosar CAN bus, OSEK CAN bus.
  • FIG. 1 is a schematic structural diagram of an in-vehicle hybrid network architecture including an in-vehicle Ethernet in an embodiment
  • Figure 1 shows that A1 and A2 are connected to the Autosar Ethernet bus.
  • A1 and A2 can represent node gateways, ECUs, nodes, etc. on the Autosar Ethernet bus.
  • A1, A2 data reception and transmission are based on Autosar Ethernet's in-vehicle Ethernet protocol
  • B1, B2, and B3 can all represent OSEK node gateways, ECUs, nodes, etc. on the CAN bus.
  • B1, B2, and B3 data reception and transmission are based on OSEK CAN protocol.
  • C1, C2, C3 can all represent node gateways, ECUs, nodes, etc. on the Autosar CAN bus.
  • B1, B2, and B3 data reception and transmission are based on Autosar CAN protocol.
  • the central gateway includes at least a sleep wake management device (see Figure 2, which is a schematic diagram of the central gateway including the sleep wake management device), and the sleep wake management device at least includes a bus network management module, a network coordinator, an Autosar network manager, and OSEK CAN network manager, among them, Autosar network manager includes Autosar Ethernet manager, Autosar CAN network manager;
  • the bus network management module is connected with the network coordinator, and the network coordinator is respectively connected with the Autosar Ethernet bus manager, the Autosar CAN network manager, and the OSEK CAN network manager.
  • the bus network management module is configured to manage multiple bus protocol communications in the car
  • the network coordinator is configured to coordinate a variety of different types of network managers in the car, including the use of built-in algorithms to manage the sleep and wake-up of multiple buses in the car;
  • the Autosar Ethernet Manager is configured to manage the network nodes and ECUs connected under the Autosar Ethernet bus, including the communication, sleep and wake-up of the network nodes and ECUs;
  • the Autosar Ethernet Manager is configured to manage the network nodes and ECUs connected under the Autosar Ethernet bus, including the communication, sleep and wake-up of the network nodes and ECUs;
  • the Autosar CAN manager is configured to manage the sleep and wake-up management of network nodes and ECUs connected under the Autosar CAN bus;
  • the OSEK network manager is configured to manage the sleep and wake-up management of network nodes and ECUs connected under the Autosar CAN bus.
  • the network of the Autosar network manager includes three working modes, see Figure 3, which specifically include bus sleep mode, network mode, and bus Pre-sleep mode, according to different trigger conditions, the operation mode of the network node or ECU is cyclically switched between the three. If the current mode is the network mode, when the network pre-sleep condition is met, the Ethernet bus will be converted from the network mode to the bus pre-sleep mode. Sleep mode, and then enter the bus sleep mode when the network sleep conditions are met. The change of any one of the three modes is notified to the upper application through the callback function;
  • the network mode includes three internal states: repeated message state, normal operation state, and ready to sleep state.
  • the repeated message state is used to ensure that nodes from the bus sleep mode or bus pre-sleep mode to the network are discovered by other nodes on the bus, and repeat
  • the message state can be used to detect the nodes connected to the bus; when entering the repeated message state, the node should start to transmit identification information; in the repeated message state, when the timer expires, the Ethernet bus manager reloads the timer; Ethernet
  • the network bus manager maintains a preset time period in the repeated message state, and needs to be reconfigured after this time period; when leaving the repeated message state, if the node needs to communicate, it enters the normal operating state; if the node does not need to communicate, then Enter the ready-to-sleep mode and clear the repeated messages.
  • the normal operation state can keep the bus in the wake-up state; the identification information should be sent from the ready-to-sleep state to the normal operation state; in the normal operation state, when the timer overflows, the Ethernet bus manager reloads the timer. If the node does not need to use communication, the network should be released and the node should enter the ready-to-sleep state; if the node receives a request for the repeated message state, the node enters the repeated message state, if the node itself needs to enter the repeated message state, the node enters Repeat the message status and set the request of the repeat message status.
  • Ready to sleep state this state is for if the node is ready to release the bus, and other nodes need to use the bus, in the ready to sleep state, wait for the nodes on other buses to enter the ready to sleep mode.
  • the Ethernet bus manager stops the transmission of message information. If the timer expires, the node will enter the ready-to-sleep mode; if the node needs to use the bus, the node will enter the normal operation mode. If the node receives the request for the repeated message state, the node enters the repeated message state, and if the node itself needs to enter the repeated message state, the node enters the repeated message state and sets the repeated message state request.
  • the bus pre-sleep mode is configured to wait for all nodes on the bus to have time to stop the active state of the node before entering the bus sleep mode: such as clearing the queue for sending messages.
  • all nodes are silent; when the node enters the bus pre-sleep mode, the upper layer application should be notified.
  • the waiting parameters you can change the time that the node stays in the bus pre-sleep mode, after which the node will enter other states.
  • the bus sleep mode is configured to put the nodes on the bus in a sleep state when the nodes on the bus have no messages within a preset period of time or when they do not actively send messages to other targets;
  • bus sleep mode the node can be awakened.
  • the two parameters of the timer timeout and the bus sleep time should match the nodes on the entire bus to ensure that the nodes on the bus can sleep uniformly.
  • the upper layer (bus network management module) application When entering the bus sleep mode, the upper layer (bus network management module) application should be notified.
  • the Ethernet bus manager In the bus sleep mode, if the message is successfully received, the Ethernet bus manager should call the function to enter the repeated message state in the network mode.
  • the state transition diagram of AUTOSAR Ethernet network management is shown in Figure 3.
  • the conditions for state transition are: (1) enter the bus sleep mode after the network management is initialized; (2) the node requests network communication; (3) repeat messages The state timing time is up, the node needs network communication and the node can correctly send and receive network management messages; (4) the network management message of the repeated message state is received or the node itself requests to enter the repeated message state; (5) the repeated message state timing time is up, and The node itself does not need network communication; (6) A network management message with a repeated message state is received or the node itself requests to enter a repeated message state; (7) The node needs to communicate and requests the bus; (8) The node does not need to communicate, and the bus is released; ( 9) The node receives a network management message; (10) The node itself requests network communication; (11) The network management timer expires; (12) The pre-sleep timer expires; (13) The system is powered off.
  • a limp state is added, which is used when a certain node under the bus has an error, and prevents the node from being forced after a failure. Go to sleep. Specifically, in the network mode, increase the limp state, when the node cannot use the bus normally, enter this state; modify the sleep mechanism, add a sleep flag in the communication protocol in the network manager, when the node is ready to sleep When entering the sleep-ready state, the network management message with the sleep flag bit is repeatedly sent, and other nodes judge whether the node is in a faulty state or a sleep-ready state on this basis.
  • Table 1 is the basic structure of the Ethernet network management protocol data unit
  • Table 1 shows the basic structure of Autosar network management protocol data unit
  • Table 2 shows the data structure of Control Bit Vector (control bit)
  • User data User-defined data.
  • the length of User data can be 6 bytes.
  • System users can implement network management expansion algorithms according to different network wiring characteristics.
  • Control Bit Vector Whether it is necessary to detect faulty nodes and the type of network management messages, the specific design of this bit is shown in Table 2.
  • Each sender has a unique network identifier, which is statically configured during the network design process and is used to identify the node that sends the message;
  • Rpt (2 bits): 11 indicates that the network requests failure detection, 01 indicates that ordinary network management messages are transmitted, and 10 indicates that the node sends a limp status message;
  • Rdysleep (1 bit): This bit is mainly used to identify whether the node needs bus communication, that is, whether to enter the sleep state. The position 1 indicates that the node is going to sleep, and the position 0 indicates that the node needs bus communication;
  • Figure 4 adds a lame state on the basis of Figure 3.
  • the specific changes to the relationship of the corresponding nodes are as follows: (14) During the timing of the repeated message state, the node sending error or receiving error exceeds the threshold; ( 15) The node can correctly send network management messages and can receive network management messages without the sleep flag; (16) the node sending error reaches or the reception error exceeds the threshold; (17) the node receives the network management message with the sleep flag ; (18) The node was in a limp state before and received a network management message without sleep.
  • the Ethernet network management adopts the sleep negotiation method.
  • the nodes in the network do not need bus communication and enter the ready-to-sleep state, before the network management timer expires, continue to repeatedly send the sleep flag bit Network management messages.
  • a node in the network that cannot send messages normally receives the sleep message, it sets itself to enter the state of preparing to sleep. After receiving the message, other nodes will not perform network status and network management timers except for registering the information that the node is ready to sleep. Any modification.
  • the network management messages with the sleep flag in the network have no effect on the network status of the online nodes. Therefore, when all nodes in the network send network management messages with the sleep flag, the nodes can enter the sleep mode synchronously. Since the faulty node cannot send network management messages, adopting this method of negotiating sleep not only can ensure that the nodes in the network enter the synchronous sleep mode, but also can judge the faulty nodes in the network.
  • the network node increases the node detection mechanism in the limp state, see Figure 5.
  • the faulty node detection is another function of network management, which is realized by modifying the network sleep mechanism and configuring a dynamic network management table in the network management interface module Detection function of failed nodes.
  • the network management table includes 3 fields, namely node ID, unsent data interval and failure counter Cnt.
  • the "unsent data interval" and “fault counter Cnt" corresponding to the node are cleared to 0.
  • the node may be faulty. If a node needs to detect it, it will send the network management message in the repeated state. After receiving the message, the normal node will send the network management message in the repeated message state in the next sending cycle. If the node does not send it, it will The fault counter Cnt is incremented by 1. Repeat the above process, when the failure counter Cnt reaches the threshold, it is considered that the node is faulty and is reported to the application layer.
  • AUTOSAR in this embodiment adopts a distributed direct network management strategy, in which each node under the Autosar bus executes self-sufficient network activities according to the message of the Ethernet bus manager sent or received in the communication system;
  • the Autosar network manager peer-to-peer algorithm is based on periodic message messages. Message messages are sent by broadcast, and all nodes in the network under all Ethernet buses can receive them. The received message message means that the message message is sent. Nodes tend to maintain the network working mode. If a node is ready to enter the bus sleep mode, it will stop sending messages, but as long as it can still receive messages from other nodes, it will delay the transition to the bus sleep mode. Finally, within a certain time limit, since no more messages are received, each node starts the transition to the bus sleep mode.
  • any node in the network needs bus communication, it can wake up the network from the bus sleep mode by sending a message.
  • the AUTOSAR network management strategy can be summarized as the following two points:
  • each network node wants to maintain bus communication, it will always send periodic network management messages; if it no longer needs to maintain bus communication, it will no longer send network management messages.
  • the AUTOSAR network management state machine should contain the state, transition and trigger conditions from the perspective of a network node.
  • the AUTOSAR CAN network manager is configured to manage the network nodes and ECUs connected to the Autosar CAN network, including the communication, sleep and wake-up of the network nodes and ECUs;
  • the working mode and state transformation of the nodes based on the CAN bus are all the same as those under the management of the Ethernet bus.
  • the node working mode and state transition are the same.
  • the OSEK CAN network manager is configured to manage the network nodes and ECUs connected to the OSEK CAN bus, including the communication, sleep and wake-up of the network nodes and ECUs;
  • OSEK CAN network manager includes two working modes, see Figure 6, which specifically include network sleep and network wake-up. According to different trigger conditions, the operating mode of the network node or ECU is switched between the two cyclically. In order to detail the switching between wake-on-LAN and network status, see Table 3.
  • Table 3 shows the message format of OSEK CAN network management
  • Base ID indicates the base address of the network management message, that is, the ID allocation interval
  • Source ID indicates the source address of the network management message, that is, the address of the node that sends the network management message
  • Destination ID indicates the address of the network management message
  • the target address is the address of the node that needs to receive the network management message
  • Option Code represents the control field, and the meaning of each bit of the control field is shown in Table 2
  • Data represents the data field, which is currently reserved and filled with "0x00".
  • Table 4 shows the data structure of the control field of the network management message
  • Bit0 position 1 means that the network management message is an Alive message; Bit1 position 1 means that the network management message is a Ring message; Bit2 position 1 means that the network management message is a Limphone limp message; Bit 4 bits It is the sleep indicator bit, set 1 to indicate that the node no longer needs network communication; Bit 5 is the sleep response bit, set 1 to indicate that the node has monitored that the node used in the current logical ring has set the sleep indicator to 1, and the network segment is ready to enter the sleep state . The other bits are reserved and filled with 0. At the same time, Bit 0, Bit 1, and Bit 2 are mutually exclusive, that is, only one of them can be set to 1.
  • OSEK CAN network management message types can be divided into Alive messages, Ring messages and Limphone messages:
  • Alive message After a node in the network segment is initialized or skipped, an Alive message is sent to declare the existence of the node. The destination address of the Alive message is equal to the node's own address.
  • Ring message the logical ring message.
  • nodes are used to transmit network management messages for status information.
  • OSEK CAN network management uses a token ring mechanism.
  • the token is passed from a node with a low network address to a node with a high network address. If there is no higher node, it is passed to the node with the lowest address; the token ring is established according to the network address of the ECU.
  • Each ECU will receive network management messages, and only a node with the same destination address will get the token.
  • OSEK's network wake-up includes lame state, reset state, and normal state.
  • the normal state or the reset state is converted to the lame state.
  • the lame state after the network message is sent and successfully received Enter the reset state, and then transform to the normal state.
  • the process of establishing a logical ring after waking up includes:
  • each node After the logical ring is completed, each node sends Ring messages in order to pass the "token" to subsequent nodes.
  • Figure 7 is the OSEK CAN network sleep state flowchart in the OSEK CAN network manager.
  • the sleep state of OSEK CAN network includes the following steps:
  • Step S301 establish a logical ring
  • Step S302 Determine whether the node meets the sleep condition one by one according to the logical ring established by the node, if it is satisfied, perform step S303, if not, perform step S304;
  • Step S303 the node that meets the sleep condition sends a ring message with "sleel.ind” equal to 1, and jumps to step S305;
  • Step S304 the node that does not meet the sleep condition sends a ring message with "sleel.ind" equal to 0, and jumps to step S302;
  • Step S305 Determine whether all nodes in the logical ring meet the sleep state, if all nodes meet the sleep state, perform step S306, and if they do not meet the sleep state, skip to step S302;
  • Step S306 the judged node sends the sleep response position of the message in the network to 1 and sends it to the network, the node itself enters the sleep waiting state, and stops sending the message;
  • Step S307 After receiving the gateway message with the sleep response position of 1, the remaining nodes immediately enter the sleep waiting state and stop sending the message;
  • Step S308 start the timer in the sleep waiting state
  • Step S309 when the timer expires, enter the network sleep state
  • the ECU when the OSEK CAN network is in the dormant state, when the application needs CAN communication, the ECU requests the network to wake up; when the node is in the dormant state, if a wake-up event is received, the node is awakened and sends an Alive message.
  • This embodiment provides a sleep and wake-up method for an in-vehicle Ethernet network, which includes the following steps:
  • Step S1 the in-vehicle controllers are connected to the network through their respective buses connected to them and are managed by the network manager;
  • the network manager includes Autosar network manager, OSEK CAN network manager, Autosar network manager includes Autosar Ethernet network manager and Autosar CAN network manager;
  • the bus includes at least Autosar Ethernet bus, Autosar CAN bus, OSEK CAN bus , The network manager and its corresponding bus are managed;
  • the controller includes at least one or more of ECU and node gateway;
  • Step S2 When there is a sleep trigger condition in the network, the network coordinator judges whether the bus is in the sleep state according to the bus in the network. If any bus is not in the sleep state, the current network is in the waiting sleep state. All are in a sleep state, after a preset waiting time, the network coordinator releases the network and enters the total sleep mode;
  • step S2 the judgment is based on the OSEK CAN bus first, and then the judgment is based on the Autosar Ethernet bus and the Autosar CAN bus;
  • Step S3 when the wake-up condition is triggered, the application layer calls the instruction that the current network is in the network mode when the main network management module is triggered;
  • Step S4 the network management coordinator triggers the Ethernet network and the CAN network, the AUTOSAR protocol triggers the network request, and OSEK coordinates to trigger the wake-up condition;
  • Step S5 AUTOSAR network management initiates network wake-up, including AUTOSAR Ethernet and AUTOSAR CAN, OSEK CAN network management initiates network wake-up according to its protocol, and establishes a logical ring;
  • Step S6 the bus network management wakes up the controller on the bus, and the wake-up process ends.
  • FIG. 8 is a flowchart of the bus sleep management coordination method under the vehicle-mounted Ethernet architecture in this embodiment, see FIG. 8;
  • step S2 The specific steps in step S2 include:
  • Step S21 When the sleep is triggered, the application notifies the bus network management module, triggers the network coordination flag to coordinate the network to determine whether the bus in the current network is in a sleep state;
  • Step S22 judge whether the OSEK CAN bus (CAN bus_flag) is not used, if not, it means that there are nodes in the OSEK network that have a network request and keep the network mode; if yes, go to step S23;
  • Step S23 Determine whether the Autosar Ethernet bus and the Autosar CAN bus are not used. If not, it means that there are nodes in the Autosar network that have a network request and keep the network mode; if so, perform step S24;
  • Step S24 judge whether the Coordinator-flag is in the bus sleep mode, if not, it means that there is a network request in the network node, and keep the network mode; if yes, go to step S25;
  • Step S25 the network coordinator releases the network, and after a preset waiting time, the network coordinator puts the network in a sleep state.
  • the sleep state under the Autosar bus is managed based on the distributed direct network management strategy, in which each node performs network activities according to the network management messages sent or received in the communication system. If each network node wants to maintain communication, it will pass the cycle Send network management messages sexually, if no communication is needed, stop sending network management messages;
  • the maximum time interval for a node to send a network management message is that the second node should send a network management message before the first node sends the second network management message at the latest;
  • Autosar network manager includes Autosar Ethernet network manager and Autosar Can network manager, both of which have the same network management mode;
  • the network management modes of Autosar network manager include bus sleep mode, network mode, and bus pre-sleep mode. According to different trigger conditions, the operating mode of the network node or ECU can be switched between different modes, and the change of any mode is called back The function informs the upper application;
  • the network mode includes at least: repeated message state, normal operation state, and ready to sleep state.
  • the internal state switching in the network mode includes:
  • the system When the system is powered on and the network management is initialized, it enters the bus sleep mode.
  • a node When a node requests communication, it changes from the bus sleep mode to the repeated message state in the network mode;
  • the conditions for the mutual conversion between the repeated message state and the normal operation state include: when the node needs network communication and can correctly send and receive network management messages, it is converted from the repeated message state to the normal operation state; when the node receives the network management message or the node in the repeated message state When it needs to enter the repeated message state, the node transforms from the normal operation state to the repeated message state;
  • the conditions for the mutual conversion between the repeated message state and the ready-to-sleep state include:
  • the node When the timing of the repeated message state is up and the node itself does not need network communication, it will transition from the repeated message state to the ready-to-sleep state; when a network management message in the repeated message state is received or the node requires to enter the repeated message state, it will go from the ready-to-sleep state Transform into a repeated message state;
  • the conditions for the mutual conversion between the normal operating state and the ready-to-sleep state include: the node does not need to communicate, requesting to release the bus, and transforming from the normal operating state to the ready-to-sleep state; when the node needs to communicate and requesting the bus, it will transform from the ready-to-sleep state to normal operation status;
  • the network manager when the network manager times out, it switches from the ready-to-sleep mode to the bus pre-sleep mode, and enters the bus sleep mode if it is not awakened within the preset waiting time.
  • the network mode also includes the limp state.
  • the node When the number of sending errors or receiving errors of the node in the network mode exceeds the threshold, the node will enter the limp state and repeatedly send the limp state information at regular intervals in this state, if the time is preset If the message sent by the node fails or the network management message cannot be received, the node will report the error to the application layer;
  • the conditions for the conversion of limp state and repeated elimination state, ready to sleep state, and normal operation state include:
  • the node sending error reaches or the receiving error exceeds the threshold, from the repeated message state to the limp state; in the limp state, the node can correctly send network management messages and can receive the network without the sleep flag Manage messages, from the limp state to the repeated message state; in the normal operation state, the node sending error reaches or the receiving error exceeds the threshold, from the normal operation state to the limp state; in the limp state, the node receives a sleep flag
  • the network management message changes from a limp state to a sleep-ready state; in the sleep-ready state, the node was in a limp state before and received a network management message without sleep, and it changes from a sleep-ready state to a limp state.
  • OSEK network management uses a token ring mechanism.
  • the token is passed from a node with a low network address to a node with a high network address. If there is no higher node, it is passed to the node with the lowest address; the token ring is based on The network address of the ECU is established, and each ECU will receive network management messages, and only a node with the same destination address will get the token.
  • OSEK's network wake-up includes lame state, reset state, and normal state.
  • the normal state or the reset state is converted to the lame state.
  • the lame state after the network message is sent and successfully received Enter the reset state, and then transform to the normal state.
  • This embodiment provides a method for sleeping and waking up an in-vehicle Ethernet network, which further includes:
  • Step S3 when the wake-up condition is triggered, the application layer calls the instruction that the current network is in the network mode when the main network management module is triggered;
  • Step S4 the network management coordinator triggers the Ethernet network and the CAN network, the AUTOSAR protocol triggers the network request, and OSEK coordinates to trigger the wake-up condition;
  • Step S5 AUTOSAR network management initiates network wake-up, including AUTOSAR Ethernet and AUTOSAR CAN, OSEK CAN network management initiates network wake-up according to its protocol, and establishes a logical ring;
  • Step S6 the bus network management wakes up the controller on the bus, and the wake-up process ends.
  • the network management coordinator triggers the Ethernet network and the CAN network, the AUTOSAR protocol triggers the network request, and the OSEK coordinates triggers the wake-up condition.
  • the AUTOSAR and OSEK network management status In order to keep the AUTOSAR and OSEK network management status consistent, follow the network management corresponding relationship in Table 5 below.

Abstract

本发明提供了一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,包括:步骤S1,车内控制器通过各自与其连接的总线接入到网络中并被网络管理器进行管理;步骤S2,当网络中存在触发睡眠条件,网络协调器对网络中的总线进行判断是否处于休眠状态,若有任意一条总线未处于休眠状态,则当前网络保持网络模式,若所有的总线都处于休眠状态,经过预设等待时间,网络协调器释放网络并进入总睡眠模式。本发明提供技术方案在能够对包含有车载以太网的车内混合网络的睡眠及唤醒状态进行管理,协调管理含有Autosar以太网网络、Autosar CAN网络、OSEK CAN网络的睡眠与唤醒状态进行管理,节省车内网络资源和节能,提高效率。

Description

一种包括车载以太网的车内混合网络的睡眠与唤醒方法 技术领域
本发明涉及智能汽车领域,尤其涉及包括车载以太网的车内混合网络的睡眠与唤醒方法。
背景技术
随着汽车的普及,越来越多的汽车进入千家万户,人民生活消费水平的不断提高,汽车的数量也不断的增多,大家对车内电器的智能化要求越来越高。在汽车智能化数据要求提高的同时,传统的CAN网络(2M/s)由于传输速率较低已经不能满足智能汽车的数据传输,为了解决流量的数据传输问题,一种高速传输的汽车以太网(100M/s)被引入智能汽车中,但随着汽车以太网逐步引入到汽车内部,使得原本复杂的汽车线束网络更加复杂。在加入汽车以太网的前提下,汽车内部网络管理按照总线和协议可以存着多种方式:一种是基于AUTOSAR(Automotive Open System Architecture)的CAN网络管理,第二种为基于AUTOSAR的以太网网络管理,第三种为基于OSEK(Open systems and their interfaces for electronics in automobiles)的CAN网络,这些不同的网络通过各自的总线直接或间接的与汽车网关相连接,进一步提出了汽车网关装置在对这些多总线网络管理时如何协调和如何管理睡眠和唤醒提出了挑战。但现有汽车内部都采用CAN的网络管理或信号电平的方式,随着ECU控制器总线形式由CAN转换成以太网,以太网ECU控制器需要睡眠唤醒管理,网关装置面临如下问题:一方面需要支持以太网网络睡眠唤醒管理,另一方面需要一种策略来协调与其他总线睡眠唤醒管理机制。汽车网关装置则需要同时支持传统CAN总线网络管理和以太网网络管理,同时CAN网络管理又存在OSEK和AUTOSAR两种协议,这样给汽车睡眠唤醒存在许多的协议和多种总线形式,目前还没有一个明确的方法来协调管理,本发明就是为解决此问题而提出。
发明内容
基于现有技术中存在的缺陷,本发明提供了一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,包括:
步骤S1,车内控制器通过各自与其连接的总线接入到网络中并被网络管理器进行管理;
步骤S2,当网络中存在触发睡眠条件,网络协调器对网络中的总线进行判断是否处于休眠状态,若有任意一条总线未处于休眠状态,则当前网络保持网络模式,若所有的总线都处于休眠状态,经过预设等待时间,网络协调器释放网络并进入总睡眠模式;
控制器至少包括ECU、节点网关中的一种或多种;
其中,网络管理器包括Autosar网络管理器、OSEK CAN网络管理器,Autosar网络管理器包括Autosar以太网网络管理器和Autosar CAN网络管理器;总线至少包括Autosar以太网总线、Autosar CAN总线、OSEK CAN总线,网络管理器与其对应的总线进行管理。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,所述步骤2的具体包括:
步骤S21,当睡眠被触发,则应用通知总线网络管理模块,触发网络协调标志对网络进行协调判断当前网络中的总线是否处于休眠的状态;
步骤S22,判断OSEK CAN总线是否未被使用,若否,则说明OSEK网络中有节点存在网络请求,保持网络模式;若是,则执行步骤S23;
步骤S23,判断Autosar以太网总线和Autosar CAN总线是否未被使用,若否,则说明Autosar网络中有节点存在网络请求,保持网络模式;若是,则执行步骤S24;
步骤S24,判断网络协调器标志是否处于总线睡眠模式,若否,则说明网络节点中存在网络请求,保持网络模式;若是,则执行步骤S25;
步骤S25,网络协调器释放网络,并经过预设的等待时间内,网络协调器使网络处于睡眠状态。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,包括:Autosar总线下的休眠状态基于分布式直接网络管理策略进行管理,其中,每个节点根据通信系统中发送或接收到的网络管理消息来执行网络活动,每个网络节点如果想保持通信,则通过周期性的发送网络管理消息,若无须通信,则停止发送网络管理消息;
当总线通信已被释放,并且在配置的预设时间内没有发送或接收到网络管理消息,则进入总线睡眠模式;
节点发送网络管理消息的最大时间间隔为第二个节点最晚应该在第一个节点发送第二个网络管理消息之前发送网络管理消息。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,Autosar网络管理器的网络管理模式包括总线睡眠模式、网络模式、总线预睡眠模式,根据不同的触发条件,网络节点或ECU的运行模式在不同的模式间进行切换,任意一种模式的改变通过 回调函数通知上层的应用;
网络模式至少包括:重复消息状态、普通操作状态、准备睡眠状态。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,所述重复消息状态与普通操作状态相互转化的条件包括:当节点需要网络通信且能够正确收发网络管理消息时,从重复消息状态转化为普通操作状态;当节点收到重复消息状态的网络管理消息或节点本身需要进入重复消息状态时,节点从普通操作状态转化为重复消息状态;
重复消息状态与准备睡眠状态相互转化的条件包括:
当重复消息状态的定时时间到并且节点自身不需要网络通信时,从重复消息状态转化为准备睡眠状态;当收到重复消息状态的网络管理消息或节点要求进入重复消息状态,则从准备睡眠状态转化为重复消息状态;
普通操作状态与准备睡眠状态相互转化的条件包括:节点不需要通信,请求释放总线使,从普通操作状态转化为准备睡眠状态;当节点需要通信,请求总线,则从准备睡眠状态转化为普通操作状态;
在准备睡眠模式状态下,当网络管理器超时,则从准备睡眠模式切换到总线预睡眠模式,在超过等待的预设时间内若没有被唤醒,则进入总线睡眠模式。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,网络模式还包括跛行状态,当节点在网络模式下的发送错误或接收错误的次数超过阈值,节点将进入跛行状态并在该状态下每隔一段时间重复发送跛行状态信息,若在预设的时间内,该节点发送的消息失败或不能收到网络管理消息,则将该节点错误上报应用层;
跛行状态与重复消状态、准备睡眠状态、普通操作状态的转化条件包括:
在重复消息状态定时时间内,节点发送错误达到或者接收错误超过阈值,从重复消息状态转化为跛行状态;在跛行状态下,节点能够正确的发送网络管理消息并且能够收到不带睡眠标志的网络管理消息,从跛行状态转化为重复消息状态;在普通操作状态下,节点发送错误达到或者接收错误超过阈值,从普通操作状态转化为跛行状态;在跛行状态下,节点收到带有睡眠标志的网络管理消息,从跛行状态转化为准备睡眠状态;准备睡眠状态下,节点之前处于跛行状态,并且收到不带睡眠的网络管理消息,从准备睡眠状态转化为跛行状态。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,在跛行状态下,在当网络中的节点不需要总线通信而进入准备睡眠状态后,在网络管理定时器超时之前,继续重复发送带有睡眠标志位的网络管理消息;
网络中不能正常发送消息的节点收到该睡眠消息时,设置自身也进入准备睡眠状态,其他节点收到该消息后,除登记该节点准备睡眠的信息外,不对网络状态和网络管理定时器做任何修改;
当网络中的节点都发送带有睡眠标志的网络管理消息时,节点同步进入到总线预睡眠模式。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,包括:OSEK CAN总线下网络管理方法,具体包括:OSEK网络管理使用令牌环机制,令牌从网络地址低的节点传到网络地址高的节点,如果没有更高的节点,就传给最低地址节点;令牌环根据ECU的网络地址建立,每个ECU都会接受网络管理消息,只有和目的地址相同的一个节点才会得到令牌;
OSEK CAN网络管理器的网络管理模式包括网络模式和网络唤醒,其中,OSEK CAN的网络唤醒包括跛行状态、复位状态、正常状态,当接收错误计算器或发送错误计数器超过阈值后,由正常状态或复位状态转化跛行状态,在跛行状态下,发送且成功接收网络报文后进入复位状态,再转化为正常状态。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,OSEK CAN网络总线的休眠状态包括以下步骤:
步骤S 301,建立逻辑环,
步骤S302,按照节点建立的逻辑环逐个节点判断节点是否满足休眠条件,若满足,执行步骤S303,若不满足,执行步骤S304;
步骤S303,满足休眠条件的节点发送“sleel.ind”等于1的ring报文,跳转执行步骤S305;
步骤S304,不满足休眠条件的节点发送“sleel.ind”等于0的ring报文,跳转执行步骤S302;
步骤S305,判断逻辑环中的是否所有的节点都满足休眠状态,若都满足休眠状态,执行步骤S306,若不满足休眠状态,则跳转执行步骤S302;
步骤S306,由判断的节点发送将网络中的报文的睡眠应答位置1并发送到网络中,该节点自身进入睡眠等待状态,并停止发送报文;
步骤S307,其余节点收到睡眠应答位置为1的网关报文后,立即进入睡眠等待状态,并停止发送报文;
步骤S308,睡眠等待状态启动定时器;
步骤S309,定时器到时,进入网络睡眠状态。
一种包括车载以太网的车内混合网络的睡眠与唤醒方法,进一步地,还包括:步骤S3,当唤醒条件被触发时,应用层调用总网络管理模块触发时当前网络处于网络模式的指令;
步骤S4,网络管理协调器触发以太网网络和CAN网络,AUTOSAR协议的触发网络请求,OSEK协调触发唤醒条件;
步骤S5,AUTOSAR网络管理发起网络唤醒,包括AUTOSAR以太网和AUTOSAR CAN,OSEK CAN网络管理按照其协议发起网络唤醒,建立逻辑环;
步骤S6,总线网络管理唤醒总线上控制器,唤醒流程结束;
网络管理协调器触发以太网网络和CAN网络,AUTOSAR协议的触发网络请求,OSEK协调触发唤醒条件;
OSEK CAN网络管理模式与AUTOSAR网络管理模式具有的一一对应;
所述OSEK CAN网络唤醒后建立逻辑环过程包括:
步骤S51,控制器唤醒后想参与网络的节点会先发Alive报文申请加入逻辑环;
步骤S52,逻辑环建成后,各节点按顺序发Ring报文向后续节点传递“令牌”。
有益效果:
1.本发明提供技术方案在能够对包含有车载以太网的车内混合网络的睡眠及唤醒状态进行管理,协调管理含有Autosar以太网网络、Autosar CAN网络、OSEK CAN网络的睡眠与唤醒状态进行管理,节省车内网络资源和省电,提高效率;
2.本发明提供技术方案在Autosar网络管理器中的网络模式中增加跛行状态,能够对发生故障的节点进行检测,避免在节点发生故障后被误判为该节点处于休眠状态。
附图说明
以下附图仅对本发明做示意性说明和解释,并不限定本发明的范围。
图1为本发明一实施例中包括车载以太网的车内混合网络架构的结构示意图。
图2为本发明一实施例中含有睡眠唤醒管理装置的中央网关结构示意图。
图3为本发明一实施例中Autosar网络管理器中网络管理模式的结构示意图。
图4为本发明一实施例中Autosar网络管理器中含有跛行状态网络管理模式的结构示意图。
图5为本发明一实施例中Autosar网络管理器中含有跛行状态网络管理模式的故障节点的检测方法流程图。
图6为本发明一实施例中OSEK CAN网络管理器中网络管理模式的结构示意图。
图7为本发明一实施例中OSEK CAN网络管理器中OSEK CAN网络休眠状态流程 图。
图8为本发明一实施例中含有车载以太网的汽车混合网络架构下的总线睡眠管理协调方法。
具体实施方式
为了对本文的技术特征、目的和效果有更加清楚的理解,现对照附图说明本发明的具体实施方式,在各图中相同的标号表示相同的部分。为使图面简洁,各图中的示意性地表示出了与本发明相关部分,而并不代表其作为产品的实际结构。另外,为使图面简洁便于理解,在有些图中具有相同结构或功能的部件,仅示意性地绘示了其中的一个,或仅标出了其中的一个。
关于控制系统,功能模块、应用程序(APP)本领域技术人员熟知的是,其可以采用任何适当的形式,既可以是硬件也可以是软件,既可以是离散设置的多个功能模块,也可以是集成到一个硬件上的多个功能单元。作为最简单的形式,所述控制系统可以是控制器,例如组合逻辑控制器、微程序控制器等,只要能够实现本申请描述的操作即可。当然,控制系统也可以作为不同的模块集成到一个物理设备上,这些都不偏离本发明的基本原理和保护范围。
本发明中“连接”,即可包括直接连接、也可以包括间接连接、通信连接、电连接,特别说明除外。
本文中所使用的术语仅为了描述特定实施方案的目的并且不旨在限制本公开。如本文中所使用地,单数形式“一个”、“一种”、以及“该”旨在也包括复数形式,除非上下文明确地另作规定。还将理解的是,当在说明书中使用时,术语“包括”和/或“包含”是指存在有所陈述的特征、数值、步骤、操作、元件和/或组分,但是并不排除存在有或额外增加一个或多个其它的特征、数值、步骤、操作、元件、组分和/或其组成的群组。作为在本文中所使用的,术语“和/或”包括列举的相关项的一个或多个的任何和全部的组合。
应当理解,此处所使用的术语“车辆”或“车辆的”或其它类似术语一般包括机动车辆,例如包括运动型多用途车辆(SUV)、公共汽车、卡车、各种商用车辆的乘用汽车,包括各种舟艇、船舶的船只,航空器等等,并且包括混合动力车辆、电动车辆、可插式混合动力电动车辆、氢动力车辆以及其它替代性燃料车辆(例如源于非石油的能源的燃料)。正如此处所提到的,混合动力车辆是具有两种或更多动力源的车辆,例如汽油动力和电力动力两者的车辆。
此外,本公开的控制器可被具体化为计算机可读介质上的非瞬态计算机可读介质,该计算机可读介质包含由处理器、控制器或类似物执行的可执行程序指令。计算机可读 介质的示例包括,但不限于,ROM、RAM、光盘(CD)-ROM、磁带、软盘、闪存驱动器、智能卡和光学数据存储设备。计算机可读记录介质也可分布在通过网络耦合的计算机系统中,使得计算机可读介质例如通过远程信息处理服务器或控制器区域网络(CAN)以分布式方式存储和执行。
实施例1:
本实施例提供了包含有车载以太网的车内混合网络的睡眠与唤醒管理装置,参见图1,包括中央网关,中央网关分别通过多条基于不同传输协议的总线连接相应的ECU或节点网关,总线至少包括:Autosar Ethernet(以太网)总线、Autosar CAN总线、OSEK CAN总线。
图1为实施例中含有车载以太网的车内混合网络架构的结构示意图;
图1中显示了A1、A2连接于Autosar Ethernet总线上,A1、A2都可以代表Autosar Ethernet总线上的节点网关、ECU、节点等。A1,A2数据接收和发送都基于Autosar Ethernet的车载以太网协议,B1、B2、B3都可以代表OSEK CAN总线上的节点网关、ECU、节点等,B1、B2、B3数据接收和发送都基于OSEK CAN协议。C1,C2,C3都可以代表Autosar CAN总线上的节点网关、ECU、节点等。B1、B2、B3数据接收和发送都基于Autosar CAN协议。
中央网关至少包括睡眠唤醒管理装置(参见图2,图2为包含有睡眠唤醒管理装置的中央网关结构示意图),睡眠唤醒管理装置至少包括总线网络管理模块、网络协调器、Autosar网络管理器、OSEK CAN网络管理器,其中,Autosar网络管理器包括Autosar以太网管理器、Autosar CAN网络管理器;
总线网络管理模块与网络协调器相连接,网络协调器分别与Autosar以太网总线管理器、Autosar CAN网络管理器、OSEK CAN网络管理器相连接。
总线网络管理模块,被配置为用于管理车内的多种总线协议通信;
网络协调器,被配置为用于协调车内多种不同类别的网络管理器,包括利用内置算法管理车内多条总线的睡眠和唤醒;
Autosar以太网管理器,被配置为用于管理基于Autosar以太网总线下接入的网络节点、ECU进行管理,包括网络节点、ECU的通信、睡眠和唤醒;
Autosar以太网管理器,被配置为用于管理基于Autosar以太网总线下接入的网络节点、ECU进行管理,包括网络节点、ECU的通信、睡眠和唤醒;
Autosar CAN管理器,被配置为用于管理基于Autosar CAN总线下接入的网络节点、ECU的睡眠和唤醒进行管理;
OSEK网络管理器,被配置为用于管理基于Autosar CAN总线下接入的网络节点、ECU的睡眠和唤醒进行管理。
对于Autosar网络管理器,为了便于对接入的设备进行管理,在本实施例中,对Autosar网络管理器的网络中包括三个工作模式,参见图3,具体包括总线睡眠模式、网络模式、总线预睡眠模式,根据不同的触发条件,网络节点或ECU的运行模式在三者之间进行循环切换,若当前模式为网络模式,当满足网络预睡眠条件,以太网总线从网络模式转化为总线预睡眠模式,然后在满足网络睡眠条件下,进入总线睡眠模式。三种模式之间任意一种模式的改变通过回调函数通知上层的应用;
网络模式包括三个内部状态:重复消息状态、普通操作状态、准备睡眠状态,其中,重复消息状态被用来确保从总线睡眠模式或总线预睡眠模式到网络的节点被总线上面其他节点发现,重复消息状态能够用来检测连接于总线上的节点;当进入重复消息状态时,节点应该开始传送标识信息;在重复消息状态下,当定时器超时溢出,以太网总线管理器重载定时器;以太网总线管理器在重复消息状态下保持预设的时间段,超过该时间段需要重新配置;当离开重复消息状态的时候,如果节点需要通信,则进入普通操作状态;如果节点不需要通信,则进入准备睡眠模式,并且清空重复消息。
普通操作状态:普通操作状态能够保持总线处于唤醒状态;从准备睡眠状态进入普通操作状态应该发送标识信息;在普通操作状态下,当定时器超时溢出,以太网总线管理器重载定时器。如果节点不需要使用通信,则网络应该被释放,节点应该进入准备睡眠状态;如果节点接收到重复消息状态的请求,则节点进入重复消息状态,如果节点自身需要进入重复消息状态,则该节点进入重复消息状态并且设置重复消息状态的请求。
准备睡眠状态,这个状态是为了如果本节点已经准备释放总线,而其他节点还需要使用总线的时候,在准备睡眠状态下等待其他总线上的节点进入准备睡眠模式。进入准备睡眠状态之后,以太网总线管理器停止报文信息的传送。如果定时器超时溢出,节点将会进入准备睡眠模式;如果该节点需要使用总线,则节点进入普通操作模式。如果节点接收到重复消息状态的请求,则节点进入重复消息状态,如果节点自身需要进入重复消息状态,则该节点进入重复消息状态并且设置重复消息状态请求。
总线预睡眠模式被配置为了等待总线上的所有节点能够在进入总线睡眠模式之前,有时间停止节点的活动(active)状态:如清空队列中为发送的报文。在总线预睡眠模式下,所有节点都静默下来;当节点进入总线预睡眠模式时,应该通知上层应用。通过配置等待参数,可以改变节点在总线预睡眠模式停留的时间,在这段时间之后节点将会进入其他状态。在总线预睡眠模式下面接收到报文或者被上层应用请求通信时,节点将进入网络中的 普通操作状态。
总线睡眠模式被配置为当位于总线的节点在预设的时间段内都没有消息或本身没有主动向其它目标发送消息的请求时,使总线上的节点处于睡眠状态;
在总线睡眠模式下,节点可以被唤醒。定时器超时与总线睡眠时间的两个参数在整个总线上面的节点应该匹配,保证了总线上的节点能够统一的进行休眠。
当进入总线睡眠模式时候,应该通知上层(总线网络管理模块)应用。
在总线睡眠模式下,如果成功接收到报文,以太网总线管理器应该调用函数,进入网络模式中的重复消息状态。
具体地,AUTOSAR以太网网络管理的状态转换图如图3所示,其状态转换的条件是:(1)网络管理初始化后进入总线睡眠模式;(2)节点请求网络通信;(3)重复消息状态定时时间到、节点需要网络通信且节点能够正确收发网络管理消息;(4)收到重复消息状态的网络管理消息或者节点自身请求进入重复消息状态;(5)重复消息状态定时时间到,并且节点自身不需要网络通信;(6)收到重复消息状态的网络管理消息或者节点自身请求进入重复消息状态;(7)节点需要通信,请求总线;(8)节点不需要通信,释放总线;(9)节点收到网络管理消息;(10)节点自身请求网络通信;(11)网络管理定时器超时;(12)预休眠定时器超时;(13)系统断电。
参见图4,为了解决以太网总线下故障节点的发现和监测问题,在网络模式中,增加了一个跛行状态,用于当总线下的某一个节点出现错误时实用,避免节点出现故障后被强制进入休眠状态。具体地,在网络模式下,增加跛行状态,当节点不能正常使用总线时,则进入该状态;修改睡眠机制,在网络管理器中的通信协议中增加一个睡眠标志位,当节点准备睡眠时即进入准备睡眠状态时,重复发送带有睡眠标志位的网络管理消息,其他节点在此基础上判断节点是处于故障状态还是准备睡眠状态。
Autosar网络管理通信协议中,增加了睡眠标志位,具体参见表1和表2,表1为以太网网络管理协议数据单元的基本结构;
表1为Autosar网络管理协议数据单元的基本结构
Figure PCTCN2020075842-appb-000001
表2为Control Bit Vector(控制位)的数据结构
Figure PCTCN2020075842-appb-000002
表1中各个字段的含义为:
User data:用户自定义数据,对于CAN总线,User data的长度可为6个字节,系统用户可根据不同的网络布线特点进行网络管理扩展算法的实现。
Control Bit Vector:是否需要检测故障节点,以及网络管理消息的类型,该位的具体设计如表2所示。
源ID:每一个发送方都有一个唯一的网络标识符,这个网络标识符是在网络设计过程中静态配置的,用于标识发送消息的节点;
Rpt(2位):11表示网络请求故障检测,01表示传输普通的网络管理消息,10表示节点发送的是跛行状态消息;
Rdysleep(1位):该位主要用于标识节点是否需要总线通信,即是否要进入睡眠状态。该位置1表示节点要进入睡眠状态,该位置0表示节点需要总线通信;
具体地,参见图4,图4在图3的基础上增加了跛行状态,具体改变相应节点的关系如下:(14)在重复消息状态定时时间内,节点发送错误达到或者接收错误超过阈值;(15)节点能够正确的发送网络管理消息并且能够收到不带睡眠标志的网络管理消息;(16)节点发送错误达到或者接收错误超过阈值;(17)节点收到带有睡眠标志的网络管理消息;(18)节点之前处于跛行状态,并且收到不带睡眠的网络管理消息。
增加跛行状态下,以太网的网络管理采用睡眠协商的方法,在当网络中的节点不需要总线通信而进入准备睡眠状态后,在网络管理定时器超时之前,继续重复发送带有睡眠标志位的网络管理消息。网络中不能正常发送消息的节点收到该睡眠消息时,设置自身也进入准备睡眠状态,其他节点收到该消息后,除登记该节点准备睡眠的信息外,不对网络状态和网络管理定时器做任何修改。网络中带有睡眠标志的网络管理消息对在线节点的网络状态没有任何影响,所以当网络中的节点都发送带有睡眠标志的网络管理消息时,节点能同步进入到睡眠模式。由于故障节点不能发送网络管理报文,采用这种协商睡眠的方法不但能够保证网络中的节点进入同步睡眠模式,同时也能够对网络中的故障节点进行判断。
网络节点在增加跛行状态下的节点检测机制,参见图5,故障节点检测是网络管理的另一功能,通过修改网络的睡眠机制和在网络管理接口模块中配置一张动态的网络管理表来实现故障节点的检测功能。网络管理表包括3个字段,分别是节点ID、未发送数据 间隔和故障计数器Cnt。在以太网网络管理器启动之初,每个节点都默认进入重复消息状态,并且各个节点按照一定的顺序在重复消息状态下发送网络管理消息。其他节点将接收到的以太网网络管理器的消息上报以太网网络管理器接口模块,并将收到的网络管理器协议数据单元的源地址存储在网络管理表节点ID列中,重复ID不记录该表。当收到任何一个节点的网络管理消息时,则将该节点对应的“未发送数据间隔”和“故障计数器Cnt”清0。当某个节点在未发送数据间隔内不发送网络管理消息时,该节点可能存在故障。如果有节点需要对其进行检测,则发送重复状态下的网络管理消息,正常的节点收到该消息后均在下一个发送周期发送重复消息状态下的网络管理消息,如果该节点不发送,则将故障计数器Cnt加1。重复上述过程,当故障计数器Cnt达到阈值时,则认为该节点故障,并将其上报给应用层。
本实施例中AUTOSAR采用基于分布式直接网络管理策略,其中,Autosar总线下的每个节点根据通信系统中发送或者接收到的以太网总线管理器的报文消息来执行自给自足的网络活动;
Autosar网络管理器对等算法基于周期性的报文消息,报文消息通过广播发送,所有以太网总线下的网络中的所有节点都可以接收到,接收到报文消息表示发送这个报文消息的节点倾向保持网络工作模式。如果有节点准备好进入总线睡眠模式,它就停止发送报文消息,但是只要它还能够接收到从其他节点发来的报文消息,它就延迟到总线睡眠模式的变迁。最终,在一定的时限内,由于不再接收到报文消息,每个节点都启动到总线睡眠模式的变迁。
如果网络中的任何节点需要总线通信,它可以通过发送报文消息使网络从来总线睡眠模式中唤醒。
AUTOSAR网络管理策略可以总结为如下两个点:
S101,每个网络节点如果想保持总线通信,就会一直发送周期性的网络管理消息;如果它不再需要保持总线通信,它就不再发送网络管理消息。
S102,如果总线通信已经被释放,并且在配置的一段时间内没有发送或者接收到网络管理消息,则执行到总线睡眠模式的转移。
实现这种对等算法可以通过一个网络状态机来维护。这个状态机的特征如下:
a1)AUTOSAR网络管理状态机应包含从一个网络节点的角度来看的状态,变迁和触发条件。
a2)AUTOSAR网络管理状态机的变迁应通过NmIf层的函数调用或者自身的定时器的到期来触发。
AUTOSAR CAN网络管理器,被配置为用于管理基于Autosar CAN网络下接入的网络节点、ECU进行管理,包括网络节点、ECU的通信、睡眠和唤醒;
对于AUTOSAR CAN网络管理器,由于其与以太网网络管理器都是基于Autosar架构,因此,在此实施例中,其基于CAN总线下的节点的工作模式以及状态变换都与以太网总线管理下的节点工作模式以及状态变换相同。
OSEK CAN网络管理器,被配置为用于管理基于OSEK CAN总线下接入的网络节点、ECU进行管理,包括网络节点、ECU的通信、睡眠和唤醒;
对于OSEK CAN网络管理器,为了便于对接入的设备进行管理,在本实施例中,
OSEK CAN网络管理器包括两个工作模式,参见图6,具体包括网络睡眠和网络唤醒,根据不同的触发条件,网络节点或ECU的运行模式在二者之间进行循环切换。为了详细说明在网络唤醒和网络状态之间的切换,参见表3,
表3为OSEK CAN网络管理的报文格式
Figure PCTCN2020075842-appb-000003
表3中,Base ID表示网络管理报文的基地址,即ID分配区间,Source ID表示网络管理报文的源地址,即发送该网络管理报文的节点地址;Destination ID表示网络管理报文的目标地址,即需要接收该网络管理报文的节点地址;Option Code表示控制场,控制场各个位的含义如表2所示;Data表示数据场,当前保留,用"0x00"填充。
表4为网络管理报文的控制场的数据结构
Figure PCTCN2020075842-appb-000004
表4中,Bit0位置1代表该网络管理报文为Alive报文;Bit1位置1代表该网络管理报文为Ring报文;Bit2位置1代表该网络管理报文为Limphone跛行报文;Bit 4位为睡眠指示 位,置1代表该节点不再需要网络通信;Bit 5位为睡眠应答位,置1代表节点已监测到当前逻辑环中所用节点已将睡眠指示位置1,网段准备进入睡眠状态。其他位为保留位,以0填充。同时,Bit 0、Bit 1和Bit 2位为互斥状态,即只能有其中一位置1。
OSEK CAN网络管理报文类型可分为Alive报文、Ring报文和Limphone报文:
b1)Alive报文:网段中的节点完成初始化或被跳过后,发送Alive报文,用于声明节点存在。Alive报文的目标地址等于节点的自身地址。
b2)Ring报文:即逻辑环报文。在稳定的逻辑环中,节点用于传递状态信息的网络管理报文。
b3)LimpHone报文:接收错误计数器或发送错误计数器超过阈值后,节点以固定周期发送LimpHone报文。LimpHone报文的目标地址等于节点的本地地址。
OSEK CAN网络管理使用令牌环机制,令牌从网络地址低的节点传到网络地址高的节点,如果没有更高的节点,就传给最低地址节点;令牌环根据ECU的网络地址建立,每个ECU都会接受网络管理消息,只有和目的地址相同的一个节点才会得到令牌。
OSEK的网络唤醒包括跛行状态、复位状态、正常状态,当接收错误计算器或发送错误计数器超过阈值后,由正常状态或复位状态转化跛行状态,在跛行状态下,发送且成功接收网络报文后进入复位状态,在转化为正常状态。
唤醒后建立逻辑环过程包括:
S51,控制器唤醒后想参与网络的节点会先发Alive报文申请加入逻辑环。
S52,逻辑环建成后,各节点按顺序发Ring报文向后续节点传递“令牌”。
同步休眠过程:
c1)如果逻辑环中有节点想休眠,就设置Ring报文中的Sleep.Ind指示位。
c2当逻辑环中所有的节点都设置了Sleep.Ind指示位,也意味着任何节点接收到所有其它节点的Sleep.Ind指示位。
c3)逻辑环中所有的节点设置Sleep.Ack指示位。
c4任何节点接收到所有其它的节点的Sleep.Ack指示位。
c5)所有节点同步进入等待睡眠状态。c6)WaitBusSleep时间内没有收到唤醒时间,所有节点同步进入睡眠状态。
图7为OSEK CAN网络管理器中OSEK CAN网络休眠状态流程图。
OSEK CAN网络的休眠状态包括以下步骤:
步骤S301,建立逻辑环;
步骤S302,按照节点建立的逻辑环逐个节点判断节点是否满足休眠条件,若满足,执行步骤S303,若不满足,执行步骤S304;
步骤S303,满足休眠条件的节点发送“sleel.ind”等于1的ring报文,跳转执行步骤S305;
步骤S304,不满足休眠条件的节点发送“sleel.ind”等于0的ring报文,跳转执行步骤S302;
步骤S305,判断逻辑环中的是否所有的节点都满足休眠状态,若都满足休眠状态,执行步骤S306,若不满足休眠状态,则跳转执行步骤S302;
步骤S306,由判断的节点发送将网络中的报文的睡眠应答位置1并发送到网络中,该节点自身进入睡眠等待状态,并停止发送报文;
步骤S307,其余节点收到睡眠应答位置为1的网关报文后,立即进入睡眠等待状态,并停止发送报文;
步骤S308,睡眠等待状态启动定时器;
步骤S309,定时器到时,进入网络睡眠状态;
另外,当OSEK CAN网络处于休眠状态时,当应用程序需要CAN通信时,ECU为请求网络唤醒;当节点处于休眠状态时,如果接收到唤醒事件,,则节点被唤醒并发送Alive报文。
实施例2:
本实施例提供一种车载以太网网络睡眠及唤醒方法,包括以下步骤:
步骤S1,车内控制器通过各自与其连接的总线接入到网络中并被网络管理器进行管理;
其中,网络管理器包括Autosar网络管理器、OSEK CAN网络管理器,Autosar网络管理器包括Autosar以太网网络管理器和Autosar CAN网络管理器;总线至少包括Autosar以太网总线、Autosar CAN总线、OSEK CAN总线,网络管理器与其对应的总线进行管理;
控制器至少包括ECU、节点网关中的一种或多种;
步骤S2,当网络中存在触发睡眠条件,网络协调器根据对网络中的总线进行判断总线是否处于休眠状态,若有任意一条总线未处于休眠状态,则当前网络处于等待睡眠状态,若所有的总线都处于休眠状态,经过预设等待时间,网络协调器释放网络并进入总睡眠模式;
步骤S2中,首先判断基于OSEK CAN总线,然后在判断基于Autosar以太网总线和Autosar CAN总线;
步骤S3,当唤醒条件被触发时,应用层调用总网络管理模块触发时当前网络处于网络模式的指令;
步骤S4,网络管理协调器触发以太网网络和CAN网络,AUTOSAR协议的触发网络请求,OSEK协调触发唤醒条件;
步骤S5,AUTOSAR网络管理发起网络唤醒,包括AUTOSAR以太网和AUTOSAR CAN,OSEK CAN网络管理按照其协议发起网络唤醒,建立逻辑环;
步骤S6,总线网络管理唤醒总线上控制器,唤醒流程结束。
图8为本实施例中车载以太网架构下的总线睡眠管理协调方法流程图,参见图8;
在步骤S2的具体步骤包括:
步骤S21,当睡眠被触发,则应用通知总线网络管理模块,触发网络协调标志对网络进行协调判断当前网络中的总线是否处于休眠的状态;
步骤S22,判断OSEK CAN总线(CAN bus_flag)是否没有被使用,若否,则说明OSEK网络中有节点存在网络请求,保持网络模式;若是,则执行步骤S23;
步骤S23,判断Autosar以太网总线和Autosar CAN总线是否没有被使用,若否,则说明Autosar网络中有节点存在网络请求,保持网络模式;若是,则执行步骤S24;
其中,Autosar以太网总线和Autosar CAN总线是通过Ethernet bus_flag标志进行判断的;
步骤S24,判断网络协调器标志(Coordinator-flag)是否处于总线睡眠模式,若否,则说明网络节点中存在网络请求,保持网络模式;若是,则执行步骤S25;
步骤S25,网络协调器释放网络,并经过预设的等待时间内,网络协调器使网络处于睡眠状态。
Autosar总线下的休眠状态基于分布式直接网络管理策略进行管理,其中,每个节点根据通信系统中发送或接收到的网络管理消息来执行网络活动,每个网络节点如果想保持通信,则通过周期性的发送网络管理消息,若无须通信,则停止发送网络管理消息;
当总线通信已被释放,并且在配置的预设时间内没有发送或接收到网络管理消息,则进入总线睡眠模式;
节点发送网络管理消息的最大时间间隔为第二节点最晚应该在第一个节点发送第二个网络管理消息之前发送网络管理消息;
Autosar网络管理器包括Autosar以太网网络管理器和Autosar Can网络管理器,二 者的网络管理模式相同;
Autosar网络管理器的网络管理模式包括总线睡眠模式、网络模式、总线预睡眠模式,根据不同的触发条件,网络节点或ECU的运行模式在不同的模式间进行切换,任意一种模式的改变通过回调函数通知上层的应用;
网络模式至少包括:重复消息状态、普通操作状态、准备睡眠状态,网络模式中内部状态的切换包括:
当系统上电,网络管理初始化后进入总线睡眠模式,当有节点请求进行通信时,从总线睡眠模式转化为网络模式中的重复消息状态;
重复消息状态与正常操作状态相互转化的条件包括:当节点需要网络通信且能够正确收发网络管理消息时,从重复消息状态转化为普通操作状态;当节点收到重复消息状态的网络管理消息或节点本身需要进入重复消息状态时,节点从普通操作状态转化为重复消息状态;
重复消息状态与准备睡眠状态相互转化的条件包括:
当重复消息状态的定时时间到并且节点自身不需要网络通信时,从重复消息状态转化为准备睡眠状态;当收到重复消息状态的网络管理消息或节点要求进入重复消息状态,则从准备睡眠状态转化为重复消息状态;
普通操作状态与准备睡眠状态相互转化的条件包括:节点不需要通信,请求释放总线使,从普通操作状态转化为准备睡眠状态;当节点需要通信,请求总线,则从准备睡眠状态转化为普通操作状态;
在准备睡眠模式状态下,当网络管理器超时,则从准备睡眠模式切换到总线预睡眠模式,在超过等待的预设时间内若没有被唤醒,则进入总线睡眠模式。
网络模式还包括跛行状态,当节点在网络模式下的发送错误或接收错误的次数超过阈值,节点将进入跛行状态并在该状态下每隔一段时间重复发送跛行状态信息,若在预设的时间内,该节点发送的消息失败或不能收到网络管理消息,则将该节点错误上报应用层;
跛行状态与重复消状态、准备睡眠状态、普通操作状态的转化条件包括:
在重复消息状态定时时间内,节点发送错误达到或者接收错误超过阈值,从重复消息状态转化为跛行状态;在跛行状态下,节点能够正确的发送网络管理消息并且能够收到不带睡眠标志的网络管理消息,从跛行状态转化为重复消息状态;在普通操作状态下,节点发送错误达到或者接收错误超过阈值,从普通操作状态转化为跛行状态;在跛行状态下,节点收到带有睡眠标志的网络管理消息,从跛行状态转化为准备睡眠状态;准备睡眠状态下,节点之 前处于跛行状态,并且收到不带睡眠的网络管理消息,从准备睡眠状态转化为跛行状态。
OSEK总线下的休眠状态:OSEK网络管理使用令牌环机制,令牌从网络地址低的节点传到网络地址高的节点,如果没有更高的节点,就传给最低地址节点;令牌环根据ECU的网络地址建立,每个ECU都会接受网络管理消息,只有和目的地址相同的一个节点才会得到令牌。
OSEK的网络唤醒包括跛行状态、复位状态、正常状态,当接收错误计算器或发送错误计数器超过阈值后,由正常状态或复位状态转化跛行状态,在跛行状态下,发送且成功接收网络报文后进入复位状态,在转化为正常状态。
本实施例提供一种车载以太网网络睡眠及唤醒方法,还包括:
步骤S3,当唤醒条件被触发时,应用层调用总网络管理模块触发时当前网络处于网络模式的指令;
步骤S4,网络管理协调器触发以太网网络和CAN网络,AUTOSAR协议的触发网络请求,OSEK协调触发唤醒条件;
步骤S5,AUTOSAR网络管理发起网络唤醒,包括AUTOSAR以太网和AUTOSAR CAN,OSEK CAN网络管理按照其协议发起网络唤醒,建立逻辑环;
步骤S6,总线网络管理唤醒总线上控制器,唤醒流程结束。
网络管理协调器触发以太网网络和CAN网络,AUTOSAR协议的触发网络请求,OSEK协调触发唤醒条件。为保持AUTOSAR和OSEK网络管理状态一致,则按照如下表5网络管理对应关系。
表5 OSEK网络管理模式与AUTOSAR网络管理模式一一对应
Figure PCTCN2020075842-appb-000005
以上所述的仅是本发明的优选实施方式,本发明不限于以上实施例。本领域的技术人员可以清楚,该实施例中的形式不局限于此,同时可调整方式也不局限于此。可以理解,本领域技术人员在不脱离本发明的基本构思的前提下直接导出或联想到的其他改进和变化,均应认为包含在本发明的保护范围之内。

Claims (10)

  1. 一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,包括:
    步骤S1,车内控制器通过各自与其连接的总线接入到网络中并被网络管理器进行管理;
    步骤S2,当网络中存在触发睡眠条件,网络协调器对网络中的总线进行判断是否处于休眠状态,若有任意一条总线未处于休眠状态,则当前网络保持网络模式,若所有的总线都处于休眠状态,经过预设等待时间,网络协调器释放网络并进入总睡眠模式;
    控制器至少包括ECU、节点网关中的一种或多种;
    其中,网络管理器包括Autosar网络管理器、OSEK CAN网络管理器,Autosar网络管理器包括Autosar以太网网络管理器和Autosar CAN网络管理器;总线至少包括Autosar以太网总线、Autosar CAN总线、OSEK CAN总线,网络管理器与其对应的总线进行管理。
  2. 如权利要求1所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,所述步骤2的具体包括:
    步骤S21,当睡眠被触发,则应用通知总线网络管理模块,触发网络协调标志对网络进行协调判断当前网络中的总线是否处于休眠的状态;
    步骤S22,判断OSEK CAN总线是否未被使用,若否,则说明OSEK网络中有节点存在网络请求,保持网络模式;若是,则执行步骤S23;
    步骤S23,判断Autosar以太网总线和Autosar CAN总线是否未被使用,若否,则说明Autosar网络中有节点存在网络请求,保持网络模式;若是,则执行步骤S24;
    步骤S24,判断网络协调器标志是否处于总线睡眠模式,若否,则说明 网络节点中存在网络请求,保持网络模式;若是,则执行步骤S25;
    步骤S25,网络协调器释放网络,并经过预设的等待时间内,网络协调器使网络处于睡眠状态。
  3. 如权利要求1所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,包括:Autosar总线下的休眠状态基于分布式直接网络管理策略进行管理,其中,每个节点根据通信系统中发送或接收到的网络管理消息来执行网络活动,每个网络节点如果想保持通信,则通过周期性的发送网络管理消息,若无须通信,则停止发送网络管理消息;
    当总线通信已被释放,并且在配置的预设时间内没有发送或接收到网络管理消息,则进入总线睡眠模式;
    节点发送网络管理消息的最大时间间隔为第二个节点最晚应该在第一个节点发送第二个网络管理消息之前发送网络管理消息。
  4. 如权利要求1所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,Autosar网络管理器的网络管理模式包括总线睡眠模式、网络模式、总线预睡眠模式,根据不同的触发条件,网络节点或ECU的运行模式在不同的模式间进行切换,任意一种模式的改变通过回调函数通知上层的应用;
    网络模式至少包括:重复消息状态、普通操作状态、准备睡眠状态。
  5. 如权利要求4所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,所述重复消息状态与普通操作状态相互转化的条件包括:当节点需要网络通信且能够正确收发网络管理消息时,从重复消息状态转化为普通操作状态;当节点收到重复消息状态的网络管理消息或节点本身需要进入重复消息状态时,节点从普通操作状态转化为重复消息状态;
    重复消息状态与准备睡眠状态相互转化的条件包括:
    当重复消息状态的定时时间到并且节点自身不需要网络通信时,从重复消息状态转化为准备睡眠状态;当收到重复消息状态的网络管理消息或节点要求进入重复消息状态,则从准备睡眠状态转化为重复消息状态;
    普通操作状态与准备睡眠状态相互转化的条件包括:节点不需要通信,请求释放总线使,从普通操作状态转化为准备睡眠状态;当节点需要通信,请求总线,则从准备睡眠状态转化为普通操作状态;
    在准备睡眠模式状态下,当网络管理器超时,则从准备睡眠模式切换到总线预睡眠模式,在超过等待的预设时间内若没有被唤醒,则进入总线睡眠模式。
  6. 如权利要求4所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,网络模式还包括跛行状态,当节点在网络模式下的发送错误或接收错误的次数超过阈值,节点将进入跛行状态并在该状态下每隔一段时间重复发送跛行状态信息,若在预设的时间内,该节点发送的消息失败或不能收到网络管理消息,则将该节点错误上报应用层;
    跛行状态与重复消状态、准备睡眠状态、普通操作状态的转化条件包括:
    在重复消息状态定时时间内,节点发送错误达到或者接收错误超过阈值,从重复消息状态转化为跛行状态;在跛行状态下,节点能够正确的发送网络管理消息并且能够收到不带睡眠标志的网络管理消息,从跛行状态转化为重复消息状态;在普通操作状态下,节点发送错误达到或者接收错误超过阈值,从普通操作状态转化为跛行状态;在跛行状态下,节点收到带有睡眠标志的网络管理消息,从跛行状态转化为准备睡眠状态;准备睡眠状态下,节点之前处于跛行状态,并且收到不带睡眠的网络管理消息,从准备睡眠状态转化为跛行状态。
  7. 如权利要求6所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,在跛行状态下,在当网络中的节点不需要总线通信而进入准备睡眠状态后,在网络管理定时器超时之前,继续重复发送带有睡眠标志位的网络管理消息;
    网络中不能正常发送消息的节点收到该睡眠消息时,设置自身也进入准备睡眠状态,其他节点收到该消息后,除登记该节点准备睡眠的信息外,不对网络状态和网络管理定时器做任何修改;
    当网络中的节点都发送带有睡眠标志的网络管理消息时,节点同步进入到总线预睡眠模式。
  8. 如权利要求1所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,包括:OSEK CAN总线下网络管理方法,具体包括:OSEK网络管理使用令牌环机制,令牌从网络地址低的节点传到网络地址高的节点,如果没有更高的节点,就传给最低地址节点;令牌环根据ECU的网络地址建立,每个ECU都会接受网络管理消息,只有和目的地址相同的一个节点才会得到令牌;
    OSEK CAN网络管理器的网络管理模式包括网络模式和网络唤醒,其中,OSEK CAN的网络唤醒包括跛行状态、复位状态、正常状态,当接收错误计算器或发送错误计数器超过阈值后,由正常状态或复位状态转化跛行状态,在跛行状态下,发送且成功接收网络报文后进入复位状态,再转化为正常状态。
  9. 如权利要求8所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,OSEK CAN网络总线的休眠状态包括以下步骤:
    步骤S301,建立逻辑环,
    步骤S302,按照节点建立的逻辑环逐个节点判断节点是否满足休眠条件,若满足,执行步骤S303,若不满足,执行步骤S304;
    步骤S303,满足休眠条件的节点发送“sleel.ind”等于1的ring报文,跳转执行步骤S305;
    步骤S304,不满足休眠条件的节点发送“sleel.ind”等于0的ring报文,跳转执行步骤S302;
    步骤S305,判断逻辑环中的是否所有的节点都满足休眠状态,若都满足休眠状态,执行步骤S306,若不满足休眠状态,则跳转执行步骤S302;
    步骤S306,由判断的节点发送将网络中的报文的睡眠应答位置1并发送到网络中,该节点自身进入睡眠等待状态,并停止发送报文;
    步骤S307,其余节点收到睡眠应答位置为1的网关报文后,立即进入睡眠等待状态,并停止发送报文;
    步骤S308,睡眠等待状态启动定时器;
    步骤S309,定时器到时,进入网络睡眠状态。
  10. 如权利要求1所述的一种包括车载以太网的车内混合网络的睡眠与唤醒方法,其特征在于,还包括:步骤S3,当唤醒条件被触发时,应用层调用总网络管理模块触发时当前网络处于网络模式的指令;
    步骤S4,网络管理协调器触发以太网网络和CAN网络,AUTOSAR协议的触发网络请求,OSEK协调触发唤醒条件;
    步骤S5,AUTOSAR网络管理发起网络唤醒,包括AUTOSAR以太网和AUTOSAR CAN,OSEK CAN网络管理按照其协议发起网络唤醒,建立逻辑环;
    步骤S6,总线网络管理唤醒总线上控制器,唤醒流程结束;
    网络管理协调器触发以太网网络和CAN网络,AUTOSAR协议的触发网络请求,OSEK协调触发唤醒条件;
    OSEK CAN网络管理模式与AUTOSAR网络管理模式一一对应;
    所述OSEK CAN网络唤醒后建立逻辑环过程包括:
    步骤S51,控制器唤醒后想参与网络的节点会先发Alive报文申请加入逻辑环;
    步骤S52,逻辑环建成后,各节点按顺序发Ring报文向后续节点传递“令牌”。
PCT/CN2020/075842 2019-10-31 2020-02-19 一种包括车载以太网的车内混合网络的睡眠与唤醒方法 WO2021082301A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911056477.0A CN110758289B (zh) 2019-10-31 2019-10-31 一种包括车载以太网的车内混合网络的睡眠与唤醒方法
CN201911056477.0 2019-10-31

Publications (1)

Publication Number Publication Date
WO2021082301A1 true WO2021082301A1 (zh) 2021-05-06

Family

ID=69335169

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/075842 WO2021082301A1 (zh) 2019-10-31 2020-02-19 一种包括车载以太网的车内混合网络的睡眠与唤醒方法

Country Status (2)

Country Link
CN (1) CN110758289B (zh)
WO (1) WO2021082301A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113359570A (zh) * 2021-06-30 2021-09-07 一汽奔腾轿车有限公司 一种整车下电后网络替代报文发送系统及发送方法
FR3127054A1 (fr) * 2021-09-14 2023-03-17 Psa Automobiles Sa Architecture de réveil et d’endormissement de calculateurs compatible avec différents types de véhicules automobiles

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110758289B (zh) * 2019-10-31 2021-08-20 上海赫千电子科技有限公司 一种包括车载以太网的车内混合网络的睡眠与唤醒方法
CN113448302A (zh) * 2020-03-27 2021-09-28 北京新能源汽车股份有限公司 一种车辆控制器的控制方法、装置及汽车
CN111404819B (zh) * 2020-03-30 2022-05-27 北京经纬恒润科技股份有限公司 一种基于路由功能的网络控制方法及系统
CN111625282B (zh) * 2020-05-15 2023-07-14 一汽奔腾轿车有限公司 一种基于can总线多子网协同睡眠方法及系统
CN113905344B (zh) * 2020-06-22 2023-06-16 华为技术有限公司 通信方法及装置
CN111885173B (zh) * 2020-07-27 2022-12-30 大陆汽车研发(重庆)有限公司 一种符合autosar架构的ecu及其睡眠/唤醒管理方法
CN112260844A (zh) * 2020-10-21 2021-01-22 王文君 一种混合动力系统的网络管理方法及其管理系统
CN112241164B (zh) * 2020-10-29 2022-02-15 安徽江淮汽车集团股份有限公司 汽车网络休眠测试方法、装置、设备及存储介质
CN112380045B (zh) * 2020-12-03 2022-09-20 安徽江淮汽车集团股份有限公司 车辆异常检测方法、装置、设备及存储介质
CN112615767B (zh) * 2020-12-04 2022-08-12 东风商用车有限公司 一种整车网络管理方法及系统
CN112738160A (zh) * 2020-12-11 2021-04-30 武汉格罗夫氢能汽车有限公司 一种氢能汽车的基于autosar的网络管理系统及方法
CN114710516A (zh) * 2020-12-16 2022-07-05 广州汽车集团股份有限公司 一种车载外部设备的通信状态管理系统及方法
CN114765594A (zh) * 2021-01-04 2022-07-19 广州汽车集团股份有限公司 一种全局车载网络管理方法、系统和车载网关
CN114760610B (zh) * 2021-02-08 2023-04-28 广州汽车集团股份有限公司 多路网络唤醒方法、装置及汽车
CN113037759B (zh) * 2021-03-15 2022-07-22 北京邮电大学 适配autosar汽车电子架构的新鲜度值管理方法及装置
CN113542265B (zh) * 2021-07-13 2023-11-07 深圳南方德尔汽车电子有限公司 局部网络安全管理、装置、计算机设备及存储介质
CN113630746A (zh) * 2021-07-15 2021-11-09 江铃汽车股份有限公司 一种休眠方法、系统、可读存储介质及车辆
CN113993196B (zh) * 2021-10-25 2024-01-30 浙江吉利控股集团有限公司 一种车载以太网的节点控制方法、系统、设备及存储介质
CN114024864B (zh) * 2021-11-17 2023-02-03 中国科学院合肥物质科学研究院 一种基于autosar网络管理的休眠异常检测方法
CN114826795B (zh) * 2022-04-12 2024-01-26 南京芯驰半导体科技有限公司 一种支持唤醒功能的以太网phy系统及实现方法
CN114844711B (zh) * 2022-05-17 2024-04-09 北京经纬恒润科技股份有限公司 一种车载以太网安全状态检测方法和装置
CN114978883B (zh) * 2022-05-20 2023-10-20 中国第一汽车股份有限公司 网络唤醒的管理方法、装置、电子设备及存储介质
CN115042729A (zh) * 2022-06-06 2022-09-13 中国第一汽车股份有限公司 一种基于车载以太网的整车ecu休眠系统及其下电方法
CN115225454B (zh) * 2022-06-06 2024-03-29 广州汽车集团股份有限公司 车辆的异常监控方法、装置、电子设备及存储介质
CN115208792B (zh) * 2022-06-27 2023-11-03 东风汽车集团股份有限公司 基于autosar网络管理的多网段整车CAN网络异常监控方法
CN115460028B (zh) * 2022-08-30 2023-05-12 重庆长安汽车股份有限公司 车载网络休眠管理方法、装置、车载网络系统及车辆
CN115499269B (zh) * 2022-09-22 2023-05-16 重庆长安汽车股份有限公司 多路can通道osek网络管理实现方法、系统、设备及可读介质
CN115776526A (zh) * 2022-11-30 2023-03-10 重庆长安汽车股份有限公司 一种车载诊断报文协议转换控制方法、装置、设备及介质
CN116232969B (zh) * 2023-02-21 2024-05-03 深蓝汽车科技有限公司 网络节点的网络通信状态监测、上报方法及车辆

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302060A (zh) * 2016-07-26 2017-01-04 广州汽车集团股份有限公司 一种整车休眠唤醒方法、系统和汽车can网络网关
WO2017167907A1 (en) * 2016-03-31 2017-10-05 Jaguar Land Rover Limited Communications on vehicle data buses
CN107465588A (zh) * 2017-07-27 2017-12-12 广州汽车集团股份有限公司 多路总线网络的状态控制方法、装置及网络管理系统
CN107612774A (zh) * 2017-09-15 2018-01-19 北京经纬恒润科技有限公司 一种多通道同步睡眠方法及系统
CN110224915A (zh) * 2018-03-01 2019-09-10 上海汽车集团股份有限公司 一种车载混合网络中的局部网络工作方法及系统
CN110758289A (zh) * 2019-10-31 2020-02-07 上海赫千电子科技有限公司 一种包括车载以太网的车内混合网络的睡眠与唤醒方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102882731B (zh) * 2012-10-22 2015-08-05 南京依维柯汽车有限公司 一种商用车can网络管理方法
CN107819736B (zh) * 2016-09-13 2021-12-31 现代自动车株式会社 基于车辆网络中的汽车安全完整性等级的通信方法及设备
KR102524290B1 (ko) * 2017-12-26 2023-04-21 현대자동차주식회사 이더넷 스위치, 차량 내 네트워크 구성 방법 및 차량
CN108933719B (zh) * 2018-06-21 2021-06-04 北京车和家信息技术有限公司 车载can网络管理方法、车载can网络、车辆
CN108900313B (zh) * 2018-06-27 2020-10-27 安徽江淮汽车集团股份有限公司 一种基于can总线的网络管理方法及系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017167907A1 (en) * 2016-03-31 2017-10-05 Jaguar Land Rover Limited Communications on vehicle data buses
CN106302060A (zh) * 2016-07-26 2017-01-04 广州汽车集团股份有限公司 一种整车休眠唤醒方法、系统和汽车can网络网关
CN107465588A (zh) * 2017-07-27 2017-12-12 广州汽车集团股份有限公司 多路总线网络的状态控制方法、装置及网络管理系统
CN107612774A (zh) * 2017-09-15 2018-01-19 北京经纬恒润科技有限公司 一种多通道同步睡眠方法及系统
CN110224915A (zh) * 2018-03-01 2019-09-10 上海汽车集团股份有限公司 一种车载混合网络中的局部网络工作方法及系统
CN110758289A (zh) * 2019-10-31 2020-02-07 上海赫千电子科技有限公司 一种包括车载以太网的车内混合网络的睡眠与唤醒方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113359570A (zh) * 2021-06-30 2021-09-07 一汽奔腾轿车有限公司 一种整车下电后网络替代报文发送系统及发送方法
FR3127054A1 (fr) * 2021-09-14 2023-03-17 Psa Automobiles Sa Architecture de réveil et d’endormissement de calculateurs compatible avec différents types de véhicules automobiles

Also Published As

Publication number Publication date
CN110758289B (zh) 2021-08-20
CN110758289A (zh) 2020-02-07

Similar Documents

Publication Publication Date Title
WO2021082301A1 (zh) 一种包括车载以太网的车内混合网络的睡眠与唤醒方法
CN108933719B (zh) 车载can网络管理方法、车载can网络、车辆
CN107659494B (zh) 数据处理方法及智能车载网关
CN210839611U (zh) 一种包括车载以太网的车内混合网络的睡眠与唤醒装置
CN110830267A (zh) 网络节点的状态控制方法、装置及网关
JP2014525201A (ja) 通信ネットワークにおける電力セーブプロキシ
EP2208124A1 (en) System and method for changing the state of vehicle components
WO2019184455A1 (zh) 信息传输方法、装置、设备及存储介质
CN114363099A (zh) 一种网络管理系统、控制方法、电子控制器及电动汽车
WO2012013057A1 (zh) 一种短信中心集群的控制方法、设备及系统
KR20160146045A (ko) 차량 네트워크에서 통신노드의 동작방법
US20110310859A1 (en) Basic service set scheduling based on media access controller states
CN113993196B (zh) 一种车载以太网的节点控制方法、系统、设备及存储介质
CN111490918B (zh) 车载以太网网络唤醒系统、方法、装置和计算机设备
CN103078756A (zh) 模式切换方法及can网络
KR20100020253A (ko) 차량 네트워크에서의 메시지 전송 상태 진단 장치
JP2004511956A (ja) 節電モードにおける通信ネットワークの駆動方法
CN111885173B (zh) 一种符合autosar架构的ecu及其睡眠/唤醒管理方法
CN113472618A (zh) 一种基于软件的canpn网络管理方法
CN111625282B (zh) 一种基于can总线多子网协同睡眠方法及系统
TWI763136B (zh) 用於多點式網路系統之方法
KR102371990B1 (ko) 차량용 제어기 및 차량용 제어기 전력 제어 방법
CN112565359A (zh) 网络连接方法、系统、车载终端及存储介质
CN110972099A (zh) 一种汽车综合多协议网关及外围设备与传感器互联系统
CN114697154B (zh) 一种休眠和唤醒控制方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20883283

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20883283

Country of ref document: EP

Kind code of ref document: A1