Embedded program running exception processing method and device, electronic equipment and medium

By storing the first exception information and disabling reset source recording when an embedded program exception occurs, the information overwrite problem is solved, detailed error context preservation and root cause analysis are achieved, and fault diagnosis efficiency is improved.

CN120743592APending Publication Date: 2025-10-03CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510764173.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

When an embedded program runs abnormally, the existing technology has limited storage information, lacks detailed error context, has a high risk of data overwrite, and does not record the system operating environment, which affects root cause analysis.

Method used

When an embedded program runs abnormally, determine whether the current program status is abnormal. If abnormal, store the first abnormal information in the information recording queue and turn off the reset source information recording function. After the soft reset, analyze the queue data to locate the root cause.

Benefits of technology

Ensure that the first abnormal data is completely preserved, improve fault diagnosis efficiency, reduce information coverage risks, and improve problem location accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743592A_ABST
    Figure CN120743592A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of embedded controller control systems, in particular to an embedded program operation exception processing method and device, electronic equipment and a medium. Storing the first abnormal information of the current program to an information recording queue, closing a reset source information recording function, starting soft reset operation for the current program under the condition that the abnormal level of the current program is greater than a preset level, and starting the soft reset operation for the current program when the running state of the current program is in a normal working state after soft reset. And reading and analyzing the queue data, and further positioning the root cause. Therefore, the problem that the problem is difficult to locate due to the fact that information stored for the first time is possibly covered when a processing method in the related technology encounters continuous reset is solved, through hierarchical storage and a first-time exception protection mechanism, it is ensured that first-time exception data is completely stored, and the fault diagnosis efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of embedded controller control systems, and in particular to a method, device, electronic device, and medium for handling abnormal operation of an embedded program. Background Art

[0002] In the AUTOSAR architecture, the operating system is used to manage system resources, task scheduling, communication, and error handling. When the operating system program runs abnormally (such as memory overflow, task deadlock, hardware failure, etc.), it may cause the system to crash or function to fail.

[0003] In the related art, an ErrorHook mechanism is usually used to capture exceptions, and a handling measure is determined according to the severity of the problem. Then, a small amount of reset source information of the abnormal situation is stored and a reset operation is performed.

[0004] However, the above method has the following problems: (1) Limited storage information: only the key reset source is recorded, and detailed error context (such as task status, variable values, etc.) is lacking; (2) Data overwrite risk: during continuous resets, the key data of the first abnormality may be overwritten by subsequent abnormal data, making the problem difficult to reproduce and locate; (3) Lack of working condition correlation: the system operating environment when the abnormality occurs (such as sensor data, communication status) is not recorded, which affects the root cause analysis and needs to be solved urgently. Summary of the Invention

[0005] The present application provides a method, device, electronic device and medium for handling abnormal operation of an embedded program, so as to solve the problem that the processing method in the related art may cause the first stored information to be overwritten when encountering continuous reset, thereby making it difficult to locate the problem.

[0006] The first embodiment of the present application provides a method for handling an exception in an embedded program operation, comprising the following steps: Determine whether the current program running state is in an abnormal state; If the current program running state is in the abnormal state, then when the reset source information recording function of the current program is in the enabled state, storing the first abnormal information of the current program in the information recording queue, obtaining the queue data of the current program, and simultaneously disabling the reset source information recording function; When the abnormality level of the current program is greater than a preset level, a soft reset operation is initiated for the current program, and when the running state of the current program after the soft reset operation is in a normal working state, the queue data is read and analyzed to locate the root cause of the abnormal state of the current program based on the queue data.

[0007] Furthermore, in some embodiments, before determining whether the current program running state is in an abnormal state, the method further includes: When the system is in a power-on state, the wakeup source type of the system is detected, and when the wakeup source type is a preset wakeup source type, the reset source information recording function of the current program is enabled.

