CN117215817A - Abnormality processing method, abnormality processing apparatus, and computer-readable storage medium - Google Patents

Abnormality processing method, abnormality processing apparatus, and computer-readable storage medium Download PDF

Info

Publication number
CN117215817A
CN117215817A CN202311102919.7A CN202311102919A CN117215817A CN 117215817 A CN117215817 A CN 117215817A CN 202311102919 A CN202311102919 A CN 202311102919A CN 117215817 A CN117215817 A CN 117215817A
Authority
CN
China
Prior art keywords
exception
information
processing
core module
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311102919.7A
Other languages
Chinese (zh)
Inventor
吴才泽
纪亚萍
刘学欧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sisu Technology Co ltd
Original Assignee
Shenzhen Sisu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sisu Technology Co ltd filed Critical Shenzhen Sisu Technology Co ltd
Priority to CN202311102919.7A priority Critical patent/CN117215817A/en
Publication of CN117215817A publication Critical patent/CN117215817A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses an exception handling method, an exception handling device and a computer readable storage medium, wherein the method comprises the following steps: when at least one of triggering instruction abnormality of a kernel module, stack overflow abnormality information and client abnormality detected by an application layer is monitored, controlling the kernel module and/or the application layer to generate panic information, and sending the panic information to the kernel module; when the core module receives the panic information, interrupting the current processing function of the core module and controlling the core module to enter a panic mode; controlling the core module to start an exception handling program, and processing exception information acquired when the core module enters the panic mode based on the exception handling program to acquire target exception information; and feeding the target abnormal information back to the application layer and/or the display layer. According to the application, the trigger panic mode is used for informing the abnormal information in advance, so that the abnormal processing efficiency is improved.

Description

