Subsystem abnormality processing method and electronic equipment
By modifying its coupling relationship with the entire machine when the subsystem is started, the reboot of the entire machine caused by subsystem exceptions is avoided, and the problem of subsystem crashes in the existing technology affecting the use of the entire machine is solved, which improves the user experience.
Patent Information
- Application Number
- CN202410552972.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-05-07
AI Technical Summary
When the subsystem of an electronic device crashes, the prior art will be difficult to avoid the problem of restarting the entire machine, especially after the subsystem is started and before the SSR process is pulled up, subsystem exceptions will affect the use of the entire machine.
By modifying the coupling relationship between the subsystem and the entire machine when the subsystem is started, specifically, the restart level of the subsystem is changed from the default system level to the subsystem level, so that only the subsystem is performed when the subsystem is abnormal. Restart, without restarting the entire machine.
It effectively avoids the entire machine restart caused by subsystem abnormalities, improves the user experience, and ensures the normal use of other functions.
Smart Images

Figure CN118312361B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a method for handling subsystem exceptions and an electronic device. Background Art
[0002] Electronic devices can achieve long-distance or short-distance communication based on different types of protocols through deployed protocol subsystems. For example, electronic devices can achieve network communication based on Wi-Fi through the wireless fidelity (Wi-Fi) protocol subsystem; achieve communication based on cellular network through the cellular modem protocol subsystem; achieve communication based on Bluetooth network through the Bluetooth protocol subsystem; achieve communication based on NFC technology through the near field communication (NFC) protocol subsystem, etc.
[0003] Currently, when a subsystem crashes, the subsystem restart (SSR) mechanism is usually used to modify the coupling relationship between the subsystem and the entire machine, thereby avoiding the problem of the entire machine restarting due to subsystem abnormalities. However, if the subsystem has an abnormality before the SSR process is pulled up, the entire process is no longer controlled by the SSR mechanism, and the subsystem abnormality will affect the use of the entire machine. Summary of the invention
[0004] The embodiment of the present application provides a method for handling subsystem exceptions and an electronic device. The method modifies the coupling relationship between the subsystem and the whole machine when the subsystem is started to solve the problem of the whole machine restarting due to the subsystem exception.
[0005] The method for handling subsystem exceptions provided in the embodiment of the present application will synchronously modify the restart level of the subsystem when the subsystem driver is started (or subsystem startup). Specifically, the subsystem restart level will be modified from the default system level to the subsystem level. In this way, when the subsystem crashes abnormally, the entire electronic device will not be restarted, but only the subsystem will be restarted, thereby avoiding the abnormal restart of the subsystem affecting the user's use of other functions of the electronic device.
[0006] In a first aspect, a method for handling subsystem exceptions is provided, which is applied to an electronic device and includes:
[0007] In response to a user's power-on operation, executing a power-on process;
[0008] In the boot process, when the subsystem driver is loaded, the restart level corresponding to the subsystem is modified to the target restart level, wherein, at the target restart level, when the subsystem is abnormal, the subsystem is restarted instead of the entire electronic device.
[0009] The target restart level here may be a subsystem restart level, that is, the subsystem is restarted instead of the entire machine.
[0010] In a possible implementation, the restart level may be represented by assigning a value to restart_level.
[0011] It should be noted that the whole machine restart in the embodiment of the present application may refer to restarting the entire system of the electronic device; it may also refer to restarting the entire system and hardware of the electronic device.
[0012] In one possible implementation, the timing for modifying the restart level corresponding to the subsystem in the embodiment of the present application is when the subsystem driver is loaded. For ease of understanding, loading the subsystem driver may also be described below as loading the subsystem, starting the subsystem, and starting the subsystem driver.
[0013] According to the subsystem exception handling method provided by the present implementation, the restart level corresponding to the subsystem is modified during the kernel startup process so that the restart level corresponding to the subsystem is synchronously modified when the subsystem is started, thereby avoiding machine problems caused by subsystem exceptions that may occur during the period after the subsystem is started and before the SSR process is started.
[0014] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0015] When an exception occurs in the subsystem before parsing the resource file RC in the boot process, the restart level corresponding to the subsystem is read as the target restart level;
[0016] The subsystem is restarted according to the target restart level, and the entire electronic device is not restarted.
[0017] It should be understood that since the restart level corresponding to the subsystem is changed from the default system level to the subsystem level when the subsystem driver is loaded, a subsystem exception occurring after the subsystem is loaded will not cause the entire machine to restart.
[0018] In a possible implementation, when a subsystem is abnormal, the AP can read the restart level corresponding to the subsystem. When the restart level of the subsystem is obtained to be the target restart level, the subsystem can be controlled to restart according to the restart level instead of restarting the entire device.
[0019] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0020] When an exception occurs in the subsystem before the subsystem restart SSR process is started in the boot process, the restart level corresponding to the subsystem is read as the target restart level;
[0021] The subsystem is restarted according to the target restart level, and the entire electronic device is not restarted.
[0022] In combination with the first aspect, in some implementations of the first aspect, when loading the subsystem driver, modifying the restart level corresponding to the subsystem to the target restart level specifically includes:
[0023] When loading the subsystem driver, the restart level corresponding to the subsystem is modified from the default initial restart level to the target restart level, wherein, at the initial restart level, when the subsystem is abnormal, the entire electronic device is restarted.
[0024] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0025] Load the bootloader;
[0026] Initializing the kernel according to the parameters provided by the boot program;
[0027] During the kernel initialization process, loading the subsystem driver;
[0028] When the subsystem driver is loaded, the restart level corresponding to the subsystem is modified to the target restart level;
[0029] Determine whether a subsystem abnormality occurs; wherein,
[0030] If an abnormality occurs in the subsystem, determine the restart level corresponding to the subsystem;
[0031] When the restart level is the target restart level, restarting the subsystem;
[0032] If the subsystem abnormality does not occur, the second initialization phase is started, and the second initialization phase is used to initialize the upper layer process of the electronic device.
[0033] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0034] Parse the RC file and start the SSR process;
[0035] In response to the SSR process, the restart level corresponding to the subsystem is modified to the target restart level.
[0036] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0037] Determine whether a subsystem abnormality occurs; wherein,
[0038] If an abnormality occurs in the subsystem, determine the restart level corresponding to the subsystem;
[0039] When the restart level is the target restart level, restarting the subsystem;
[0040] If the subsystem abnormality does not occur, the boot process continues and the boot is completed.
[0041] In a second aspect, an electronic device is provided, including:
[0042] processor;
[0043] Memory;
[0044] The memory stores a computer program, which includes instructions. When the instructions are executed by the processor, the electronic device executes the method as described in any implementation of the first aspect above.
[0045] In a third aspect, a chip system is provided, comprising a processing circuit, a receiving pin and a transmitting pin; wherein the receiving pin, the transmitting pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes a method as described in any implementation method of the first aspect above to control the receiving pin to receive a signal and control the transmitting pin to send a signal.
[0046] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable program instructions, and when the computer-executable program instructions are executed on a computer, the computer executes the method as described in any implementation of the first aspect above.
[0047] In a fifth aspect, a computer program product is provided, the computer program product comprising a computer program code, and when the computer program code is run on a computer, the computer is caused to execute the method as described in any implementation manner of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of a startup process provided in an embodiment of the present application.
[0049] Figure 2 A schematic flowchart of a method for handling subsystem exceptions provided in an embodiment of the present application.
[0050] Figure 3A schematic flowchart for determining whether an abnormality occurs in a subsystem is provided in an embodiment of the present application.
[0051] Figure 4 A schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0052] Figure 5 A software structure block diagram of an electronic device 100 provided in an embodiment of the present application.
[0053] Figure 6 A schematic flowchart of a method for handling subsystem exceptions provided in an embodiment of the present application.
[0054] Figure 7 A schematic flowchart of another method for handling subsystem exceptions provided in an embodiment of the present application.
[0055] Figure 8 A schematic diagram of modifying a subsystem restart level provided in an embodiment of the present application.
[0056] Fig. 9 A schematic flowchart of another method for handling subsystem exceptions provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] It should be noted that the terms used in the implementation method part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present 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 obstacles, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two, "at least one" and "one or more" mean one, two or more than two.
[0058] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, it is defined that the "first" and "second" features may explicitly or implicitly include one or more of the features.
[0059] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing at different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0060] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0061] The subsystem abnormality scenarios in the embodiments of the present application include modem subsystem abnormality, digital signal processing (ADSP) subsystem abnormality (including ADSP subsystem abnormality and CDSP subsystem abnormality, etc.), sensor subsystem abnormality, Wi-Fi subsystem abnormality, NFC subsystem abnormality, Bluetooth subsystem abnormality, etc. Different types of subsystem abnormalities usually lead to different problems. For example, cellular modem subsystem abnormalities are manifested as terminal network loss, card loss, no signal, etc.; short-range Wi-Fi, Bluetooth, and NFC subsystem abnormalities are manifested as network disconnection, interruption of flow, access control failure, etc. Subsystem abnormalities will have an impact on protocol services. If subsystem abnormalities occur in protocol service scenarios, users will have a strong perception.
[0062] In some scenarios, the coupling relationship between the subsystem and the whole machine is modified by starting the SSR process during system startup. When the subsystem is abnormal, the whole machine will not be abnormal. However, under normal circumstances, the timing of subsystem startup is generally earlier than the SSR process. If a subsystem abnormality occurs before the SSR process is started, it will affect the use of the whole machine. Considering that subsystem startup usually occurs during the boot process, subsystem abnormalities can easily cause the whole machine to restart or even fail to boot, seriously affecting the user experience.
[0063] In order to better understand the logic of how subsystem abnormalities lead to whole machine problems, the following describes the startup process with reference to the accompanying figures.
[0064] For example, Figure 1 As shown, it is a schematic diagram of a startup process provided in an embodiment of the present application. Figure 1 The boot process shown in the figure shows the main steps in the boot process. In actual application, the boot process may also include Figure 1 There may be more or fewer steps shown, and the embodiments of the present application are not limited thereto.
[0065] In some embodiments, after receiving the user's operation on the power button (or power button), the electronic device will first perform a power self-test. The power self-test is mainly used to check whether the power system of the electronic device is working properly. After passing the power self-test, the electronic device will then perform a basic input / output system (BIOS) self-test. The BIOS self-test is mainly used to check whether the hardware of the electronic device is normal. Specifically, the BIOS self-test may include initializing hardware, checking memory, checking hard disks and other storage devices, and so on. After the BIOS self-test passes, the electronic device will enter the boot program, select the boot program, and then load the boot program (bootloder).
[0066] The role of bootloader loading is to load the core code of the operating system into the device memory and execute it after the BIOS self-test and boot device selection. After that, the electronic device performs the operation of loading the operating system, the main purpose of which is to load all the modules of the operating system into the memory and start the initialization process of the operating system. The loading of the operating system is mainly divided into two stages: kernel loading and kernel initialization (kernel init). In the kernel loading stage, the bootloader reads the kernel code of the operating system into the memory. Once the kernel is successfully loaded into the memory, the bootloader transfers control to the kernel and starts executing the kernel code. At this point, the kernel of the operating system can start to perform initialization operations. In the initialization stage, the kernel will initialize the hardware of the system and load various subsystem drivers. The subsystem is pulled up when the corresponding driver is loaded, and subsys_register is executed to register the corresponding subsystem with the kernel. That is, subsystem start (subsystemstart) is started during the kernel startup process.
[0067] After the subsystem is started, the second initialization stage (init second stage) is executed. The second initialization stage is mainly used to initialize the upper layer process of the electronic device.
[0068] After that, the operation of parsing resource files (parse rescoure files) is executed. In the process of parsing resource files (rescoure files, RC), the SSR process is pulled up. That is, the SSR process is started in the RC file. Specifically, in the later stage of RC file parsing, when the persist.vendor.ssr.restart_level attribute is set, the operation of pulling up the SSR process is executed. When the RC file is parsed, the boot process ends and the user can use the electronic device normally.
[0069] For example, Figure 2 FIG. 1 is a schematic flow chart of a method for handling subsystem exceptions provided in an embodiment of the present application. Specifically, the following steps may be included:
[0070] S201, turn on the computer.
[0071] The power-on process may include: receiving a power-on operation (such as a long press operation) input by a user on a power button of the electronic device; and performing power-on, power self-test and other operations in response to the power-on operation.
[0072] S202, boot program loading.
[0073] In some embodiments, after the electronic device is turned on and the central processing unit (CPU) is powered on, a bootloader can be executed. The bootloader is a boot program of the kernel and can initialize hardware parameters, such as initializing touch panel liquid crystal display (TP LCD) information or CPU information. After the bootloader is started, parameters for starting the kernel can be generated.
[0074] S203, kernel starts.
[0075] Among them, after the bootloader is started, the kernel can be started according to the startup parameters generated by it.
[0076] S204, subsystem driver loading.
[0077] The kernel may include a subsystem driver, and during the kernel startup process, the subsystem driver will be registered with the kernel. When the kernel startup is completed, it can be considered that the subsystem driver has been successfully registered.
[0078] Specifically, during the kernel startup process, the subsystem driver will be initialized, and the attribute information in the memory (or structure) corresponding to the subsystem will also be initialized, so that the attribute information corresponding to the subsystem in the structure is assigned by default. After that, the subsystem will be registered in the kernel, and at this time, the subsystem can provide its own attribute information to the kernel. According to the attribute information of the subsystem, the kernel can enter the corresponding information in the structure corresponding to the subsystem, that is, reassign the information in the structure according to the attribute information provided by the subsystem. Among them, if the subsystem does not provide certain attribute information when registering, the kernel will not enter the attribute information in the structure, and this part of the information in the structure will maintain the default value. For example, in an embodiment of the present application, the kernel may not enter the value of the restart_level corresponding to the subsystem. At this time, in the structure, the value of the restart_level corresponding to the subsystem driver defaults to SYSTEM, that is, the level corresponding to the subsystem remains at the system level.
[0079] S205, keep restart_level=SYSTEM.
[0080] In some embodiments, when the subsystem is registered with the kernel, the kernel does not provide the kernel with a value for restart_level, so the kernel may not change the default value of restart_level in the subsystem structure. At this time, the value of restart_level is still the default value, that is, restart_level=SYSTEM, which means that the subsystem restart level is system level (higher priority), and the entire machine will be restarted when the subsystem crashes. In other words, the main reason for the subsystem abnormality and the entire machine restart is that the restart_level maintains the default high priority level.
[0081] S206, determining whether a subsystem abnormality occurs.
[0082] Among them, if a subsystem abnormality occurs, that is, the judgment result of this step is "yes", then step S207 can be executed next; if no subsystem abnormality occurs, that is, the judgment result of this step is "no", then step S208 can be executed next.
[0083] In some embodiments, the process of determining whether an abnormality occurs in a subsystem of an electronic device can be referred to in Figure 3 In the case where the subsystem is normal, the process may include the following steps:
[0084] S301A, the application processor (AP) sends subsystem status query information to the subsystem.
[0085] The subsystem status query information is used to query whether the current status of the subsystem is a normal operating status.
[0086] S302A, the subsystem sends subsystem status response information to the AP.
[0087] The subsystem status response information is used to indicate the current normal operation status of the subsystem.
[0088] It should be noted that when a subsystem responds to the subsystem status query information sent by the AP and feeds back its own status to the AP within a preset time, it usually means that the subsystem is in normal operation. At this time, the entire machine controlled by the AP can also process other services according to the original logic.
[0089] In some other embodiments, when a subsystem is abnormal, the process of determining whether the subsystem is abnormal may include the following steps:
[0090] S301B, the AP sends subsystem status query information to the subsystem.
[0091] S302B: The subsystem does not send subsystem status response information to the AP.
[0092] S303, determining that the subsystem is abnormal, determining the subsystem abnormal restart level, and performing abnormal processing according to the restart level.
[0093] In some embodiments, when the AP does not receive the subsystem status response information sent by the subsystem within a preset time, it can be determined that the subsystem is abnormal. After that, the AP can query the restart level corresponding to the subsystem. Specifically, the AP can query the restart_level value corresponding to the subsystem in the memory. When it is determined that the restart level corresponding to the subsystem is a whole machine restart, such as the restart_level value is the default value (that is, the restart_level value = SYSTEM), the AP can call the exception handling process to show the whole machine restart phenomenon.
[0094] S207, kernel panic.
[0095] The kernel panic refers to the action taken by the operating system when it detects an internal fatal error and cannot safely handle the error. In the embodiment of the present application, when it is determined that the entire machine needs to be restarted, the kernel of the operating system can process the kernel panic subroutine, and then the process can continue to execute step S201, that is, restart the machine.
[0096] S208, initialization start.
[0097] In some embodiments, after the kernel is successfully started, an initialization (init) process will be performed, that is, the second stage of initialization (init second stage). The init process here is the link between the kernel and the upper layer application, and is used to mount partitions and mount system files to specific locations, such as system components, system images, etc.
[0098] S209, parsing the RC file.
[0099] After the kernel is started, the upper-level processes need to be started, and the RC file includes the service files corresponding to these processes, which are used to initialize the upper-level running space and start the upper-level services of the system.
[0100] S210, start SSR.
[0101] In the process of starting the upper layer service (ie, in the process of executing step S209 ), it may include starting an SSR process, which is used to modify restart_level, that is, to modify the restart level of the subsystem exception.
[0102] S211, determine whether a subsystem abnormality occurs.
[0103] The process of judging whether a subsystem is abnormal can be found in Figure 3 The description in the embodiments will not be repeated here.
[0104] Among them, if a subsystem abnormality occurs, that is, the judgment result of this step is "yes", then step S212 can be executed next; if no subsystem abnormality occurs, that is, the judgment result of this step is "no", then step S213 can be executed next.
[0105] S212, the subsystem restarts.
[0106] S213, booting completed.
[0107] Combined with the introduction of the above embodiments, it can be seen that in the startup process of the electronic device, the subsystem has been started before the SSR process is pulled up, and there is a strict order between the two. This results in the SSR process being unable to synchronously modify the relationship between the subsystem and the whole machine when the subsystem is started. When booting, the restart level corresponding to the subsystem abnormality is higher. By default, when the subsystem crashes abnormally, the whole machine also crashes and restarts.
[0108] The reason for setting the coupling relationship between the subsystem and the whole machine is that when the whole machine crashes, the electronic equipment will report the reason for the whole machine crash, not just the reason for the subsystem crash. This makes it easier to obtain more information that may cause subsystem abnormalities during the research and development stage, so as to more comprehensively analyze the reasons for subsystem abnormalities. Considering that there are already rich analysis results on the causes of subsystem abnormalities, and the impact of subsystem abnormalities leading to the crash of the whole machine on users cannot be ignored, it is necessary to improve the process of subsystem abnormality handling, remove the binding relationship between subsystem abnormalities and the whole machine, and avoid the problem of the whole machine restarting or even not starting due to subsystem abnormalities.
[0109] In view of this, an embodiment of the present application provides a method for handling subsystem exceptions, by using the startup of the subsystem as a trigger event to modify the coupling relationship between the subsystem and the whole machine, so that when an exception occurs in the subsystem, the binding relationship between the subsystem and the whole machine is synchronously decoupled when the subsystem is started, thereby avoiding whole machine problems caused by subsystem exceptions that may occur during the period when the subsystem is started and the SSR process is not started.
[0110] It should be noted that under normal circumstances, hardware reasons, software reasons, and communication environment reasons may all cause subsystem abnormalities. After a subsystem crashes, it can be reset. Therefore, in many cases, although the subsystem will be abnormal, the user will not be aware of it because the abnormal event lasts for a short time. However, if the subsystem abnormality causes the entire machine to restart or not boot up, the user will clearly feel that the boot time has become longer or the boot is abnormal. Therefore, timely decoupling the relationship between the subsystem abnormality and the entire machine can avoid the problem of users obviously perceiving the abnormality due to the subsystem crash, and improve the user's device usage experience.
[0111] The electronic device in the embodiments of the present application is a device with functions such as communication. For example, the electronic device may be a portable computer (such as a mobile phone), a tablet computer, a personal computer (PC), a wearable electronic device (such as a smart watch), an augmented reality (AR) or virtual reality (VR) device, a Bluetooth device, an NFC device, etc. The following embodiments do not specifically limit the specific type of the electronic device.
[0112] For example, Figure 4 , which is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0113] It should be noted that Figure 4The structure of the electronic device 100 shown in the embodiment is only an example. In actual applications, the electronic device 100 may have more or fewer components, which is not limited in the embodiment of the present application.
[0114] The electronic device 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.
[0115] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0116] 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.
[0117] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0118] 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.
[0119] 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.
[0120] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0121] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of an electronic device. While the charging management module 140 is charging the battery 142, it can also power the terminal through the power management module 141.
[0122] 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.
[0123] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0124] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0125] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. 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 may be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be set in the same device as at least some of the modules of the processor 110.
[0126] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and may be set in the same device as the mobile communication module 150 or other functional modules.
[0127] The wireless communication module 160 can provide wireless communication solutions for electronic devices, 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. 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 filters it, 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.
[0128] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).
[0129] The electronic device implements the display function through the GPU, the display screen 194, and the application processor, etc. The display screen 194 is used to display images, videos, etc.
[0130] The electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0131] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device is selecting a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy. Video codecs are used to compress or decompress digital videos. NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn.
[0132] 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. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external memory card. The internal memory 121 can be used to store computer executable program codes, which include instructions.
[0133] The electronic device 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.
[0134] The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device. The magnetic sensor 180D includes a Hall sensor. The electronic device can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device in various directions (generally three axes). When the electronic device is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the terminal posture and applied to applications such as horizontal and vertical screen switching and pedometers. The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode. The electronic device emits infrared light outward through the light emitting diode. The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect the temperature. The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect a touch operation on or near it. The bone conduction sensor 180M can obtain a vibration signal.
[0135] In addition, the electronic device also includes an air pressure sensor 180C and a distance sensor 180F. The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0136] The distance sensor 180F is used to measure the distance. The electronic device can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0137] Exemplarily, the software system of the smart terminal 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The present application embodiment takes the Android system of the layered architecture as an example to exemplify the software structure of the smart terminal 100. Figure 5 It is a software structure block diagram of a smart terminal 100 provided in an embodiment of the present application.
[0138] The layered architecture divides the software into several layers, each with 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: application layer, application framework layer, Android runtime, system library, kernel layer, hardware abstraction layer (HAL), and hardware layer.
[0139] The application layer can include a series of application packages. Figure 5 As shown, the application package may include applications such as camera, calendar, map, WLAN, music, short message, Bluetooth, video, social, gallery, navigation, etc.
[0140] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 5 As shown, the application framework layer may include a window manager, a content provider, a phone manager, a resource manager, a notification manager, a view system, and the like.
[0141] 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.
[0142] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0143] 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.
[0144] The phone manager is used to provide communication functions of the smart terminal 100, such as management of call status (including connecting, hanging up, etc.).
[0145] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0146] 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, the terminal vibrates, the indicator light flashes, etc.
[0147] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0148] 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.
[0149] The application layer and the application framework layer run in the 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 obstacle life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0150] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0151] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0152] 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.
[0153] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0154] A 2D graphics engine is a drawing engine for 2D drawings.
[0155] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera sensor driver, audio driver, and sensor driver.
[0156] For example, Figure 6 As shown, it is a schematic flow chart of a method for handling subsystem exceptions provided in an embodiment of the present application. The execution subject of the process can be an electronic device, and specifically can include the following steps:
[0157] S601, turn on the computer.
[0158] The power-on process may include: receiving a power-on operation (such as a long press operation) input by a user on a power button of the electronic device; and performing power-on, power self-test and other operations in response to the power-on operation.
[0159] S602, loading the bootloader.
[0160] In some embodiments, after the electronic device is turned on and the CPU is powered on, a bootloader may be executed. The bootloader is a boot program of the kernel and may initialize hardware parameters, such as initializing touch panel liquid crystal display (TP LCD) information or CPU information. After the bootloader is started, parameters for starting the kernel may be generated.
[0161] S603, kernel startup.
[0162] After the bootloader is started, the kernel can be started according to the boot parameters generated by it. The kernel can include an extended boot loader (eXtensible boot loader / secondary bootloader, XBL) and an application bootloader (application bootloader, ABL).
[0163] S604, subsystem driver loading.
[0164] The kernel may include a subsystem driver, and during the kernel startup process, the subsystem driver will be registered with the kernel. When the kernel startup is completed, it can be considered that the subsystem driver has been successfully registered.
[0165] Specifically, during kernel startup, the subsystem driver will be initialized, and the attribute information in the memory (or structure) corresponding to the subsystem will also be initialized, so that the attribute information corresponding to the subsystem in the structure is assigned by default. After that, the subsystem will be registered in the kernel, and the subsystem can provide its own attribute information to the kernel during registration. According to the attribute information of the subsystem, the kernel can enter the corresponding information in the structure corresponding to the subsystem, that is, reassign the information in the structure according to the attribute information provided by the subsystem.
[0166] and Figure 2 The difference in the embodiment is that when the subsystem is registered in the kernel, the subsystem will provide its own attribute information to the kernel, and the attribute information may include a re-assignment of the subsystem restart level. For example, the code corresponding to the attribute information may include: subsys->restart_level=RESET_SUBSYS_COUPLED. That is, the assignment of the subsystem restart level is: RESET_SUBSYS_COUPLED, which reduces the restart level of the subsystem. When the subsystem is abnormal, the whole machine is no longer restarted, but the abnormally crashed subsystem is restarted.
[0167] S605, modify the subsystem restart level.
[0168] In some embodiments, the kernel can modify the subsystem restart level in the structure corresponding to the subsystem according to the attribute information provided when the subsystem is registered, specifically according to the attribute information for the subsystem restart level provided when the subsystem is registered. Specifically, the kernel can modify the restart level of the subsystem in the structure from the default system level (SYSTEM level) to the restart subsystem level (RESET_SUBSYS_COUPLED), that is, lower the corresponding restart level when the subsystem is abnormal, and modify it from the whole machine restart level to the subsystem restart level, so as to avoid the whole machine restarting when the subsystem crashes abnormally, affecting the user's device experience.
[0169] S606, determining whether a subsystem abnormality occurs.
[0170] The process of judging whether a subsystem is abnormal can be found in Figure 3 The description in the embodiments will not be repeated here.
[0171] When a subsystem abnormality occurs, that is, the judgment result of this step is "yes", step S607 can be executed next; when no subsystem abnormality occurs, that is, the judgment result of this step is "no", step S608 can be executed next.
[0172] S607, subsystem crashes.
[0173] It should be noted that since the restart level of the subsystem is lowered at this time, when the subsystem crashes, the entire system will not be restarted.
[0174] S608, the subsystem restarts.
[0175] S609, initialization restart.
[0176] The initialization restart (init start) in this step may specifically include initialization of an upper layer process.
[0177] S610, parsing the RC file.
[0178] In some embodiments, during the process of parsing the RC file, the SSR process may no longer be started, thereby simplifying the boot process and improving boot efficiency.
[0179] S611, booting completed.
[0180] According to the method for handling subsystem exceptions provided in an embodiment of the present application, by modifying the restart level corresponding to the subsystem during the kernel startup process, the restart level corresponding to the subsystem is synchronously modified when the subsystem is started, thereby avoiding machine problems caused by subsystem exceptions that may occur in the period after the subsystem is started and before the SSR process is started.
[0181] For example, Figure 7 As shown, it is a schematic flow chart of another method for handling subsystem exceptions provided in an embodiment of the present application. The execution subject of the process can be an electronic device, and specifically can include the following steps:
[0182] S701, turn on the computer.
[0183] S702, boot program loading.
[0184] S703, kernel startup.
[0185] S704, subsystem driver loading.
[0186] S705, modify the subsystem restart level.
[0187] S706, determining whether a subsystem abnormality occurs.
[0188] When a subsystem abnormality occurs, that is, the judgment result of this step is "yes", step S707 can be executed next; when no subsystem abnormality occurs, that is, the judgment result of this step is "no", step S710 can be executed next.
[0189] S707, subsystem crash.
[0190] S708, obtaining the restart level of the subsystem.
[0191] S709, the subsystem restarts.
[0192] S710, initialization startup.
[0193] S711, parse RC file.
[0194] S712, start the SSR process.
[0195] It should be noted that launching the SSR process during the parsing of the RC file is an SSR mechanism for subsystem exceptions in the Qualcomm QCOM platform. Therefore, in this embodiment, the SSR process is still launched when parsing the RC file, which can reduce the difference between the subsystem exception restart process provided by the QCOM platform, that is, it can solve the problem of the whole machine restarting due to subsystem exception after the subsystem is started and before the SSR process is launched with minimal modification.
[0196] S713, modify the subsystem restart level.
[0197] In some embodiments, after the SSR process is started, the subsystem restart level can be modified to RELATED, where the subsystem restart level is used to indicate that when an abnormality occurs in a subsystem, the subsystem is restarted instead of the entire machine.
[0198] S714, determine whether a subsystem abnormality occurs.
[0199] When no subsystem abnormality occurs, that is, the judgment result of this step is "no", then step S715 can be executed next, that is, the boot is completed. When the subsystem abnormality occurs, that is, the judgment result of this step is "yes", then step S716 can be executed next, that is, the subsystem is restarted; then, step S715 can be executed, that is, the boot is completed.
[0200] It is worth noting that the embodiments of the present application are Figure 6 The main difference between the embodiments is that, in this embodiment, although the subsystem restart level has been modified when the subsystem is started, the SSR process is still started when the RC file is parsed, that is, the subsystem restart level is modified again. Figure 8As shown, when the subsystem driver is started (or called subsystem startup), the kernel can modify the restart level corresponding to the subsystem from the default SYSTEM to RESET_SUBSYS_COUPLED, that is, when the subsystem crashes, the subsystem restarts without restarting the entire machine; when the SSR process is started, the subsystem restart level has been modified to RESET_SUBSYS_COUPLED, at this time, the subsystem restart level can be modified from RESET_SUBSYS_COUPLED to RELATED, or, RESET_SUBSYS_COUPLED can be modified to RESET_SUBSYS_COUPLED (that is, the assignment of the subsystem restart before and after the SSR process modification is the same). Among them, the restart levels corresponding to RESET_SUBSYS_COUPLED and RELATED in the embodiment of the present application can be consistent, that is, when the subsystem crashes, the subsystem restarts without restarting the entire machine.
[0201] Optionally, the embodiment of the present application only introduces the example of modifying the default subsystem level (SYSTEM) to RESET_SUBSYS_COUPLED when the subsystem driver is started. In actual applications, the default subsystem level (SYSTEM) can also be modified to RELATED when the subsystem driver is started, or other information used to indicate that the subsystem restart level is reduced to the startup subsystem itself rather than the entire system. The embodiment of the present application does not limit this. In addition, in the embodiment of the present application, the subsystem driver startup can correspond to the subsystem startup.
[0202] It should be understood that the reason for retaining the steps of starting the SSR process and modifying the subsystem restart level again is to reduce the difference between the process of this application and the subsystem abnormal restart process currently used in electronic devices, so as to realize the subsystem exception handling method provided in the embodiment of this application. It is more convenient to apply it to the existing software framework, thereby improving the universality of the subsystem exception handling method.
[0203] According to the method for handling subsystem exceptions provided in an embodiment of the present application, by modifying the restart level corresponding to the subsystem during the kernel startup process, the restart level corresponding to the subsystem is synchronously modified when the subsystem is started, thereby avoiding machine problems caused by subsystem exceptions that may occur in the period after the subsystem is started and before the SSR process is started.
[0204] For example, Fig. 9 As shown, it is a schematic flowchart of another method for handling subsystem exceptions provided in an embodiment of the present application.
[0205] S901, in response to a user's power-on operation, executing a power-on process.
[0206] S902, in the boot process, when the subsystem driver is loaded, the restart level corresponding to the subsystem is modified to the target restart level, wherein, under the target restart level, when the subsystem is abnormal, the subsystem is restarted instead of the entire electronic device.
[0207] In some embodiments, the method also includes: when an exception occurs in the subsystem before parsing the resource file RC in the boot process, reading the restart level corresponding to the subsystem as the target restart level; restarting the subsystem according to the target restart level, and not restarting the entire electronic device.
[0208] In some embodiments, the method also includes: when an exception occurs in the subsystem before the subsystem restart SSR process is started in the boot process, reading the restart level corresponding to the subsystem as the target restart level; according to the target restart level, restarting the subsystem, and not restarting the entire electronic device.
[0209] In some embodiments, when the subsystem driver is loaded, the restart level corresponding to the subsystem is modified to a target restart level, specifically including: when the subsystem driver is loaded, the restart level corresponding to the subsystem is modified from a default initial restart level to a target restart level, wherein, at the initial restart level, when the subsystem is abnormal, the entire electronic device is restarted.
[0210] In some embodiments, the method also includes: loading a boot program; performing kernel initialization according to parameters provided by the boot program; during the kernel initialization process, loading the subsystem driver; when loading the subsystem driver, modifying the restart level corresponding to the subsystem to the target restart level; determining whether a subsystem abnormality occurs; wherein, if the subsystem abnormality occurs, determining the restart level corresponding to the subsystem; when the restart level is the target restart level, restarting the subsystem; if the subsystem abnormality does not occur, starting a second initialization phase, the second initialization phase is used to initialize the upper-level process of the electronic device.
[0211] In some embodiments, the method further includes: parsing the RC file and starting the SSR process; and in response to the SSR process, modifying the restart level corresponding to the subsystem to the target restart level.
[0212] In some embodiments, the method also includes: determining whether a subsystem abnormality occurs; wherein, if the subsystem abnormality occurs, determining the restart level corresponding to the subsystem; when the restart level is the target restart level, restarting the subsystem; if the subsystem abnormality does not occur, continuing the boot process and completing the boot.
[0213] According to the method for handling subsystem exceptions provided in an embodiment of the present application, by modifying the restart level corresponding to the subsystem during the kernel startup process, the restart level corresponding to the subsystem is synchronously modified when the subsystem is started, thereby avoiding machine problems caused by subsystem exceptions that may occur in the period after the subsystem is started and before the SSR process is started.
[0214] Based on the same technical concept, an embodiment of the present application also provides an electronic device, including a processor; a memory; the memory stores a computer program, and the computer program includes instructions. When the instructions are executed by the processor, the electronic device performs one or more steps in any of the above methods.
[0215] Based on the same technical concept, an embodiment of the present application also provides a chip system, which includes: a processing circuit, a receiving pin and a transmitting pin; wherein the receiving pin, the transmitting pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes one or more steps of any one of the above methods to control the receiving pin to receive a signal and control the transmitting pin to send a signal.
[0216] Based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable program instructions. When the computer-executable program instructions are executed on a computer, the computer or processor executes one or more steps in any of the above methods.
[0217] Based on the same technical concept, an embodiment of the present application also provides a computer program product comprising instructions, wherein the computer program product includes computer program code. When the computer program code runs on a computer, the computer or processor executes one or more steps in any of the above methods.
[0218] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0219] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0220] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims
1. A method for handling subsystem exceptions, characterized in that: Used in electronic equipment, including: In response to a user's power-on operation, executing a power-on process; In the boot process, when the subsystem driver is loaded, the restart level corresponding to the subsystem is synchronously modified to the target restart level, wherein, at the target restart level, when the subsystem is abnormal, the subsystem is restarted instead of the entire electronic device; The method further comprises: When an exception occurs in the subsystem before the subsystem restart SSR process is started in the boot process, the restart level corresponding to the subsystem is read as the target restart level; The subsystem is restarted according to the target restart level, and the entire electronic device is not restarted.
2. The method according to claim 1, characterized in that: The method further comprises: When an exception occurs in the subsystem before parsing the resource file RC in the boot process, the restart level corresponding to the subsystem is read as the target restart level; The subsystem is restarted according to the target restart level, and the entire electronic device is not restarted.
3. The method according to claim 1 or 2, characterized in that: When loading the subsystem driver, modifying the restart level corresponding to the subsystem to the target restart level specifically includes: When loading the subsystem driver, the restart level corresponding to the subsystem is modified from the default initial restart level to the target restart level, wherein, at the initial restart level, when the subsystem is abnormal, the entire electronic device is restarted.
4. The method according to claim 1 or 2, characterized in that: The method further comprises: Load the bootloader; Initializing the kernel according to the parameters provided by the boot program; During the kernel initialization process, loading the subsystem driver; When the subsystem driver is loaded, the restart level corresponding to the subsystem is modified to the target restart level; Determine whether a subsystem abnormality occurs; wherein, If an abnormality occurs in the subsystem, determine the restart level corresponding to the subsystem; When the restart level is the target restart level, restarting the subsystem; If the subsystem abnormality does not occur, the second initialization phase is started, and the second initialization phase is used to initialize the upper layer process of the electronic device.
5. The method according to claim 4, characterized in that The method further comprises: Parse the RC file and start the SSR process; In response to the SSR process, the restart level corresponding to the subsystem is modified to the target restart level.
6. The method according to claim 5, characterized in that The method further comprises: Determine whether a subsystem abnormality occurs; wherein, If an abnormality occurs in the subsystem, determine the restart level corresponding to the subsystem; When the restart level is the target restart level, restarting the subsystem; If the subsystem abnormality does not occur, the boot process continues and the boot is completed.
7. An electronic device, characterized in that: include: processor; Memory; The memory stores a computer program, wherein the computer program includes instructions, and when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 6.
8. A chip system, characterized in that: The chip system includes a processing circuit, a receiving pin and a transmitting pin; wherein the receiving pin, the transmitting pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method described in any one of claims 1 to 6 to control the receiving pin to receive a signal and control the transmitting pin to send a signal.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable program instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 6.