[0008] Furthermore, in some embodiments, storing the first exception information of the current program in an information recording queue to obtain queue data of the current program and simultaneously disabling the reset source information recording function includes: Determining whether the first abnormality information and the entire vehicle operating condition information are stored in the information recording queue, or whether the storage of the first abnormality information and the entire vehicle operating condition information is terminated; If the first abnormality information and the whole vehicle operating condition information are stored in the information recording queue, or the first abnormality information and the whole vehicle operating condition information are terminated from being stored, the reset source information recording function is turned off.

[0009] Furthermore, in some embodiments, after determining whether the first abnormality information and the entire vehicle operating condition information are stored in the information recording queue, or whether the storage of the first abnormality information and the entire vehicle operating condition information is terminated, the method further includes: If the first abnormality information and the vehicle operating condition information have not been stored in the information recording queue, and the storage of the first abnormality information and the vehicle operating condition information has not been terminated, then exiting the storage of the first abnormality information and the vehicle operating condition information, and re-storing the first abnormality information and the vehicle operating condition information in the information recording queue; Determine whether the re-storage time of the abnormal information and the vehicle operating condition information is greater than the preset time. If the re-storage time is greater than the preset time, determine that the storage is abnormal and terminate the storage. Otherwise, continue to execute the step of re-storing the first abnormal information and the vehicle operating condition information to the information recording queue.

[0010] Furthermore, in some embodiments, after determining that the current program running state is in the abnormal state, the method further includes: If the reset source information recording function of the current program is not in the enabled state, determining that an exception has occurred in the current program, and determining whether non-first exception information and vehicle operating condition information are stored in the information recording queue, or whether storage of the non-first exception information and vehicle operating condition information is terminated; If the non-first abnormal information and the vehicle operating condition information are stored in the information recording queue, or the non-first abnormal information and the vehicle operating condition information are terminated from being stored, the reset source information recording function is turned off.

[0011] According to the embedded program operation exception handling method of the embodiment of the present application, when the current program operation state is in an abnormal state and the reset source information recording function is in an enabled state, the first exception information of the current program is stored in the information recording queue, and the reset source information recording function is disabled at the same time. At the same time, when the abnormal level of the current program is greater than the preset level, a soft reset operation is initiated for the current program. After the soft reset, when the current program operation state is in a normal working state, the queue data is read and analyzed to locate the root cause. This solves the problem that the processing method in the related art may cause the first stored information to be overwritten when encountering continuous resets, thereby making it difficult to locate the problem. Through hierarchical storage and the first exception protection mechanism, the first exception data is ensured to be completely preserved, thereby improving the efficiency of fault diagnosis.

[0012] A second embodiment of the present application provides an embedded program execution exception handling device, comprising: A judgment module is used to judge whether the current program running state is in an abnormal state; a storage module configured to, if the current program running state is in the abnormal state, store the first abnormal information of the current program in an information recording queue when the reset source information recording function of the current program is in the enabled state, obtain queue data of the current program, and simultaneously disable the reset source information recording function; The root cause location module is used to start a soft reset operation on the current program when the abnormality level of the current program is greater than a preset level, and when the current program running state after the soft reset operation is in a normal working state, read and analyze the queue data to locate the root cause of the abnormal state of the current program based on the queue data.

[0013] Furthermore, in some embodiments, before determining whether the current program running state is in an abnormal state, the determination module further includes: The detection unit is configured to detect a wakeup source type of the system when the system is in a powered-on state, and enable a reset source information recording function of the current program when the wakeup source type is a preset wakeup source type.

[0014] Furthermore, in some embodiments, the storage module includes: a first determining unit, configured to determine whether the first abnormality information and the entire vehicle operating condition information are stored in the information recording queue, or whether the storage of the first abnormality information and the entire vehicle operating condition information is terminated; The first function shutoff unit is used to shut down the reset source information recording function if the first abnormality information and the vehicle operating condition information are stored in the information recording queue, or the first abnormality information and the vehicle operating condition information are terminated from being stored.