Abnormality processing method, abnormality processing apparatus, and computer-readable storage medium
Technical Field
The present application relates to the field of exception information processing, and more particularly, to an exception processing method, an exception processing apparatus, and a computer-readable storage medium.
Background
In a small and medium-sized embedded system, when the system crashes, the crashing problem is usually required to be positioned by means of disassembly, checking of a general register value, checking of a function call stack and the like. The above means are accomplished using a debug tool or debugger, which is typically provided in a chip SDK (Software Development Kit ), and which can be accomplished by a developer using debug commands, debug instructions, or by corresponding functions on the tool interface.
However, different chip SDKs may employ different debugging tools or debuggers, and their specific operations and functions may be different, so that developers need to use different tools and methods to locate problems in different chip SDKs, which results in lower exception handling efficiency when a crash occurs in a small and medium-sized embedded system.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present application and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The application mainly aims to provide an exception handling method, an exception handling device and a computer readable storage medium, which solve the problem of lower exception handling efficiency when a small and medium-sized embedded system crashes in the prior art.
In order to achieve the above object, the present application provides an exception handling method, the method comprising the steps of:
when at least one of triggering instruction abnormality of a kernel module, stack overflow abnormality information and client abnormality detected by an application layer is monitored, controlling the kernel module and/or the application layer to generate panic information, and sending the panic information to the kernel module;
when the core module receives the panic information, interrupting the current processing function of the core module and controlling the core module to enter a panic mode;
controlling the core module to start an exception handling program, and processing exception information acquired when the core module enters the panic mode based on the exception handling program to acquire target exception information;
and feeding the target abnormal information back to the application layer and/or the display layer.
Optionally, before the step of controlling the core module to start an exception handler and process the exception information acquired when the core module enters the panic mode based on the exception handler to obtain the target exception information, the method further includes:
controlling the kernel module to execute an abnormal callback function to obtain a plurality of register information and a function call stack, and sending the register information and the function call stack to the kernel module as the abnormal information; or alternatively
And controlling the application layer to execute the abnormal callback function to obtain a plurality of register information, and sending the register information to the core module as the abnormal information.
Optionally, before the step of controlling the core module to start an exception handler and process the exception information acquired when the core module enters the panic mode based on the exception handler to obtain the target exception information, the method further includes:
and controlling the core module to send a collapse information detection instruction to the core module and/or the application layer so as to enable the core module and the application layer to generate the abnormal information.
Optionally, the step of controlling the core module to start an exception handler, and processing exception information obtained when the core module enters the panic mode based on the exception handler, to obtain target exception information includes:
controlling the core module to start the exception handling program and acquiring the exception information received when the core module enters the panic mode;
determining an abnormality type and abnormality scene information corresponding to the abnormality type according to the abnormality information;
and determining an exception handling code according to the exception type and the exception scene information, and taking the exception handling code as the target exception information.
Optionally, the step of determining an exception handling code according to the exception type and the exception scene information includes:
according to the abnormal type, analyzing register information of the abnormal scene information to obtain processing information of the register;
and the exception processing code is determined according to the processing information.
Optionally, the step of feeding back the target anomaly information to the application layer and/or the display layer includes:
determining a target abnormality type of the target abnormality information;
when the target exception type is kernel level exception, determining a code processing log corresponding to the exception processing code;
and printing the code processing log into target equipment based on a serial port, and outputting the code processing log and the abnormal information corresponding to the code processing log in display equipment of the display layer.
Optionally, the step of feeding back the exception handling code to the application layer based on the exception type, and/or the step of displaying layer further comprises:
when the target exception type is user level exception, performing conventional repair processing on the exception processing code, and when the result of the conventional repair processing is repair failure, feeding back the exception processing code to the application layer; or alternatively
When the target exception type is kernel level exception and user level exception, executing the step of performing conventional repair processing on the exception handling code, and executing the step of determining a code handling log corresponding to the exception handling code when repair failure information fed back by the application layer is received; or alternatively
And when the target exception type is kernel level exception and user level exception, executing the step of determining a code processing log corresponding to the exception processing code and executing the step of performing conventional repairing processing on the exception processing code.
Optionally, the step of controlling the kernel module and/or the application layer to generate panic information and send the panic information to the kernel module includes:
controlling the kernel module to send the panic information to the kernel module based on a direct serial port; and/or
And controlling the application layer to send the panic information to the core module based on a user application module.
In addition, in order to achieve the above object, the present application also provides an exception handling apparatus including a memory, a processor, and an exception handling program stored on the memory and executable on the processor, the exception handling program implementing the steps of the exception handling method as described above when executed by the processor.
In addition, in order to achieve the above object, the present application also provides a computer-readable storage medium having stored thereon an abnormality processing program which, when executed by a processor, implements the steps of the abnormality processing method as described above.
The embodiment of the application provides an exception handling method, an exception handling device and a computer readable storage medium, wherein when at least one of a kernel module triggering instruction exception, stack overflow exception information and a client exception detected by an application layer is monitored, the kernel module and/or the application layer are controlled to generate panic information, the panic information is sent to the kernel module, when the kernel module receives the panic information, the current handling function of the kernel module is interrupted, the kernel module is controlled to enter a panic mode, then the kernel module is controlled to start an exception handling program, the exception information acquired when the kernel module enters the panic mode is processed based on the exception handling program, target exception information is obtained, and then the target exception information is fed back to the application layer and/or a display layer. According to the method, the device and the system, the related information of the kernel module and the application layer is monitored, and when the kernel triggers the abnormality or the application layer detects the abnormality, the panic information for enabling the kernel module to enter the panic mode is generated, so that the kernel module is guaranteed to accurately acquire the current abnormality information in advance, the abnormality information is fed back to the application layer or the display layer in time, and the abnormality processing efficiency when the medium-small embedded system breaks down is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart illustrating a first embodiment of an exception handling method according to the present application;
FIG. 2 is a schematic diagram of a system architecture of an exception handling method of the present application;
FIG. 3 is a flowchart illustrating a second embodiment of an exception handling method according to the present application;
FIG. 4 is a flowchart illustrating a second embodiment of an exception handling method according to the present application;
fig. 5 is a schematic diagram of a terminal hardware structure of each embodiment of the exception handling method of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Different chip SDKs may adopt different debugging tools or debuggers, the specific operations and functions of the chip SDKs may be different, developers need to use different tools and methods to locate problems in different chip SDKs, and therefore when a breakdown occurs in a small and medium-sized embedded system, the exception handling efficiency is low.
In order to solve the above-mentioned drawbacks, an embodiment of the present application provides an exception handling method, which mainly includes the following steps:
when at least one of triggering instruction abnormality of a kernel module, stack overflow abnormality information and client abnormality detected by an application layer is monitored, controlling the kernel module and/or the application layer to generate panic information, and sending the panic information to the kernel module;
when the core module receives the panic information, interrupting the current processing function of the core module and controlling the core module to enter a panic mode;
controlling the core module to start an exception handling program, and processing exception information acquired when the core module enters the panic mode based on the exception handling program to acquire target exception information;
and feeding the target abnormal information back to the application layer and/or the display layer.
According to the application, the core module generates the panic information for entering the panic mode when the kernel triggers the abnormality or the application layer detects the abnormality by monitoring the related information of the kernel module and the application layer, so that the core module can accurately acquire the current abnormality information in advance, and timely feeds back the abnormality information to the application layer or the display layer, thereby improving the abnormality processing efficiency when the medium-small embedded system breaks down.
In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
First embodiment
In a first embodiment, referring to fig. 1, the method for exception handling according to the present application includes the steps of:
step S10, when at least one of abnormal triggering instruction information and stack overflow abnormal information of a kernel module and abnormal client detected by an application layer is monitored, controlling the kernel module and/or the application layer to generate panic information, and sending the panic information to the kernel module;
in the embodiment, the application refers to a mechanism of amygdala in brain science, and when the brain receives environmental information to stimulate amygdala to generate moods such as panic, tension and the like, the brain can simultaneously stimulate nervous systems such as hippocampus, spinal cord and the like to generate phenomena such as fear memory, limb reflex and the like. Corresponding to the amygdala, when the information processing system monitors kernel collapse and an application program actively initiates an exception, an error site and a function call stack in the case of system exception are saved to a flash memory or a RAM (Random Access Memory ), and the exception can be intuitively fed back to a developer through external settings such as a serial port and a display. That is, in this embodiment, the triggering of "panic" by the core module refers to a specific information processing and information transferring process.
When the embedded system executes corresponding tasks, the information processing system monitors the kernel module and the application layer, for example, when the situation that the kernel module is not in line with expectations, namely, the situation of triggering instruction exception, stack overflow and the like is encountered in the process of monitoring the execution instruction of the kernel module, or the application layer detects the exception information sent by the client, which indicates that the current embedded system has exception conditions, the kernel module needs to be controlled to enter a panic mode at the moment, and the kernel module can rapidly analyze and process the information sent by the kernel module and the application layer when entering the panic, so that corresponding exception information is obtained. The kernel module and/or the application layer may be controlled to generate panic information and send the panic information to the kernel module, so that the kernel module enters the panic mode.
Optionally, in addition to generating panic information to enable the core module to enter a panic mode, the core module can be directly controlled to enter the panic mode when abnormal information sent by an application layer is received or when the core module is monitored to trigger an abnormality, and at this time, the core module can analyze the abnormal information when entering the panic.
Optionally, in addition to the panic information, the application layer or the kernel module can actively initiate exception information, thereby enabling the kernel module to enter panic. For example, when the application layer detects that the camera is overexposed, the application layer can actively initiate an abnormality to enable the core module to generate "panic", and when the core module detects that the memory is continuously increased for a long time and is not released, the application layer can actively initiate an abnormality to enable the core module to generate "panic". And the core module enters a panic mode when generating panic, so as to process abnormal information.
Optionally, as shown in fig. 2, the system structure may be that the amygdalar module is a core module, and can acquire kernel level exception through exception callback processing, and also can receive input of an application layer to trigger exception; the system core module is a system kernel module and comprises underlying logic such as interrupt processing and the like, and when the module is abnormal, a program cannot run again generally, so that the system core module is directly connected with the amygdalar module; the flash module is a memory and is used for storing abnormal information; the user_appx module is used for actively initiating an exception, the async input module is used for supporting asynchronous input of kernel exception, the user_appx module can actively generate 'panic information' through the channel, the sync output module is used for supporting synchronous output of kernel exception, and when the kernel is panic, all registered modules can simultaneously receive the kernel exception information. Therefore, the kernel module can be controlled to send the panic information to the core module based on a direct serial port, and the application layer can be controlled to send the panic information to the core module based on a user application program module.
Step S20, when the core module receives the panic information, interrupting the current processing function of the core module and controlling the core module to enter a panic mode;
in this embodiment, after the core module receives the panic information, the processing function of the core module is executed due to the interrupt of the abnormal information corresponding to the panic information, and at this time, the core module needs to enter the panic mode, so that the core module and the related abnormal information sent by the application layer can be analyzed, and further, the target abnormal data can be obtained.
Step S30, controlling the core module to start an exception handling program, and processing exception information acquired when the core module enters the panic mode based on the exception handling program to obtain target exception information;
in this embodiment, the exception handler may be configured to process the exception information sent by the currently acquired kernel module or the application layer to obtain the target exception information, where the processing procedure of the exception handler may include performing an analysis process on the exception information, storing the exception information in the memory or the flash memory after the analysis process, and printing or displaying the exception information on the display screen through the interface. The exception information can be fed back to the corresponding processing end so as to repair the exception in time. The target exception information includes repair completed data, function call logic of the current system, execution sequence, log file, and the like.
Optionally, when the core module enters the panic mode, the received abnormal information sent by the kernel and/or the application layer is required, so after entering the panic mode or before starting the abnormal processing program, the core module can be controlled to send a crash information detection instruction to the kernel module and/or the application layer, so that the kernel module and/or the application layer generate the abnormal information.
Optionally, in addition to enabling the kernel module and/or the application layer to generate the exception information by sending the crash information detection instruction, the kernel module may be controlled to execute an exception callback function while the kernel module enters the panic mode, to obtain a plurality of register information and a function call stack, and send the plurality of register information and the function call stack as the exception information to the kernel module, or control the application layer to execute the exception callback function, to obtain a plurality of register information, and send the plurality of register information as the exception information to the kernel module. In the riscv architecture, the register information may be x1 to x31 register values, epc register values, tval register values, and the like.
Step S40, feeding back the target abnormality information to the application layer and/or the display layer
In this embodiment, after the target abnormal information is obtained, the abnormal information may be fed back to the corresponding user client through the application layer, so that the developer may learn and process the abnormal information, and may also display the abnormal information in a display device of the display layer, such as a display screen.
For example, when the application layer detects overexposure of the camera, the application layer can actively initiate an exception to enable the core module to generate "panic", and then the core module reduces exposure time in the panic exception handling code or reduces gain to weaken the overexposure environment, so that the processed exception code is fed back to the application layer. Or when the kernel module detects that the memory is continuously increased in a long time without release, the kernel can actively initiate an exception to enable the kernel module to generate 'panic', and then the kernel module can warn of the situation of memory leakage in a mode of prompting through a serial port or a display screen in panic exception processing codes, so that a developer is timely informed of the existence of the defects of the codes.
Optionally, referring to fig. 2, taking riscv architecture as an example, when an exception such as an instruction exception, stack overflow, etc. occurs in the kernel, the kernel "panics" is caused, that is, the kernel enters a panic mode, and at this time, the kernel triggers an exception callback function and directly transmits information such as x 1-x 31 register values, epc register values, tval register values, and a function call stack to the kernel module for processing. After the core module receives the exception, the exception information is stored in the memory, the exception is packed and then sent to the sync output module to be sent out, the application layer can print through a serial port (uart, universal Asynchronous Receiver/Transmitter, universal asynchronous receiver/Transmitter) according to the requirement, or the exception information is prompted on a display screen, so that a developer can intuitively see the execution condition of a function before breakdown and the condition of a register value during breakdown and quickly locate the exception information, based on the exception information, the information exception can be obtained through a brain science amygdala mechanism, a corresponding processing mode is made, and the exception processing efficiency is improved.
In the technical scheme disclosed in the embodiment, the core module is controlled to enter the panic mode by detecting the abnormal information triggered by the core module, the abnormal information detected by the application layer or the panic information actively sent by the core, and the like, so that the core module can timely sense and process the abnormal information when the system is abnormal, and inform a developer of the processed abnormal information through a display and other devices, and the developer can check the corresponding abnormal information without debugging related commands, thereby improving the abnormal processing efficiency when the middle-small embedded system is crashed.
Second embodiment
Referring to fig. 3, in the second embodiment, based on the first embodiment, step S30 specifically includes:
step S31, controlling the core module to start the exception handling program and acquiring the exception information received when the core module enters the panic mode;
step S32, determining an abnormal type and abnormal scene information corresponding to the abnormal type according to the abnormal information;
in this embodiment, the exception information may be sent by the kernel module or may be sent by the application layer, so when the exception information is processed, it is necessary to determine an exception type of the exception information, where the exception type includes a kernel-level exception and a user-level exception. The abnormal scene information refers to the scene type corresponding to the triggering of the abnormality, such as the executed business scene.
And step S33, determining an exception handling code according to the exception type and the exception scene information, and taking the exception handling code as the target exception information.
In this embodiment, specifically, the register information of the abnormal scene information may be analyzed according to the abnormal type, so as to obtain the processing information of the register, and the abnormal processing code may be determined according to the processing information. For example, the received exception information generally includes register information, and the scene information is the overexposure of the camera, where the obtained register information includes the execution codes corresponding to the overexposure of the camera, the execution sequence of each code, and the like, and the specific exception handling code can be obtained at this time. After the exception handling code is obtained, if the core system can be repaired simply, the exception handling code is repaired, and the repaired correct code information is fed back to the camera end corresponding to the application layer.
Optionally, when the core module is controlled to start the exception handling program, a preset script analysis file is started, and analysis processing is performed on the exception scene information, the register information and the like through the script analysis file, so that an exception handling code is obtained.
Based on the method, the core module can directly position the abnormal code and feed back the code information, so that the problem that a developer needs to repeatedly check the information and repeatedly call a function to check the corresponding code information is avoided, and the efficiency of exception handling is improved.
Optionally, referring to fig. 4, in this embodiment, step S40 specifically includes:
step S41, determining a target abnormality type of the target abnormality information;
step S42, when the target exception type is kernel level exception, determining a code processing log corresponding to the exception processing code;
and step S43, printing the code processing log into a target device based on a serial port, and outputting the code processing log and the abnormal information corresponding to the code processing log in a display device of the display layer.
In this embodiment, the obtained target exception information generally includes kernel-level exception information and user-level exception information, and at this time, the system can select a transmission mode according to the type of the target exception information, for example, when the target exception type is kernel-level exception, print an exception handling code into the target device in a manner of a handling log, and output the code handling log in a display device of the display layer, such as a display screen. And when the target exception type is user level exception, conventional repair processing can be performed on the exception code, and when the result of the conventional repair processing is repair failure, the exception code is fed back to the application layer.
Optionally, when the target exception type includes both kernel level exception and user level exception, the step of performing conventional repair processing on the exception code may be performed first, and when repair failure information is received, the step of performing conventional repair processing on the exception code is performed, and when repair failure information fed back by the application layer is received, the step of determining a code processing log corresponding to the exception code is performed. The steps of determining the code processing log corresponding to the exception handling code and performing the conventional repair processing on the exception handling code may also be performed simultaneously. Based on this, the feedback efficiency of the abnormality information is improved.
In the technical scheme disclosed by the embodiment, the abnormal type corresponding to the current abnormal information is obtained, and according to the abnormal type and the corresponding scene information, the abnormal code information corresponding to the abnormal triggering of the kernel module or the abnormal detection of the client side by the application layer is obtained, and then the abnormal code information is used as target abnormal information to be fed back, so that the situation that the abnormal code can be positioned only by repeated table lookup and function calling is avoided, the abnormal position can be rapidly positioned and repaired by a researcher, and the abnormal processing efficiency when the small and medium-sized embedded system is in abnormal breakdown is further improved.
Referring to fig. 5, fig. 5 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present application.
As shown in fig. 5, the terminal may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a network interface 1003, and a memory 1004. Wherein the communication bus 1002 is used to enable connected communication between these components. The network interface 1003 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1004 may be a high-speed RAM Memory (Random Access Memory, RAM) or a stable Non-Volatile Memory (NVM), such as a disk Memory. The memory 1004 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal structure shown in fig. 5 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 5, an operating system, a data storage module, a network communication module, and an abnormality processing program may be included in the memory 1004, which is one type of computer storage medium.
In the terminal shown in fig. 5, the network interface 1003 is mainly used for connecting to a background server, and performing data communication with the background server; the processor 1001 may call an exception handler stored in the memory 1004 and perform the following operations:
when at least one of triggering instruction abnormality of a kernel module, stack overflow abnormality information and client abnormality detected by an application layer is monitored, controlling the kernel module and/or the application layer to generate panic information, and sending the panic information to the kernel module;
when the core module receives the panic information, interrupting the current processing function of the core module and controlling the core module to enter a panic mode;
controlling the core module to start an exception handling program, and processing exception information acquired when the core module enters the panic mode based on the exception handling program to acquire target exception information;
and feeding the target abnormal information back to the application layer and/or the display layer.
Further, the processor 1001 may call an exception handler stored in the memory 1004, and further perform the following operations:
controlling the kernel module to execute an abnormal callback function to obtain a plurality of register information and a function call stack, and sending the register information and the function call stack to the kernel module as the abnormal information; or alternatively
And controlling the application layer to execute the abnormal callback function to obtain a plurality of register information, and sending the register information to the core module as the abnormal information.
Further, the processor 1001 may call an exception handler stored in the memory 1004, and further perform the following operations:
and controlling the core module to send a collapse information detection instruction to the core module and/or the application layer so as to enable the core module and the application layer to generate the abnormal information.
Further, the processor 1001 may call an exception handler stored in the memory 1004, and further perform the following operations:
controlling the core module to start the exception handling program and acquiring the exception information received when the core module enters the panic mode;
determining an abnormality type and abnormality scene information corresponding to the abnormality type according to the abnormality information;
and determining an exception handling code according to the exception type and the exception scene information, and taking the exception handling code as the target exception information.
Further, the processor 1001 may call an exception handler stored in the memory 1004, and further perform the following operations:
according to the abnormal type, analyzing register information of the abnormal scene information to obtain processing information of the register;
and the exception processing code is determined according to the processing information.
Further, the processor 1001 may call an exception handler stored in the memory 1004, and further perform the following operations:
determining a target abnormality type of the target abnormality information;
when the target exception type is kernel level exception, determining a code processing log corresponding to the exception processing code;
and printing the code processing log into target equipment based on a serial port, and outputting the code processing log and the abnormal information corresponding to the code processing log in display equipment of the display layer.
Further, the processor 1001 may call an exception handler stored in the memory 1004, and further perform the following operations:
when the target exception type is user level exception, performing conventional repair processing on the exception processing code, and when the result of the conventional repair processing is repair failure, feeding back the exception processing code to the application layer; or alternatively
When the target exception type is kernel level exception and user level exception, executing the step of performing conventional repair processing on the exception handling code, and executing the step of determining a code handling log corresponding to the exception handling code when repair failure information fed back by the application layer is received; or alternatively
And when the target exception type is kernel level exception and user level exception, executing the step of determining a code processing log corresponding to the exception processing code and executing the step of performing conventional repairing processing on the exception processing code.
Further, the processor 1001 may call an exception handler stored in the memory 1004, and further perform the following operations:
controlling the kernel module to send the panic information to the kernel module based on a direct serial port; and/or
And controlling the application layer to send the panic information to the core module based on a user application module.
Furthermore, it will be appreciated by those of ordinary skill in the art that implementing all or part of the processes in the methods of the above embodiments may be accomplished by computer programs to instruct related hardware. The computer program comprises program instructions, and the computer program may be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the control terminal to carry out the flow steps of the embodiments of the method described above.
Accordingly, the present application also provides a computer-readable storage medium storing an abnormality processing program which, when executed by a processor, implements the respective steps of the abnormality processing method described in the above embodiment.
It should be noted that, because the storage medium provided in the embodiments of the present application is a storage medium used for implementing the method in the embodiments of the present application, based on the method described in the embodiments of the present application, a person skilled in the art can understand the specific structure and the modification of the storage medium, and therefore, the description thereof is omitted herein. All storage media adopted by the method of the embodiment of the application belong to the scope of protection of the application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flowchart and/or block of the flowchart illustrations and/or block diagrams, and combinations of flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. An exception handling method, characterized in that the exception handling method comprises:
when at least one of triggering instruction abnormality of a kernel module, stack overflow abnormality information and client abnormality detected by an application layer is monitored, controlling the kernel module and/or the application layer to generate panic information, and sending the panic information to the kernel module;
when the core module receives the panic information, interrupting the current processing function of the core module and controlling the core module to enter a panic mode;
controlling the core module to start an exception handling program, and processing exception information acquired when the core module enters the panic mode based on the exception handling program to acquire target exception information;
and feeding the target abnormal information back to the application layer and/or the display layer.
2. The exception handling method according to claim 1, wherein the step of controlling the core module to start an exception handler and to process exception information acquired when the core module enters the panic mode based on the exception handler, further comprises, before the step of obtaining target exception information:
controlling the kernel module to execute an abnormal callback function to obtain a plurality of register information and a function call stack, and sending the register information and the function call stack to the kernel module as the abnormal information; or alternatively
And controlling the application layer to execute the abnormal callback function to obtain a plurality of register information, and sending the register information to the core module as the abnormal information.
3. The exception handling method according to claim 1, wherein the step of controlling the core module to start an exception handler and to process exception information acquired when the core module enters the panic mode based on the exception handler, further comprises, before the step of obtaining target exception information:
and controlling the core module to send a collapse information detection instruction to the core module and/or the application layer so as to enable the core module and the application layer to generate the abnormal information.
4. The exception handling method according to claim 1, wherein the step of controlling the core module to start an exception handler and to process exception information acquired when the core module enters the panic mode based on the exception handler, to obtain target exception information comprises:
controlling the core module to start the exception handling program and acquiring the exception information received when the core module enters the panic mode;
determining an abnormality type and abnormality scene information corresponding to the abnormality type according to the abnormality information;
and determining an exception handling code according to the exception type and the exception scene information, and taking the exception handling code as the target exception information.
5. The exception handling method of claim 4, wherein the step of determining exception handling code based on the exception type and the exception scenario information comprises:
according to the abnormal type, analyzing register information of the abnormal scene information to obtain processing information of the register;
and the exception processing code is determined according to the processing information.
6. The exception handling method of claim 4, wherein the step of feeding back the target exception information to the application layer and/or display layer comprises:
determining a target abnormality type of the target abnormality information;
when the target exception type is kernel level exception, determining a code processing log corresponding to the exception processing code;
and printing the code processing log into target equipment based on a serial port, and outputting the code processing log and the abnormal information corresponding to the code processing log in display equipment of the display layer.
7. The exception handling method of claim 6, wherein the step of feeding back the exception handling code to the application layer based on the exception type, and/or the display layer further comprises:
when the target exception type is user level exception, performing conventional repair processing on the exception processing code, and when the result of the conventional repair processing is repair failure, feeding back the exception processing code to the application layer; or alternatively
When the target exception type is kernel level exception and user level exception, executing the step of performing conventional repair processing on the exception handling code, and executing the step of determining a code handling log corresponding to the exception handling code when repair failure information fed back by the application layer is received; or alternatively
And when the target exception type is kernel level exception and user level exception, executing the step of determining a code processing log corresponding to the exception processing code and executing the step of performing conventional repairing processing on the exception processing code.
8. The exception handling method of claim 1, wherein the step of controlling the kernel module and/or the application layer to generate panic information and transmitting the panic information to the kernel module comprises:
controlling the kernel module to send the panic information to the kernel module based on a direct serial port; and/or
And controlling the application layer to send the panic information to the core module based on a user application module.
9. An exception handling apparatus, the apparatus comprising: memory, a processor and an exception handler stored on the memory and executable on the processor, which when executed by the processor implements the steps of the exception handling method according to any one of claims 1 to 8.
10. A computer-readable storage medium, wherein an exception handler is stored on the computer-readable storage medium, which when executed by a processor, implements the steps of the exception handling method according to any one of claims 1 to 8.
CN202311102919.7A 2023-08-30 2023-08-30 Abnormality processing method, abnormality processing apparatus, and computer-readable storage medium Pending CN117215817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311102919.7A CN117215817A (en) 2023-08-30 2023-08-30 Abnormality processing method, abnormality processing apparatus, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311102919.7A CN117215817A (en) 2023-08-30 2023-08-30 Abnormality processing method, abnormality processing apparatus, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN117215817A true CN117215817A (en) 2023-12-12

