Abnormality processing method and device, equipment, storage medium and vehicle
By refining the abnormal information in the vehicle control unit and applying hierarchical processing strategies, the problem of poor stability of the domain controller is solved, the stability and fault recovery capabilities of the system are improved, and the normal operation of the vehicle control unit is ensured.
Patent Information
- Application Number
- CN202410674192.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-08-30
AI Technical Summary
The stability of the domain controller in the vehicle system is poor, which may cause a variety of abnormal problems during operation, affecting the overall stability of the system.
By obtaining the target system exception information in the vehicle control unit, the exception information is refined into different levels and processed according to the preset processing strategies at each level, including exception processing strategies at the system level, process level, module level and interface level. , such as soft restart, initialization and detection strategies, to ensure accurate processing of abnormal information and prevent further deterioration of the problem.
It improves the stability of the vehicle control unit system, reduces the risk of data loss, enhances fault recovery capabilities, accurately locates and processes abnormal information, reduces the impact on normal operating parts, and ensures the continued stable operation of the system.
Smart Images

Figure CN118567331A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, in particular to the field of exception handling technology, and specifically to an exception handling method, device, equipment, storage medium and vehicle. Background Art
[0002] With the rapid development of automotive electronic technology, domain controllers have become an important part of the core control unit of vehicles. Domain controllers generally use a hardware architecture that combines a microprocessor unit (MPU) and a microcontroller unit (MCU).
[0003] However, the MPU system is highly complex and may face various abnormal problems during operation, resulting in poor stability of the vehicle system where the domain controller is located. Summary of the invention
[0004] The present application provides an exception handling method, device, equipment, storage medium and vehicle to at least solve the technical problem of poor stability of the vehicle system where the domain controller is located in the related art. The technical solution of the present application is as follows:
[0005] According to the first aspect of the present application, there is provided an exception handling method, including: obtaining exception information of a target system in a vehicle control unit; the target system includes multiple levels; there is a subordinate relationship between the multiple levels; determining the exception level corresponding to the exception information from the multiple levels; executing a target processing strategy corresponding to the exception level in a preset strategy set to process the exception information; the preset strategy set includes preset processing strategies corresponding to each of the multiple levels.
[0006] According to the above technical means, the present application can refine the abnormal information to different levels, so as to locate the problem more accurately, avoid indiscriminate investigation of the entire system, and handle the abnormality according to the corresponding processing strategy of each level, thereby accurately handling the abnormal information, helping to prevent the problem from further deteriorating and ensuring the stable operation of the vehicle control unit system. Therefore, the present application can improve the stability of the system.
[0007] In one possible manner, the method further includes: multiple levels include: system level, process level, module level and interface level, the interface level is subordinate to the module level, the module level is subordinate to the process level, and the process level is subordinate to the system level.
[0008] In one possible embodiment, the above method also includes: the exception level is the system level, and the target exception handling strategy corresponding to the system level is executed, including: restarting the target system through a preset restart method; the preset restart method includes one or more of the following: soft restart and / or hard restart.
[0009] According to the above technical means, the present application can restart the system through multiple restarting methods when an abnormality occurs at the system level. Different restarting methods can be targeted at different types of abnormalities or failures, thereby reducing the risk of data loss and improving fault recovery capabilities. Therefore, the present application can improve the stability of the system.
[0010] In one possible manner, the above method also includes: the exception level is the process level, the process level includes multiple processes, each of the multiple processes includes at least one thread; executing the exception handling strategy corresponding to the process level, including: determining the target thread in which the exception information appears in the target process; the target process is the process in which the exception information appears in the process level; when threads other than the target thread in the target process have not executed tasks and the number of restarts is less than a first number threshold, restart the target process and update the number of restarts; when the number of restarts is greater than or equal to the first number threshold, or threads other than the target thread in the target process are executing tasks, perform exception handling according to the exception handling strategy corresponding to the system level.
[0011] According to the above technical means, the present application can accurately locate the location where the abnormal information occurs and quickly process it, and can restart the target process when other threads in the target process except the target thread are not executing tasks, thereby minimizing the impact on other normal operating parts of the system. Therefore, the present application can improve the stability of the system.
[0012] In one possible manner, the above method also includes: determining a target module in which exception information appears in the module hierarchy; initializing the target module and updating the initialization times when there is no dependency between the target module and other modules in the target system and the number of initialization times is less than a second number threshold; performing exception handling according to the exception handling strategy corresponding to the process hierarchy when there is a dependency between the target module and other modules in the target system or the number of initialization times is greater than or equal to the second number threshold.
[0013] According to the above technical means, the present application can accurately locate the location where the abnormal information occurs and quickly process it, and can isolate and process the fault of the abnormal module separately to ensure that the normal operation of other modules is not affected. Therefore, the present application can improve the stability of the system.
[0014] In one possible embodiment, the method further includes: determining a target interface where abnormal information occurs; operating the target interface when the target system meets the operating conditions of the target interface; updating the number of detections when the duration for which the target system does not meet the operating conditions of the target interface is equal to a preset duration; and performing exception handling according to the exception handling strategy corresponding to the module level when the number of detections is greater than or equal to a third quantity threshold.
[0015] According to the above technical means, the present application can accurately locate the location where the abnormal information occurs and quickly process it, and intelligently determine the duration of the abnormality by recording and comparing the number of detections, so as to further process it according to the abnormality handling strategy corresponding to the module level when the number of detections exceeds the set threshold, ensuring that the handling measures are more accurate and effective. Therefore, the present application can improve the stability of the system.
[0016] In one possible manner, the method further includes: during the operation of the target system, monitoring whether there is an abnormal event in the target system; and when there is an abnormal event in the target system, obtaining abnormal information corresponding to the abnormal event in the target system.
[0017] According to the above technical means, the present application can detect abnormal events just when they occur or are about to occur through continuous monitoring, thereby supporting timely response and handling of abnormal events in the future and reducing the possibility of system downtime or crash due to failure. Therefore, the present application can improve the stability of the system.
[0018] According to the second aspect provided by the present application, there is provided an exception handling device, including: an acquisition unit, a determination unit and an execution unit; the acquisition unit is used to acquire exception information of a target system in a vehicle control unit; the target system includes multiple levels; there is a subordinate relationship between the multiple levels; the determination unit is used to determine the exception level corresponding to the exception information from the multiple levels; the execution unit is used to execute a target processing strategy corresponding to the exception level in a preset strategy set to process the exception information; the preset strategy set includes preset processing strategies corresponding to each of the multiple levels.
[0019] In one possible manner, the execution unit is specifically used to: restart the target system through a preset restart method; the preset restart method includes one or more of the following: soft restart and / or hard restart.
[0020] In one possible manner, the execution unit is specifically used to: determine a target thread in a target process where exception information appears; the target process is a process in a process hierarchy where exception information appears; when threads other than the target thread in the target process have not executed tasks and the number of restarts is less than a first threshold, restart the target process and update the number of restarts; when the number of restarts is greater than or equal to the first threshold, or threads other than the target thread in the target process are executing tasks, perform exception handling according to an exception handling strategy corresponding to the system hierarchy.
[0021] In one possible manner, the execution unit is specifically used to: determine a target module in which exception information appears in the module hierarchy; initialize the target module and update the initialization count when there is no dependency between the target module and other modules in the target system and the number of initializations is less than a second quantity threshold; perform exception handling according to the exception handling strategy corresponding to the process hierarchy when there is a dependency between the target module and other modules in the target system or the number of initializations is greater than or equal to the second quantity threshold.
[0022] In one possible manner, the execution unit is specifically used to: determine the target interface where the exception information occurs; run the target interface when the target system meets the operating conditions of the target interface; update the number of detections when the duration for which the target system does not meet the operating conditions of the target interface is equal to a preset duration; and perform exception handling according to the exception handling strategy corresponding to the module level when the number of detections is greater than or equal to a third quantity threshold.
[0023] In one possible embodiment, the device also includes: a monitoring unit; the monitoring unit is used to monitor whether there are abnormal events in the target system during the operation of the target system; and the acquisition unit is also used to acquire abnormal information corresponding to the abnormal event in the target system when there is an abnormal event in the target system.
[0024] According to the third aspect provided by the present application, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to execute instructions to implement the method of the above-mentioned first aspect and any possible implementation manner thereof.
[0025] According to the fourth aspect provided by the present application, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method in the above-mentioned first aspect and any possible implementation method thereof.
[0026] According to the fifth aspect provided by the present application, a computer program product is provided, the computer program product comprising computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method of the above-mentioned first aspect and any possible implementation manner thereof.
[0027] Therefore, the above technical features of the present application have the following beneficial effects:
[0028] (1) This application can refine the abnormal information to different levels, so as to locate the problem more accurately, avoid indiscriminate investigation of the entire system, and handle the abnormality according to the corresponding processing strategy of each level, thereby accurately handling the abnormal information, helping to prevent the problem from further deteriorating and ensuring the stable operation of the vehicle control unit system. Therefore, this application can improve the stability of the system.
[0029] (2) This application can restart the system through multiple restart methods when an abnormality occurs at the system level. Different restart methods can be targeted at different types of abnormalities or failures, thereby reducing the risk of data loss and improving fault recovery capabilities. Therefore, this application can improve the stability of the system.
[0030] (3) This application can accurately locate the location where the abnormal information occurs and quickly process it, and can restart the target process when other threads in the target process except the target thread are not executing tasks, thereby minimizing the impact on other normal operating parts of the system. Therefore, this application can improve the stability of the system.
[0031] (4) The present application can accurately locate the location where the abnormal information occurs and process it quickly, and can isolate and process the fault of the abnormal module separately to ensure that the normal operation of other modules is not affected. Therefore, the present application can improve the stability of the system.
[0032] (5) This application can accurately locate the location where the abnormal information occurs and quickly process it. By recording and comparing the number of detections, it can intelligently determine the duration of the abnormality. When the number of detections exceeds the set threshold, it can further process it according to the abnormality handling strategy corresponding to the module level, ensuring that the handling measures are more accurate and effective. Therefore, this application can improve the stability of the system.
[0033] (6) This application can detect abnormal events just after they occur or are about to occur through continuous monitoring, thereby supporting timely response and handling of abnormal events in the future and reducing the possibility of system downtime or crash due to failure. Therefore, this application can improve the stability of the system.
[0034] It should be noted that the technical effects brought about by any implementation method in the second to fifth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here.
[0035] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.
[0037] Figure 1 is a flow chart of an exception handling method according to an exemplary embodiment;
[0038] Figure 2 is a schematic diagram of an architecture of a target system according to an exemplary embodiment;
[0039] Figure 3 is a schematic diagram of an MPU restart process according to an exemplary embodiment;
[0040] Figure 4 is a schematic diagram of a process-level exception handling flow according to an exemplary embodiment;
[0041] Figure 5 is a schematic diagram of a module-level exception handling process according to an exemplary embodiment;
[0042] Figure 6 is a schematic diagram of an interface processing flow at an interface level according to an exemplary embodiment;
[0043] Figure 7 is a block diagram of an exception handling device according to an exemplary embodiment;
[0044] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0045] In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0047] For ease of understanding, the exception handling method provided in this application is specifically introduced below with reference to the accompanying drawings.
[0048] Figure 1 is a flowchart of an exception handling method according to an exemplary embodiment. Figure 1 As shown, the exception handling method includes the following steps: S101-S103.
[0049] S101. An abnormality handling device obtains abnormality information of a target system in a vehicle control unit.
[0050] The target system may include multiple levels, and there may be a subordinate relationship between the multiple levels.
[0051] In one possible approach, the multiple levels may include: system level, process level, module level and interface level, the interface level is subordinate to the module level, the module level is subordinate to the process level, and the process level is subordinate to the system level.
[0052] For example, Figure 2 FIG. 1 is a schematic diagram of the architecture of a target system. The target system may include: a system level, a process level, a module level, and an interface level.
[0053] In one possible approach, each layer of the target system represents a different level of abstraction. The system layer involves a global view of the entire system, including all components, functions, goals of the system, and its interactions with the external environment (such as other systems, users, etc.). The process layer includes multiple processes in the target system, which may be designed to perform specific functions or achieve system goals. The process layer is located below the system layer, and it organizes activities based on the goals and architecture defined at the system layer. At the same time, the execution of a process may involve multiple modules and interfaces. The module layer includes multiple functional units or modules, each of which is responsible for implementing a specific function or task. The module layer is located below the process layer because a process may consist of multiple modules. At the same time, the interaction between modules is achieved through interfaces. The interface layer includes multiple interfaces, which are the interaction points between different modules or components, and define how to pass data, commands, and status information. The interface layer is the bridge for interaction between all other layers. Whether it is the system layer, process layer, or module layer, the interaction between them is achieved through interfaces.
[0054] In one possible manner, the exception handling device may monitor whether there is an abnormal event in the target system during the operation of the target system. The exception handling device may obtain abnormal information corresponding to the abnormal event in the target system when there is an abnormal event in the target system. The specific implementation of the abnormal handling device obtaining the abnormal information of the target system in the vehicle control unit can refer to the following S601-S602. No further details will be given here.
[0055] S102: The exception handling device determines an exception level corresponding to the exception information from multiple levels.
[0056] In a possible manner, the abnormal level can be used to represent the level at which the abnormality occurs among multiple levels.
[0057] Specifically, the abnormal information may include a level identifier. The abnormality handling device may determine the abnormal level corresponding to the level identifier from multiple levels.
[0058] Exemplarily, the level identifier may be a process level. The exception handling device may determine the process level among the multiple levels as the exception level.
[0059] S103: The exception processing device executes a target processing strategy corresponding to the exception level in the preset strategy set to process the exception information.
[0060] The preset strategy set may include preset processing strategies corresponding to multiple levels.
[0061] In one possible manner, the exception handling device may be configured with a storage unit. A preset strategy set may be stored in the storage unit. The exception handling device may read a target processing strategy corresponding to the exception level in the preset strategy set, and execute the target processing strategy corresponding to the exception level in the preset strategy set to process the exception information.
[0062] Exemplarily, the exception level may be a process level, and the exception handling device may read a target storage policy corresponding to the process level from the storage unit.
[0063] In a possible manner, the exception level may be a system level, and the specific implementation of the exception handling device executing the target exception handling strategy corresponding to the system level may refer to the following S201, which will not be described in detail here.
[0064] In a possible manner, the exception level may be a process level, and the specific implementation of the exception handling device executing the target exception handling strategy corresponding to the process level may refer to the following S301-S303, which will not be described in detail here.
[0065] In a possible manner, the exception level may be a module level, and the specific implementation of the exception handling device executing the target exception handling strategy corresponding to the module level may refer to the following S401-S403, which will not be described in detail here.
[0066] In a possible manner, the exception level may be an interface level, and the specific implementation of the exception handling device executing the target exception handling strategy corresponding to the interface level may refer to the following S501-S504, which will not be described in detail here.
[0067] Based on the above technical solution, the exception handling method provided in the present application can obtain the exception information of the target system in the vehicle control unit, and determine the exception level corresponding to the exception information from multiple levels, so as to further execute the target processing strategy corresponding to the exception level in the preset strategy set to process the exception information.
[0068] Based on this, the present application can refine the abnormal information to different levels, so as to locate the problem more accurately, avoid indiscriminate investigation of the entire system, and handle the abnormality according to the corresponding processing strategy of each level, thereby accurately handling the abnormal information, helping to prevent the problem from further deteriorating and ensuring the stable operation of the vehicle control unit system. Therefore, the present application can improve the stability of the system.
[0069] In some embodiments, the exception level may be a system level. When executing a target exception handling strategy corresponding to the system level, the exception handling method provided in the embodiment of the present application further includes the following steps: S201.
[0070] S201. The exception handling device restarts the target system in a preset restart mode.
[0071] In one possible manner, the preset restart mode may include one or more of the following: soft restart and / or hard restart.
[0072] Optionally, the target system can be set according to actual needs. For example, the target system can be a Linux system or other systems. This application does not make specific restrictions on this.
[0073] Optionally, the soft restart may include: the MPU calls a system instruction to restart. The hard restart may include the MCU restarting the MPU. The MCU restarting the MPU may include: powerkey restart, reset restart, and power-off restart.
[0074] In one possible way, the target system can be an MPU, and the MPU can be a Linux system. When in use, the Linux system can integrate third-party libraries or third-party components to support basic functions, such as inter-process communication, logging functions, etc. Due to the uncertainty of open source systems and third-party components, difficult-to-find problems may occur in specific operating scenarios, which in turn affect normal operation. In addition, some problems involving modules and chips are extremely difficult to handle, and the testing cycle is extremely long and the cost investment is large. Therefore, when the exception handling device detects these problems, it can restart the MPU through a preset restart method.
[0075] In one possible way, the exception handling device can restart the MPU immediately when an exception occurs at the system level and the current MPU does not execute key functions such as the emergency call system (Ecall) and over-the-air technology (OTA) to quickly restore the system to a normal state. Or when the MPU is executing key functions such as Ecall and OTA, and the abnormal problem will have a serious impact on the normal execution of these functions, restart the MPU immediately and restart to continue executing these functions. If the abnormal problem does not have a substantial impact on the use of important functions such as Ecall and OTA being executed, that is, these functions can continue to run stably until completion in an abnormal environment, the exception handling device can restart the MPU after these functions are executed.
[0076] Based on this, the present application can restart the system through multiple restart methods when an abnormality occurs at the system level. Different restart methods can be targeted at different types of abnormalities or failures, thereby reducing the risk of data loss and improving fault recovery capabilities. Therefore, the present application can improve the stability of the system.
[0077] In some embodiments, the exception level may be a process level. When executing a target exception handling strategy corresponding to the process level, the exception handling method provided in the embodiment of the present application further includes the following steps: S301-S303.
[0078] S301, the exception handling device determines a target thread in which exception information appears in a target process.
[0079] The target process is a process in the process hierarchy where abnormal information occurs. The process hierarchy may include multiple processes. Each of the multiple processes may include at least one thread.
[0080] Specifically, the exception information may include a process identifier and a thread identifier. The exception handling device may determine a target process corresponding to the process identifier from the process hierarchy. The exception handling device may determine a target thread corresponding to the thread identifier from the target process.
[0081] S302: When threads other than the target thread in the target process do not execute tasks and the restart count is less than a first threshold, the exception handling device restarts the target process and updates the restart count.
[0082] Optionally, the first quantity threshold may be set according to actual needs. For example, the first quantity threshold may be 10 times or 5 times. This application does not impose any specific restrictions on this.
[0083] Specifically, the exception handling device can determine whether other threads in the target process except the target thread are executing tasks and the number of restarts. The exception handling device can restart the target process and update the number of restarts when other threads in the target process except the target thread are not executing tasks and the number of restarts is less than the first number threshold.
[0084] Alternatively, the exception handling device may determine the number of threads in the target process, and determine whether threads other than the target thread in the target process are executing tasks, and the number of restarts. Determine whether threads other than the target thread in the target process are executing tasks, and the number of restarts. The exception handling device may restart the target process and update the number of restarts when the number of threads in the target process is 1, threads other than the target thread in the target process are not executing tasks (or restarting has no effect on the execution of threads other than the target thread in the target process), and the number of restarts is less than a first number threshold.
[0085] S303: When the number of restarts is greater than or equal to the first number threshold, or when other threads in the target process except the target thread are executing tasks, the exception handling device performs exception handling according to the exception handling strategy corresponding to the system level.
[0086] Specifically, the exception handling device can perform exception handling according to the exception handling strategy corresponding to the system level when the number of restarts is greater than or equal to the first number threshold, or when other threads in the target process except the target thread are executing tasks. That is, the exception handling device can restart the target system in a preset restart mode when the number of restarts is greater than or equal to the first number threshold, or when other threads in the target process except the target thread are executing tasks.
[0087] Based on this, the application can accurately locate the location where the abnormal information occurs and quickly handle it, and can restart the target process when other threads in the target process except the target thread are not executing tasks, thereby minimizing the impact on other normal operating parts of the system. Therefore, the application can improve the stability of the system.
[0088] In some embodiments, the exception level may be a module level. When executing a target exception handling strategy corresponding to the module level, the exception handling method provided in the embodiment of the present application further includes the following steps: S401-S403.
[0089] S401. The exception handling device determines a target module in which exception information appears in the module hierarchy.
[0090] Specifically, in the design of the MPU, each function type is encapsulated in an independent running module, such as a positioning data processing module and a time synchronization module. These modules interact with the bottom layer of the module through the standardized interface provided by the intermediate communication layer to achieve their own specific functions. When the MPU is started or running, the exception handling device can monitor the operation of each module in the module hierarchy and generate exception information when an abnormal event occurs in a module. The exception information may include a module identifier. The exception handling device can determine the target module where the exception information occurs based on the module identifier in the exception information.
[0091] S402: When there is no dependency relationship between the target module and other modules in the target system and the number of initialization times is less than a second quantity threshold, the exception handling device performs initialization processing on the target module and updates the number of initialization times.
[0092] In one possible manner, the initialization process may include: the management process in the exception handling device may perform corresponding operations to stop the application module involved in the exception and perform initialization processing on all initialized underlying interfaces in the module to ensure that the module is completely returned to the initial state. After completing the above operations, the module will be restarted to restore its normal function.
[0093] Optionally, the second quantity threshold may be set according to actual needs. For example, the second quantity threshold may be 5 or 10. This application does not impose any specific limitation on this.
[0094] Specifically, the exception handling device can determine whether there is a dependency relationship between the target module and other modules in the target system, and the number of initialization times of the target module. The exception handling device can perform initialization processing on the target module and update the number of initialization times when there is no dependency relationship between the target module and other modules in the target system and the number of initialization times is less than the second number threshold.
[0095] S403: When there is a dependency relationship between the target module and other modules in the target system, or the number of initializations is greater than or equal to a second quantity threshold, the exception handling device performs exception handling according to an exception handling strategy corresponding to the process level.
[0096] Specifically, the exception handling device can determine whether there is a dependency relationship between the target module and other modules in the target system, as well as the number of initializations of the target module. The exception handling device can perform exception handling according to the exception handling strategy corresponding to the process level when there is a dependency relationship between the target module and other modules in the target system, or when the number of initializations is greater than or equal to the second number threshold. That is, the exception handling device can determine the target thread in the target process where the exception information appears when there is a dependency relationship between the target module and other modules in the target system, or when the number of initializations is greater than or equal to the second number threshold. The exception handling device can restart the target process and update the number of restarts when other threads in the target process except the target thread have not executed tasks, and the number of restarts is less than the first number threshold. The exception handling device can perform exception handling according to the exception handling strategy corresponding to the system level when the number of restarts is greater than or equal to the first number threshold, or when other threads in the target process except the target thread are executing tasks.
[0097] Based on this, the present application can accurately locate the location where the abnormal information occurs and process it quickly, and can perform separate fault isolation and processing on the abnormal module to ensure that the normal operation of other modules is not affected. Therefore, the present application can improve the stability of the system.
[0098] In some embodiments, the exception level may be an interface level. When executing a target exception handling strategy corresponding to the interface level, the exception handling method provided in the embodiment of the present application further includes the following steps: S501-S504.
[0099] S501: The exception handling device determines the target interface where the exception information appears.
[0100] In a possible manner, the exception information may include an interface identifier. The exception handling device may determine the target interface where the exception information appears according to the interface identifier in the exception information.
[0101] For example, during the startup and operation of the MPU, problems may be encountered due to improper system startup timing and resource management. Taking the Linux system as an example, when the system startup speed is slow and the resource loading time is long, it is possible that the application function starts running before the resources are fully prepared. This may lead to resource access conflicts, functional abnormalities, and even reduced system stability. Specifically, when a function in process A depends on the successful startup of a function in process B to run normally, if the startup timing of the two functions is very close, there is a risk that the function in process A starts running before the function in process B is ready. In this case, the function in process A may behave abnormally due to problems such as interface call failure, insufficient resource application, or conditional judgment error. The exception handling device can monitor the problem and generate exception information. The exception handling device can determine the target interface where the exception information appears based on the interface identifier in the exception information.
[0102] S502: The exception handling device operates the target interface when the target system meets the operating conditions of the target interface.
[0103] Specifically, the exception handling device may detect the target system according to a preset period to determine whether the target system meets the operating environment of the target interface. The exception handling device may run the target interface if the target system meets the operating conditions of the target interface.
[0104] Optionally, the preset period can be set according to actual needs. For example, the preset period can be 1 second or 0.5 second. This application does not make specific restrictions on this.
[0105] S503: When the duration during which the target system does not meet the operating conditions of the target interface is equal to a preset duration, the exception handling device updates the number of detection times.
[0106] Specifically, the exception handling device can detect the target system according to a preset period to determine whether the target system meets the operating environment of the target interface. The exception handling device can update the number of detections after completing a cycle. That is, the exception handling device can update the number of detections when the duration of the target system not meeting the operating conditions of the target interface is equal to the preset duration.
[0107] S504: When the number of detections is greater than or equal to a third quantity threshold, the exception handling device performs exception handling according to an exception handling strategy corresponding to the module level.
[0108] Optionally, the third quantity threshold may be set according to actual needs. For example, the third quantity threshold may be 5 or 10. This application does not impose any specific limitation on this.
[0109] Specifically, the exception handling device can determine whether the number of detections is greater than or equal to a third quantity threshold. The exception handling device can perform exception handling according to the exception handling strategy corresponding to the module level when the number of detections is greater than or equal to the third quantity threshold. That is, the exception handling device can determine the target module in which the exception information appears in the module level. The exception handling device can perform initialization processing on the target module and update the initialization number when there is no dependency relationship between the target module and other modules in the target system and the number of initializations is less than the second quantity threshold. The exception handling device can perform exception handling according to the exception handling strategy corresponding to the process level when there is a dependency relationship between the target module and other modules in the target system or the number of initializations is greater than or equal to the second quantity threshold.
[0110] Based on this, the application can accurately locate the location where the abnormal information occurs and quickly process it, and intelligently determine the duration of the abnormality by recording and comparing the number of detections, so that when the number of detections exceeds the set threshold, it can be processed according to the abnormality handling strategy corresponding to the module level, ensuring that the handling measures are more accurate and effective. Therefore, the application can improve the stability of the system.
[0111] In some embodiments, when acquiring abnormal information of a target system in a vehicle control unit, the abnormality handling method provided in the embodiments of the present application further includes the following steps: S601-S602.
[0112] S601. During the operation of the target system, the exception handling device monitors whether there is an abnormal event in the target system.
[0113] In a possible manner, the abnormal event characteristics may be preset in the abnormality handling device, and the abnormal event may include system crash, service unresponsiveness, performance degradation, resource exhaustion, etc.
[0114] In a possible manner, a monitoring tool may be configured in the exception handling device, and the monitoring tool may detect in real time whether there is an abnormal event in the target system during the operation of the target system.
[0115] S602: When an abnormal event occurs in the target system, the abnormality handling device obtains abnormality information corresponding to the abnormal event in the target system.
[0116] Specifically, when an abnormal event occurs in the target system, the abnormality handling device can collect relevant abnormality information. The abnormality information may include: system logs, performance indicators, etc. The abnormality handling device can integrate the collected abnormal information to form a complete abnormality report. This report should include the type of abnormal event, the time of occurrence, the scope of impact, and the type of abnormal event.
[0117] Based on this, the present application can detect abnormal events just after they occur or are about to occur through continuous monitoring, thereby supporting timely response and handling of abnormal events in the future, and reducing the possibility of system downtime or crash due to failure. Therefore, the present application can improve the stability of the system.
[0118] In one embodiment, Figure 3 , which is a schematic diagram of an MPU restart process.
[0119] In one possible manner, the exception handling device can monitor whether the MPU is operating normally when the MPU is running. The exception handling device can continue to run the MPU when the MPU is operating normally, or call a system instruction to restart when the MPU is operating abnormally. The system instruction may include a reboot instruction in the Linux system. The reboot instruction can be executed in the kernel, end all processes, save the system state, stop the device, and then restart the system.
[0120] In one possible way, the exception handling device can restart the system if the system instruction is successfully executed, or restart the MPU through the powerkey if the system instruction fails to execute. That is, the MCU can lower the power supply of the powerkey for a specific time so that the module CPU receives the interrupt signal generated by the power management integrated circuit. The CPU can respond to the interrupt signal and execute the MPU shutdown instruction, and then the power management integrated circuit is powered off to shut down the module. Then, the MCU can pull up the power supply of the powerkey, the power management integrated circuit can re-supply power to the CPU, and the MPU starts running again.
[0121] In one possible way, the exception handling device can perform a restart if the module responds normally, or restart the MPU by resetting it if the module does not respond normally. That is, the exception handling device can perform a reset method if the CPU does not correctly respond to the signal of the power management integrated circuit during the powerkey restart process. The exception handling device can directly operate the reset pin connected to the CPU to reset the central processing unit (CPU) and restart it. Reset can avoid restart failures caused by other factors such as the MPU power management integrated circuit.
[0122] In one possible way, the exception handling device can restart the module when the module responds normally, or restart the MPU by powering off the module when the module does not respond normally. That is, the exception handling device can restart the MPU by powering off the module when the CPU cannot respond to any restart signal due to a software failure. The exception handling device can control the module to power off so that the MPU stops working completely. The exception handling device can re-power the module according to the MCU to restart the MPU.
[0123] In one embodiment, Figure 4 The figure shows a schematic diagram of a process-level exception handling process.
[0124] In one possible manner, the exception handling device may monitor the running state of the process level and obtain the exception information. The exception handling device may determine the target process and the target thread according to the exception information. The exception handling device may restart the target process and update the restart count when the target thread is abnormal and restarting the target thread is invalid, the number of threads in the target process is 1, the restart does not affect the execution of other threads in the target process except the target thread, and the number of restarts is less than a first number threshold.
[0125] Alternatively, the exception handling device can perform exception handling according to the exception handling strategy corresponding to the system level when the number of threads in the target process is greater than 1, or the restart affects the execution of other threads in the target process except the target thread, or the number of restarts is greater than or equal to the first number threshold.
[0126] In one embodiment, Figure 5 The figure shows a schematic diagram of a module-level exception handling process.
[0127] In one possible manner, the exception handling device may perform initialization processing on the target module when an exception exists in the target module, initialization will not affect the operation of other modules, and the number of initializations is less than a second threshold value. The initialization processing includes: the management process in the exception handling device may perform corresponding operations to stop the operation of the application module involved in the exception, and perform initialization processing on all initialized underlying interfaces in the module to ensure that the module is completely returned to the initial state. After completing the above operations, the module will be restarted to restore its normal function.
[0128] In one possible manner, the exception handling device may perform exception handling according to the exception handling strategy corresponding to the process level when an exception exists in the target module, initialization will affect the operation of other modules, or the number of initializations is greater than or equal to a second quantity threshold.
[0129] In one possible manner, when there is no abnormality in the target module of the exception handling device, the target module continues to run.
[0130] In one embodiment, Figure 6 The figure shows a schematic diagram of an interface processing flow at an interface level.
[0131] In one possible manner, the exception handling device may determine the target interface where the exception information appears. The exception handling device may detect whether the target system satisfies the operating conditions of the target interface. The exception handling device may operate the target interface when the target system satisfies the operating conditions of the target interface. The exception handling device may update the number of detections when the duration for which the target system does not satisfy the operating conditions of the target interface is equal to a preset duration. The exception handling device may perform exception handling according to the exception handling strategy corresponding to the module level when the number of detections is greater than or equal to a third quantity threshold.
[0132] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the exception handling device or electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0133] The embodiment of the present application can divide the functional modules of the exception handling device or electronic device according to the above method. For example, the exception handling device or electronic device can include various functional modules corresponding to the various functional divisions, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0134] Figure 7 is a block diagram of an exception handling device according to an exemplary embodiment. Figure 7 The exception handling device includes: an acquisition unit 701, a determination unit 702, an execution unit 703 and a monitoring unit 704.
[0135] In a possible manner, the acquisition unit 701 is used to acquire abnormal information of a target system in a vehicle control unit.
[0136] In a possible manner, the determination unit 702 is configured to determine an abnormality level corresponding to the abnormality information from multiple levels.
[0137] In a possible manner, the execution unit 703 is used to execute a target processing strategy corresponding to the abnormal level in a preset strategy set to process abnormal information; the preset strategy set includes preset processing strategies corresponding to multiple levels.
[0138] In one possible manner, the execution unit 703 is specifically configured to: restart the target system in a preset restart mode; the preset restart mode includes one or more of the following: soft restart and / or hard restart.
[0139] In one possible manner, the execution unit 703 is specifically used to: determine a target thread in which exception information appears in a target process; the target process is a process in which exception information appears in a process hierarchy; when threads other than the target thread in the target process have not executed tasks and the number of restarts is less than a first threshold, restart the target process and update the number of restarts; when the number of restarts is greater than or equal to the first threshold, or threads other than the target thread in the target process are executing tasks, perform exception handling according to an exception handling strategy corresponding to the system hierarchy.
[0140] In one possible manner, the execution unit 703 is specifically used to: determine a target module in which exception information appears in the module hierarchy; when there is no dependency relationship between the target module and other modules in the target system, and the number of initialization times is less than a second quantity threshold, initialize the target module and update the number of initialization times; when there is a dependency relationship between the target module and other modules in the target system, or the number of initialization times is greater than or equal to the second quantity threshold, perform exception handling according to the exception handling strategy corresponding to the process hierarchy.
[0141] In one possible manner, the execution unit 703 is specifically used to: determine the target interface where the exception information occurs; operate the target interface when the target system meets the operating conditions of the target interface; update the number of detections when the duration for which the target system does not meet the operating conditions of the target interface is equal to a preset duration; and perform exception handling according to the exception handling strategy corresponding to the module level when the number of detections is greater than or equal to a third quantity threshold.
[0142] In a possible manner, the monitoring unit 704 is used to monitor whether there is any abnormal event in the target system during the operation of the target system.
[0143] In a possible manner, the acquisition unit 701 is further configured to, when an abnormal event occurs in the target system, acquire abnormal information corresponding to the abnormal event that occurs in the target system.
[0144] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0145] Figure 8 FIG. 1 is a block diagram of an electronic device according to an exemplary embodiment. Figure 8 As shown, the electronic device includes but is not limited to: a processor 801 and a memory 802 .
[0146] The memory 802 is used to store executable instructions of the processor 801. It can be understood that the processor 801 is configured to execute instructions to implement the exception handling method in the above embodiment.
[0147] It should be noted that those skilled in the art can understand that Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include Figure 8 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.
[0148] The processor 801 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 802, and calling data stored in the memory 802, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 801 may include one or more processing units. Optionally, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0149] The memory 802 may be used to store software programs and various data. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one functional module (such as a determination unit, a processing unit, etc.), etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0150] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 802 including instructions. The above instructions can be executed by a processor 801 of an electronic device to implement the method in the above embodiment.
[0151] In actual implementation, Figure 7 The functions of the acquisition unit 701, the determination unit 702, and the processing unit 703 in Figure 8 The processor 801 in the embodiment calls the computer program stored in the memory 802. The specific execution process can refer to the description of the method part in the above embodiment, which will not be repeated here.
[0152] Optionally, the computer-readable storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0153] In an exemplary embodiment, the present application also provides a computer program product including one or more instructions, and the one or more instructions can be executed by the processor 801 of the electronic device to complete the method in the above embodiment.
[0154] It should be noted that when the instructions in the above-mentioned computer-readable storage medium or one or more instructions in the computer program product are executed by the processor of the electronic device, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect as the above-mentioned method can be achieved. To avoid repetition, they will not be repeated here.
[0155] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0156] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0157] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0158] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0159] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the full classification part or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute the full classification part or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or CD and other media that can store program code.
[0160] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An exception handling method, characterized in that: include: Obtain abnormal information of the target system in the vehicle control unit; The target system includes multiple levels; There are subordinate relationships between the multiple levels; determining an abnormality level corresponding to the abnormality information from the plurality of levels; Execute the target processing strategy corresponding to the abnormal level in the preset strategy set to process the abnormal information; the preset strategy set includes the preset processing strategies corresponding to each of the multiple levels.
2. The method according to claim 1, characterized in that The multiple levels include: a system level, a process level, a module level and an interface level, the interface level is subordinate to the module level, the module level is subordinate to the process level, and the process level is subordinate to the system level.
3. The method according to claim 2, characterized in that The exception level is the system level, and executing the target exception handling strategy corresponding to the system level includes: Restart the target system by a preset restart method; the preset restart method includes one or more of the following: soft restart and / or hard restart.
4. The method according to claim 2, characterized in that: The exception level is the process level, the process level includes multiple processes, each of the multiple processes includes at least one thread; executing the exception handling strategy corresponding to the process level includes: Determine a target thread in which abnormal information occurs in a target process; the target process is a process in which abnormal information occurs in the process hierarchy; When no other threads except the target thread in the target process execute tasks and the restart times are less than a first quantity threshold, restart the target process and update the restart times; When the number of restarts is greater than or equal to the first quantity threshold, or when other threads in the target process except the target thread are executing tasks, exception handling is performed according to the exception handling strategy corresponding to the system level.
5. The method according to claim 2, characterized in that: The exception level is the module level, and the exception handling strategy corresponding to the module level is executed, including: Determine a target module in the module hierarchy where abnormal information occurs; If there is no dependency relationship between the target module and other modules in the target system, and the number of initialization times is less than a second quantity threshold, perform initialization processing on the target module and update the number of initialization times; When there is a dependency relationship between the target module and other modules in the target system, or the number of initialization times is greater than or equal to a second quantity threshold, exception handling is performed according to an exception handling strategy corresponding to the process level.
6. The method according to claim 2, characterized in that The multiple levels include an interface level, and executing an exception handling strategy corresponding to the interface level includes: Determine the target interface where the abnormal information appears; When the target system satisfies the operating condition of the target interface, running the target interface; When the target system does not meet the operating condition of the target interface for a period equal to a preset period, updating the number of detection times; When the number of detections is greater than or equal to a third quantity threshold, exception handling is performed according to an exception handling strategy corresponding to the module level.
7. The method according to claim 1, characterized in that The obtaining of abnormal information of a target system in a vehicle control unit includes: During the operation of the target system, monitoring whether there are any abnormal events in the target system; In the case that an abnormal event occurs in the target system, abnormal information corresponding to the abnormal event occurs in the target system is obtained.
8. An exception handling device, characterized in that: include: an acquisition unit, a determination unit, and an execution unit; The acquisition unit is used to acquire abnormal information of the target system in the vehicle control unit; The target system includes multiple levels; There are subordinate relationships between the multiple levels; The determining unit is used to determine the abnormal level corresponding to the abnormal information from the multiple levels; The execution unit is used to execute the target processing strategy corresponding to the abnormal level in the preset strategy set to process the abnormal information; the preset strategy set includes the preset processing strategies corresponding to each of the multiple levels.
9. The device according to claim 8, characterized in that The execution unit is specifically used for: Restart the target system by a preset restart method; the preset restart method includes one or more of the following: soft restart and / or hard restart.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that: When the computer-executable instructions stored in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is capable of performing the method as claimed in any one of claims 1 to 7.
12. A vehicle, characterized in that: The vehicle comprises the device of claim 8 or 9.