[0015] Furthermore, in some embodiments, after determining whether the first abnormality information and the entire vehicle operating condition information are stored in the information recording queue, or whether the storage of the first abnormality information and the entire vehicle operating condition information is terminated, the determining unit further includes: a storage subunit, configured to quit storing the first abnormality information and the whole vehicle operating condition information if the first abnormality information and the whole vehicle operating condition information have not been stored in the information recording queue and storage of the first abnormality information and the whole vehicle operating condition information has not been terminated, and to re-store the first abnormality information and the whole vehicle operating condition information in the information recording queue; The judgment subunit is used to judge whether the re-storage time of the abnormal information and the vehicle operating condition information is greater than the preset time. If the re-storage time is greater than the preset time, it is determined that the storage is abnormal and the storage is terminated. Otherwise, the step of re-storing the first abnormal information and the vehicle operating condition information into the information recording queue is continued.

[0016] Furthermore, in some embodiments, after determining that the current program running state is in the abnormal state, the storage module further includes: a second determining unit, configured to determine, if the reset source information recording function of the current program is not in the enabled state, that an exception has occurred in the current program, and to determine whether non-first exception information and vehicle operating condition information are stored in the information recording queue, or whether storage of the non-first exception information and vehicle operating condition information is terminated; The second function shutoff unit is used to shut down the reset source information recording function if the non-first abnormal information and the vehicle operating condition information are stored in the information recording queue, or the non-first abnormal information and the vehicle operating condition information are terminated from storage.

[0017] According to the embedded program operation exception handling device of the embodiment of the present application, when the current program operation state is in an abnormal state and the reset source information recording function is in an on state, the first abnormal information of the current program is stored in the information recording queue, and the reset source information recording function is turned off at the same time. At the same time, when the abnormal level of the current program is greater than the preset level, a soft reset operation is initiated for the current program. After the soft reset, when the current program operation state is in a normal working state, the queue data is read and analyzed to locate the root cause. This solves the problem that the processing method in the related art may cause the first stored information to be overwritten when encountering continuous resets, thereby making it difficult to locate the problem. Through hierarchical storage and the first abnormality protection mechanism, the first abnormality data is ensured to be completely preserved, thereby improving the efficiency of fault diagnosis.

[0018] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for handling embedded program execution exceptions as described in the above embodiment.

[0019] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the embedded program execution exception handling method as described in the above embodiment.

[0020] The fifth aspect of the present application provides a computer program product, including a computer program, which is executed to implement the embedded program execution exception handling method described in the above embodiment.

[0021] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which: Figure 1 A flowchart of a method for handling an abnormality in an embedded program according to an embodiment of the present application; Figure 2 This is an overall flow chart of a method for handling an abnormality in an embedded program according to one embodiment of the present application; Figure 3 1 is a block diagram of an exemplary apparatus for handling abnormal execution of an embedded program according to an embodiment of the present application; Figure 4 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following describes in detail embodiments of the present application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0024] The following describes the embedded program operation exception processing method, device, electronic device and medium of the embodiment of the present application with reference to the accompanying drawings. In view of the problem that the processing method in the related art mentioned in the above background technology may cause the first stored information to be overwritten when encountering continuous reset, thereby making it difficult to locate the problem, the present application provides an embedded program operation exception processing method, in which when the current program operation state is in an abnormal state and the reset source information recording function is in an open state, the first abnormal information of the current program is stored in an information recording queue, and the reset source information recording function is turned off at the same time. At the same time, when the abnormal level of the current program is greater than the preset level, a soft reset operation is started for the current program, and after the soft reset, when the current program operation state is in a normal working state, the queue data is read and analyzed to locate the root cause. Thus, the processing method in the related art solves the problem that when encountering continuous reset, the first stored information may be overwritten, thereby making it difficult to locate the problem. Through hierarchical storage and first abnormal protection mechanism, the first abnormal data is ensured to be completely saved, thereby improving the efficiency of fault diagnosis.

[0025] Specifically, Figure 1 A flowchart of a method for handling an exception in the execution of an embedded program provided in an embodiment of the present application.

[0026] like Figure 1 As shown, the embedded program running exception handling method includes the following steps: In step S101 , it is determined whether the current program running state is in an abnormal state.

[0027] Furthermore, in some embodiments, before determining whether the current program running state is in an abnormal state, it also includes: when the system is in a powered-on state, detecting the wake-up source type of the system, and when the wake-up source type is a preset wake-up source type, turning on the reset source information recording function of the current program.

[0028] The preset wake-up source type may be set by those skilled in the art according to actual test requirements and is not specifically limited here.

[0029] Specifically, in order to solve the problem in the related art that the key information of the first abnormality may be overwritten when the program is continuously reset, thereby making it difficult to locate the problem, the embodiment of the present application improves the fault recording and storage mechanism to ensure that the first-site data of the first abnormality is completely preserved, thereby avoiding cascading faults from overwriting key information.

[0030] Specifically, if Figure 2As shown, first, the system is initialized and set. After the system is powered on or reset, the wake-up source type of the system is detected. For example, whether the wake-up source type of the system is CAN (Controller Area Network) wake-up, KEY wake-up, 30 wake-up, or timer wake-up is detected. The above wake-up source types are all preset wake-up source types. That is, when the system wake-up source type is CAN wake-up, KEY wake-up, 30 wake-up, or timer wake-up, the system is in normal wake-up operation. At this time, the reset source information recording function of the current program is turned on to prepare for recording subsequent abnormalities. Secondly, after the reset source information recording function is turned on, the program running status is constantly monitored to determine whether the current program running status is in an abnormal state, such as memory overflow, task timeout, hardware failure, etc., and whether the current system power-on is the first abnormality is further determined based on the current program running status and the on / off status of the reset source information recording function.

[0031] It should be noted that this system operation may be a soft reset. If it is determined to be a soft reset, the reset source information recording function will remain as it is, that is, the reset source information recording function will not be turned on or off. For example, if the reset source information recording function has been turned off before, the reset source information recording function will continue to be turned off; if the reset source information recording function has been turned on before, the reset source information recording function will be maintained on, so as to prevent the recording function from being reset incorrectly due to a soft reset and ensure abnormal continuity.

[0032] In step S102, if the current program running state is in an abnormal state, then when the reset source information recording function of the current program is in the turned-on state, the first abnormal information of the current program is stored in the information recording queue to obtain the queue data of the current program, and the reset source information recording function is turned off at the same time.

[0033] Furthermore, in some embodiments, the first abnormality information of the current program is stored in the information recording queue to obtain the queue data of the current program, and the reset source information recording function is turned off at the same time, including: judging whether the first abnormality information and the whole vehicle operating condition information are stored in the information recording queue, or whether the first abnormality information and the whole vehicle operating condition information are terminated from storage; if the first abnormality information and the whole vehicle operating condition information are stored in the information recording queue, or the first abnormality information and the whole vehicle operating condition information are terminated from storage, then the reset source information recording function is turned off.

[0034] Specifically, if Figure 2As shown, if the current program running status is in an abnormal state, if the reset source information recording function of the current program is turned on, it means that the system is powered on for the first time. First, obtain the detailed error information of the first abnormality, that is, the first abnormality information, such as error code, task stack, register value, program counter, and obtain the required current vehicle operating condition information, such as CAN signal, sensor data, system load and other context information.

[0035] Secondly, the first abnormal information and the current vehicle operating condition information obtained are stored in the information recording queue to obtain the queue data of the current program. Among them, the information recording queue of the embodiment of the present application adopts the mode of fixed area queue (length m) and rolling area queue (length n). The fixed area queue stores historical abnormal information in sequence, starting from 1. After storing to m groups, it will no longer be updated. The error sequence number of the rolling area queue starts from m+1. After exceeding m+n, the rolling area data is cyclically overwritten and updated to keep the latest n groups of information. In this way, it is possible to ensure the first-site record of the m historical abnormal situations since the operation of this software while retaining the first abnormality that occurred in the last n power-on cycles.

[0036] Finally, determine whether the first abnormal information and the whole vehicle operating condition information have been stored in the information recording queue, or whether the first abnormal information and the whole vehicle operating condition information have been terminated. If the first abnormal information and the whole vehicle operating condition information are stored in the information recording queue, they are marked as stored. If the storage of the first abnormal information and the whole vehicle operating condition information times out, it means that there is an abnormality in the storage. At this time, the storage is terminated and the storage failure record is recorded. At the same time, the reset source information recording function is turned off to avoid the system from being unable to reset in time due to storage blockage, affecting safety, and providing a storage reliability basis for subsequent analysis.

[0037] Furthermore, after the first abnormality information and the current vehicle operating condition information are stored in the information recording queue, the reset source information recording function is immediately turned off to avoid the cascading fault information caused by the first abnormality information covering the first abnormality site information, or invalid information wasting the space of the recording queue, to ensure that the information recorded queue stores the first abnormality information of this power-on cycle.

[0038] Furthermore, in some embodiments, after determining whether the first abnormal information and the whole vehicle operating condition information are stored in the information recording queue, or whether the first abnormal information and the whole vehicle operating condition information are terminated from storage, it also includes: if the first abnormal information and the whole vehicle operating condition information are not stored in the information recording queue, and the first abnormal information and the whole vehicle operating condition information are not terminated from storage, then exit the storage of the first abnormal information and the whole vehicle operating condition information this time, and re-store the first abnormal information and the whole vehicle operating condition information in the information recording queue; determine whether the re-storage time of the abnormal information and the whole vehicle operating condition information is greater than the preset time. If the re-storage time is greater than the preset time, determine that the storage is abnormal and terminate the storage. Otherwise, continue to execute the step of re-storing the first abnormal information and the whole vehicle operating condition information in the information recording queue.

[0039] The preset duration can be set by those skilled in the art according to actual test requirements and is not specifically limited here.

[0040] Specifically, if Figure 2 As shown, when storing the information recording queue, if the first abnormal information and the whole vehicle operating condition information are not stored in the information recording queue, and the storage of the first abnormal information and the whole vehicle operating condition information is not terminated, then exit the storage of the first abnormal information and the whole vehicle operating condition information this time, and re-store the first abnormal information and the whole vehicle operating condition information to the information recording queue, and at the same time judge whether the re-storage time of the abnormal information and the whole vehicle operating condition information is greater than the preset time. If the re-storage time is greater than the preset time, it is determined that the storage is abnormal and the storage is terminated. Otherwise, continue to re-store the first abnormal information and the whole vehicle operating condition information to the information recording queue, and continue to judge based on the above storage time.

[0041] In step S103, when the abnormality level of the current program is greater than the preset level, a soft reset operation is started for the current program, and when the current program running state after the soft reset operation is in a normal working state, the queue data is read and analyzed to locate the root cause of the abnormal state of the current program based on the queue data.

[0042] The preset level can be set by those skilled in the art according to actual test requirements and is not specifically limited here.

[0043] Specifically, if the initial abnormality information and vehicle operating condition information have been stored in the information recording queue, or if the initial abnormality information and vehicle operating condition information have ceased to be stored, the abnormality level of the current program is further determined. Based on the abnormality level, a soft reset operation is determined for the current program. If the abnormality level of the current program is greater than a preset level, a soft reset operation is initiated for the current program. This allows appropriate recovery measures to be taken based on the specific circumstances of the abnormality, helping to quickly restore normal operation and reduce system downtime. When the current program is in normal operating state after the soft reset operation, the stored queue data is read via the DID (Data Identifier) ​​or calibrated CAN method and problem analysis and location are performed to locate the root cause of the abnormal state of the current program based on the queue data. For example, queue data can be read via a diagnostic interface (such as a DID or calibrated CAN), and long-term trend faults can be analyzed based on the fixed area queue. At the same time, the most recent abnormality can be located based on the rolling area queue. Thus, the root cause (such as a CAN signal abnormality triggering a memory overflow) can be located by combining the error information with the operating condition data.

[0044] For example, if the current program's exception level is low (for example, the log is full), it means that the exception problem is minor and will not affect the normal operation of the program. In this case, only recording is done without resetting. If the current program's exception level is medium (for example, a task has timed out), it means that the program is running abnormally and needs to be restored in time. Therefore, it can be restored by triggering a soft reset. If the current program's exception level is high (for example, a hardware failure), it will seriously affect the program's operation. Therefore, it can be restored by triggering a hard reset. Thus, different levels correspond to different reset strategies to balance system availability and fault recovery capabilities. After recovery, the wake-up source is re-judged in the initialization phase to decide whether to start a new round of recording.