Family

ID=89043438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311102919.7A Pending CN117215817A (en) 2023-08-30 2023-08-30 Abnormality processing method, abnormality processing apparatus, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN117215817A (en)

Similar Documents

Publication Publication Date Title
US8516304B2 (en) Integrated circuit including a programmable logic analyzer with enhanced analyzing and debugging capabilities and a method therefor
US8914681B2 (en) Integrated circuit including a programmable logic analyzer with enhanced analyzing and debugging capabilities and a method therefor
CN108021791B (en) Data protection method and device
CN109144873B (en) Linux kernel processing method and device
US20110047424A1 (en) Integrated circuit including a programmable logic analyzer with enhanced analyzing and debugging capabilites and a method therefor
CN112052169A (en) Test management method, system, device and computer readable storage medium
CN107357694A (en) Error event reporting system and its method during startup self-detection
CN102541679A (en) Method and system for testing GPU (graphic processing unit) cards
US20170270033A1 (en) Information processing device, computer program product and test system
CN110502369B (en) Method and device for recovering equipment crash and storage medium
CN117215817A (en) Abnormality processing method, abnormality processing apparatus, and computer-readable storage medium
CN110399275B (en) Exception display method and device
CN111078484A (en) Power-off test method, device, equipment and storage medium for system upgrading
CN111651350A (en) Test case processing method, device and equipment and computer readable storage medium
CN106528402B (en) Method and system for testing terminal
CN115756935A (en) Abnormal fault positioning method, device and equipment of embedded software system
CN115587046A (en) Code exception processing method and device, storage medium and computer equipment
CN115686899A (en) Terminal abnormity capture analysis method and device
CN110519098B (en) Method and device for processing abnormal single board
CN112732510A (en) Testing device for unmanned vehicle computing platform
CN113010422A (en) Mirror image file testing method and device, electronic equipment and readable storage medium
CN106250260B (en) Processor overflows monitoring and adjustment method and device
CN112650538A (en) Starting method and device of network equipment
CN111737115B (en) Pressure testing method and device based on android APP
CN116610557B (en) Action binding information debugging method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination