A method for handling abnormality, electronic equipment and storage medium

By judging the first acquisition of abnormal information in the first processor of the electronic device, only stopping multiple functional modules and acquiring data when the first abnormality occurs, and establishing a correlation relationship, the problem of low subsystem exception processing efficiency is solved, and rapid Recovery and efficient exception handling.

CN117130824BActive Publication Date: 2024-10-08HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310035500.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-10
Publication Date
2024-10-08
Estimated Expiration
2043-01-10

AI Technical Summary

Technical Problem

In electronic equipment, when a subsystem is abnormal, the speed of interrupting the entire subsystem is slow, the efficiency of handling abnormal situations is low, and it may affect the operation of other functional modules.

Method used

By determining whether the abnormal information is obtained for the first time in the first processor, and only instructing multiple functional modules to stop running when it is obtained for the first time and obtaining data from the memory of the second processor, the association between the abnormal information and the data is established to achieve Quick recovery and exception analysis, and only restart the abnormal function module when it is not the first exception to reduce the impact on other modules.

Benefits of technology

It improves the efficiency of handling exceptions, reduces the number of subsystem restarts, reduces the impact on other functional modules, and ensures that the system continues to operate normally while waiting for developers to handle exceptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117130824B_ABST
    Figure CN117130824B_ABST
Patent Text Reader

Abstract

The present application discloses a method for handling an exception, an electronic device and a storage medium, and relates to the field of electronic technology. The method is applied to an electronic device, and the electronic device includes a first processor and a second processor, and the second processor includes one or more functional modules. When an exception occurs in the first functional module, the method obtains information related to the exception that occurs in the first functional module; when the information related to the exception that occurs in the first functional module is obtained for the first time, the first processor instructs multiple functional modules to stop running, and obtains the first data from the memory corresponding to the second processor. When the information related to the exception that occurs in the first functional module is not obtained for the first time, the second processor can restart only the first functional module. The present application adds support for restarting only the first functional module, and when handling the exception that occurs in the first functional module, it does not affect the operation of other functional modules, and can improve the efficiency of handling abnormal situations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a method for processing an exception, an electronic device, and a storage medium. Background Art

[0002] As electronic devices such as smartphones and tablets can realize more and more functions, electronic devices usually include other processors in addition to application processors (AP), such as digital signal processors (DSP). Among them, application processors are the most important part of electronic devices and are used to run operating systems, user interfaces, and applications. Other processors are managed by application processors as subsystems and can handle some computing tasks for different functions of electronic devices, reducing the tasks that the application processor needs to handle.

[0003] Since the processor itself may have technical vulnerabilities or may fail as the running time increases, when an abnormal situation occurs in the subsystem, the abnormal situation is generally handled by interrupting the entire subsystem. However, the subsystem may actually include multiple modules, and interrupting the entire subsystem is slow, and the efficiency of handling abnormal situations is low. Summary of the invention

[0004] The present application provides a method for handling an exception, an electronic device and a storage medium, which can improve the efficiency of handling an exception. The technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for handling an exception, the method being applied to an electronic device, the electronic device comprising a first processor and a second processor, the second processor being used to assist the first processor in processing tasks, the second processor comprising one or more functional modules, the method being executed by the first processor, comprising:

[0006] When an exception occurs in the first functional module, information related to the exception occurring in the first functional module is obtained; when the information related to the exception occurring in the first functional module is obtained for the first time, multiple functional modules are instructed to stop running, and first data is obtained from the memory corresponding to the second processor.

[0007] Based on the above technical solution, when an exception occurs in the first functional module, the first processor can determine whether the information related to the exception in the first functional module is obtained for the first time. The first processor only needs to instruct multiple functional modules to stop running when the information related to the exception in the first functional module is obtained for the first time, and obtain the first data from the memory corresponding to the second processor for subsequent analysis. Since the first data has been obtained for the first time, if the information related to the exception in the first functional module is not obtained for the first time, the first processor does not need to obtain it from the memory of the second processor, and does not need to instruct multiple functional modules to stop running. Therefore, multiple functional modules of the second processor do not need to stop running, so that if the information related to the exception in the first functional module is not obtained for the first time, when processing the exception in the first functional module, it does not affect the operation of other functional modules, and can improve the efficiency of handling abnormal situations.

[0008] In combination with the first aspect, in certain implementations of the first aspect, after instructing multiple functional modules to stop running and obtaining the first data from the memory corresponding to the second processor, the above method also includes: establishing an association relationship between information related to the anomaly occurring in the first functional module and the first data.

[0009] That is to say, when the information related to the exception occurring in the first functional module is obtained for the first time, the first processor saves the first data obtained from the memory of the second processor, and also saves the information related to the exception occurring in the first functional module, and establishes an association relationship between the information related to the exception occurring in the first functional module and the first data, thereby facilitating the first processor to search and judge each time an exception occurs based on the association relationship.

[0010] In combination with the first aspect and the above implementation, in some implementations of the first aspect, after instructing the multiple functional modules to stop running and obtaining the first data from the memory corresponding to the second processor, the above method further includes: instructing the multiple functional modules to start running. In the embodiment of the present application, the multiple functional modules are restarted to achieve rapid recovery of the abnormal problem, so that the second processor can continue to operate normally while waiting for the abnormal problem to be processed.

[0011] In combination with the first aspect, in certain implementations of the first aspect, when information related to an exception occurring in a first functional module is not obtained for the first time, second data of a memory corresponding to a second processor is obtained locally based on the information related to the exception occurring in the first functional module and the first information, and the first information indicates an association between the information related to the exception occurring in the first functional module and the memory data corresponding to the second processor.

[0012] Since the first processor saves the first data, the information related to the exception, and the association between the two when the information related to the exception in the first functional module is obtained for the first time, then the same exception is not the first time it occurs again. Therefore, when the information related to the exception in the first functional module is not obtained for the first time, the first processor locally stores the first data, the information related to the exception, and the association between the two. The first processor can obtain the first data locally based on the information related to the exception and the association between the two. The first processor records the association each time an exception occurs, and these associations are recorded as the first information. In order to distinguish, the data in the memory obtained in real time this time is called the first data, and the data in the memory obtained historically is called the second data. When the information related to the exception in the first functional module is not obtained for the first time, the first processor can obtain the second data locally to determine that the abnormal data does exist.

[0013] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: when the information related to the abnormality occurring in the first functional module is not obtained for the first time, instructing the first functional module to stop running, and restarting the running after stopping running. That is to say, in the embodiment of the present application, when the information related to the abnormality occurring in the first functional module is not obtained for the first time, a quick recovery is achieved by restarting the first functional module. Since only the first functional module is restarted, the restart speed can be accelerated and the impact on other functional modules can be reduced.

[0014] In a second aspect, an embodiment of the present application provides a method for handling exceptions, which is applied to an electronic device, wherein the electronic device includes a first processor and a second processor, the second processor being used to assist the first processor in processing tasks, the second processor including one or more functional modules, and the above method is executed by the second processor, including: when an exception occurs in the first functional module, sending information related to the exception occurring in the first functional module to the first processor; when the information related to the exception occurring in the first functional module is obtained by the first processor for the first time, stopping the operation of multiple functional modules under the instruction of the first processor.

[0015] Based on the above technical solution, the second processor will report the information related to the exception occurring in the first functional module to the first processor. After the first processor receives the information related to the exception occurring in the first functional module, it will determine whether the information related to the exception occurring in the first functional module is obtained for the first time. Only when the information related to the exception occurring in the first functional module is obtained for the first time by the first processor, the first processor will instruct to stop running multiple functional modules. Then, if the information related to the exception occurring in the first functional module is not obtained for the first time by the first processor, the first processor will not instruct to stop running multiple functional modules, and then the second processor will not stop running multiple functional modules. Therefore, the exception occurring in the first functional module does not affect the operation of other functional modules, and the efficiency of handling exceptions can be improved.

[0016] In combination with the second aspect, in certain implementations of the second aspect, after stopping the operation of the multiple functional modules, the method further includes: starting the operation of the multiple functional modules under the instruction of the first processor.

[0017] In combination with the second aspect, in certain implementations of the second aspect, when the information related to the exception occurring in the first functional module is not obtained for the first time by the first processor, the above method also includes: under the instruction of the first processor, stopping the operation of the first functional module, and starting the operation of the first functional module again after stopping the operation.

[0018] In combination with the second aspect and the above-mentioned implementation methods, in some implementation methods of the second aspect, the above-mentioned method also includes: when the first functional module stops running within a preset time length, and the number of times it starts running again after stopping is greater than or equal to a preset threshold, stopping running of multiple functional modules, and starting running of multiple functional modules again after stopping running.

[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a first processor and a second processor, the second processor being used to assist the first processor in processing tasks; one or more memories; the memory storing one or more programs, and when one or more programs are executed by the processor, the electronic device executes any possible method of the first or second aspect mentioned above.

[0020] In a fourth aspect, an embodiment of the present application provides a device, which is included in an electronic device, and the device has the function of realizing the above-mentioned aspects and the electronic device behavior in the possible implementation methods of the above-mentioned aspects. The function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, an acquisition module or unit, a judgment module or unit, a processing module or unit, etc.

[0021] In a fifth aspect, an embodiment of the present application provides a device (for example, the device may be a chip system), which includes a first processor for supporting an electronic device to implement the functions involved in the first aspect above; or, the device includes a second processor for supporting an electronic device to implement the functions involved in the second aspect above. When the device is a chip system, it may be composed of a chip, or it may include a chip and other discrete devices. Optionally, the chip system also includes a memory, and the memory is connected to the processor by a circuit or wire.

[0022] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the method described in the first aspect or the second aspect above.

[0023] In a seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first or second aspect above.

[0024] The technical effects obtained in the third to seventh aspects are similar to those obtained by the corresponding technical means in the first and second aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application is shown;

[0026] Figure 2 An example of a software structure block diagram provided in an embodiment of the present application is shown;

[0027] Figure 3 A communication schematic diagram provided in an embodiment of the present application is shown;

[0028] Figure 4 Another communication schematic diagram provided in an embodiment of the present application is shown;

[0029] Figure 5 A schematic flowchart of a method for handling an exception provided in an embodiment of the present application is shown;

[0030] Figure 6 A schematic flowchart of another method for handling an exception provided in an embodiment of the present application is shown;

[0031] Figure 7 A schematic flowchart of another method for handling an exception provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical scheme and advantages of the present application clearer, the implementation mode of the present application will be further described in detail below with reference to the accompanying drawings. Hereinafter, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present embodiment, unless otherwise specified, the meaning of "multiple" is two or more.

[0033] The method provided in the embodiments of the present application can be applied to electronic devices with processing units, such as smart phones, tablet computers, PCs, ultra-mobile personal computers (UMPCs), vehicle-mounted devices, netbooks, and personal digital assistants (PDAs). The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0034] For example, Figure 1 1 is a schematic diagram of the structure of an example of an electronic device 100 provided in an embodiment of the present application. Taking the electronic device 100 as a mobile phone as an example, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0035] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0036] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0037] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0038] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0039] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0040] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0041] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0042] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0043] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0044] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0045] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0046] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0047] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0048] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0049] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0050] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0051] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0052] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0053] It should be understood that, in addition to Figure 1 In addition to the various components or modules listed in the figure, the embodiment of the present application does not specifically limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware.

[0054] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0055] Figure 2 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. Taking the electronic device 100 as a mobile phone as an example, the layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, respectively, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.

[0056] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, mobile assistant and other applications.

[0057] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0058] like Figure 2As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0059] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0060] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0061] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0062] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0063] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0064] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0065] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0066] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0067] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0068] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0069] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0070] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0071] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0072] A 2D graphics engine is a drawing engine for 2D drawings.

[0073] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, sensor driver, etc.

[0074] It should be understood that, in addition to Figure 2 In addition to the layers and modules included in each layer listed in the figure, the embodiment of the present application does not specifically limit the software architecture of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also include more or fewer layers than shown in the figure, or combine some layers, or split some layers, or arrange modules differently.

[0075] The above-mentioned application processor can also be called the main control processor, main central processing unit (CPU), etc. It is used to run the operating system, user interface and application programs, etc., is responsible for the control of the entire system, is the most important part of the electronic device, and corresponds to the aforementioned first processor.

[0076] Although the application processor has very strong processing and computing capabilities, as the functions of the electronic device 100 become more and more complex, the application processor may need to process more and more tasks. The application processor can share processing tasks with other processors, and the application processor can manage other processors, for example, responsible for loading, starting, restarting, etc. of other processors. For example, the above-mentioned digital signal processor is a chip with integrated special computing capabilities, which is used to process digital signals, and can assist the application processor in completing some computing tasks, reducing the tasks that the application processor needs to process.

[0077] In addition to processing digital image signals, digital signal processors can also process other digital signals. For example, digital signal processors can also complete signal processing such as modulation and demodulation in communications, and can also be responsible for information processing of low-power sensors, such as monitoring pedometers to obtain the number of steps taken by users, and can also process audio, such as speech synthesis, speech recognition, encoding and decoding, etc.

[0078] That is to say, the power management module 141, the modem processor (modem), the baseband processor, the audio module 170 or some functional modules of the audio module 170 included in the above-mentioned electronic device 100 can be implemented by a digital signal processor. These functional modules can be integrated in a digital signal processor. Alternatively, a functional module corresponds to a digital signal processor. For example, the electronic device 100 can use an ultra-low power consumption DSP to process information from a low-power consumption sensor, use a computing DSP to process digital image signals, use a MODEM DSP to process communication signals, and use an Audio DSP to process audio. That is to say, the electronic device 100 may include one or more digital signal processors, and a digital signal processor may include one or more functional modules. In the embodiment of the present application, a digital signal processor or a collection of multiple digital signal processors corresponds to the aforementioned second processor.

[0079] It should be noted that in the electronic device 100, the application processor and the digital signal processor can be two separate independent devices, that is, the digital signal processor is an independent chip. Alternatively, the application processor and the digital signal processor can be integrated as sub-chips in a system-on-chip (SoC), which can also be called a system on chip, and the division of labor between the application processor and the digital signal processor is still clear inside the SoC.

[0080] In addition, the digital signal processor has an independent embedded operating system, which can be understood as, in a system composed of multiple processors, a digital signal processor or a collection of multiple digital signal processors constitutes an independent subsystem, that is, the second processor can be considered as a subsystem, which runs an embedded operating system. Whether separate or integrated, the subsystem can communicate with the application processor through shared memory or hardware (for example, direct memory access (DMA)). Shared memory refers to a large-capacity memory that can be accessed by different central processing units in a multi-processor computer system. Through memory sharing, the exchange of information between the application processor and the digital signal processor can be carried out quickly and effectively, which can well solve the problem of communication (data exchange) between processors.

[0081] Since the processor itself may have technical vulnerabilities or may fail as the running time increases, the digital signal processor may experience exceptions during operation. The exceptions here refer to the exceptions that occur during the execution of the program. For example, the exceptions that occur during the operation of the digital signal processor may include type conversion exceptions, null pointer exceptions, array subscript out-of-bounds exceptions, string subscript out-of-bounds exceptions, arithmetic exceptions, class not found exceptions, file not found exceptions, execution timeout exceptions, etc. These exceptions may cause the program to be unable to continue executing, such as causing the process of related applications to be interrupted, and then causing the related applications to crash or flash back. After an exception occurs in the digital signal processor, the exception is usually reported to the application processor, and the application processor captures the exception data so that the developer can check or repair the exception.

[0082] For example, Figure 3 A schematic diagram of a subsystem communicating with an application processor is shown. The subsystem can be divided into a computing layer and a communication layer, wherein the computing layer includes a power management module, an audio management module, and a sensor management module, which are respectively used to process tasks related to power, audio, and sensors, and the communication layer includes an exception handling module and a first interrupt module. The application processor includes a data collection module and a subsystem restart module. Each functional module in the subsystem may have an abnormal situation. For example, when an abnormality occurs in the power management module, the exception handling module obtains the abnormal information and notifies the first interrupt module that an abnormality has occurred in a functional module. The first interrupt module actively triggers a subsystem interrupt and notifies the application processor. The data collection module of the application processor collects the abnormal data of the subsystem for analyzing the cause of the abnormality in the power management module. The subsystem restart module is used to instruct the subsystem to restart after the abnormal data collection is completed.

[0083] However, during the operation of the subsystem, there may be a situation where the power management module is abnormal while the audio management module and the sensor management module are not abnormal. In this case, the subsystem restart module actively triggers the subsystem interrupt, which will affect the normal operation of the audio management module and the sensor management module. In addition, the subsystem includes multiple functional modules, and the speed of interrupting the entire subsystem is slow. In order for the program to continue to execute normally, it may be necessary to restart the subsystem after the subsystem interruption. In this case, the speed of restarting the entire subsystem is also slow, and the efficiency of handling abnormal situations is low.

[0084] In order to reduce the number of times the entire subsystem is restarted, the embodiment of the present application provides a method for handling exceptions. It can determine whether to restart the subsystem based on information related to the exceptions in the functional module. In some cases where the subsystem does not need to be restarted, only the functional module with the exception can be restarted. For example, when only the power management module has an exception, only the power management module is restarted, and the audio management module and the sensor management module operate normally. At the same time, the present application takes into account the problems that may arise from restarting only the abnormal functional module, which may make this method unapplicable, such as Figure 3 As shown, the first problem is that only restarting the abnormal function module cannot analyze the cause of the abnormality. When the second interrupt module only restarts the abnormal function module, the entire subsystem does not stop running. Due to the exclusivity of the memory, the application processor cannot obtain the data of the subsystem when the subsystem is running, resulting in the inability to analyze the cause of the abnormality of the function module after restarting the abnormal function module, which in turn causes the abnormality problem to be unable to be solved and still requires restarting the subsystem. The second problem is that the computing layer of the subsystem communicates with the application processor through the communication layer. If the abnormality of the function module is caused by the communication layer (such as insufficient memory, scheduling congestion, etc.), restarting the abnormal function module cannot allow the program to continue to execute normally. After restarting, the function module will still have abnormal problems, resulting in the problem of repeated restarts of the function module.

[0085] For example, Figure 4 A schematic diagram of a subsystem communicating with an application processor is shown. The subsystem can be divided into a computing layer and a communication layer, wherein the computing layer includes one or more functional modules, such as a power management module, an audio management module, and a sensor management module, which are used to process tasks related to power, audio, and sensors, respectively. Each functional module of the computing layer is an application process. The communication layer includes an exception handling module, an automatic control module, a first interrupt module, a second interrupt module, and a fast recovery module. The application processor includes a data collection module, a subsystem restart module, an information receiving module, and a judgment module.

[0086] Among them, when an exception occurs in a functional module (such as a power management module), the power management module sends its own information related to the exception to the exception handling module. The exception handling module can communicate with the information receiving module through shared memory or DMA hardware, so that the information receiving module obtains information related to the exception. The data collection module saves the exception data obtained after the exceptions occurred in each functional module in the historical period. The information receiving module sends the received information related to the exception to the judgment module. The judgment module judges whether the information related to the exception is obtained for the first time based on the historical data saved in the data collection module and the information related to the exception this time, and then the judgment module sends an indication message to the automatic control module.

[0087] After receiving the indication information, the automatic control module determines which mode to use to handle the abnormality of the power management module. In the first mode, the first interrupt module actively triggers the subsystem interrupt and notifies the data collection module. The data collection module collects the abnormal data of the subsystem for analyzing the cause of the abnormality of the power management module. In addition, the data collection module also saves the information related to the abnormality this time, and associates the abnormal data collected this time with the information related to the abnormality this time, so that the judgment module can search and judge later. In the first mode, after the abnormal data collection is completed, the subsystem can be restarted. The subsystem restart module is used to instruct the subsystem to restart. In the second mode, the second interrupt module controls the power management module to stop running through the interface between the computing layer and the communication layer, and restarts running after stopping running. If the fast recovery module monitors that within a certain period of time, for the same abnormal problem, the abnormality of the power management module is processed through the second mode for many times, then the fast recovery module will trigger the first mode to process the abnormality of the power management module.

[0088] The first mode mentioned above can be called subsystem restart (SSR), and the second mode mentioned above can be called application restart (APR). It can be understood that the operations of performing restart in subsystem restart and application restart are different. It should be noted that the division of modules in the embodiment of the present application is schematic, and there may be other division methods in actual implementation. Figure 4 The embodiments describe in detail the method provided in the embodiments of the present application.

[0089] Figure 5 A method for handling an exception provided in an embodiment of the present application is shown, which is applied to an electronic device. The method is executed by an application processor and includes the following S501 and S502.

[0090] S501, when an exception occurs in a first functional module, obtain information related to the exception occurring in the first functional module.

[0091] The first functional module is any one of the one or more functional modules in the subsystem. When an exception occurs in the first functional module, the subsystem may transfer information related to the exception in the first functional module to the shared memory, and the application processor accesses the shared memory, so that the application processor obtains information related to the exception in the first functional module. The information related to the exception in the first functional module may include a module identifier, an exception type, an exception time, etc.

[0092] The module identifier is a unique identifier of the functional module where an exception occurs, which can be the name of the functional module. For example, when an exception occurs in the audio management module, its module identifier can be expressed as "audio management module", or the module identifier can be other directional identifiers, such as encoding each functional module, etc. The embodiments of the present application do not limit the form of expression of the module identifier.

[0093] The exception type indicates what type of exception problem has occurred in the functional module, so as to facilitate the subsequent analysis of the cause of the exception. For example, when a null pointer exception occurs (the pointer stores the memory address, and when the pointer does not point to any memory address, it is called a null pointer), it means that no valid memory address is accessed. The exception type can be expressed as 000000. The embodiment of the present application does not limit the form of expression of the exception type.

[0094] S502: When information related to the abnormality occurring in the first functional module is obtained for the first time, instruct multiple functional modules to stop running, and obtain first data from a memory corresponding to the second processor.

[0095] In the historical period, after each exception occurs in each functional module, the application processor saves the information related to the exception and the corresponding exception data of the functional module to form a historical record. There is a correlation between the information related to the exception and the exception data. Among them, the exception data comes from all or part of the memory data of the subsystem, which may specifically include module operation information, thread information, stack call information, etc. The exception data can be saved in some log files, for example, it can be saved as a Dump file. The Dump file can also be called a memory dump file, a memory snapshot file, etc., which is a memory image of the program process. In other words, the application processor can save the execution state of the program when the functional module has an exception to the Dump file. When repairing the exception later, the Dump file can be used to reproduce the execution state of the program and the exception problem, and then locate the cause of the exception according to the situation of reproducing the exception problem, and then repair the vulnerability.

[0096] The information related to the exception can be recorded in the form of a list, a dump file name, etc. After the application processor obtains the information related to the exception that occurred in the first functional module, it determines whether the information related to the exception that occurred in the first functional module is obtained for the first time based on its own historical records. The first time means that there is no corresponding information related to the exception that occurred in the first functional module in the historical records of the application processor.

[0097] Specifically, the application processor can make a judgment based on the module identifier and the exception type. For example, when a null pointer exception occurs in the audio management module, the application processor searches the historical records for the module identifier of the audio management module based on the module identifier. If there is a module identifier, the application processor further searches the exception type associated with the module identifier of the audio management module based on the exception type to determine whether there is a null pointer exception. If there is a null pointer exception, it indicates that the information related to the exception that occurred in the first functional module is not being obtained for the first time. If the module identifier of the audio management module is not found, or the null pointer exception is not found, it indicates that the information related to the exception that occurred in the first functional module is being obtained for the first time.

[0098] When the information related to the exception in the first functional module is obtained for the first time (corresponding to the SSR mode), there is no exception data associated with this exception in the historical records of the application processor. The exception problem in the first functional module cannot be located and analyzed later, and it is necessary to obtain the exception data of the subsystem. Specifically, the application processor instructs multiple functional modules of the subsystem to stop running. After the multiple functional modules stop running, the first data is obtained from the memory corresponding to the subsystem. The first data here and the second data mentioned below are data in the memory corresponding to the subsystem in different time periods. The first data is the data obtained for this exception, and the second data is the data obtained when the exception occurred in the historical period.

[0099] Based on the above technical solution, when an exception occurs in the first functional module, the application processor only needs to instruct multiple functional modules to stop running when the information related to the exception occurring in the first functional module is obtained for the first time, and obtain the first data from the memory corresponding to the second processor for subsequent analysis. For the case where the information related to the exception occurring in the first functional module is not obtained for the first time, the application processor has the corresponding exception data stored, and does not need to obtain it from the memory of the subsystem, and does not need to stop the operation of multiple functional modules. Therefore, for the case where it is not obtained for the first time, when processing the exception occurring in the first functional module, it does not affect the operation of other functional modules, and can improve the efficiency of handling abnormal situations.

[0100] Furthermore, when the information related to the exception that occurred in the first functional module is obtained for the first time, the application processor can save the obtained first data into a dump file, and the dump file can be used to conveniently save the state of the process when the exception occurred, which is convenient for subsequent analysis. The application processor also saves the information related to the exception that occurred in the first functional module, and establishes an association relationship between the information related to the exception that occurred in the first functional module and the first data, so that based on the association relationship, the corresponding information related to the exception that occurred in the first functional module can be determined according to the first data, or the first data can be found according to the corresponding information related to the exception that occurred in the first functional module, which is convenient for subsequent analysis and also convenient for searching and judging when the exception occurs next time.

[0101] One purpose of exception capture is to allow the program to continue to execute normally. In some scenarios where exception processing is delayed, after the application processor obtains the exception data, it may take the developer several days, a week or even longer to handle the exception. In one implementation, after obtaining the first data, the application processor instructs multiple functional modules of the subsystem to restart and run, thereby achieving rapid recovery of the subsystem, so that the subsystem can continue to operate normally while waiting for the developer to handle the exception.

[0102] When the information related to the exception occurring in the first functional module is not obtained for the first time (corresponding to the APR mode), it indicates that there is exception data associated with this exception type in the historical records of the application processor. This type of exception problem can be subsequently located and analyzed, and there is no need to obtain exception data from the memory of the subsystem this time. In one implementation, in order to allow the program to continue to execute normally, the application processor can instruct the first functional module to stop running, and start running again after stopping. In other words, by restarting the first functional module, a quick recovery is achieved to solve the current exception problem, so that the first functional module can continue to operate normally while waiting for the developer to deal with the exception problem. Since only the first functional module is restarted, the restart speed can be accelerated and the impact on other functional modules can be reduced. In addition, in an embodiment of the present application, when the information related to the exception occurring in the first functional module is not obtained for the first time, the first functional module is restarted, thereby avoiding the problem that the subsystem cannot obtain exception data.

[0103] In some implementations, when the information related to the exception occurring in the first functional module is not obtained for the first time, the application processor can obtain the second data of the memory corresponding to the subsystem locally based on the information related to the exception occurring in the first functional module and the first information, so as to determine that the exception data does exist, or in some scenarios of real-time exception processing, meet the scenario requirements. The first information indicates the association relationship between the information related to the exception occurring in the first functional module and the memory data corresponding to the subsystem. It can be understood that for each type of exception occurring in each functional module, the application processor saves the corresponding exception data, and establishes an association relationship between the information related to the exception and the exception data, and these association relationships can be recorded as the first information.

[0104] In some implementations, when the information related to the exception occurring in the first functional module is not obtained for the first time, the application processor may instruct the first functional module to stop running after obtaining the second data, and restart the running after stopping running. If the second data is not obtained, the application processor instructs the subsystem to handle the exception in SSR mode.

[0105] In addition, when saving the information related to the exception occurring in the first functional module, the application processor may record the number of occurrences of each exception type in each functional module, so as to provide more information for subsequent exception processing.

[0106] Figure 6 A method for handling an exception provided in an embodiment of the present application is shown, which is applied to an electronic device. The method is executed by a subsystem and includes the following S601 and S602.

[0107] S601, when an exception occurs in a first functional module, sending information related to the exception occurring in the first functional module to a first processor.

[0108] As mentioned above, the subsystem may communicate with the application processor through shared memory or DMA hardware, etc., to transmit information related to the exception occurring in the first functional module.

[0109] S602: When the first processor obtains information related to the abnormality of the first functional module for the first time, the first processor stops running the multiple functional modules under the instruction of the first processor.

[0110] When the application processor first obtains the information related to the exception of the first functional module, the application processor sends the first indication information to the subsystem, instructing the multiple functional modules of the subsystem to stop running. After receiving the first indication information, the subsystem uses the SSR mode to handle the exception. Specifically, the subsystem cleans up its own cache, actively triggers the subsystem interrupt through the register, and stops running (both the computing layer and the kernel layer stop running), and then sends an interrupt signal to the application processor. After receiving the interrupt signal, the application processor obtains the first data of the memory corresponding to the subsystem.

[0111] Based on the above technical solution, the subsystem needs to stop running as a whole only when the information related to the exception occurring in the first functional module is obtained for the first time by the application processor. Then, if the information related to the exception occurring in the first functional module is not obtained for the first time by the application processor, the subsystem does not need to stop running as a whole. Therefore, the exception occurring in the first functional module does not affect the operation of other functional modules, thereby improving the efficiency of handling exceptions.

[0112] In some implementations, when the subsystem sends an interrupt signal to the application processor, it may also transmit information related to the exception occurring in the first functional module to the application processor again to make the first information more accurate.

[0113] In some implementations, after the first data is acquired, the application processor sends a reset signal to the subsystem to instruct the multiple functional modules of the subsystem to restart operation. After receiving the reset signal, the subsystem restarts operation.

[0114] When the information related to the exception occurring in the first functional module is not obtained for the first time by the application processor, the application processor sends a second indication message to the subsystem. After receiving the second indication message, the subsystem adopts the APR mode to handle the exception. Specifically, the subsystem stops running the first functional module and starts running the first functional module again after the first functional module stops running (i.e., restarts the first functional module).

[0115] In some implementations, the subsystem records each time an abnormal function module occurs and the type of abnormality that occurs, and records the number of times the first function module is restarted and the time of each restart. The number of restarts is the number recorded before the current abnormality. After receiving the second indication information, the subsystem determines whether the number of times the first function module is restarted within the preset time length is greater than or equal to the preset threshold. If it is greater than or equal to the preset threshold, the subsystem automatically uses the SSR mode to handle the abnormality. If it is less than the preset threshold, the subsystem uses the APR mode to handle the abnormality. This is because the number of times the first function module is restarted within the preset time length is greater than or equal to the preset threshold, indicating that the first function module is repeatedly restarted, the APR mode cannot handle the abnormality of the first function module, and the first function module cannot resume operation.

[0116] Alternatively, after receiving the second indication information, the subsystem determines whether the number of times the first functional module is restarted due to the same type of abnormality within a preset time period is greater than or equal to a preset threshold. If it is greater than or equal to the preset threshold, the subsystem automatically adopts the SSR mode to handle the abnormality. If it is less than the preset threshold, the subsystem adopts the APR mode to handle the abnormality. The embodiment of the present application adds support for the APR mode, and when an abnormality that cannot be recovered by the APR mode occurs, it can be automatically converted to the SSR mode.

[0117] Figure 7 A method for handling an exception provided in an embodiment of the present application is shown, which is applied to an electronic device. The method includes the following S701-S711.

[0118] S701: The subsystem monitors that an abnormality occurs in the first functional module.

[0119] S702: The application processor obtains information related to an exception occurring in the first functional module.

[0120] S703: The application processor determines whether the information related to the abnormality occurring in the first functional module is obtained for the first time.

[0121] S704: When information related to the abnormality occurring in the first functional module is obtained for the first time, the application processor instructs the multiple functional modules to stop running.

[0122] S705: The subsystem stops running and sends an interrupt signal to the application processor.

[0123] S706: The application processor obtains first data from the memory corresponding to the subsystem.

[0124] S707, the application processor instructs multiple functional modules to start running.

[0125] S708, multiple functional modules of the subsystem restart and run.

