Vehicle and control method thereof
By designing a data storage coordination mechanism between the first ECU and the second ECU in the vehicle, the problem of the slave ECU stopping caused the slave ECU to not complete data storage is solved, and the complete storage of log data and the normal stop of the ECU are achieved.
Patent Information
- Application Number
- CN202311599727.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2025-05-27
AI Technical Summary
The problem of data storage of the slave ECU not completing due to the stop of the master ECU.
A vehicle is designed, including a main relay, a first ECU and a second ECU. The first ECU detects whether the predetermined action is completed and sends a data storage instruction to the second ECU at the end of the action. After the storage of log data is completed, the second ECU sends a data saving completion message to the first ECU, and the first ECU closes the main relay after receiving the message.
Make sure to stop the ECU after the log data is saved, thereby avoiding log data loss.
Smart Images

Figure CN120039207A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle control, and in particular, to a vehicle and a control method thereof. Background Art
[0002] In the prior art, in order to save the production cost of the whole vehicle, the functions of some ECUs are usually streamlined in the vehicle. These ECUs can be called slave ECUs. The startup and stop of the slave ECUs depend on other ECUs, which can be called master ECUs. That is to say, there is no startup and stop processing logic in the slave ECUs, and the master ECUs' processing logic is used to start and stop the slave ECUs.
[0003] However, after a certain action of the vehicle ends, since the master ECU stops and the slave ECUs also stop accordingly, the slave ECUs fail to complete data saving. Summary of the Invention
[0004] In view of this, an embodiment of the present invention provides a vehicle to solve the technical problem that the slave ECUs fail to complete data saving due to the stop of the master ECU.
[0005] To achieve the above object, according to one aspect of the embodiments of the present invention, an embodiment of the present invention provides a vehicle, including:
[0006] A main relay;
[0007] A first ECU, configured to detect whether a predetermined action ends, and in response to detecting that the predetermined action has ended, send a data saving instruction to a second ECU; in response to receiving a data saving completion message sent by the second ECU, determine whether the log data of the first ECU is saved; in response to the log data of the first ECU being saved, control the main relay to close;
[0008] A second ECU, configured to, in response to receiving the data saving instruction sent by the first ECU, determine whether the log data of the second ECU is saved; in response to the log data of the second ECU being saved, send a data saving completion message to the first ECU.
[0009] Optionally, the first ECU is further configured to detect whether the predetermined action starts, and in response to detecting that the predetermined action has started, control the main relay to turn on.
[0010] Optionally, the first ECU is further configured to control the operation of the vehicle drive.
[0011] Optionally, the second ECU is further configured to control the operation of the auxiliary machine according to the instruction of the first ECU.
[0012] Optionally, the vehicle is a fuel cell vehicle, the auxiliary machine includes a drainage system, and the predetermined action is a parking drainage action.
[0013] Optionally, the vehicle further includes a storage battery connected to the main relay. The first ECU and the second ECU are connected in parallel and connected to the storage battery through the main relay.
[0014] Optionally, the first ECU sends a data saving instruction to the second ECU through a hard wire or a CAN line.
[0015] Optionally, the second ECU sends a data saving completion message to the first ECU through a hard wire or a CAN line.
[0016] In addition, according to another aspect of the embodiments of the present invention, the embodiments of the present invention further provide a control method for the vehicle in any of the above embodiments, including:
[0017] The first ECU detects whether the predetermined action is ended. In response to detecting that the predetermined action has ended, the first ECU sends a data saving instruction to the second ECU.
[0018] In response to receiving the data saving instruction sent by the first ECU, the second ECU determines whether the log data of the second ECU has been saved completely.
[0019] In response to the log data of the second ECU being saved completely, the second ECU sends a data saving completion message to the first ECU.
[0020] In response to receiving the data saving completion message sent by the second ECU, the first ECU determines whether the log data of the first ECU has been saved completely.
[0021] In response to the log data of the first ECU being saved completely, the first ECU controls the main relay to turn off.
[0022] Optionally, before the first ECU sends a data saving instruction to the second ECU in response to detecting that the predetermined action has ended, it further includes:
[0023] The first ECU detects whether the predetermined action starts. In response to detecting that the predetermined action has started, the first ECU controls the main relay to turn on.
[0024] Since the first ECU sends a data saving instruction to the second ECU after detecting that the predetermined action has ended, and controls the main relay to turn off after the log data of the second ECU has been saved completely, the embodiments of the present invention can ensure that the ECU stops after the log data has been saved completely, thereby avoiding loss of log data.
[0025] The further effects of the above non-conventional alternative manners will be described below in conjunction with specific embodiments. Brief Description of the Drawings
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0027] Figure 1 is a schematic structural diagram of a vehicle according to an embodiment of the present invention;
[0028] Figure 2 is a flowchart of a control method for a vehicle according to an embodiment of the present invention.
[0029] The reference numerals are as follows:
[0030] 1 - Main relay;
[0031] 2 - First ECU;
[0032] 3 - Second ECU;
[0033] 4 - Battery. Detailed Embodiments
[0034] In order to enable those skilled in the art of the present technology to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0035] Figure 1 is a schematic structural diagram of a vehicle according to an embodiment of the present invention. As Figure 1As shown in the figure, an embodiment of the present invention provides a vehicle, which includes a main relay 1, a first ECU 2, and a second ECU 3. The first ECU 2 is configured to detect whether a predetermined action has ended, and in response to detecting that the predetermined action has ended, send a data saving instruction to the second ECU 3; in response to receiving a data saving completion message sent by the second ECU 3, determine whether the log data of the first ECU 2 has been saved; in response to the log data of the first ECU 2 being saved, control the main relay 1 to turn off. The second ECU 3 is configured to, in response to receiving the data saving instruction sent by the first ECU 2, determine whether the log data of the second ECU 3 has been saved; in response to the log data of the second ECU 3 being saved, send a data saving completion message to the first ECU 2.
[0036] In an embodiment of the present invention, if the first ECU 2 detects that the predetermined action has ended, it sends a data saving instruction to the second ECU 3. After receiving the data saving instruction sent by the first ECU 2, the second ECU 3 determines whether the log data of the second ECU 3 has been saved. If all the data has been saved, it sends a data saving completion message to the first ECU 2. If not all the data has been saved, it saves all the log data of the second ECU 3 and then sends a data saving completion message to the first ECU 2.
[0037] It should be noted that if the second ECU 3 has been saving log data in real time before receiving the data saving instruction sent by the first ECU 2, after receiving the data saving instruction sent by the first ECU 2, it continues to save the log data until all the log data of the second ECU 3 has been saved, and then sends a data saving completion message to the first ECU 2. If the second ECU 3 has not saved log data before receiving the data saving instruction sent by the first ECU 2, it starts to save the log data after receiving the data saving instruction sent by the first ECU 2 until all the log data of the second ECU 3 has been saved, and then sends a data saving completion message to the first ECU 2.
[0038] After receiving the data saving completion message sent by the second ECU 3, the first ECU 2 determines whether the log data of the first ECU 2 has been saved. If all the log data of the first ECU 2 has been saved, it controls the main relay 1 to turn off. If not all the log data of the first ECU 2 has been saved, it saves all the log data of the first ECU 2 and then controls the main relay 1 to turn off.
[0039] It should be noted that before receiving the message indicating that the data saving of the second ECU 3 is completed, if the first ECU 2 has been saving log data in real time, after receiving the message indicating that the data saving of the second ECU 3 is completed, continue to save the log data until all the log data of the first ECU 2 is saved, and then control the main relay 1 to close. Before receiving the message indicating that the data saving of the second ECU 3 is completed, if the first ECU 2 has not saved the log data, after receiving the message indicating that the data saving of the second ECU 3 is completed, start to save the log data until all the log data of the first ECU 2 is saved, and then control the main relay 1 to close.
[0040] Since after the first ECU 2 detects that the predetermined action has ended, it first sends a data saving instruction to the second ECU 3, and after the log data of the second ECU 3 is saved, then controls the main relay 1 to close. Therefore, the embodiment of the present invention can ensure that the ECU stops after the log data is saved, thus avoiding the loss of log data.
[0041] As Figure 1 shown, the vehicle further includes a storage battery 4 connected to the main relay 1. The first ECU 2 and the second ECU 3 are connected in parallel and are connected to the storage battery 4 through the main relay 1.
[0042] It should be noted that the first ECU 2, the second ECU 3 and the storage battery 4 are continuously connected, and the connection line is as Figure 1 shown by the dotted line in. Before the main relay 1 is turned on, the storage battery 4 supplies power to the first ECU 2 and the second ECU 3 in a low power consumption mode, that is, supplies power in a low power consumption mode by using the line shown by the dotted line in Figure 1 . At this time, the first ECU 2 and the second ECU 3 are in a sleep state. After the main relay 1 is turned on, the storage battery 4 supplies power to the first ECU 2 and the second ECU 3 in a high power consumption mode, that is, supplies power in a high power consumption mode by using the line shown by the solid line in Figure 1 . At this time, the first ECU 2 and the second ECU 3 are in a working state.
[0043] In some other embodiments of the present invention, the first ECU 2 is further configured to respond to detecting whether the predetermined action starts, and in response to detecting that the predetermined action has started, control the main relay 1 to turn on.
[0044] Optionally, the predetermined action may be parking purge (PPG), or the start of the air conditioner, or the release of fragrance. The embodiment of the present invention does not limit this. When the first ECU 2 detects that the predetermined action has started, it controls the main relay 1 to turn on. The first ECU 2 and the second ECU 3 enter the working state, and the second ECU 3 executes the predetermined action, such as controlling the vehicle to park and drain water, controlling the start of the air conditioner, or controlling the release of fragrance.
[0045] When the predetermined action is completed, the first ECU 2 detects whether the predetermined action has ended. If it detects that the predetermined action has ended, it starts to save the log data and sends a data saving instruction to the second ECU 3. After the log data of the first ECU 2 and the second ECU 3 are saved, the main relay 1 is then controlled to turn off. It should be noted that one of the functions of saving the log data of the ECU is to diagnose the cause of the ECU failure when a failure occurs.
[0046] Optionally, the first ECU 2 is also used to control the operation of the vehicle drive. Optionally, the second ECU 3 is also used to control the operation of the auxiliary machine according to the instruction of the first ECU 2, and the predetermined action can be executed by the second ECU 3.
[0047] In some embodiments of the present invention, the vehicle is a fuel cell vehicle, the predetermined action is a parking drainage action, and the second ECU 3 is also used to control the operation of the drainage system according to the instruction of the first ECU 2. Therefore, in the vehicle power-off state, the second ECU 3 controls the drainage system to drain the water in the pipeline. The first ECU 2 detects whether the parking drainage is completed. If the first ECU 2 detects that the parking drainage has ended, it starts to save the log data and sends a data saving instruction to the second ECU 3. After the log data of the second ECU 3 are saved, the main relay 1 is then controlled to turn off.
[0048] Optionally, the first ECU sends a data saving instruction to the second ECU through a hard wire or a CAN line. Sending a data saving instruction through a hard wire results in little change in the software of the first ECU 2, and sending a data saving instruction through a CAN line results in little change in the hardware of the first ECU 2.
[0049] Optionally, the second ECU sends a data saving completion message to the first ECU through a hard wire or a CAN line. Sending a data saving completion message through a hard wire results in little change in the software of the first ECU 2 and the second ECU 3, and sending a data saving completion message through a CAN line results in little change in the hardware of the first ECU 2 and the second ECU 3.
[0050] Figure 2 is a flowchart of a control method for a vehicle according to an embodiment of the present invention. Embodiments of the present invention also provide a control method for a vehicle described in any of the above embodiments, as Figure 2 shown, the control method includes:
[0051] Step S201, the first ECU 2 detects whether the predetermined action has ended, and in response to detecting that the predetermined action has ended, sends a data saving instruction to the second ECU 3.
[0052] Step S202: The second ECU 3 determines whether the log data of the second ECU 3 has been saved in response to receiving the data saving instruction sent by the first ECU 2.
[0053] Step S203: The second ECU 3 sends a data saving completion message to the first ECU 2 in response to the completion of saving the log data of the second ECU 3.
[0054] Step S204: The first ECU 2 determines whether the log data of the first ECU 2 has been saved in response to receiving the data saving completion message sent by the second ECU 3.
[0055] Step S205: The first ECU 2 controls the main relay 1 to turn off in response to the completion of saving the log data of the first ECU 2.
[0056] In an embodiment of the present invention, if the first ECU 2 detects that a predetermined action has ended, it starts to save the log data and sends a data saving instruction to the second ECU 3. After receiving the data saving instruction sent by the first ECU 2, the second ECU 3 determines whether the log data of the second ECU 3 has been saved. If all the data has been saved, it sends a data saving completion message to the first ECU 2. If not all the data has been saved, it saves all the log data of the second ECU 3 and then sends a data saving completion message to the first ECU 2.
[0057] It should be noted that if the second ECU 3 has been saving the log data in real time before receiving the data saving instruction sent by the first ECU 2, after receiving the data saving instruction sent by the first ECU 2, it continues to save the log data until all the log data of the second ECU 3 has been saved, and then sends a data saving completion message to the first ECU 2. If the second ECU 3 has not saved the log data before receiving the data saving instruction sent by the first ECU 2, it starts to save the log data after receiving the data saving instruction sent by the first ECU 2 until all the log data of the second ECU 3 has been saved, and then sends a data saving completion message to the first ECU 2.
[0058] After the first ECU 2 receives the data saving completion message sent by the second ECU 3, it determines whether the log data of the first ECU 2 has been saved. If all the log data of the first ECU 2 has been saved, it controls the main relay 1 to turn off. If not all the log data of the first ECU 2 has been saved, it saves all the log data of the first ECU 2 and then controls the main relay 1 to turn off.
[0059] It should be noted that before receiving the data saving completion message sent by the second ECU 3, if the first ECU 2 has been saving log data in real time, after receiving the data saving completion message sent by the second ECU 3, it continues to save the log data until all the log data of the first ECU 2 is saved, and then controls the main relay 1 to close. Before receiving the data saving completion message sent by the second ECU 3, if the first ECU 2 has not saved the log data, after receiving the data saving completion message sent by the second ECU 3, it starts to save the log data until all the log data of the first ECU 2 is saved, and then controls the main relay 1 to close.
[0060] Since after the first ECU 2 detects that the predetermined action has ended, it first sends a data saving instruction to the second ECU 3, and after the log data of the second ECU 3 is saved, it then controls the main relay 1 to close. Therefore, the embodiment of the present invention can ensure that the ECU stops after the log data is saved, thus avoiding the loss of log data.
[0061] Optionally, the predetermined action may be parking and draining water, or starting the air conditioner, or releasing fragrance. The embodiment of the present invention does not limit this. When the first ECU 2 detects that the predetermined action has started, it controls the main relay 1 to turn on, and the first ECU 2 and the second ECU 3 enter the working state. The second ECU 3 executes the predetermined action, such as controlling the vehicle to park and drain water, controlling the air conditioner to start, or controlling the fragrance to be released.
[0062] Optionally, before step 201, it further includes: the first ECU 2 detects whether the predetermined action has started, and in response to detecting that the predetermined action has started, controls the main relay 1 to turn on.
[0063] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention should be included within the protection scope of the present invention.
Claims
1. A vehicle, characterized in that, the vehicle includes: a main relay; a first ECU, configured to detect whether a predetermined action ends, and send a data saving instruction to a second ECU in response to detecting that the predetermined action has ended; judge whether the log data of the first ECU is saved completely in response to receiving a data saving completion message sent by the second ECU; control the main relay to turn off in response to the log data of the first ECU being saved completely; a second ECU, configured to judge whether the log data of the second ECU is saved completely in response to receiving the data saving instruction sent by the first ECU; send a data saving completion message to the first ECU in response to the log data of the second ECU being saved completely.
2. The vehicle according to claim 1, characterized in that, the first ECU is further configured to detect whether the predetermined action starts, and control the main relay to turn on in response to detecting that the predetermined action has started.
3. The vehicle according to claim 1 or 2, characterized in that, the first ECU is further configured to control the operation of vehicle driving.
4. The vehicle according to claim 1 or 2, characterized in that, the second ECU is further configured to control the operation of an auxiliary machine according to an instruction of the first ECU.
5. The vehicle according to claim 4, characterized in that, the vehicle is a fuel cell vehicle, the auxiliary machine includes a drainage system, and the predetermined action is a parking drainage action.
6. The vehicle according to claim 1 or 2, characterized in that, the vehicle further includes a storage battery connected to the main relay, the first ECU and the second ECU are connected in parallel and connected to the storage battery through the main relay.
7. The vehicle according to claim 1 or 2, characterized in that, the first ECU sends the data saving instruction to the second ECU through a hard wire or a CAN wire.
8. The vehicle according to claim 1 or 2, characterized in that, the second ECU sends the data saving completion message to the first ECU through a hard wire or a CAN wire.
9. A control method of the vehicle according to any one of claims 1-8, characterized in that, the control method includes: the first ECU detects whether the predetermined action ends, and sends a data saving instruction to the second ECU in response to detecting that the predetermined action has ended; the second ECU judges whether the log data of the second ECU is saved completely in response to receiving the data saving instruction sent by the first ECU; the second ECU sends a data saving completion message to the first ECU in response to the log data of the second ECU being saved completely; the first ECU judges whether the log data of the first ECU is saved completely in response to receiving the data saving completion message sent by the second ECU; the first ECU controls the main relay to turn off in response to the log data of the first ECU being saved completely.
10. The control method of the vehicle according to claim 9, characterized in that, Before the first ECU sends a data saving instruction to the second ECU in response to detecting that the predetermined action has ended, it further includes: The first ECU detects whether the predetermined action has started, and in response to detecting that the predetermined action has started, controls the main relay to turn on.