LIN-based network management method, electronic control unit and wake-up manager
By using a wake-up manager in the electronic control unit, the network to be awakened is determined directly based on the LIN wake-up source, and the problem of slow wake-up speed of LIN network in the prior art is solved, and fast and low-power network management is achieved.
Patent Information
- Application Number
- CN202411194560.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-10
AI Technical Summary
In the prior art, the wake-up process based on the LIN network relies on the application layer software for logical judgment, resulting in a slow wake-up speed and cannot meet the demand of application functions in the vehicle for the fast wake-up network.
A network management method based on LIN is designed. Through the electronic control unit and the wake-up manager, the network to be awakened is determined directly based on the LIN wake-up source, and the mapping relationship between the pre-stored wake-up source and the PNC is used to directly initiate the PNC network wake-up request to avoid Application layer logic judgment to improve wake-up speed.
It realizes rapid wake-up of the LIN network, improves the network wake-up speed, reduces energy consumption, and meets the needs of application functions in the vehicle for rapid wake-up.
Smart Images

Figure CN119109719A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to network management technology, and in particular to a network management method, an electronic control unit and a wake-up manager based on LIN. Background Art
[0002] In vehicles, the networks involved include: CAN (Controller Area Network), LIN (Local Interconnect Network) and Ethernet.
[0003] In order to reduce the energy consumption of the vehicle, it is necessary to manage the vehicle network. For example, when the vehicle is not in use, the ECU (Electronic Control Unit) coordinates through a series of control mechanisms to control the vehicle network to enter low-power mode or sleep mode in an orderly manner. At present, the mainstream network management standard is based on the AUTOSAR (Automotive Open System Architecture) network management solution.
[0004] In the LIN network, LIN is divided into master nodes and slave nodes. The slave node cannot actively send information to the master node, and the master node can only realize information exchange through the scheduling table. In the CAN network, there is no master-slave distinction between nodes, and both can independently send messages to realize network wake-up.
[0005] Therefore, limited by the communication mechanism of LIN, the network management of LIN is generally to bind the sleep / wake-up of the LIN network with the ECU power supply or the CAN network. For example, the LIN network is woken up during the ECU power-on initialization phase, and the LIN network is shut down during the ECU power-off process. For another example, the LIN network and the CAN network sleep and wake up at the same time.
[0006] With the increase of vehicle application functions, in some applications, LIN slave nodes are needed to trigger network wake-up. At this time, the ECU (LIN master node) is generally designed to detect the level on the LIN bus. When the wake-up level is detected, the ECU returns to the wake-up state. The awakened ECU communicates with the LIN slave node, receives the signal (data) on the LIN slave node and uploads it to the application layer. The application layer determines the network that needs to be awakened based on the received LIN signal, and sends the network request to the basic software layer to realize the wake-up of the specified network, thereby executing the corresponding function.
[0007] In the above solution, the wake-up based on the LIN network needs to rely on the application layer software to make logical judgments, so there is a problem of slow wake-up speed. Summary of the invention
[0008] In view of this, the present invention provides a LIN-based network management method, an electronic control unit and a wake-up manager, which can quickly wake up the network.
[0009] An electronic control unit compliant with the AUTOSAR architecture according to an embodiment of the present invention is used to manage a vehicle network, comprising: a LIN driver, for instructing a wake-up source check when determining that a wake-up signal exists on a LIN bus; an electronic control unit manager, for performing a wake-up source check to determine a specific LIN wake-up source according to the instruction of the LIN driver; a wake-up manager, for determining PNC information corresponding to the LIN wake-up source according to the LIN wake-up source determined by the electronic control unit manager and a mapping relationship between a pre-stored LIN wake-up source and a local network cluster PNC; and a communication manager, for waking up the network according to the PNC information determined by the wake-up manager; wherein the LIN driver, the electronic control unit manager, the wake-up manager and the communication manager are all located in the basic software layer in the AUTOSAR architecture.
[0010] In some embodiments, the electronic control unit also includes: a LIN communication module located at the basic software layer, used to obtain data reported by the LIN slave node based on a scheduling table; and a software component located at the application layer, used to determine whether to maintain the current network based on the data obtained by the LIN communication module, and when it is determined not to maintain the current network, release the current network through the wake-up manager and the communication manager.
[0011] In some embodiments, the wake-up manager is specifically used to: set a timeout timer to manage the maintenance and release of the network, and start the timeout timer when waking up the network; when the timeout timer times out, send a network release request to the communication manager; and when the software component determines to maintain the current network, reset the timeout timer.
[0012] In some implementations, a network maintenance parameter is used to indicate whether to maintain the current network; the value of the network maintenance parameter is set by the software component; and the wake-up manager determines whether to reset the timeout timer by querying the value of the network maintenance parameter.
[0013] A LIN-based network management method according to an embodiment of the present invention includes: when a wake-up signal is detected on a LIN bus, determining a specific LIN wake-up source; determining corresponding PNC information according to a mapping relationship between the LIN wake-up source and a local network cluster PNC; and waking up the network according to the PNC information.
[0014] In some embodiments, after the network is awakened, the method further includes: obtaining data reported by the LIN slave node based on a scheduling table; determining whether to maintain the current network based on the data reported by the LIN slave node; when it is determined to maintain the current network, maintaining the current network in an awake state; when it is determined not to maintain the current network, controlling the current network to enter a sleep state.
[0015] In some implementations, a network maintenance parameter is set to indicate whether to maintain the current network.
[0016] In some implementations, a timeout timer is used to control the state of the current network; when the timeout timer times out, the current network is controlled to enter a sleep state, and when the timeout timer has not timed out, the LIN network is controlled to remain in an awake state; and based on the network maintenance parameters, it is determined whether to control the timeout timer to re-time.
[0017] A wake-up manager according to an embodiment of the present invention pre-stores a mapping relationship between a LIN wake-up source and a local network cluster PNC in the wake-up manager; when the network is in a dormant state, if there is a valid LIN wake-up source, the wake-up manager determines the PNC information corresponding to the valid LIN wake-up source according to the mapping relationship, and controls the wake-up of the network corresponding to the PNC information according to the PNC information.
[0018] A vehicle network according to an embodiment of the present invention is in a dormant state and includes: a LIN slave node and an electronic control unit as a LIN master node; the LIN slave node sends a wake-up signal to a LIN bus when a predetermined condition is met; the electronic control unit turns on a wake-up monitoring function when in dormancy, and when the wake-up signal is detected, performs a wake-up source detection to determine a specific LIN wake-up source; the electronic control unit determines a network to be awakened based on the LIN wake-up source, and wakes up the network to be awakened.
[0019] In some implementations, the electronic control unit is specifically configured to determine the network to be awakened according to a predefined mapping relationship between a LIN wakeup source and a local network cluster PNC.
[0020] In some implementations, when rain is detected, the LIN slave node sends the wake-up signal to the LIN bus; the mapping relationship is predefined at least based on a network required to implement a function of closing windows when it rains.
[0021] A computer device according to an embodiment of the present invention includes a memory, a processor, and a computer program / instruction stored in the memory, wherein the processor executes the computer program / instruction to implement the method according to the embodiment of the present invention.
[0022] A computer-readable storage medium according to an embodiment of the present invention stores a computer program / instruction thereon, and when the computer program / instruction is executed by a processor, the method described in the embodiment of the present invention is implemented.
[0023] A computer program product according to an embodiment of the present invention includes a computer program / instruction stored therein, and when the computer program / instruction is executed by a processor, the method according to the embodiment of the present invention is implemented.
[0024] Beneficial effects of the embodiments of the present invention:
[0025] In the embodiment of the present invention, the network to be awakened is determined directly based on the LIN wake-up source, for example, based on the correspondence between the predefined LIN wake-up source and the PNC (partial network cluster), and then the network to be awakened is awakened. In this way, the network is directly based on the LIN wake-up source instead of the data reported by the LIN slave node, so there is no need to rely on the application layer software for logical judgment, and the network wake-up can be realized faster. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Other details and advantages of the present invention will become apparent from the detailed description provided below. It should be understood that the following drawings are merely illustrative and thus cannot be considered as limiting the present invention, and the following will be described in detail with reference to the drawings, wherein:
[0027] Figure 1 is a schematic structural diagram of an embodiment of a vehicle network of the present invention;
[0028] Figure 2A It is a schematic diagram of the topology of the LIN network;
[0029] Figure 2B It is a schematic diagram of the scheduling method of LIN;
[0030] Figure 3 It is a schematic structural diagram of an embodiment of an ECU (electronic control unit) of the present invention;
[0031] Figure 4 is a schematic diagram of the architecture of an embodiment of the ECU of the present invention;
[0032] Figure 5 It is a flow chart of an embodiment of a network management method based on LIN of the present invention;
[0033] Figure 6 is a flow chart of another embodiment of the LIN-based network management method of the present invention;
[0034] Figure 7 is a flow chart of another embodiment of the LIN-based network management method of the present invention;
[0035] Figure 8 is a flow chart of another embodiment of the LIN-based network management method of the present invention; and
[0036] Fig. 9 It is a schematic diagram of the structure of an embodiment of a computer device of the present invention, and the computer device can implement each method in the embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and more understandable, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the present invention.
[0038] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. Moreover, the terms "first", "second", etc. are applicable to distinguishing similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present invention described herein can be in an order other than those illustrated or described herein.
[0039] In electric vehicles, the power of the power battery will directly affect the driving range, and the rich application functions in electric vehicles require the deployment of more ECUs (Electronic Control Units), which means more energy consumption. Therefore, in order to minimize the consumption of battery power by ECUs, it is very important to manage the network of many ECUs. Network management generally means that when the vehicle is not in use, the ECU will coordinate through a series of control mechanisms, so as to orderly enter low-power mode or sleep mode to reduce energy consumption.
[0040] like Figure 1 As shown, it is a structural diagram of an embodiment of a vehicle network. The vehicle network includes: ECU0 (with gateway function), ECU1-5 and LIN slave nodes 10-11. Among them, ECU0 and ECU1-5 are connected by CAN bus, and ECU0 and LIN slave nodes 10 and 11 are connected by LIN bus. At this time, ECU0 serves as the LIN master node. In vehicle network management, ECU0 can control the devices in CAN1, CAN2 and LIN1 channels to enter sleep or wake-up state (mode) as needed to achieve the purpose of saving power.
[0041] It should be noted that Figure 1 This is only an example and not a limitation of the embodiments of the present invention. In different network architectures, the vehicle network may have more or fewer nodes, and the buses involved in the vehicle network are not limited to CAN and LIN. Other buses such as FlexRay and Ethernet are commonly used. There are also various ways to connect nodes, not limited to those shown in the figure.
[0042] For the management of vehicle networks, a network management solution based on AUTOSAR (Automotive Open System Architecture) is generally used. In AUTOSAR, a standard middle layer is embedded between the upper-layer software and the underlying hardware platform to achieve the decoupling of software and hardware, which is conducive to improving development efficiency. Specifically, AUTOSAR abstracts software into three layers: application (Application, App) layer, runtime environment (Runtime Environment, RTE) layer and basic software (Basic Software, BSW) layer. Among them, the BSW layer contains many services, such as storage services (Memory Services), encryption services (Crypto Services) and communication services (Communication Services). Communication services can also include: CAN network management, LIN network management, Ethernet network management and FlexRay network management, etc.
[0043] For network management, AUTOSAR uses the PNC (Partial Network Cluster) mechanism, which can selectively turn on / off a group of specified ECUs based on functional communication requirements, thereby achieving energy saving. Specifically, the communication requirements when executing application layer functions can be associated with PNC, so when executing the function, only the corresponding PNC needs to be requested to wake up the required ECU. For example, taking the electric vehicle charging function as an example, only some ECUs related to the charging function need to be woken up, while other ECUs not related to charging can enter a dormant state. Figure 1 For example, assuming that the electric vehicle needs to wake up ECU4 and ECU5 and LIN slave nodes 10 and 11 when charging, it is only necessary to configure the corresponding PNC 1 to include the above channels CAN2 and LIN1.
[0044] For CAN network management, Ethernet network management, and FlexRay network management, there is no master-slave distinction between nodes on the bus, and all nodes can send messages independently. Therefore, ECU requests for PNC network and receives PNC network requests from other ECUs are all implemented through NM (Network Management) messages. Taking CAN NM messages as an example, 8 bytes of data are usually allocated to NM messages, including SNI (Source Node ID), CBV (Control Bit Vector) and user data (User Data), where user data is user-defined content. When using PNC, all or part of the user data is defined as PNC information. Figure 1 For example, when the predetermined conditions are met, ECU1-5 can send NM messages to ECU0, and carry PNC information in the NM messages. ECU0 can wake up the relevant network based on the PNC information in the received NM messages.
[0045] However, for LIN network management, there is no similar NM message, which is related to the communication mechanism of LIN itself. Figure 2A As shown in the figure, it is a schematic diagram of the network topology of LIN. Figure 2A In the LIN bus, there is only one LIN master node (for example, Figure 1 ECU0), and n LIN slave nodes, n is generally less than 16. Among them, the LIN slave node cannot actively send information to the master node, and the master node can only realize information exchange through the scheduling table. When the LIN network is in sleep state, the LIN bus presents a recessive level for a long time. At this time, if the LIN slave node has communication needs, the LIN slave node can send a dominant level lasting 250μs to 5ms to the LIN bus. The remaining nodes (except the nodes that send wake-up signals) use a threshold greater than 150μs to determine the wake-up signal. When the LIN master node detects that there is a valid wake-up signal on the bus, it generally notifies the LIN driver through an interrupt to start the wake-up source detection. After that, the LIN master node can start the scheduling table to schedule the LIN slave node to send data. Among them, the scheduling mechanism of LIN can refer to Figure 2B As shown, Figure 2B As shown, the LIN master node first sends a frame header to the LIN bus. After receiving the frame header, the LIN slave node 1 parses it. When the frame header indicates that the LIN slave node 1 responds, the LIN slave node 1 sends the corresponding response (Response, i.e., the data to be sent) to the LIN bus.
[0046] Due to the limitation of LIN communication mechanism, there is no NM message carrying PNC information in LIN network, so the wake-up and sleep of LIN network can be bound to power supply or CAN network, that is to say, LIN is not the initiator of network wake-up and sleep, but only a follower. However, with the increase of application functions in vehicles, there is a need to wake up the network from LIN slave node in some applications, such as the automatic window closing function when rain falls. After the vehicle stops, when the rain sensor on LIN slave node detects rain signal, it will trigger the execution of automatic window closing function. At this time, the following mechanism can be generally adopted:
[0047] 1. The LIN slave node sends a wake-up signal to the LIN bus, that is, the LIN bus is set to a dominant level and lasts for 250μs to 5ms.
[0048] 2. For example Figure 3 As shown, when the ECU host 301 in the ECU 3 as the LIN master node detects a valid wake-up level on the LIN bus, the ECU 3 is restored from the sleep state to the wake-up state.
[0049] 3. Based on the scheduling table, the ECU receives the signal (data) from the LIN slave node and reports it to the ECU application 302.
[0050] 4. The ECU application 302 analyzes the reported signal and determines that the signal indicates rain. Then the ECU application layer determines which nodes are required to cooperate in completing the function of closing windows when it rains, that is, determines the PNC information corresponding to the function of closing windows when it rains.
[0051] 5. Based on the PNC information, the ECU application 302 calls the ECU host 301 to open the network corresponding to the PNC, and then executes automatic window closing when it rains.
[0052] In the above mechanism, the ECU application is required to make logical judgments (ie, to analyze which networks to wake up based on the data obtained from the scheduling LIN slave node), so there is a problem of slow wake-up speed.
[0053] Based on this, in the scheme of the embodiment of the present invention, considering that there are not many demands for LIN slave nodes to wake up the network, and the network channels required for the LIN slave node functions to be realized can be known in advance, the PNC information corresponding to the specific LIN channel (LIN wake-up source) can be pre-defined. In this way, a PNC network wake-up request can be directly initiated based on the LIN wake-up source without the need for logical judgment at the application layer, which can significantly improve the wake-up speed.
[0054] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0055] like Figure 4, which is a schematic diagram of the structure of an embodiment of the ECU of the present invention. The ECU of the embodiment of the present invention includes a hardware layer and a software layer above the hardware layer, and the software layer further includes: an application layer, an RTE layer, and a BSW layer. Therefore, the ECU complies with the AUTOSAR architecture specification. Figure 4 The ECU may be a gateway, a central computing unit, an HPC (High Performance Computer), a domain controller, a regional controller, etc. in a vehicle, without limitation herein.
[0056] The application layer is responsible for processing specific application logic, which contains software components (SWC) of various applications, such as driver assistance systems, in-vehicle entertainment systems, etc. It implements specific functional requirements by calling the services of the next layer.
[0057] The RTE layer, located between the application layer and the BSW layer, is the key to implementing the AUTOSAR Virtual Function Bus (VFB) interface. RTE provides infrastructure services for communication between application software and facilitates access to basic software components including the operating system (OS). It is responsible for managing communication between software components (SWCs) and ensuring that information can be accurately and efficiently transmitted between different software components or basic software (BSW).
[0058] The BSW layer provides basic services for the application layer, such as reusable, scalable and reliable basic software functions to meet the needs of different automobile manufacturers. This layer interacts with the application by providing some core modules, such as communication modules, diagnostic modules, operating system modules, etc., and provides common functions such as network communication, fault diagnosis, task management, etc., so that developers can focus more on application development without paying too much attention to the underlying hardware and communication details.
[0059] exist Figure 4 In the figure, some basic software modules in the BSW layer are shown as examples, including but not limited to: COMM (COMMunication Manager), ECUM (ECU Manager), LIN driver (LINDriver), COM (Communication) module, LINIF (Local Interconnect NetworkInterface) and WUM (Wake UP Manager), etc.
[0060] exist Figure 4In the BSW layer of , except for WUM, all other modules are standard modules in AUTOSAR, and their related functions and usage methods can refer to the relevant standards of AUTOSAR. WUM is a non-standard AUTOSAR module, which is introduced to implement the solution of this embodiment and will be explained in detail below. Of course, it can be understood that the related functions of WUM can also be implemented in other standard AUTOSAR modules, such as COMM.
[0061] Specifically, when the ECU is in a dormant state, it will start the wake-up monitoring function to monitor whether there is a valid wake-up signal on the LIN bus. For example, the transceiver or controller in the hardware layer of the ECU will monitor the level change on the LIN bus. When a valid wake-up signal is detected on the LIN bus, the relevant status register is set to indicate whether there is a valid wake-up signal on the LIN bus.
[0062] The LIN driver is used to instruct the wake-up source check when it is determined that there is a valid wake-up signal on the LIN bus. When the ECU enables the wake-up interrupt function, the transceiver or controller will trigger an interrupt to notify the LIN driver that there is a valid wake-up signal on the bus after detecting the valid wake-up signal; if the ECU does not enable the wake-up interrupt function, the LIN driver can periodically poll the relevant status register on the LIN transceiver or controller to determine whether there is a valid wake-up signal on the bus.
[0063] For example, the LIN driver can notify ECUM to do a wakeup source check by calling the EcuM_CheckWakeup() function.
[0064] ECUM is used to perform a wakeup source check according to the instruction of the LIN driver to determine the specific LIN wakeup source, wherein the wakeup source refers to a specific LIN channel (bus).
[0065] In some implementations, after completing the wake-up source detection, the ECUM may call the WUM_EcuM_WakeUpIndication() function to notify the WUM that there is a valid remote wake-up source.
[0066] WUM is used to determine the PNC information corresponding to the LIN wake-up source according to the LIN wake-up source determined by ECUM and the pre-stored mapping relationship between the LIN channel and the PNC (Partial Network Cluster).
[0067] The mapping relationship between the LIN channel and the PNC may be as shown in Table 1, for example:
[0068] Table 1:
[0069] Wake-up source PNC LIN1 1 LIN2 3
[0070] In this embodiment, all the requirements for waking up the network from the LIN slave node and the information of the network channels required to implement the functions corresponding to these requirements can be counted in advance, and then based on this information, the PNC information corresponding to the specific LIN channel can be clarified to generate the above-mentioned mapping relationship table. In this way, the PNC network wake-up operation can be directly initiated in the WUM without the participation of the application layer.
[0071] In some implementations, after determining the PNC information, the WUM directly initiates a PNC request to the COMM through the COMM_RequestCOMMode() function.
[0072] COMM is used to wake up the network according to PNC information. The corresponding relationship between PNC and network (channel) is pre-stored in COMM, for example, as shown in Table 2.
[0073]
[0074] As shown in Table 2, the PNC network request sent by WUM obtained by COMM contains not only LIN channels but also CAN channels and Ethernet channels. CAN and Ethernet are processed according to the standard wake-up process in AUTOSAR, which will not be described in detail in this invention. The following is a brief description of the process of waking up the LIN network:
[0075] 1. When the PNC network request obtained by COMM contains the LIN channel, COMM first switches the LIN channel network state to "COMM_FULL_COMMUNICATION", and then calls the LinSM_RequestCOMMode() function to send a LIN channel communication mode request to LINSM (Local Interconnect Network State Manager).
[0076] 2. When LINSM obtains the LIN channel communication mode request from COMM, it directly calls the LinIf_Wakeup() function to LINIF to start the LIN channel wake-up process.
[0077] 3. After LINIF obtains the LINSM wake-up request, it directly calls the Lin_Wakeup() function to request the LIN driver to send a wake-up signal to the LIN bus.
[0078] 4. After receiving the wake-up request sent by LINIF, the LIN driver sets the LIN channel state to "LIN_CH_OPERATIONAL" and configures the wake-up character in the LIN buffer data register (BDR), such as BDR[data1]=F0.
[0079] 5. The LIN transceiver / controller sends a wake-up signal to the LIN bus, where the wake-up signal is a dominant level lasting 250μs to 5ms.
[0080] 6. When the LIN wake-up signal is sent successfully, the LIN driver notifies LINIF through the return value of the Lin_Wakeup() function, LINIF notifies LINSM through the confirmation function LinSM_WakeupConfirmation(), and LINSM notifies COMM through the function COMM_BusSM_ModeIndication().
[0081] 7. After COMM receives the notification from the COMM_BusSM_ModeIndication() function, it calls the BSWM_COMM_CurrentMode() function to notify BSWM that the LIN channel is currently in the "COMM_FULL_COMMUNICATION" state.
[0082] In this embodiment, the network is directly awakened based on the LIN wake-up source, thereby eliminating the need for logical judgment of the application layer software and improving the wake-up speed.
[0083] In some implementations, the awakening may be a false awakening. In this embodiment, the false awakening problem can be solved by:
[0084] After the LIN network is awakened, the LIN communication module located in the BSW layer is used to obtain the data reported by the LIN slave node based on the scheduling table and send the reported data to the SWC in the application layer.
[0085] The above-mentioned LIN communication module is a general term for a series of modules in the BSW layer. For example, the LIN communication module may involve LINIF, LIN driver, PDUR and COM, etc. For those skilled in the art, how to schedule the data of the LIN slave node after the LIN network is awakened is familiar, so it will not be repeated here.
[0086] The SWC in the application layer determines whether to maintain the current network based on the data obtained by the LIN communication module. When it is determined not to maintain the current network, the current network is released through WUM and COMM.
[0087] For example, if the SWC finds that the data reported by the LIN slave node is a signal that it is not raining, the SWC can determine that the current network does not need to be maintained and the current wakeup may be a false wakeup. At this time, the network can be switched back to sleep mode.
[0088] In some implementations, the SWC may inform the WUM whether to maintain the current network by setting a network maintenance parameter, and the SWC sets the value of the network maintenance parameter based on data reported by the LIN slave node.
[0089] In some embodiments, WUM can manage the maintenance and release of the current network through a timeout timer. Specifically, the default value of the network maintenance parameter can be set to 0 to indicate that the current network does not need to be maintained. When the network wakes up, WUM starts a timeout timer, and before the timeout timer times out, WUM maintains the current network; when the timeout timer times out, WUM sends a network release request to COMM to switch the network back to sleep. In this way, when SWC confirms that it is not necessary to maintain the current network, the network maintenance parameter is kept at the default value, so that WUM will release the network when the timer times out. When SWC confirms that it is necessary to maintain the current network, the value of the network maintenance parameter is set to 1, so that when WUM finds that the value of the network maintenance parameter is 1, it will reset the timer to avoid releasing the network. Among them, the period of WUM querying the network maintenance parameter is less than the timing duration of WUM.
[0090] In this embodiment, by setting the network maintenance parameters and the timeout timer, the management of network maintenance and release can be achieved, and the problem of false awakening can be quickly solved. Specifically, when the network is falsely awakened, when WUM starts the timeout timer, since SWC will not modify the value of the network maintenance parameter at this time, WUM will switch the network to a dormant state when the timeout timer times out.
[0091] like Figure 5 FIG. 1 is a flow chart of an embodiment of a LIN-based network management method of the present invention. The method can be applied to an ECU, and the method includes:
[0092] Step S50: When it is determined that there is a wake-up signal on the LIN bus, a specific LIN wake-up source is determined.
[0093] Step S52: determining corresponding PNC information according to the pre-stored mapping relationship between the LIN wakeup source and the PNC; and
[0094] Step S54: Wake up the network according to the PNC information.
[0095] In this embodiment, by pre-storing the mapping relationship between the LIN wake-up source and the PNC, the network is directly awakened based on the detected LIN wake-up source. This method does not require the application layer to make logical judgments, and can improve the network wake-up speed.
[0096] like Figure 6 FIG. 1 is a flow chart of another embodiment of a LIN-based network management method of the present invention, which includes:
[0097] Step S60: By Figure 5 The method of an embodiment wakes up the network.
[0098] Step S62: Based on the scheduling table, obtain the data reported by the LIN slave node.
[0099] Step S64: Determine whether to maintain the current network according to the data of the LIN slave node wake-up. If the determination result is yes, execute step S66, and if the determination result is no, execute step S68.
[0100] Step S66: When it is determined to maintain the current network, maintaining the LIN network in the awake state;
[0101] Step S68: When it is determined that the current network is not to be maintained, the LIN network is controlled to enter a dormant state.
[0102] like Figure 7 FIG. 1 is a flow chart of another embodiment of a LIN-based network management method of the present invention, which includes:
[0103] Step S70: By Figure 5 The method of the embodiment wakes up the network and starts a timeout timer.
[0104] Step S71: based on the scheduling table, obtaining data reported by the LIN wake-up source, and setting the value of the network maintenance parameter based on the obtained data.
[0105] Step S72: Determine whether the value of the network maintenance parameter indicates that the network is to be maintained. If yes, execute step S73; if no, execute step S74.
[0106] Step S73: The timeout timer is reset.
[0107] Step S74: Determine whether the timeout timer has timed out. If so, execute step S75; if not, wait for the timeout timer to time out.
[0108] Step S75: Control the LIN network to enter a dormant state.
[0109] In this embodiment, the management of network maintenance and release is achieved through the timeout timer and the network maintenance parameter. In addition, this method can quickly solve the problem of false wake-up.
[0110] It should be noted that Figures 5 to 6 Most of the details of the method embodiments are already in Figure 4 The two can be understood in combination in the described embodiments shown, and the details are not repeated here.
[0111] Combine the following Figure 8 , a detailed embodiment of the present invention is illustrated.
[0112] like Figure 8 As shown, the LIN-based network management process of the embodiment of the present invention includes:
[0113] Step 1: When the ECU (LIN master node) enters sleep mode, the (remote) wake-up monitoring function is turned on, that is, the transceiver or controller on the ECU will monitor the level changes on the LIN bus. When the ECU transceiver or controller detects a valid wake-up signal on the LIN bus, it will set the relevant status register, such as LINSR[WUF] (LIN State Register WakeUP Flag) = 1, to indicate whether there is a valid wake-up signal on the LIN bus.
[0114] Step 2: When the ECU enables the wake-up interrupt function, the transceiver or controller detects a valid wake-up signal and triggers an interrupt to notify the LIN driver, indicating that there is a valid wake-up signal on the bus. If the ECU does not enable the wake-up interrupt function, the LIN driver can also periodically poll the LINSR[WUF] register on the LIN transceiver or controller to determine whether there is a valid wake-up signal on the bus.
[0115] Step 3: When the LIN driver obtains the wake-up interrupt notification or LINSR[WUF]=1, it notifies ECUM to perform a wake-up source check by calling the EcuM_CheckWakeup() function to determine the specific wake-up source.
[0116] Step 4: When ECUM completes the wakeup source check, it notifies WUM that there is a valid remote wakeup source by calling the WUM_EcuM_WakeUpIndication() function.
[0117] Step 5: WUM maps the acquired wake-up source to the corresponding PNC information, and then directly initiates a PNC request to COMM through the COMM_RequestCOMMode() function, and starts the timer WUT (the timer time can be customized, such as 5 seconds). That is, network wake-up is directly initiated in WUM.
[0118] Step 6: There is a mapping relationship between PNC and network channels in COMM. The channels included in PNC are configured according to specific functions. If COMM obtains that the PNC network request sent by WUM contains not only LIN channels but also CAN channels and Ethernet channels, CAN and Ethernet are processed according to the standard wake-up process in AUTOSAR, which will not be repeated here.
[0119] When the PNC network request obtained by COMM contains the LIN channel, COMM first switches the LIN channel network state to "COMM_FULL_COMMUNICATION", and then calls the LinSM_RequestCOMMode() function to send a LIN channel communication mode request to LINSM.
[0120] Step 7: After LINSM obtains the COMM communication mode request, it directly calls the LinIf_Wakeup() function to LINIF to start the LIN channel wake-up process.
[0121] Step 8: After LINIF obtains the LINSM wake-up request, it directly calls the Lin_Wakeup() function to request the LIN driver to send a wake-up signal to the LIN bus.
[0122] Step 9: After receiving the wake-up request sent by LINIF, the LIN driver sets the LIN channel state to "LIN_CH_OPERATIONAL" and configures the wake-up character in the LIN buffer data register (BDR), such as BDR[data1]=F0.
[0123] Step 10: The LIN transceiver / controller sends a wake-up signal to the LIN bus, wherein the wake-up signal is a dominant level lasting 250 μs to 5 ms.
[0124] When the LIN wake-up signal is sent successfully, the LIN driver notifies LINIF through the return value of the Lin_Wakeup() function, LINIF notifies LINSM through the confirmation function LinSM_WakeupConfirmation(), and LINSM notifies COMM through the function COMM_BusSM_ModeIndication().
[0125] Step 11: After COMM receives the notification from the COMM_BusSM_ModeIndication() function, it calls the BSWM_COMM_CurrentMode() function to notify BSWM that the LIN channel is currently in the "COMM_FULL_COMMUNICATION" state.
[0126] Step 12: After BSWM obtains the "COMM_FULL_COMMUNICATION" status of the LIN channel, it makes a decision based on the rules and sends a schedule request to LINSM through the function LinSM_ScheduleRequest().
[0127] Step 13: When LINSM obtains the BSWM schedule request, it directly calls LinIf_ScheduleRequest() to initiate a schedule opening request to LINIF.
[0128] Step 14: When LINIF obtains the LINSM schedule table request, it opens the specified schedule table and sends a request Lin_SendFrame() to the LIN driver according to the content and timing in the schedule table.
[0129] Step 15: After the LIN driver obtains the information (such as frame ID, transmission direction and data segment length) transmitted by LINIF through the Lin_SendFrame() function, it configures the relevant function registers in the controller such as the buffer identification registers BIDR[ID], BIDR[DTD] and BIDR[DFL], where ID refers to the LIN message ID, DIR refers to the message transmission direction (Data TransmitDirection) and DFL refers to the data segment length (Data Field Length).
[0130] Step 16: The LIN controller and transceiver convert the information in the function register into a level signal and send it to the LIN bus. When the LIN slave node receives the frame ID, it parses it and decides to send a response message to the LIN bus. When the host node completes receiving the slave node response, it sets the controller status register LINSR[DRF] = 1 to indicate whether the data has been received.
[0131] Step 17: LINIF obtains the message receiving status in the LIN driver through the Lin_GetStatus() function. When the function return value is "LIN_RX_OK", it means that the correct slave node response has been received.
[0132] Step 18: LINIF notifies PDUR (Protocol Data Unit Router) through the PDUR_RxIndication() function that PDU (Protocol Data Unit) is received from the underlying LINIF.
[0133] Step 19: PDUR notifies COM through the Com_RxIndication() function that it has received the PDU from the underlying PDUR.
[0134] Steps 20 and 21: COM splits the received PDU into signals and calls the function Rte_COMCbk() to notify the software component (SWC) that a new signal has been received.
[0135] In steps 22 and 23, the software component decides whether to maintain the current network based on the acquired signal value. If the software component needs to maintain the current network based on functional requirements, the bit corresponding to PNC in the function SWC_WUM_KeepNetwork() parameter is set to 1; if the software component does not need to maintain the current network based on functional requirements or the related functions have been executed and the network can be released, the bit corresponding to PNC in the function SWC_WUM_KeepNetwork() parameter is set to 0; the default value of the bit corresponding to PNC in the function SWC_WUM_KeepNetwork() parameter is 0. WUM will periodically obtain the network maintenance status from the software component, where the period should be less than the timer WUT value.
[0136] Step 24: When WUM obtains the corresponding bit of PNC as 1 from SWC_WUM_KeepNetwork(), WUT restarts the timing and the network will remain in the awake state; when WUM obtains the corresponding bit of PNC as 0 from SWC_WUM_KeepNetwork(), WUT continues timing until it times out. When WUT times out, WUM sends a network release request to COMM through the function COMM_RequestCOMMode().
[0137] Step 25: After receiving the WUM network release request, COMM sets the LIN channel status to "COMM_NO_COMMUNICATION" and calls the function LinSM_RequestCOMMode() to request LINSM to switch to no communication mode.
[0138] Step 26: LINSM receives the no-communication mode request and calls the Linif_GotoSleep() function to request LINIF to start the sleep mode transition for the LIN channel.
[0139] Step 27: LINIF calls the Lin_GoToSleep() function to notify the LIN driver to send a sleep command to the LIN bus.
[0140] Step 28: After the LIN driver receives the Lin_GoToSleep() function notification, it configures the LIN control register LINCR[Sleep] = 1, and writes BIDR[ID] = 3C to the buffer identifier register (BIDR), and writes BDR[data1] = 00, BDR[data2] = FF, BDR[data3] = FF, BDR[data4] = FF, BDR[data5] = FF, BDR[data6] = FF, BDR[data7] = FF, BDR[data8] = FF to the buffer data register (BDR).
[0141] Step 29: The LIN controller and transceiver convert the sleep command in the register into a level signal and send it to the LIN bus. When the sleep command is sent, the LINIF mode switches to the sleep state, and switches the schedule table to an empty table, that is, closes the schedule table. LINIF notifies LINSM through the LinSM_GotoSleepConfirmation() function, LINSM notifies COMM through the COMM_BusSM_ModeIndication() function, and COMM notifies BSWM through the BSWM_COMM_CurrentMode() function. At this point, the LIN channel enters sleep, and the sleep state of the LIN channels in each module is also completed synchronously.
[0142] like Fig. 9 , is a schematic diagram of the structure of an embodiment of a computer device 9 of the present invention, which includes: a memory 90, a processor 92 and a computer program / instruction stored in the memory 90, and the processor 90 executes the computer program / instruction to implement the method described in the embodiment of the present invention.
[0143] In addition, an embodiment of the present invention further relates to a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the method described in the embodiment of the present invention is implemented.
[0144] In addition, an embodiment of the present invention further relates to a computer program product, including a computer program / instruction stored therein, and when the computer program / instruction is executed by a processor, the method described in the embodiment of the present invention is implemented.
[0145] The description of the above device, storage medium and program product embodiments is similar to the description of the above method and other embodiments, and has similar beneficial effects as the method and other embodiments. For technical details not disclosed in the device, storage medium and program product embodiments of this application, please refer to the description of the method and other embodiments of this application for understanding.
[0146] The processor may be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, a microprocessor, etc. It is understandable that the electronic device that implements the function of the processor may also be other, and the embodiments of the present application are not specifically limited.
[0147] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0148] It should be noted that the above description is only for example and not for limitation of the present invention. In other embodiments of the present invention, the method may have more, fewer or different steps, and the order, inclusion and function of each step may be different from that described and illustrated. For example, generally multiple steps can be combined into a single step, and a single step can also be divided into multiple steps. For those of ordinary skill in the art, without paying creative work, the sequential changes of each step are also within the scope of protection of the present invention.
[0149] The technical solution of the present invention, in essence or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor or a microcontroller to perform all or part of the steps of the method described in each embodiment of the present invention.
[0150] Those skilled in the art will appreciate that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed.
[0151] Although the present invention has been disclosed as above with preferred embodiments, the present invention is not limited thereto. Any changes and modifications made by any person skilled in the art without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention, and therefore the protection scope of the present invention should be subject to the scope defined by the claims.
Claims
1. An electronic control unit compliant with the AUTOSAR architecture for managing a vehicle network, characterized in that: include: A LIN driver, for instructing to perform a wake-up source check when it is determined that a wake-up signal is present on the LIN bus; an electronic control unit manager, configured to perform a wakeup source check to determine a specific LIN wakeup source according to the instruction of the LIN driver; A wake-up manager, configured to determine the PNC information corresponding to the LIN wake-up source according to the LIN wake-up source determined by the electronic control unit manager and a pre-stored mapping relationship between the LIN wake-up source and the local network cluster PNC; as well as A communication manager, configured to wake up the network according to the PNC information determined by the wake-up manager; The LIN driver, the electronic control unit manager, the wake-up manager and the communication manager are all located in the basic software layer of the AUTOSAR architecture.
2. The electronic control unit according to claim 1, characterized in that: Also includes: A LIN communication module located in the basic software layer, used for acquiring data reported by a LIN slave node based on a scheduling table; as well as The software component located at the application layer is used to determine whether to maintain the current network according to the data obtained by the LIN communication module, and when it is determined not to maintain the current network, release the current network through the wake-up manager and the communication manager.
3. The electronic control unit according to claim 2, characterized in that: The wake-up manager is specifically used for: Setting a timeout timer to manage the maintenance and release of the network, and starting the timeout timer when waking up the network; When the timeout timer times out, sending a network release request to the communication manager; as well as When the software component of the application layer determines to maintain the current network, the timeout timer is reset.
4. The electronic control unit according to claim 3, characterized in that: Indicating whether to maintain the current network through a network maintenance parameter; The value of the network maintenance parameter is set by a software component of the application layer; The wake-up manager determines whether to reset the timeout timer by acquiring the value of the network maintenance parameter.
5. A network management method based on LIN, characterized in that: include: When a wake-up signal is detected on the LIN bus, a specific LIN wake-up source is determined; Determine corresponding PNC information according to the mapping relationship between the LIN wake-up source and the local network cluster PNC; and The network is awakened according to the PNC information.
6. The LIN-based network management method according to claim 5, characterized in that: After the network is awakened, the method further includes: Based on the scheduling table, obtain the data reported by the LIN slave node; Determining whether to maintain the current network based on the data reported by the LIN slave node; When it is determined to maintain the current network, the current network is maintained in an awake state; When it is determined that the current network is not to be maintained, the current network is controlled to enter a dormant state.
7. The LIN-based network management method according to claim 6, characterized in that: A network maintenance parameter is set to indicate whether to maintain the current network.
8. The LIN-based network management method according to claim 7, characterized in that: Control the current network status through a timeout timer; When the timeout timer times out, control the current network to enter a dormant state, and when the timeout timer does not time out, control the LIN network to maintain an awake state; as well as Based on the network maintenance parameter, it is determined whether to control the timeout timer to be re-timed.
9. A wake-up manager, characterized in that: Pre-storing a mapping relationship between a LIN wakeup source and a local network cluster PNC in the wakeup manager; When the network is in a dormant state, if there is a valid LIN wake-up source, the wake-up manager determines the PNC information corresponding to the valid LIN wake-up source according to the mapping relationship, and controls the wake-up of the network corresponding to the PNC information according to the PNC information.
10. A vehicle network, the vehicle network being in a dormant state, and the vehicle network comprising: LIN slave node and an electronic control unit as a LIN master node; characterized in that, The LIN slave node sends a wake-up signal to the LIN bus when a predetermined condition is met; The electronic control unit starts a wake-up monitoring function when in sleep mode, and performs a wake-up source detection when the wake-up signal is detected to determine a specific LIN wake-up source; The electronic control unit determines a network to be awakened according to the LIN wake-up source, and wakes up the network to be awakened.
11. The vehicle network according to claim 10, characterized in that The electronic control unit is specifically configured to determine the network to be awakened according to a predefined mapping relationship between a LIN wakeup source and a local network cluster PNC.
12. The vehicle network according to claim 11, characterized in that When the LIN slave node detects rain, the LIN slave node sends the wake-up signal to the LIN bus; The mapping relationship is predefined at least based on a network required to implement the function of closing windows when it rains.
13. A computer device comprising a memory, a processor and a computer program / instruction stored in the memory, characterized in that: The processor executes the computer program / instructions to implement the method of any one of claims 5 to 8.
14. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 5 to 8 is implemented.
15. A computer program product, comprising a computer program / instruction stored therein, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 5 to 8 is implemented.
Citation Information
Cited By
Low-power-consumption LIN frame wake-up system, method and equipment
CN119583249A
A low-power LIN frame wake-up system, method and device
CN119583249B
Vehicle sleep wake-up management method and device, medium and electronic equipment
CN119882666A