[0126] S709: When the information related to the abnormality occurring in the first functional module is not obtained for the first time, the application processor instructs the first functional module to restart.

[0127] S710: The subsystem determines whether the number of times the first functional module is restarted due to the same abnormal problem within a preset time period is greater than or equal to a threshold.

[0128] S711, if the number of times the first functional module is restarted due to the same abnormal problem within the preset time period is less than the threshold, the subsystem restarts the first functional module. If the number of times the first functional module is restarted due to the same abnormal problem within the preset time period is greater than or equal to the threshold, execute S705-S708.

[0129] The details of the embodiments of the present application refer to the above embodiments, which will not be repeated here. In summary, the method provided by the embodiments of the present application supports restarting only the function module with an exception, which can reduce the impact on other function modules without an exception and improve the efficiency of handling exceptions.

[0130] The above describes in detail an example of the method provided by the embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the present application.

[0131] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0132] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0133] The electronic device provided in this embodiment is used to execute the above method, and thus can achieve the same effect as the above implementation method.

[0134] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.

[0135] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0136] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 1 Device of the structure shown.

[0137] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the method of any of the above embodiments.

[0138] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the method in the above-mentioned embodiments.

[0139] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.

[0140] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0141] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0142] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0143] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0144] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0145] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0146] In the above description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0147] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0148] It should also be understood that the "multiple" mentioned in the specification and the appended claims of this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, which means any combination of one or more of the items listed in the association and all possible combinations, and includes these combinations, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0149] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0150] In addition, in order to clearly describe the technical solution of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and cannot be understood as indicating or implying relative importance, and words such as "first" and "second" do not necessarily limit differences.

[0151] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0152] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for handling an exception, characterized in that: The method is applied to an electronic device, the electronic device includes a first processor and a second processor, the second processor is used to assist the first processor in processing tasks, the second processor includes one or more functional modules, and the method is executed by the first processor, including: When an abnormality occurs in the first functional module, obtaining information related to the abnormality occurring in the first functional module; When the information related to the abnormality occurring in the first functional module is obtained for the first time, instructing the multiple functional modules to stop running, and obtaining first data from the memory corresponding to the second processor; When the information related to the exception occurring in the first functional module is not obtained for the first time, second data of the memory corresponding to the second processor is obtained locally according to the information related to the exception occurring in the first functional module and the first information, wherein the first information indicates an association relationship between the information related to the exception occurring in the first functional module and the memory data corresponding to the second processor; When the information related to the abnormality occurring in the first functional module is not obtained for the first time, the first functional module is instructed to stop running.

2. The method according to claim 1, characterized in that After instructing the multiple functional modules to stop running and obtaining the first data from the memory corresponding to the second processor, the method further includes: Establish an association relationship between information related to the abnormality occurring in the first functional module and the first data.

3. The method according to claim 1 or 2, characterized in that: After instructing the multiple functional modules to stop running and obtaining the first data from the memory corresponding to the second processor, the method further includes: Instruct the multiple functional modules to start running.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: Instructing to restart the operation of the first functional module after stopping the operation.

5. A method for handling an exception, characterized in that: The method is applied to an electronic device, the electronic device includes a first processor and a second processor, the second processor is used to assist the first processor in processing tasks, the second processor includes one or more functional modules, and the method is executed by the second processor, including: When an exception occurs in the first functional module, sending information related to the exception occurring in the first functional module to the first processor; When the first processor first obtains information related to the abnormality of the first functional module, under the instruction of the first processor, stopping the operation of the multiple functional modules; When the information related to the abnormality occurring in the first functional module is not obtained for the first time by the first processor, the first functional module is stopped under the instruction of the first processor.

6. The method according to claim 5, characterized in that After stopping the operation of the multiple functional modules, the method further includes: Under the instruction of the first processor, the multiple functional modules are started and executed.

7. The method according to claim 5 or 6, characterized in that: After stopping the operation of the first functional module, the method further includes: Under the instruction of the first processor, the first functional module is started again after the first functional module stops running.

8. The method according to claim 7, characterized in that The method further comprises: If the first functional module stops running within a preset time period, and the number of times it is restarted after stopping is greater than or equal to a preset threshold, the multiple functional modules are stopped, and the multiple functional modules are restarted after stopping.

9. An electronic device, characterized in that: include: a first processor and a second processor, wherein the second processor is used to assist the first processor in processing tasks; one or more memories; The memory stores one or more programs, and when the one or more programs are executed by the first processor, the electronic device executes the method described in any one of claims 1 to 4; or, when the one or more programs are executed by the second processor, the electronic device executes the method described in any one of claims 5 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 4, or to execute the method according to any one of claims 5 to 8.