[0045] Furthermore, in some embodiments, after determining that the current program running state is in an abnormal state, it also includes: if the reset source information recording function of the current program is not in the turned-on state, then determining that an abnormality has occurred in the current program, and judging whether the non-first abnormal information and the whole vehicle operating condition information are stored in the information recording queue, or whether the non-first abnormal information and the whole vehicle operating condition information are terminated from storage; if the non-first abnormal information and the whole vehicle operating condition information are stored in the information recording queue, or the non-first abnormal information and the whole vehicle operating condition information are terminated from storage, then turning off the reset source information recording function.

[0046] Specifically, if the current program running state is in an abnormal state and the reset source information recording function of the current program is not in the turned-on state, it is determined that an abnormality has occurred in the current program, and it is determined whether the non-first abnormal information and the vehicle operating condition information are stored in the information recording queue, or whether the non-first abnormal information and the vehicle operating condition information are terminated. If the non-first abnormal information and the vehicle operating condition information are stored in the information recording queue, or the non-first abnormal information and the vehicle operating condition information are terminated, the reset source information recording function is turned off, and it is determined whether the abnormality level requires a soft reset operation. If necessary, the soft reset operation is started. Otherwise, it is stored again and the storage time is determined. The specific operation process is the same as the determination process of the first abnormal information. The specific process has been described in detail in the above-mentioned determination of the first abnormal information. To avoid redundancy, it will not be described in detail here.

[0047] Therefore, the embodiment of the present application can greatly improve the reliability of software abnormal situation handling by identifying the software running status, and realizing the storage of required information and handling of abnormal situations while ensuring the safe and reliable operation of the system. At the same time, it can save the necessary reset source information and other operating condition data, ensuring that the first-site data when the problem occurs is correctly stored, facilitating the reading of fault information through DID or calibrated CAN and subsequent analysis and positioning.

[0048] According to the embedded program operation exception handling method of the embodiment of the present application, when the current program operation state is in an abnormal state and the reset source information recording function is in an enabled state, the first exception information of the current program is stored in the information recording queue, and the reset source information recording function is disabled at the same time. At the same time, when the abnormal level of the current program is greater than the preset level, a soft reset operation is initiated for the current program. After the soft reset, when the current program operation state is in a normal working state, the queue data is read and analyzed to locate the root cause. This solves the problem that the processing method in the related art may cause the first stored information to be overwritten when encountering continuous resets, thereby making it difficult to locate the problem. Through hierarchical storage and the first exception protection mechanism, the first exception data is ensured to be completely preserved, thereby improving the efficiency of fault diagnosis.

[0049] Next, the embedded program execution exception handling device proposed in accordance with the embodiment of the present application will be described with reference to the accompanying drawings.

[0050] Figure 3 It is a block diagram of an embedded program execution exception handling device according to an embodiment of the present application.

[0051] like Figure 3 As shown, the embedded program running exception handling device 10 includes: a judgment module 100, a storage module 200 and a root cause location module 300.

[0052] The judging module 100 is used to judge whether the current program running state is in an abnormal state; The storage module 200 is configured to, if the current program is in an abnormal state, store the first abnormality information of the current program in the information recording queue when the reset source information recording function of the current program is enabled, obtain the queue data of the current program, and disable the reset source information recording function at the same time; The root cause location module 300 is used to start a soft reset operation on the current program when the abnormality level of the current program is greater than a preset level, and when the current program running state is in a normal working state after the soft reset operation, read and analyze the queue data to locate the root cause of the abnormal state of the current program based on the queue data.

[0053] Furthermore, in some embodiments, before determining whether the current program running state is in an abnormal state, the determination module 100 further includes: The detection unit is used to detect the wakeup source type of the system when the system is in a power-on state, and to enable the reset source information recording function of the current program when the wakeup source type is a preset wakeup source type.

[0054] Furthermore, in some embodiments, the storage module 200 includes: A first judgment unit is used to judge whether the first abnormality information and the whole vehicle operating condition information are stored in the information recording queue, or whether the first abnormality information and the whole vehicle operating condition information are terminated from being stored; The first function shutoff unit is used to shut down the reset source information recording function if the first abnormality information and the whole vehicle operating condition information are stored in the information recording queue, or the first abnormality information and the whole vehicle operating condition information are terminated from being stored.

[0055] Furthermore, in some embodiments, after determining whether the first abnormality information and the entire vehicle operating condition information are stored in the information recording queue, or whether the storage of the first abnormality information and the entire vehicle operating condition information is terminated, the determining unit further includes: a storage subunit, configured to exit the storage of the first abnormality information and the whole vehicle operating condition information if the first abnormality information and the whole vehicle operating condition information have not been stored in the information recording queue and the storage of the first abnormality information and the whole vehicle operating condition information has not been terminated, and to re-store the first abnormality information and the whole vehicle operating condition information in the information recording queue; The judgment subunit is used to judge whether the re-storage time of the abnormal information and the whole vehicle operating condition information is greater than the preset time. If the re-storage time is greater than the preset time, the storage is judged to be abnormal and the storage is terminated. Otherwise, the step of re-storing the first abnormal information and the whole vehicle operating condition information into the information recording queue is continued.

[0056] Furthermore, in some embodiments, after determining that the current program running state is in an abnormal state, the storage module 200 further includes: a second determining unit configured to determine, if a reset source information recording function of a current program is not enabled, whether an exception has occurred in the current program, and whether the non-first exception information and the vehicle operating condition information are stored in the information recording queue, or whether the storage of the non-first exception information and the vehicle operating condition information is terminated; The second function shutoff unit is used to shut down the reset source information recording function if the non-first abnormal information and vehicle operating condition information are stored in the information recording queue, or the non-first abnormal information and vehicle operating condition information are terminated from being stored.

[0057] According to the embedded program operation exception handling device of the embodiment of the present application, when the current program operation state is in an abnormal state and the reset source information recording function is in an on state, the first abnormal information of the current program is stored in the information recording queue, and the reset source information recording function is turned off at the same time. At the same time, when the abnormal level of the current program is greater than the preset level, a soft reset operation is initiated for the current program. After the soft reset, when the current program operation state is in a normal working state, the queue data is read and analyzed to locate the root cause. This solves the problem that the processing method in the related art may cause the first stored information to be overwritten when encountering continuous resets, thereby making it difficult to locate the problem. Through hierarchical storage and the first abnormality protection mechanism, the first abnormality data is ensured to be completely preserved, thereby improving the efficiency of fault diagnosis.

[0058] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include: Memory 401 , processor 402 , and computer programs stored in the memory 401 and executable on the processor 402 .

[0059] When the processor 402 executes the program, the embedded program execution exception handling method provided in the above embodiment is implemented.

[0060] Furthermore, the electronic device further includes: The communication interface 403 is used for communication between the memory 401 and the processor 402 .

[0061] The memory 401 is used to store computer programs that can be run on the processor 402 .

[0062] The memory 401 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0063] If the memory 401, processor 402, and communication interface 403 are implemented independently, the communication interface 403, memory 401, and processor 402 can be interconnected via a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0064] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can communicate with each other through an internal interface.

[0065] The processor 402 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0066] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned method for handling embedded program execution exceptions is implemented.

[0067] This embodiment further provides a computer program product, including a computer program. The computer program is executed to implement the embedded program execution exception handling method of the above embodiment.

[0068] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0069] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0070] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0071] The logic and / or steps represented in a flowchart or otherwise described herein, for example, can be considered a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" is any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (not exhaustive) of computer-readable media include: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing it in a suitable manner if necessary, and then storing it in a computer memory.

[0072] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having logic gate circuits for implementing logical functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.

[0073] Those skilled in the art will appreciate that all or part of the steps in the method for implementing the above-mentioned embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0074] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0075] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

Claims

1. A method for handling abnormal operation of an embedded program, characterized in that: The following steps are involved: Determine whether the current program running state is in an abnormal state; If the current program is in the abnormal state, when the reset source information recording function of the current program is in the enabled state, storing the first abnormal information of the current program in the information recording queue, obtaining the queue data of the current program, and disabling the reset source information recording function; When the abnormality level of the current program is greater than a preset level, a soft reset operation is initiated for the current program, and when the running state of the current program after the soft reset operation is in a normal working state, the queue data is read and analyzed to locate the root cause of the abnormal state of the current program based on the queue data.

2. The method according to claim 1, characterized in that Before determining whether the current program running state is in an abnormal state, the following steps are also included: When the system is in a power-on state, the wakeup source type of the system is detected, and when the wakeup source type is a preset wakeup source type, the reset source information recording function of the current program is enabled.

3. The method according to claim 1, characterized in that The storing the first exception information of the current program into the information recording queue to obtain the queue data of the current program and simultaneously disabling the reset source information recording function includes: Determining whether the first abnormality information and the entire vehicle operating condition information are stored in the information recording queue, or whether the storage of the first abnormality information and the entire vehicle operating condition information is terminated; If the first abnormality information and the whole vehicle operating condition information are stored in the information recording queue, or the first abnormality information and the whole vehicle operating condition information are terminated from being stored, the reset source information recording function is turned off.

4. The method according to claim 3, characterized in that After determining whether the first abnormality information and the entire vehicle operating condition information are stored in the information recording queue, or whether the storage of the first abnormality information and the entire vehicle operating condition information is terminated, the method further includes: If the first abnormality information and the vehicle operating condition information have not been stored in the information recording queue, and the storage of the first abnormality information and the vehicle operating condition information has not been terminated, then exiting the storage of the first abnormality information and the vehicle operating condition information, and re-storing the first abnormality information and the vehicle operating condition information in the information recording queue; Determine whether the re-storage time of the abnormal information and the vehicle operating condition information is greater than the preset time. If the re-storage time is greater than the preset time, determine that the storage is abnormal and terminate the storage. Otherwise, continue to execute the step of re-storing the first abnormal information and the vehicle operating condition information to the information recording queue.

5. The method according to claim 1, wherein After determining that the current program running state is in the abnormal state, the method further includes: If the reset source information recording function of the current program is not in the enabled state, determining that an exception has occurred in the current program, and determining whether non-first exception information and vehicle operating condition information are stored in the information recording queue, or whether storage of the non-first exception information and vehicle operating condition information is terminated; If the non-first abnormal information and the vehicle operating condition information are stored in the information recording queue, or the non-first abnormal information and the vehicle operating condition information are terminated from being stored, the reset source information recording function is turned off.

6. An embedded program running exception handling device, characterized in that: include: A judgment module is used to judge whether the current program running state is in an abnormal state; a storage module configured to, if the current program is in the abnormal state, store the first abnormality information of the current program in an information recording queue when the reset source information recording function of the current program is enabled, obtain queue data of the current program, and simultaneously disable the reset source information recording function; The root cause location module is used to start a soft reset operation on the current program when the abnormality level of the current program is greater than a preset level, and when the current program running state after the soft reset operation is in a normal working state, read and analyze the queue data to locate the root cause of the abnormal state of the current program based on the queue data.

7. The device according to claim 6, characterized in that Before determining whether the current program running state is in an abnormal state, the determination module further includes: The detection unit is configured to detect a wakeup source type of the system when the system is in a powered-on state, and enable a reset source information recording function of the current program when the wakeup source type is a preset wakeup source type.

8. The device according to claim 6, characterized in that The storage module includes: a first determining unit, configured to determine whether the first abnormality information and the entire vehicle operating condition information are stored in the information recording queue, or whether the storage of the first abnormality information and the entire vehicle operating condition information is terminated; The first function shutoff unit is used to shut down the reset source information recording function if the first abnormality information and the vehicle operating condition information are stored in the information recording queue, or the first abnormality information and the vehicle operating condition information are terminated from being stored.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for handling embedded program execution exceptions according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method for handling embedded program execution exceptions as described in any one of claims 1 to 5.