Mode switching method and device, electronic equipment and storage medium
By introducing a mode switching method in the vehicle system, the status of the vehicle module is dynamically managed, and the problem of ignoring dynamic changes and module state management in the current technology of power-up control in the prior art is solved, and the system stability and resource utilization are improved.
Patent Information
- Application Number
- CN202411477695.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-21
Smart Images

Figure CN119489826A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle system control technology, and in particular to a mode switching method, device, electronic device, storage medium and computer program product. Background Art
[0002] At present, in intelligent driving systems or other complex electronic control units, multiple functional modules are usually included, such as power-on self-test, health management, thermal management, key management, etc. The resource allocation of each module in different working modes is different, and the working modes include normal working mode, low power mode, sleep mode, shutdown mode, etc.
[0003] In related technologies, the control of powering on and off of vehicle systems usually relies on a fixed process or sequence, ignoring the dynamic changes of the vehicle system and the management requirements of the status of each module, which can easily lead to waste of resources and untimely response, resulting in insufficient stability of the vehicle system. Summary of the invention
[0004] Based on this, it is necessary to provide a mode switching method, device, electronic device, computer-readable storage medium and computer program product that can improve the stability of the vehicle system in response to the above technical problems.
[0005] In a first aspect, the present application provides a mode switching method. The method comprises:
[0006] In response to a mode switching request, obtaining a current state of each target vehicle module and a mode to be switched that matches the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in a vehicle system;
[0007] According to the to-be-switched mode, acquiring the to-be-switched state of each of the target vehicle modules matching the to-be-switched mode from a pre-constructed vehicle module state management table;
[0008] Based on the current state and the state to be switched of each of the target vehicle modules, the vehicle modules to be switched included in the vehicle system are determined, and the state of each of the vehicle modules to be switched is switched.
[0009] In one embodiment, before obtaining the current state of each target vehicle module in response to the mode switching request, the method further includes:
[0010] If it is detected that the vehicle system is powered on, determining an initial mode of the vehicle system;
[0011] According to the initial mode, obtaining the to-be-switched state of each of the target vehicle modules matching the initial mode from the pre-constructed vehicle module state management table;
[0012] According to the to-be-switched state of the target vehicle modules, the state of each target vehicle module is switched so that the vehicle system enters the initial mode.
[0013] In one embodiment, before the current state of each target vehicle module and the mode to be switched matching the mode switching request are obtained in response to the mode switching request, the method further includes:
[0014] Receiving a mode switching request sent by a vehicle system; the mode switching request is generated based on a preset trigger condition after the vehicle system meets a preset trigger condition;
[0015] Among them, the preset trigger condition includes that the system state in the vehicle system reaches a preset state, and the system state of the vehicle system is determined by at least one of user instructions, sensor data, system self-test results, and system error events in the vehicle system.
[0016] In one embodiment, determining the vehicle module to be switched included in the vehicle system based on the current state and the state to be switched of each of the target vehicle modules includes:
[0017] In the case where the current vehicle module is the target vehicle module, determining a difference between a current state of the current vehicle module and a state to be switched of the current vehicle module; the current vehicle module is any vehicle module in the vehicle system;
[0018] If the difference is a preset switching value, the current vehicle module is determined to be a vehicle module to be switched.
[0019] In one embodiment, determining the vehicle module to be switched included in the vehicle system based on the current state and the state to be switched of each of the target vehicle modules includes:
[0020] When the current vehicle module is not the target vehicle module, obtaining a target vehicle module having a dependency relationship with the current vehicle module;
[0021] In a case where the target vehicle module having a dependency relationship is a vehicle module to be switched, the current vehicle module is determined to be the vehicle module to be switched.
[0022] In one of the embodiments, if the mode to be switched in the mode switching request is the power-off mode, a power-off notification message is sent to the vehicle module to be shut down in the power-off mode, so that the vehicle module to be shut down completes the processing of the current business data and responds to the power-off notification message; the vehicle module to be shut down is determined based on the vehicle module state management table;
[0023] According to the received power-off confirmation message returned by each of the vehicle modules to be shut down, shut down the vehicle module corresponding to the power-off confirmation message;
[0024] When all the vehicle modules to be shut down are shut down, the power control module is shut down to complete power off.
[0025] In one embodiment, shutting down the vehicle module corresponding to the power-off confirmation message according to the received power-off confirmation message returned by each vehicle module to be shut down includes:
[0026] If within the preset time, each of the to-be-shutdown vehicle modules returns a corresponding power-off confirmation message, shutting down each of the to-be-shutdown vehicle modules based on the power-off confirmation message;
[0027] If within the preset time, any of the vehicle modules to be shut down does not return the corresponding power-off confirmation message, then the vehicle modules to be shut down that have returned the power-off confirmation message are shut down, and the power-off mode is switched to the error handling mode, and the vehicle modules to be shut down that have not returned the power-off confirmation message are shut down through the error handling mode; the error handling mode is used to protect the business data of the vehicle module to be shut down before forced power-off.
[0028] In a second aspect, the present application also provides a mode switching device. The device comprises:
[0029] A first acquisition module, configured to acquire, in response to a mode switching request, a current state of each target vehicle module and a mode to be switched that matches the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in a vehicle system;
[0030] A second acquisition module is used to acquire, according to the mode to be switched, the to-be-switched state of each of the target vehicle modules that matches the mode to be switched from a pre-constructed vehicle module state management table;
[0031] A switching module is used to determine the vehicle modules to be switched contained in the vehicle system based on the current state of each target vehicle module and the state to be switched, and to switch the state of each vehicle module to be switched. In a third aspect, the present application also provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method described in the first aspect when executing the computer program.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0033] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0034] In response to a mode switching request, obtaining a current state of each target vehicle module and a mode to be switched that matches the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in a vehicle system;
[0035] According to the to-be-switched mode, acquiring the to-be-switched state of each of the target vehicle modules matching the to-be-switched mode from a pre-constructed vehicle module state management table;
[0036] Based on the current state and the state to be switched of each of the target vehicle modules, the vehicle modules to be switched included in the vehicle system are determined, and the state of each of the vehicle modules to be switched is switched.
[0037] The above-mentioned mode switching method, device, electronic device, storage medium and computer program product obtain the current state of each target vehicle module by responding to the mode switching request, and determine the mode to be switched that matches the mode switching request. Among them, the target vehicle module is a vehicle module recorded in a pre-constructed vehicle module state management table in the vehicle system. According to the mode to be switched, the state to be switched corresponding to each target vehicle module matching the mode to be switched is determined from the vehicle module state management table. Afterwards, based on the current state and the state to be switched of each target vehicle module, multiple vehicle modules to be switched contained in the vehicle system are determined, and the state of each vehicle module to be switched is switched.
[0038] This method establishes the corresponding relationship between each mode and the state of the target vehicle module through the vehicle module state management table. After receiving the mode switching request, the to-be-switched state of each target vehicle module in the to-be-switched mode can be determined through the vehicle module state management table, so that the target vehicle module can be accurately determined according to the actual needs of different modes, and the to-be-switched state of the target vehicle module can be obtained, avoiding the vehicle module of the subsequent operation error. In addition, based on the current state of the target vehicle module and the to-be-switched state of the target vehicle module in the vehicle module state management table, it can be determined whether each target vehicle module is a to-be-switched vehicle module, and the state of the to-be-switched vehicle module is switched, avoiding switching of the target vehicle module that does not need to be switched, reducing resource waste, and thus improving the stability of the vehicle system. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] FIG1 is an application environment diagram of a mode switching method in one embodiment;
[0041] FIG2 is a schematic flow chart of a mode switching method in one embodiment;
[0042] FIG3 is a schematic flow chart of power-off mode switching steps in one embodiment;
[0043] FIG4 is a schematic flow chart of a mode switching method in another embodiment;
[0044] FIG5 is a structural block diagram of a mode switching device in one embodiment;
[0045] FIG. 6 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 used to explain the present application and are not used to limit the present application.
[0047] The mode switching method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. The vehicle system can communicate with the cloud server 106 through a communication network, and the vehicle system can communicate through an external terminal 108. The cloud server 106 can send a mode switching request to the vehicle system based on the monitoring information of each vehicle module in the vehicle system, or the user terminal can remotely send a mode switching request to the vehicle system through the cloud server 106. The terminal 108 can directly send access information to the vehicle system, and the vehicle system can generate a mode switching request corresponding to the access information after identifying the access information. In addition, the vehicle system can detect itself, and if the pre-configured trigger conditions are met, the vehicle system can generate a mode switching request and send it to the vehicle management module 104 in the vehicle system. The vehicle system includes at least one vehicle management module 104 and a plurality of vehicle modules 102. The vehicle management module is used to respond to the mode switching request, and through information interaction with the vehicle module 102, control each vehicle module to switch the state, so as to switch the current state of the vehicle module to the state required by the mode to be switched corresponding to the mode switching request.
[0048] Based on this, after receiving the mode switching request, the vehicle management module 104 responds to the mode switching request and determines the mode to be switched corresponding to the mode switching request. The vehicle management module 104 can obtain the to-be-switched state of each target vehicle module that matches the to-be-switched mode in the vehicle module state management table. The vehicle management module 104 can also obtain the current state of the target vehicle module. And according to the difference between the to-be-switched state and the current state, the vehicle module to be switched is determined, so as to switch the state of the vehicle module to be switched.
[0049] Among them, the terminal 108 can be, but is not limited to, various vehicle detection equipment, detection computers, detection interfaces, and maintenance equipment. The cloud server 106 can be implemented with an independent server or a server cluster composed of multiple servers. The vehicle system includes subsystems corresponding to various vehicle components of the intelligent vehicle. The vehicle system includes multiple vehicle modules 102 with different functions, and each vehicle module 102 can be distributed in different subsystems. The vehicle system also includes at least one vehicle management module 104, each of which is used to manage the system status of the subsystem.
[0050] In an exemplary embodiment, as shown in FIG2 , a mode switching method is provided, which is described by taking the method applied to the vehicle management module 104 in FIG1 as an example, and includes the following steps S202 to S206 . Among them:
[0051] Step S202 , in response to the mode switching request, obtaining the current state of each target vehicle module and the mode to be switched that matches the mode switching request.
[0052] Among them, the target vehicle module is a vehicle module included in a pre-constructed vehicle module status management table in the vehicle system. The mode switching request can be generated by the vehicle system based on the vehicle's own state, or the mode switching request can be obtained by receiving an external instruction from an external terminal or a cloud server. The state is used to indicate the current operating status of the vehicle module, for example, the state can be represented by an on state or an off state. In the on state, it can be further represented by a state value, which can represent the amount of resources consumed by the real-time operation of the vehicle module. The mode to be switched is used to indicate the mode after the vehicle system completes the switch from the current mode.
[0053] Specifically, the vehicle management module can parse the mode switching request and determine the mode to be switched contained in the mode switching request. The vehicle management module can determine each target vehicle module contained in the vehicle module state management table through a pre-constructed vehicle module state management table, and send a state request message to each target vehicle module. After receiving the state request message, the target vehicle module can store the current state of the target vehicle module in a state response message, and return the state response message to the vehicle management module, thereby obtaining the current state of each target vehicle module.
[0054] Step S204: According to the mode to be switched, the state to be switched of each target vehicle module matching the mode to be switched is obtained from a pre-constructed vehicle module state management table.
[0055] The vehicle module state management table includes the target vehicle modules required to be configured for each to-be-switched mode, and the to-be-switched state of each target vehicle module in each to-be-switched mode.
[0056] Specifically, the vehicle management module can determine multiple target vehicle modules corresponding to the to-be-switched mode in the vehicle module state management table according to the to-be-switched mode. For each target vehicle module, the vehicle management module obtains the to-be-switched state of the target vehicle module in the to-be-switched mode.
[0057] Step S206 , based on the current state of each target vehicle module and the state to be switched, determine the vehicle modules to be switched included in the vehicle system, and switch the state of each vehicle module to be switched.
[0058] The vehicle module to be switched is a vehicle module that is determined to need to switch its state among various vehicle modules included in the vehicle system.
[0059] Specifically, for each target vehicle module, the vehicle management module can compare the current state of the target vehicle module with the state to be switched, determine whether there is a difference between the current state and the state to be switched, and if there is a difference, determine that the target vehicle module is the vehicle module to be switched. Determine the state switching instruction corresponding to each vehicle module to be switched, and send the corresponding state switching instruction to the vehicle module to be switched through the vehicle management module, so that the vehicle module to be switched performs state switching based on the state switching instruction.
[0060] In the above-mentioned mode switching method, by responding to the mode switching request, the current state of each target vehicle module is obtained, and the mode to be switched that matches the mode switching request is determined. Wherein, the target vehicle module is a vehicle module recorded in a pre-constructed vehicle module state management table in the vehicle system. According to the mode to be switched, the state to be switched corresponding to each target vehicle module that matches the mode to be switched is determined from the vehicle module state management table. Afterwards, based on the current state and the state to be switched of each target vehicle module, a plurality of vehicle modules to be switched included in the vehicle system are determined, and the state of each vehicle module to be switched is switched. The embodiment of the present application establishes a corresponding relationship between each mode and the state of the target vehicle module through the vehicle module state management table. After receiving the mode switching request, the state to be switched of each target vehicle module in the mode to be switched can be determined through the vehicle module state management table, so that the target vehicle module can be accurately determined according to the actual needs of different modes, and the state to be switched of the target vehicle module is obtained, avoiding the vehicle module of subsequent operation errors. In addition, based on the current state of the target vehicle module and the to-be-switched state of the target vehicle module in the vehicle module state management table, it is possible to determine whether each target vehicle module is a to-be-switched vehicle module, and perform state switching on the to-be-switched vehicle module, thereby avoiding switching of target vehicle modules that do not need to be switched, reducing resource waste, and improving the stability of the vehicle system.
[0061] In an exemplary embodiment, before the step of “obtaining the current state of each target vehicle module in response to the mode switching request”, the method further includes:
[0062] If it is detected that the vehicle system is powered on, the initial mode of the vehicle system is determined; according to the initial mode, the to-be-switched state of each target vehicle module matching the initial mode is obtained from a pre-constructed vehicle module state management table; according to the to-be-switched state of the target vehicle module, the state of each target vehicle module is switched so that the vehicle system enters the initial mode.
[0063] The initial mode may be a default mode when the vehicle system is turned on, or may be a mode used by the vehicle system before the power was last turned off.
[0064] Specifically, the vehicle management module monitors the vehicle system in real time in the power-off state. If the vehicle system is detected to be powered on, the vehicle management module switches from the power-off state to the power-on state. The vehicle management module determines that the mode used by the vehicle system before the vehicle system was last powered off is the initial mode. Alternatively, the vehicle management module determines that the default mode corresponding to the vehicle system is the initial mode.
[0065] Afterwards, the vehicle management module obtains each target vehicle module matching the initial pattern and the to-be-switched state of each target vehicle module in the pre-built vehicle module state management table. The vehicle management module can send a state switching instruction to each target vehicle module according to the to-be-switched state of the target vehicle module, so that the target vehicle module switches state based on the state switching instruction.
[0066] Optionally, the vehicle module state management table includes a power-off mode and a state to be switched corresponding to each target vehicle module in the power-off mode. If the on-board management module detects that the vehicle system is powered on, it determines the initial mode of the vehicle system, and obtains the state to be switched of each target vehicle module that matches the initial mode from a pre-constructed vehicle module state management table according to the initial mode, and obtains the state to be switched of each target vehicle module that matches the power-off mode. The on-board management module generates a state switching instruction corresponding to each target vehicle module based on the state to be switched of each target vehicle module in the initial mode and the state to be switched of each target vehicle module in the power-off mode. The on-board management module sends a state switching instruction to each target vehicle module so that the target vehicle module switches state based on the state switching instruction.
[0067] In this embodiment, the vehicle system is switched to the initial mode by detecting the power-on of the vehicle system, and the state of the target vehicle module is switched through the target vehicle module in the vehicle module state management table and the state to be switched corresponding to the target vehicle module, thereby turning on the initial mode. The state of the target vehicle module can be switched quickly, thereby improving the accuracy and switching efficiency of the initial mode switching.
[0068] In an exemplary embodiment, before the step of “obtaining the current state of each target vehicle module in response to the mode switching request”, the method further includes:
[0069] Receive a mode switching request sent by a vehicle system.
[0070] The mode switching request is generated based on a preset trigger condition after the vehicle system meets the preset trigger condition. The preset trigger condition includes that the system state in the vehicle system reaches a preset state, and the system state of the vehicle system is determined by at least one of a user instruction, sensor data, system self-test results, and a system error event in the vehicle system.
[0071] Specifically, the user command can be sent to the vehicle system through the cloud server and the terminal. The vehicle system determines the mode switching request corresponding to the user command and sends the mode switching request to the vehicle management module. The sensor data can be sent to the vehicle system through the terminal. The vehicle system detects the sensor data and can generate a mode switching request corresponding to the sensor data so that the terminal processes the vehicle system and sends the mode switching request to the vehicle management module so that the vehicle management module switches the mode. The terminal can be a detection device, a maintenance device, etc.
[0072] The vehicle system can perform self-inspection on each subsystem and vehicle module in the vehicle system. If a fault is detected in the vehicle system, a mode switching request corresponding to the fault is generated. If it is detected that the software or firmware in the vehicle system needs to be upgraded, a mode switching request corresponding to the upgrade is generated. If it is detected that the vehicle system has returned to normal, a mode switching request corresponding to normal operation is generated.
[0073] In addition, if a system error event occurs during a time other than self-inspection of the vehicle system, a corresponding mode switching request is generated according to the error level corresponding to the system error event. For example, a mode switching request for an error correction mode may be generated so that the vehicle system performs error correction processing on the vehicle module corresponding to the error event, or a mode switching request for a power-off mode may be generated so that the vehicle system completes power-off.
[0074] In this embodiment, the vehicle system receives various types of preset trigger conditions, so that the vehicle system generates mode switching requests corresponding to the various types of preset trigger conditions and sends them to the on-board management module, thereby ensuring that the vehicle management module can obtain the corresponding mode switching requests under various circumstances, ensuring that the vehicle system can complete the mode switching under various circumstances, and improving the stability of the vehicle system.
[0075] In an exemplary embodiment, the specific implementation process of the step of "determining the vehicle modules to be switched included in the vehicle system based on the current state and the state to be switched of each target vehicle module" includes:
[0076] When the current vehicle module is the target vehicle module, the difference between the current state of the current vehicle module and the state to be switched of the current vehicle module is determined; if the difference is a preset switching value, the current vehicle module is determined to be the vehicle module to be switched.
[0077] The current vehicle module is any vehicle module in the vehicle system.
[0078] Specifically, the vehicle management module can determine whether the current vehicle module is the target vehicle module through a pre-constructed vehicle module status management table. If the pre-constructed vehicle module status management table contains the current vehicle module, the current vehicle module is determined to be the target vehicle module. If the pre-constructed vehicle module status management table does not contain the current vehicle module, the current vehicle module is determined not to be the target vehicle module.
[0079] When the current vehicle module is the target vehicle module, the on-board management module sends a status request message to the current vehicle module to obtain the current state of the current vehicle module. The on-board management module determines the state to be switched corresponding to the current vehicle module according to the vehicle module state management table. The on-board management module subtracts the current state and the state to be switched corresponding to the current vehicle module to obtain the difference. If the difference is 0 or "empty", it means that the current state and the state to be switched are the same, and there is no need to switch the state of the current vehicle module. If the difference is a preset switching value, such as "1" or "-1", it means that the current state and the state to be switched are different, and the current vehicle module needs to be switched in state, and the current vehicle module can be determined to be a vehicle module to be switched.
[0080] Optionally, the state value of the state to be switched and the state value of the current state can range from 0 to 1. 0 indicates that the vehicle module is in the off state, 1 indicates that the vehicle module is in the on state, and the resources corresponding to the on state are 100%. If the state value is any number between 0 and 1, it means that the vehicle module is in the on state, and the resources corresponding to the on state are the percentage corresponding to the number. At this time, the preset switching value can be any non-zero value. That is, if the difference between the current state of the current vehicle module and the state to be switched is any non-zero value, the current vehicle module is determined to be the vehicle module to be switched.
[0081] In this embodiment, when the current vehicle module is the target vehicle module, the difference between the current state of the current vehicle module and the state to be switched is determined, so as to determine whether the current vehicle module is the vehicle module to be switched. This can accurately determine the vehicle module to be switched that needs to be switched, thereby improving the accuracy of state switching.
[0082] In an exemplary embodiment, the specific implementation process of the step of "determining the vehicle modules to be switched included in the vehicle system based on the current state and the state to be switched of each target vehicle module" includes:
[0083] When the current vehicle module is not the target vehicle module, a target vehicle module having a dependency relationship with the current vehicle module is obtained; when the target vehicle module having a dependency relationship is the vehicle module to be switched, the current vehicle module is determined to be the vehicle module to be switched.
[0084] If the current vehicle module is not the target vehicle module, the pre-constructed vehicle module state management table does not include the current vehicle module. The dependency relationship is used to represent the switching relationship between two vehicle modules when switching states. For example, when vehicle module 1 switches from the closed state to the open state, vehicle module 2 must be switched from the closed state to the open state before vehicle module 1 can be turned on, or when vehicle module 1 switches from the open state to the closed state, vehicle module 2 must be switched from the open state to the closed state before vehicle module 1 can be turned off.
[0085] Specifically, the on-board management module can determine whether the current vehicle module is the target vehicle module through a pre-constructed vehicle module status management table. If the pre-constructed vehicle module status management table does not contain the current vehicle module, it is determined that the current vehicle module is not the target vehicle module. In the case that the current vehicle module is not the target vehicle module, the on-board management module can determine at least one target vehicle module that has a dependency relationship with the current vehicle module according to the dependency table. The on-board management module can analyze the target vehicle module to determine whether the target vehicle module is a vehicle module to be switched. If the target vehicle module is not a vehicle module to be switched, it is determined that the current vehicle module is not a vehicle module to be switched. If the target vehicle module is a vehicle module to be switched, it is determined that the current vehicle module is a vehicle module to be switched.
[0086] In this embodiment, when the current vehicle module is not the target vehicle module, the target vehicle module that has a dependency relationship with the current vehicle module is determined, and when the target vehicle module is determined to be the vehicle module to be switched, the current vehicle module is determined to be the vehicle module to be switched, which can further determine the vehicle module to be switched outside the vehicle module status management table, thereby improving the accuracy of state switching.
[0087] In an exemplary embodiment, as shown in FIG3 , the method further includes steps S302 to S306 . In which:
[0088] Step S302: If the mode to be switched in the mode switching request is the power-off mode, a power-off notification message is sent to the vehicle module to be shut down in the power-off mode, so that the vehicle module to be shut down completes the processing of the current business data and responds to the power-off notification message.
[0089] Among them, the vehicle module to be shut down is determined based on the vehicle module status management table.
[0090] Specifically, the on-board management module determines the mode to be switched in the mode switching request. When it is determined that the mode to be switched is the power-off mode, the on-board management module can obtain multiple target vehicle modules corresponding to the power-off mode in the vehicle module status management table, and determine that the vehicle module whose to-be-switched state of the target vehicle module is a preset value is a vehicle module to be shut down. The on-board management module sends a power-off notification message to each vehicle module to be shut down. After receiving the power-off notification message, each vehicle module to be shut down performs data protection processing on the current business data, for example, it can temporarily store temporary data, store executed business data, etc. After completing the processing of the current business data, each vehicle module to be shut down returns a response message to the on-board management module.
[0091] Step S304: according to the power-off confirmation messages returned by the vehicle modules to be shut down, shut down the vehicle modules corresponding to the power-off confirmation messages.
[0092] Specifically, the vehicle management module shuts down the vehicle modules corresponding to the power-off confirmation messages in sequence according to the time sequence of receiving the power-off confirmation messages, based on the power-off confirmation messages currently received and returned by the vehicle modules to be shut down.
[0093] Step S306, when all the vehicle modules to be shut down are shut down, shut down the power control module to complete power off.
[0094] Specifically, when the vehicle management module determines that all the vehicle modules to be shut down are shut down, the power control module is controlled to perform a power-off operation, thereby completing the power-off.
[0095] In this embodiment, by sending a power-off notification message to the vehicle modules to be shut down, and shutting down each vehicle module to be shut down after receiving a response from the vehicle modules to be shut down, and when all the vehicle modules to be shut down are shut down, the power control module is turned off, thereby preventing errors in the business data of each vehicle module to be shut down and completing the power off, thereby improving the data security and system stability of the power-off mode.
[0096] In an exemplary embodiment, the specific implementation process of the step of "closing the vehicle module corresponding to the power-off confirmation message according to the received power-off confirmation message returned by each vehicle module to be shut down" includes:
[0097] If within the preset time, each vehicle module to be shut down returns the corresponding power-off confirmation message, then each vehicle module to be shut down is shut down based on the power-off confirmation message. If within the preset time, any vehicle module to be shut down does not return the corresponding power-off confirmation message, then the vehicle module to be shut down that has returned the power-off confirmation message is shut down, and the power-off mode is switched to the error handling mode, and the vehicle module to be shut down that has not returned the power-off confirmation message is shut down through the error handling mode.
[0098] The error handling mode is used to protect the business data of the vehicle module to be shut down before forced power-off. The vehicle management module is configured with a preset time, which is the time for shutting down the vehicle module to be shut down through normal channels.
[0099] Specifically, within the preset time from the time when the power-off confirmation message is sent to the vehicle modules to be shut down, if each vehicle module to be shut down returns the corresponding power-off confirmation message, the vehicle management module shuts down each vehicle module to be shut down based on the power-off confirmation message. If any vehicle module to be shut down does not return the power-off confirmation message within the preset time, the vehicle management module switches the power-off mode to the error handling mode. In the error handling mode, for each vehicle module to be shut down that has not returned the power-off confirmation message, the business data in the vehicle module to be shut down is forcibly backed up, and the vehicle module to be shut down is shut down, or the vehicle module to be shut down that has not responded is forcibly shut down.
[0100] In this embodiment, the vehicle modules to be shut down that return the power-off confirmation message are shut down within the preset time. For the vehicle modules to be shut down that are not shut down within the preset time, the vehicle modules to be shut down are forcibly shut down through the error handling mode. This can ensure the data security of each vehicle module and complete the power-off of the vehicle system, thereby improving the data security and system stability of the power-off mode.
[0101] In an exemplary embodiment, as shown in FIG. 4 , the specific execution process of the above-mentioned mode switching method is described in detail below in conjunction with a specific embodiment.
[0102] Specifically, when the vehicle system is powered on, the SMM state management module (State Management Module), that is, the vehicle management module, can be pulled up. At this time, the SMM can pull up the app corresponding to the user mode according to the configured user mode. The user mode can be the initial mode or the default mode. During the operation of the vehicle system, the SMM state management module on the MCU (Microcontroller Unit) microcontroller side and the app on the SoC (System on Chip) system-level chip side can determine the mode to be switched, and switch the mode through the SMM, thereby pulling up new apps and closing redundant apps.
[0103] If the mode to be switched is the mode corresponding to Sleep, Error, or Shutdown, the mode is switched to the power-off mode, and each app is notified through SMM to prepare for power-off. When the app returns the power-off response message, each app is closed. SMM determines whether all apps are closed and whether it is possible to power off directly. If not, it is necessary to wait for a period of time before forcing the power off.
[0104] Further, for some functional modules. Among them, the vehicle module can be an app with independent functions, the app is used to manage the vehicle system, the app is also used to monitor by waking up the vehicle system preset special operation, and the app is also used to connect the underlying software and upper-level algorithms given by the vehicle system. Each vehicle module is an independent process. The vehicle modules can communicate through the COM component of the AutoSAR AP, and the communication mode can be a publish-subscribe mode, that is, the vehicle management module and the vehicle module can respectively act as producers and consumers, respectively providing services (publishing messages) or consuming services (subscribing to messages). For example, the vehicle management module can be an SMM state management module (State Management Module). After the SMM module receives the power-off mode switching request, it can publish the message corresponding to the mode switching request through the COM component of the AutoSAR AP. At this time, the running vehicle module can subscribe to the message. When the vehicle module can be powered off, it returns a response message to the SMM module, such as returning a true signal. After receiving all true signals, the SMM can perform the power-off operation. SMM can dynamically manage the start and stop of each functional module according to the current working mode of the vehicle system, and ensure the optimal resource configuration of the vehicle system in different states.
[0105] In one example, the vehicle module may include functional modules such as power-on self-test, health management, offline electrical inspection, calibration, and vehicle parameter management. Among them, the power-on self-test is a system test performed when the vehicle system is powered on, including whether the hardware, power supply, communication, etc. are normal. Health management is used to detect the health status of the system in real time, and includes functions such as management errors and health reporting. Offline electrical inspection is a step that needs to be performed when the whole vehicle is mass-produced and rolled off the line in the factory, such as production line calibration. Calibration is used for sensor calibration of the whole vehicle, such as production line calibration, after-sales calibration after replacing the sensor, and dynamic calibration throughout the life cycle. Vehicle parameter management is used to store information about the whole vehicle, such as body data, wheelbase, vehicle height and width, sensor data, etc., and serves as the input source for multiple modules.
[0106] Furthermore, for the status of modes and vehicle modules. The above status can be the basic status of the vehicle system. The basic status can play a supporting role and cannot be manually switched by non-users. The basic status is adjusted and configured by professional staff in automobile development and after-sales. The switching logic of the modes to be switched related to the basic status is defined and implemented by the developer. For example, the calibration mode of the factory production line is triggered by the workers using the diagnostic instrument when calibrating the production line. The upgrade mode is triggered when the vehicle system is upgraded. Other modes such as fault mode are automatically switched by the state management when the vehicle system receives the development trigger conditions.
[0107] In one example, the mode may include at least an operation mode, a fault mode, a calibration mode, an upgrade mode, and a factory mode. Operation mode: The camera system is in normal working condition and can complete the predetermined tasks, such as taking pictures, recording videos, or other image processing operations, and all components of the system (such as lenses, sensors, processors, etc.) are operating normally, and users can access and use the above functions. Fault mode: The camera system encounters a problem, resulting in some or all functions being unable to be used normally. Fault states can be divided into level 1, 2, and 3 faults, and different fault levels correspond to different processing measures. Calibration mode: The camera system is undergoing calibration operations to ensure image quality and measurement accuracy. During the calibration process, the system adjusts various parameters of the camera to correct the deviation of the lens and sensor. Upgrade mode: The camera system is undergoing a software or firmware upgrade to introduce new features or fix known vulnerabilities. During the upgrade process, the system may temporarily be unable to provide normal services. Factory mode: The camera system is in factory settings or test mode for factory testing, production, or maintenance. In factory mode, the system will undergo comprehensive hardware and software testing to ensure that it meets quality standards before leaving the factory.
[0108] In one embodiment, a vehicle module state management table can be obtained for different modes to be switched. The vehicle module state management table is obtained by the developer according to the current project configuration. The vehicle module state management table can run the entire system efficiently and with low load without affecting the function. The vehicle module state management table can be changed according to different projects to adapt to the best effect.
[0109] Table 1 Vehicle module status management table
[0110]
[0111] Specifically, 1. For mode switching conditions: When the vehicle system receives a mode switching request (such as switching from normal working mode to low power mode, or entering shutdown mode), SMM determines the new mode based on the current system state and external requests. The triggering conditions for mode switching may include: user instructions, sensor data, system self-test results, error events, etc. The data source for mode switching: SMM on the MCU side, and app on the SoC side.
[0112] 2. For starting / shutting down vehicle modules: According to the target mode after switching, SMM starts the required modules and gradually shuts down the modules that are no longer needed. SMM will start the modules according to the pre-defined dependencies to ensure the continuity of key system functions. For example, according to the configuration management in the figure above, when switching from user mode to upgrade mode, SMM shuts down the data return, camera calibration, and vehicle parameter modules, but keeps the state management module and activates the upgrade module.
[0113] 3. Status monitoring and confirmation: During the module startup and shutdown process, SMM monitors the status of each module in real time to ensure that all modules respond correctly. When a module cannot be shut down or started normally, SMM will enter the error handling mode to correct the error or try again.
[0114] In one embodiment, the process of the power-off mode includes three stages: processing a power-off request, waiting for a module response, and powering off the system.
[0115] Specifically, 1. Processing of power-off request: When the system receives a power-off request (shutdown, sleep, or enter error mode), SMM first notifies all modules that are currently activated and operating normally. After receiving the notification, each module will complete the current processing task, save the data, and return a confirmation signal to the status management module.
[0116] 2. Waiting for module response: After receiving confirmation signals from all modules, SMM gradually shuts down the modules until the system enters the predetermined power-off state. If a module does not respond within the specified time or cannot be shut down normally, SMM will enter error handling mode to avoid data loss or system damage caused by forced shutdown.
[0117] 3. System power off: After all modules are successfully shut down, the SMM shuts down the power control module to complete the system power off process.
[0118] In this embodiment, by dynamically managing the status of each functional module, the system can automatically pull up the required modules and close irrelevant modules according to the current working mode and mode switching request, thereby avoiding system instability caused by module error shutdown or incorrect startup. When receiving a mode switching request (such as shutdown, error handling, sleep, etc.), the system can wait for all modules to complete the current work before powering off, thereby ensuring the integrity of the data and the stability of the system. In addition, in different modes, the system only activates necessary modules, reducing unnecessary power consumption. Especially in low power or sleep mode, the system can effectively reduce energy consumption and extend the service life of the equipment. In addition, SMM can respond quickly when receiving a mode switching request, pull up the required modules and close irrelevant modules, thereby speeding up the system mode switching speed and improving operating efficiency. Finally, the error handling mechanism can quickly enter the error handling mode when detecting system or module abnormalities, perform data protection and system safety shutdown operations, and avoid data loss or system crashes caused by errors.
[0119] In an exemplary embodiment, the embodiment of the present application manages the vehicle system through methods such as dynamic module management, power-off management, error detection and processing, system management, and energy efficiency management.
[0120] Specifically, 1. State Management Module (SMM): As the core control unit of the entire system, SMM dynamically manages the start and stop of each functional module according to the current working mode of the system, and ensures the optimal resource configuration of the system in different states.
[0121] 2. Dynamic module management based on mode switching: Through mode switching requests, SMM can dynamically determine and pull up or shut down specific modules. This function allows the system to smoothly switch between different modes (such as normal working mode, low power mode, sleep mode, etc.), maximize system resource utilization, and adjust module status according to actual needs.
[0122] 3. Intelligent power-off management: When receiving a request to switch to shutdown, sleep or error handling mode, SMM will wait for all functional modules to complete their current processing tasks before powering off. This intelligent power-off management ensures data integrity and avoids system instability or data loss caused by sudden power outages.
[0123] 4. Error detection and handling mechanism: When the system detects a serious error, SMM will automatically enter the error handling mode and perform operations such as data preservation and system protection to ensure the security and reliability of the system.
[0124] 5. Full system collaborative management: All functional modules in the vehicle system are uniformly managed by SMM to ensure collaborative work between modules. When the system switches modes, SMM can start and shut down modules in the order of dependencies to ensure the continuity and stability of system functions.
[0125] 6. Efficient energy management: Through intelligent management of modules in each mode, the solution achieves efficient energy management. In low power mode, the system only retains the core functions, and other modules enter low power or shutdown state, significantly reducing the overall energy consumption of the system.
[0126] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0127] Based on the same inventive concept, the embodiment of the present application also provides a mode switching device for implementing the mode switching method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more mode switching device embodiments provided below can refer to the limitations on the mode switching method above, and will not be repeated here.
[0128] In an exemplary embodiment, as shown in FIG5 , a mode switching device 500 is provided, comprising: a first acquisition module 501, a second acquisition module 502 and a switching module 503, wherein:
[0129] The first acquisition module 501 is used to obtain the current state of each target vehicle module and the to-be-switched mode matching the mode switching request in response to the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in the vehicle system;
[0130] The second acquisition module 502 is used to acquire the to-be-switched state of each target vehicle module that matches the to-be-switched mode from a pre-constructed vehicle module state management table according to the to-be-switched mode;
[0131] The switching module 503 is used to determine the vehicle modules to be switched included in the vehicle system based on the current state of each target vehicle module and the state to be switched, and perform state switching on each vehicle module to be switched.
[0132] Furthermore, the device also includes a mode initialization module, which is used to: determine the initial mode of the vehicle system if it is detected that the vehicle system is powered on; obtain the to-be-switched state of each target vehicle module that matches the initial mode from a pre-constructed vehicle module state management table according to the initial mode; and switch the state of each target vehicle module according to the to-be-switched state of the target vehicle module so that the vehicle system enters the initial mode.
[0133] Furthermore, the device also includes a request acquisition module, which is used to: receive a mode switching request sent by the vehicle system; wherein the mode switching request is generated based on a preset trigger condition after the vehicle system meets the preset trigger condition; the preset trigger condition includes a system state in the vehicle system reaching a preset state, and the system state of the vehicle system is determined by at least one of user instructions, sensor data, system self-test results, and system error events in the vehicle system.
[0134] Furthermore, the switching module 503 is specifically used to: when the current vehicle module is the target vehicle module, determine the difference between the current state of the current vehicle module and the state to be switched of the current vehicle module; the current vehicle module is any vehicle module in the vehicle system; if the difference is a preset switching value, determine that the current vehicle module is the vehicle module to be switched.
[0135] Furthermore, the switching module 503 is specifically used to: when the current vehicle module is not the target vehicle module, obtain the target vehicle module that has a dependency relationship with the current vehicle module; when the target vehicle module that has a dependency relationship is the vehicle module to be switched, determine that the current vehicle module is the vehicle module to be switched.
[0136] Furthermore, the device also includes a power-off module, which is used for: if the mode to be switched in the mode switching request is the power-off mode, then sending a power-off notification message to the vehicle module to be shut down in the power-off mode, so that the vehicle module to be shut down completes the processing of the current business data and responds to the power-off notification message; the vehicle module to be shut down is determined based on the vehicle module status management table; according to the power-off confirmation message returned by each vehicle module to be shut down, shutting down the vehicle module corresponding to the power-off confirmation message; when all the vehicle modules to be shut down are shut down, shutting down the power control module to complete the power-off.
[0137] Furthermore, the power-off module is specifically used for: if within a preset time, each vehicle module to be shut down returns a corresponding power-off confirmation message, then shutting down each vehicle module to be shut down based on the power-off confirmation message; if within a preset time, any vehicle module to be shut down does not return a corresponding power-off confirmation message, then shutting down the vehicle module to be shut down that has returned the power-off confirmation message, and switching the power-off mode to an error handling mode, shutting down the vehicle module to be shut down that has not returned the power-off confirmation message through the error handling mode; the error handling mode is used to protect the business data of the vehicle module to be shut down before forced power-off.
[0138] Each module in the above-mentioned mode switching device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0139] In an exemplary embodiment, an electronic device is provided, which may be a vehicle-side control device, and its internal structure diagram may be shown in FIG6 . The vehicle-side control device includes a processor and a memory. The processor, the memory, and the input / output interface are connected via a system bus. The processor of the vehicle-side control device is used to provide computing and control capabilities. The memory of the vehicle-side control device stores a computer program. The memory provides an environment for the operation of the computer program. When the computer program is executed by the processor, a mode switching method is implemented.
[0140] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0141] In an exemplary embodiment, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the following steps are implemented: in response to a mode switching request, obtaining the current state of each target vehicle module and the mode to be switched that matches the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in a vehicle system;
[0142] According to the mode to be switched, from a pre-constructed vehicle module state management table, the state to be switched of each target vehicle module matching the mode to be switched is obtained;
[0143] Based on the current state of each target vehicle module and the state to be switched, the vehicle modules to be switched included in the vehicle system are determined, and the state of each vehicle module to be switched is switched.
[0144] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0145] In response to a mode switching request, obtaining the current state of each target vehicle module and the mode to be switched that matches the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in the vehicle system;
[0146] According to the mode to be switched, from a pre-constructed vehicle module state management table, the state to be switched of each target vehicle module matching the mode to be switched is obtained;
[0147] Based on the current state of each target vehicle module and the state to be switched, the vehicle modules to be switched included in the vehicle system are determined, and the state of each vehicle module to be switched is switched.
[0148] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0149] In response to a mode switching request, obtaining the current state of each target vehicle module and the mode to be switched that matches the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in the vehicle system;
[0150] According to the mode to be switched, from a pre-constructed vehicle module state management table, the state to be switched of each target vehicle module matching the mode to be switched is obtained;
[0151] Based on the current state of each target vehicle module and the state to be switched, the vehicle modules to be switched included in the vehicle system are determined, and the state of each vehicle module to be switched is switched.
[0152] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0153] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0155] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A mode switching method, characterized in that: Applied to a vehicle management module, the method comprises: In response to a mode switching request, obtaining a current state of each target vehicle module and a mode to be switched that matches the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in a vehicle system; According to the to-be-switched mode, acquiring the to-be-switched state of each of the target vehicle modules matching the to-be-switched mode from a pre-constructed vehicle module state management table; Based on the current state and the state to be switched of each of the target vehicle modules, the vehicle modules to be switched included in the vehicle system are determined, and the state of each of the vehicle modules to be switched is switched.
2. The method according to claim 1, characterized in that Before obtaining the current state of each target vehicle module in response to the mode switching request, the method further includes: If it is detected that the vehicle system is powered on, determining an initial mode of the vehicle system; According to the initial mode, obtaining the to-be-switched state of each of the target vehicle modules matching the initial mode from the pre-constructed vehicle module state management table; According to the to-be-switched state of the target vehicle modules, the state of each target vehicle module is switched so that the vehicle system enters the initial mode.
3. The method according to claim 1, characterized in that Before obtaining the current state of each target vehicle module in response to the mode switching request, the method further includes: Receiving a mode switching request sent by a vehicle system; the mode switching request is generated based on a preset trigger condition after the vehicle system meets a preset trigger condition; Among them, the preset trigger condition includes that the system state in the vehicle system reaches a preset state, and the system state of the vehicle system is determined by at least one of user instructions, sensor data, system self-test results, and system error events in the vehicle system.
4. The method according to claim 1, characterized in that: The determining of the vehicle modules to be switched included in the vehicle system based on the current state and the state to be switched of each of the target vehicle modules comprises: In the case where the current vehicle module is the target vehicle module, determining a difference between a current state of the current vehicle module and a state to be switched of the current vehicle module; the current vehicle module is any vehicle module in the vehicle system; If the difference is a preset switching value, the current vehicle module is determined to be a vehicle module to be switched.
5. The method according to claim 4, characterized in that The determining of the vehicle modules to be switched included in the vehicle system based on the current state and the state to be switched of each of the target vehicle modules comprises: When the current vehicle module is not the target vehicle module, obtaining a target vehicle module having a dependency relationship with the current vehicle module; In a case where the target vehicle module having a dependency relationship is a vehicle module to be switched, the current vehicle module is determined to be the vehicle module to be switched.
6. The method according to claim 1, characterized in that The method further comprises: If the mode to be switched in the mode switching request is the power-off mode, a power-off notification message is sent to the vehicle module to be shut down in the power-off mode, so that the vehicle module to be shut down completes the processing of the current business data and responds to the power-off notification message; the vehicle module to be shut down is determined based on the vehicle module state management table; According to the received power-off confirmation message returned by each of the vehicle modules to be shut down, shut down the vehicle module corresponding to the power-off confirmation message; When all the vehicle modules to be shut down are shut down, the power control module is shut down to complete power off.
7. The method according to claim 6, characterized in that The step of shutting down the vehicle modules corresponding to the power-off confirmation messages returned by the vehicle modules to be shut down according to the received power-off confirmation messages includes: If within the preset time, each of the to-be-shutdown vehicle modules returns a corresponding power-off confirmation message, shutting down each of the to-be-shutdown vehicle modules based on the power-off confirmation message; If within the preset time, any of the vehicle modules to be shut down does not return the corresponding power-off confirmation message, then the vehicle modules to be shut down that have returned the power-off confirmation message are shut down, and the power-off mode is switched to the error handling mode, and the vehicle modules to be shut down that have not returned the power-off confirmation message are shut down through the error handling mode; the error handling mode is used to protect the business data of the vehicle module to be shut down before forced power-off.
8. A mode switching device, characterized in that: The device comprises: A first acquisition module, configured to acquire, in response to a mode switching request, a current state of each target vehicle module and a mode to be switched that matches the mode switching request; the target vehicle module is a vehicle module included in a pre-constructed vehicle module state management table in a vehicle system; A second acquisition module is used to acquire, according to the mode to be switched, the to-be-switched state of each of the target vehicle modules that matches the mode to be switched from a pre-constructed vehicle module state management table; The switching module is used to determine the vehicle modules to be switched contained in the vehicle system based on the current state and the state to be switched of each of the target vehicle modules, and to switch the state of each of the vehicle modules to be switched.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.