CN-121996458-A - Abnormal information acquisition method and embedded equipment
Abstract
The embodiment of the application provides an abnormal information acquisition method and embedded equipment, wherein the embedded equipment is applied to a vehicle and comprises a controller, the controller comprises a first core, a second core and a first memory, the method comprises the steps that when the first core determines that an abnormality occurs in the running process, the corresponding abnormal information is acquired, the abnormal information is written into the first memory, when the second core determines that the abnormal information exists in the first memory, the abnormal information is read, the abnormal information is correspondingly processed, target abnormal information is obtained, an abnormal storage file is generated according to the target abnormal information, and the abnormal storage file is used for carrying out abnormal analysis processing according to the abnormal storage file by a developer. Therefore, when the controller of the embedded equipment of the vehicle is abnormal, the abnormal information can be acquired at the first time, so that a developer can perform abnormal analysis according to the abnormal information at the abnormal occurrence time, and the accuracy of the abnormal analysis is improved.
Inventors
- WANG HUIPENG
- SUN DONGMING
- ZHANG JIE
- ZHOU LIN
- MENG CHAO
Assignees
- 零束科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260121
Claims (10)
- 1. An abnormality information acquisition method, characterized by being applied to an embedded device in a vehicle, the embedded device including a controller including a first core, a second core, and a first memory, the method comprising: when the first core determines that an abnormality occurs in the operation process, corresponding abnormality information is acquired, and the abnormality information is written into the first memory; And when the second core determines that the first memory has the abnormal information, reading the abnormal information, carrying out corresponding processing on the abnormal information to obtain target abnormal information, and generating an abnormal storage file according to the target abnormal information so as to be used for carrying out abnormal analysis processing according to the abnormal storage file by a developer.
- 2. The abnormality information acquisition method according to claim 1, wherein an operating system of the controller includes an error recording module and a development error tracker module, the abnormality information includes first abnormality information including first sub-abnormality information and second sub-abnormality information, the first core acquiring corresponding abnormality information when determining that an abnormality occurs in a running process, including: When the first core determines that an operating system abnormality occurs in the running process, determining an abnormality type of the operating system abnormality, and acquiring first sub-abnormality information corresponding to the abnormality type from the error recording module based on a first hook function according to the abnormality type; And when the first core determines that the development error tracker is abnormal in the running process, acquiring the second sub-abnormal information from the development error tracker module based on a second hook function.
- 3. The abnormality information acquisition method according to claim 2, characterized in that, If the anomaly type is an application layer error, the first sub-anomaly information comprises detailed information and related parameter information; And if the exception type is a protection type error or a kernel error, the first sub-exception information comprises register information of the controller.
- 4. The method for obtaining exception information according to claim 3, wherein the controller further comprises a second memory, the operating system further comprises a watchdog recording module, the exception information further comprises second exception information, and the first core obtains corresponding exception information when determining that an exception occurs during operation, and the method comprises: And when the first core determines that an abnormality occurs in the operation process and the condition that the watchdog reset function is started exists, acquiring second abnormality information corresponding to the watchdog recording module, storing the second abnormality information into the second memory, and acquiring the second abnormality information from the second memory after the controller is powered on next time.
- 5. The abnormality information acquisition method according to claim 4, wherein the first core determines that there is a case where a watchdog reset function is turned on by: And when the first core detects that a watchdog reset program exists in the watchdog recording module, determining that a condition of starting the watchdog reset function exists.
- 6. The abnormality information acquisition method according to claim 5, characterized in that, If the first core and the second core are heterogeneous cores, the first core and the second core adopt a unidirectional flag mechanism to realize the processing that the first core writes the abnormal information into the first memory and the second core reads the abnormal information from the first memory; If the first core and the second core are isomorphic cores, the first core and the second core implement the processing that the first core writes the exception information into the core index array corresponding to the first core in the first memory through at least one core index array included in the first memory, and the second core reads the exception information from the core index array corresponding to the first core included in the first memory.
- 7. The abnormality information acquisition method according to claim 6, characterized in that performing corresponding processing on the abnormality information to obtain target abnormality information, comprising: and carrying out character processing on variable information included in the abnormal information to obtain target abnormal information.
- 8. The abnormality information acquisition method according to claim 7, characterized in that, After the first core writes the exception information to the first memory, the method further comprises: the first core modifies the read-write flag bit of the first memory into a written flag; The second core reads the exception information when determining that the first memory has the exception information, and the method comprises the following steps: And the second core determines that the first memory has abnormal information based on the fact that the reading thread detects that the read-write flag bit of the first memory is a written flag, and reads the abnormal information.
- 9. The method of claim 8, wherein the controller is a micro control unit, the first core is a real-time core, the second core is an application core, the first memory is a volatile memory, the second memory is a non-volatile memory, and the operating system is a system based on an open architecture of an automobile.
- 10. An embedded device for a vehicle, the embedded device comprising a controller comprising a first core, a second core, and a first memory, wherein The first core is used for acquiring corresponding abnormal information when the occurrence of the abnormality is determined in the operation process, and writing the abnormal information into the first memory; The second core is used for reading the abnormal information when the abnormal information exists in the first memory, correspondingly processing the abnormal information to obtain target abnormal information, and generating an abnormal storage file according to the target abnormal information so as to be used for carrying out abnormal analysis processing according to the abnormal storage file by a developer.
Description
Abnormal information acquisition method and embedded equipment Technical Field The present application relates to the field of exception processing technologies, and in particular, to an exception information obtaining method and an embedded device. Background For embedded devices in a vehicle, whether in a test stage or an actual use stage, it is generally required to acquire abnormality information when an abnormality occurs, so that a developer performs abnormality processing according to the abnormality information, where the abnormality processing includes abnormality analysis processing such as abnormality positioning, abnormality problem investigation, abnormality cause determination, and abnormality repair processing. Taking a controller such as a micro control unit (Micro Control Unit, abbreviated as MCU) in an embedded device as an example, when an abnormality occurs in the controller such as an operating system, a developer often needs to connect with a debugger to perform an abnormality analysis process. However, the developer is often connected to the debugger to perform the exception analysis processing, and after the exception occurs, the developer can obtain exception information such as a log of the controller based on the debugger, and perform the exception analysis processing according to the exception information. According to the method for acquiring the abnormal information and carrying out the abnormal analysis processing after a period of time after the occurrence of the abnormality, on one hand, a developer cannot be connected with the debugger for carrying out the abnormal processing at the first time under a test vehicle road test scene, so that the problem that useful information of a field environment is damaged is often caused, on the other hand, the debugger is connected after the occurrence of the abnormality, the abnormal information at the occurrence time of the abnormality is possibly lost, so that environment variable information at the occurrence time of the abnormality cannot be observed, accurate abnormality reasons are difficult to find, and the problems that the abnormality is difficult to find and the abnormality analysis is inaccurate are caused. Therefore, how to acquire the abnormality information when the controller is abnormal improves the accuracy of abnormality analysis, and is the key direction for realizing the abnormality analysis processing of the controller at present. Disclosure of Invention The embodiment of the application provides an abnormal information acquisition method and embedded equipment, which can directly acquire the abnormal information of a controller at the abnormal occurrence time and facilitate the abnormal processing of the controller according to the abnormal information at the abnormal occurrence time. In order to solve the technical problems, in a first aspect, an embodiment of the present application provides an abnormal information acquisition method, where the method is applied to an embedded device in a vehicle, the embedded device includes a controller, the controller includes a first core, a second core, and a first memory, and the method includes that when the first core determines that an abnormality occurs in an operation process, the first core acquires corresponding abnormal information, and writes the abnormal information into the first memory; when the second core determines that the first memory has the abnormal information, the second core reads the abnormal information, carries out corresponding processing on the abnormal information to obtain target abnormal information, and generates an abnormal storage file according to the target abnormal information so as to be used for carrying out abnormal analysis processing according to the abnormal storage file by a developer. By adopting the technical scheme, when the first core of the controller determines that the controller is abnormal in the operation process, the corresponding abnormal information is acquired, the abnormal information is written into the first memory, when the second core determines that the abnormal information exists in the first memory, the abnormal information is read, the corresponding processing is carried out on the abnormal information, the target abnormal information is obtained, the abnormal storage file is generated according to the target abnormal information, the abnormal storage file generated by the real-time abnormal information in the operation process of the controller can be directly acquired by a developer, and the abnormal analysis processing is carried out according to the abnormal storage file, so that the complete and real-time abnormal information can be obtained at the first time when the controller is abnormal, and the accuracy of the abnormal analysis is improved. In one possible implementation of the first aspect, the operating system of the controller includes an error recording module and a development error tracker mod