CN114077519A - System service recovery method and device and electronic equipment - Google Patents

System service recovery method and device and electronic equipment Download PDF

Info

Publication number
CN114077519A
CN114077519A CN202010855466.5A CN202010855466A CN114077519A CN 114077519 A CN114077519 A CN 114077519A CN 202010855466 A CN202010855466 A CN 202010855466A CN 114077519 A CN114077519 A CN 114077519A
Authority
CN
China
Prior art keywords
samgr
electronic device
local manager
controlling
proxy object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010855466.5A
Other languages
Chinese (zh)
Other versions
CN114077519B (en
Inventor
胡跃川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202010855466.5A priority Critical patent/CN114077519B/en
Priority to PCT/CN2021/125423 priority patent/WO2022037725A1/en
Publication of CN114077519A publication Critical patent/CN114077519A/en
Application granted granted Critical
Publication of CN114077519B publication Critical patent/CN114077519B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/142Reconfiguring to eliminate the error
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1479Generic software techniques for error detection or fault masking

Abstract

The embodiment of the application provides a system service recovery method, a device and electronic equipment, wherein the method comprises the following steps: the method comprises the steps that a local manager in an SA process of the electronic equipment control system capacity monitors death notification information of an SAMGR process of a system capacity manager through a Binder driver, and the local manager is used for managing the system capacity in the SA process; after monitoring the death notification information of the SAMGR process, the electronic equipment controls the local manager to acquire an agent object of the SAMGR process through the Binder driver; the electronic equipment controls the local manager to register the system capacity in the SA process into the SAMGR process through the agent object of the SAMGR process so as to recover the system service.

Description

System service recovery method and device and electronic equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a method and an apparatus for recovering system service, and an electronic device.
Background
With the development of electronic technology and internet technology, electronic devices (such as mobile phones, tablet computers, and the like) have become an indispensable part of people's lives, users install various third-party applications and service software on electronic devices to meet the needs of daily life, but at the same time, the third-party applications and service software based on electronic devices also present more and more compatibility problems, and the compatibility problems of the third-party applications and service software may cause system processes of electronic devices to crash.
When a system process of an existing electronic device crashes, system services are generally recovered by restarting the electronic device. However, the time required for restarting the electronic device is long, the efficiency is low, and the system process of the electronic device needs a long time to normally provide the service to the outside, which seriously affects the use experience of the user.
Disclosure of Invention
The application discloses a system service recovery method, an electronic device and a computer-readable storage medium. The time required by system service recovery can be effectively reduced, and the efficiency of system service recovery is improved.
In a first aspect, an embodiment of the present application provides a method for recovering system service, which is applied to an electronic device, and the method includes: the method comprises the steps that a local manager in an SA process of the electronic equipment control system capacity monitors death notification information of an SAMGR process of a system capacity manager through a Binder driver, and the local manager is used for managing the system capacity in the SA process; after monitoring the death notification information of the SAMGR process, the electronic equipment controls the local manager to acquire an agent object of the SAMGR process through the Binder driver; and the electronic equipment controls the local manager to register the system capability in the SA process into the SAMGR process through the proxy object of the SAMGR process so as to restore the system service.
In the embodiment of the application, the local manager in the SA process for controlling the system capability obtains the proxy object of the SAMGR process, and then the system capability in the SA process is registered in the SAMGR process by the proxy object of the SAMGR process to recover the system record, so that the electronic device using the system recovery method provided by the embodiment of the application does not need to restart the electronic device any more after the SAMGR process crashes, but only starts the crashed SAMGR process, thereby reducing the time required for recovering the system service, improving the efficiency of recovering the system service, and having strong usability and practicability.
Illustratively, each SA process has a unique local manager therein, one local manager for managing system capabilities in one SA process, and one or more system capabilities in each SA process.
For example, the local administrator may read a system capability activation profile, activate system capabilities of the electronic devices according to a predetermined sequence, and register the activated system capabilities in the SAMGR process through the Binder driver. The local administrator may also register the Binder driver for a death notification for the SAMGR process.
Illustratively, the death notification information is information notifying the Binder driver that the SAMGR process crashes, for example, when the SAMGR process terminates abnormally, the Binder driver cannot perform Binder communication with the proxy object of the SAMGR process, and at this time, the Binder driver monitors that the SAMGR process crashes, and the Binder driver calls a death notification interface to send the death notification information of the SAMGR process to the local manager.
Illustratively, the SAMGR process is used to manage system capabilities in all SA processes in the electronic device, as well as to provide services to register, query, and acquire system capabilities.
Illustratively, the SAMGR process is provided with an interface for acquiring system capability (getsystembability), an interface for registering system capability (addsystembability), and an interface for querying system capability (checksystembability), and the Binder driver may register the system capability into the SAMGR process through the addsystembability interface after the system capability is started. An application can acquire the system capability required to be used by the application through the SAMGR process. After the SAMGR process crashes, the newly started application program cannot acquire the system capacity required to be used by the newly started application program through the SAMGR process, and the newly started application program will flash back.
In a first possible implementation manner of the first aspect, the controlling the local manager to register the system capability in the SA process in the SAMGR process through a proxy object of the SAMGR process includes: and controlling the local manager to send system capability SA record information to the SAMGR process through the proxy object of the SAMGR process, and registering the system capability in the SA process in the SAMGR process.
Illustratively, the SA record information records information related to system capabilities in the SA process, such as a number of the system capabilities, a proxy object of the system capabilities, and the like.
In the embodiment of the application, a local manager is controlled to register the system capability in the SA process in the SAMGR process through a proxy object of the SAMGR process, and the local manager is controlled to send system capability SA record information to the SAMGR process through the proxy object of the SAMGR process, so that the local manager can register the system capability in the SA process in the SAMGR process. After the SAMGR process receives the SA record information sent by the local administrator, the number of the corresponding system capability, the proxy object of the corresponding system capability, and the like are recorded in the SAMGR process, so that when the application acquires the system capability required to be used by the application through the SAMGR process, the number of the system capability can be acquired through the proxy object of the system capability, and the purpose of calling the system capability by the application is achieved.
In a second possible implementation manner of the first aspect, the controlling the local manager to obtain, through the Binder driver, a proxy object of the SAMGR process includes: controlling the SAMGR process to restart; controlling the Binder driver to carry out Binder communication with the SAMGR process, and acquiring a proxy object of the SAMGR process; and controlling the Binder driver to send the proxy object of the SAMGR process to the local manager.
In this embodiment of the application, after the SAMGR process crashes, the electronic device controls the SAMGR process to restart, the restarted SAMGR process is an empty process, and a local administrator needs to register a system capability in the current SA process in the SAMGR process to recover a system service of the electronic device, and the local administrator needs to register the system capability in the current SA process in the SAMGR process, and then needs to perform Binder communication with the SAMGR process, that is, the local administrator needs to obtain an agent object of the SAMGR process to achieve the purpose of registering the system capability in the current SA process in the SAMGR process. The method comprises the steps that a Binder driver is controlled to carry out Binder communication with an SAMGR process, and an agent object of the SAMGR process is obtained; after the Binder driver acquires the proxy object of the SAMGR process, the electronic equipment controls the Binder driver to send the proxy object of the SAMGR process to a local manager.
In a third possible implementation manner of the first aspect, before controlling the SAMGR process to restart, the method includes: when monitoring death notification information of the SAMGR process, controlling the daemon to trigger a restart instruction of the SAMGR process.
Illustratively, the daemon is configured to start the SAMGR process, and to daemon and monitor the SAMGR process.
In the embodiment of the application, when the SAMGR process crashes, the daemon monitors the death notification information of the SAMGR process through the Binder driver, and at this time, the electronic device controls the daemon to trigger a restart instruction of the SAMGR process, so as to restart the SAMGR process.
After the SAMGR process is restarted, the Binder driver establishes Binder communication with the SAMGR process, so that a local manager in the SA process can perform the Binder communication through the proxy object of the SAMGR process.
In a second aspect, an embodiment of the present application provides a system service recovery apparatus, including: the information monitoring unit is used for controlling a local manager in the SA process of the system capacity to monitor death notification information of the SAMGR process of the system capacity manager through a Binder driver, and the local manager is used for managing the system capacity in the SA process; the agent object acquisition unit is used for controlling the local manager to acquire the agent object of the SAMGR process through the Binder driver after monitoring the death notification information of the SAMGR process; and the system capability registration unit is used for controlling the local manager to register the system capability in the SA process into the SAMGR process through the proxy object of the SAMGR process so as to restore the system service.
Illustratively, the system capability registration unit is specifically configured to: and controlling the local manager to send system capability SA record information to the SAMGR process through a proxy object of the SAMGR process, and registering the system capability in the SA process into the SAMGR process, wherein the SA record information records the related information of the system capability in the SA process.
Illustratively, the proxy object obtaining unit includes: the SAMGR process restarting subunit is used for controlling the SAMGR process to restart; the proxy object acquisition subunit is used for controlling the Binder driver to perform Binder communication with the SAMGR process and acquiring a proxy object of the SAMGR process; and the proxy object sending subunit is used for controlling the Binder driver to send the proxy object of the SAMGR process to the local manager.
Illustratively, the proxy object obtaining unit further includes: and the restart instruction triggering subunit is configured to control the daemon process to trigger a restart instruction of the SAMGR process when the daemon process monitors death notification information of the SAMGR process, and the daemon process is configured to start the SAMGR process and to daemon and monitor the SAMGR process.
In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, the processor and the memory being coupled, the memory being configured to store a computer program (also referred to as instructions or code), which, when executed by the processor, causes the electronic device as described above to perform the method as provided by the first aspect or any one of the possible embodiments of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program runs on an electronic device, the electronic device is caused to perform the method according to the first aspect or any one of the possible implementation manners of the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor, and when the processor reads and executes a computer program stored in a memory, the method provided in the first aspect or any one of the possible implementation manners of the first aspect is implemented.
In a sixth aspect, an embodiment of the present application provides a chip system, which includes a memory and a processor, and when the chip system operates, causes the electronic device to perform the method as provided in the first aspect or any one of the possible implementation manners of the first aspect. The chip system can be a single chip or a chip module consisting of a plurality of chips.
It is to be understood that the electronic device of the third aspect, the computer storage medium of the fourth aspect, or the chip of the sixth aspect provided above are all configured to perform the method provided by the first aspect or any one of the possible embodiments of the first aspect. Therefore, the beneficial effects achieved by the method can refer to the beneficial effects in the corresponding method, and are not described herein again.
Drawings
The drawings used in the embodiments of the present application are described below.
Fig. 1 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;
FIG. 2 is a system architecture diagram according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a system service recovery method according to an embodiment of the present application;
FIG. 4 is a schematic flowchart interaction diagram of a system service recovery method according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating a method for obtaining a proxy object of a SAMGR process according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a system service recovery apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a chip according to an embodiment of the present application.
Detailed Description
The embodiments of the present application will be described below with reference to the drawings. The terminology used in the description of the embodiments herein is for the purpose of describing particular embodiments herein only and is not intended to be limiting of the application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The electronic device related to the embodiment of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a Personal Digital Assistant (PDA), a wearable electronic device, a virtual reality device, or the like. The specific type of electronic device is not limited in this application.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present disclosure.
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 key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. 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, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (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. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (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.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the embodiments.
The charging management module 140 is configured 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 via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
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 charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication 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), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an 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 alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
In some embodiments, the display screen 194 of fig. 1 may be bent when the display panel is made of OLED, AMOLED, FLED, or the like. Here, the display screen 194 may be bent, which means that the display screen may be bent at any position to any angle and may be maintained at the angle. For example, the display screen 194 may be folded in half from the middle left to right, or folded in half from the middle up and down. In the embodiment of the present application, the display screen that can be folded is referred to as a foldable display screen. The foldable display screen may be a single screen, or a display screen formed by splicing a plurality of screens, which is not limited herein.
In some embodiments, the electronic device 100 may determine whether the foldable display screen is in the folded configuration or in the unfolded configuration through one or more of a gravity sensor, an acceleration sensor, and a gyroscope, and may also determine whether the foldable display screen is in the portrait screen display state or in the landscape screen display state. The electronic device 100 may further detect a bending angle of the foldable display screen through a gravity sensor, an acceleration sensor, and a gyroscope, and then the electronic device 100 may determine whether the foldable display screen is in the folded state or the unfolded state according to the bending angle. The electronic device 100 may further determine the orientation of the foldable display screen in the folded state through one or more of a gravity sensor, an acceleration sensor, and a gyroscope, so as to determine a display area of the interface content output by the display system. For example, when the first screen area of the foldable display screen is facing upward with respect to the ground, the electronic device 100 may display the interface content output by the display system on the first screen area. When the second screen area of the foldable display screen is facing upward relative to the ground, the electronic device 100 may display the interface content output by the display system on the second screen area.
In some embodiments, the electronic device 100 may further comprise an angle sensor (not shown in fig. 1) which may be arranged at a bend of the foldable display screen. The electronic device 100 may measure an included angle formed between two ends of the middle bending portion of the foldable display screen by an angle sensor (not shown in fig. 1) disposed at the bending portion of the foldable display screen, and when the included angle is greater than or equal to the first angle, the electronic device 100 may recognize that the foldable display screen enters the unfolded state by the angle sensor. When the included angle is smaller than or equal to the first angle, the electronic device 100 may recognize that the foldable display screen enters the folded state through the angle sensor.
In some other embodiments, the electronic device 100 can also recognize whether the foldable display screen is in the folded state through a physical switch disposed at the bending portion of the foldable display screen. For example, when the electronic device receives a user's folding operation on the foldable display screen and the physical switch provided on the electronic device is triggered to open, the electronic device 100 may determine that the foldable display screen is in the folded configuration. When the electronic device 100 receives an unfolding operation of the foldable display screen by a user, the physical switch arranged on the electronic device is triggered to be closed, and the electronic device can determine that the foldable display screen is in the unfolded state. The examples are merely illustrative of the present application and should not be construed as limiting.
Hereinafter, taking the foldable display screen as a two-fold display screen as an example, when the foldable display screen is in the unfolded state, the foldable display screen may display the content in a full screen, in a partial area (for example, the first screen area or the second screen area), or in two or more partial areas. In a possible implementation manner, when the foldable display screen displays the interface content in a full screen, the interface content may occupy a part of a display area of the foldable display screen, for example, when the display screen 194 is a special-shaped cut screen (Notch screen), a middle portion of the special-shaped cut screen displays the interface content, and when one or both edge portions are blank screens, the foldable display screen may also be regarded as displaying the interface content in a full screen.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability 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. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
In an embodiment of the application, an electronic device includes a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer. The hardware layer may include hardware such as a Central Processing Unit (CPU), a Memory Management Unit (MMU), and a memory (also referred to as a main memory). The operating system of the operating system layer may be any one or more computer operating systems that implement business processing through processes (processes), such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system. The application layer may include applications such as a browser, an address book, word processing software, and instant messaging software.
Based on the electronic device 100, the present application provides a system service recovery method.
First, some terms referred to in the embodiments of the present application are explained so as to be easily understood by those skilled in the art.
System capability (systembability, SA): and the SA base class is inherited to provide cross-process service capability. Common system capabilities include a packet management service, a non-accurate delay task scheduling service, a distributed task scheduling service, a telephone service, and the like, and different system capabilities correspond to different numbers, for example, the number of the packet management service is 401, the number of the non-accurate delay task scheduling service is 1904, the number of the distributed task scheduling service is 1401, and the number of the telephone service is 4001.
System capabilities (SA) process: the system capability container has a plurality of system capabilities in one SA process, and is managed by only one local manager (LocalAbilityManager) in the SA process. That is, each SA process has a unique local manager therein, one local manager is used for managing system capabilities in one SA process, and each SA process has one or more system capabilities therein.
Local manager (LocalAbilityManager): the SA process management system capability entity is used for managing the system capability in the SA process, and is specifically responsible for managing 1 or more system capabilities in one SA process.
System capability manager (systembalitigmanager, SAMGR) process: is responsible for managing all system capabilities in all SA processes in the system of the electronic device 100 and providing services for registering, querying and retrieving system capabilities.
It can be understood that the SAMGR process is a key service in the system, and when the SAMGR process crashes, the system cannot normally provide external services, such as no response of the application, flash back of the application, and the like. In the prior art, if the key service is crashed, the electronic device 100 needs to be restarted to recover the system service, however, the time required for restarting the electronic device 100 is long, so that the time for recovering the system service is long, and the user experience is poor. By adopting the system service recovery method provided by the embodiment of the application, when the SAMGR process crashes, the electronic equipment does not need to be restarted, but only the SAMGR process is restarted, so that the time required by the system service recovery is greatly shortened, the efficiency of the system service recovery is improved, the user experience is better, and the method has stronger usability and practicability.
The system related in the embodiment of the application can be a Hongmon system HarmonyOS, is a distributed operating system facing to a whole scene based on a microkernel, and is suitable for multiple electronic devices such as mobile phones, tablets, computers, intelligent automobiles and wearable devices.
Fig. 2 is a schematic diagram of a system architecture provided in an embodiment of the present application, and referring to fig. 2, the system provides a Binder mechanism through which communication between processes can be implemented. The system comprises an SA process, a local manager, an SAMGR process and a Binder driver.
The Binder mechanism adopts a Client-Server (Client-Server) communication mode, an SA process is used as a Client, an SAMGR process is used as a Server, and the two processes are communicated through a Binder driver. The SA process, the local manager and the SAMGR process are located in a user space, and the Binder driver is located in a kernel space.
The following describes an exemplary system service recovery method provided by the present application by using a specific embodiment.
Referring to fig. 3 and fig. 4, fig. 3 is a schematic flowchart of a system service recovery method according to an embodiment of the present application, and fig. 4 is a schematic interactive flowchart of the system service recovery method according to the embodiment of the present application. An execution subject of the system service recovery method in the embodiment of the present application is the electronic device 100, and details of the system service recovery method shown in fig. 3 are described with reference to fig. 4, specifically as follows:
s101, the electronic device 100 controls a local manager in the system capability SA process to monitor death notification information of the SAMGR process of the system capability manager through a Binder driver.
In this embodiment of the application, the local administrator may read a system capability starting configuration file, start the system capabilities of the electronic device 100 according to a predetermined sequence, and register the started system capabilities in the SAMGR process through the Binder driver. The electronic device 100 may also control the local manager to register a death notification of the SAMGR process with the Binder driver.
Illustratively, the SAMGR process is provided with an interface for acquiring system capability (getsystembability), an interface for registering system capability (addsystembability), and an interface for querying system capability (checksystembability), and after the system capability is started, the Binder driver may register the system capability in the SAMGR process through the addsystembability interface. An application can acquire the system capability required to be used by the application through the SAMGR process.
The death notification information is information for notifying the Binder driver that the SAMGR process is crashed, and for example, when the SAMGR process terminates abnormally, the Binder driver cannot perform Binder communication with the proxy object of the SAMGR process, and at this time, the Binder driver monitors that the SAMGR process is crashed, and the Binder driver calls a death notification interface to send the death notification information of the SAMGR process to the local administrator.
In some embodiments of the present application, when the Binder driver hears that the SAMGR process crashes, the Binder driver generates death notification information for the SAMGR process, which is sent to a local administrator.
Specifically, a local manager in the SA process registers the death notification of the SAMGR process with a death message notification interface of the Binder driver, so that the Binder driver calls the death message notification interface to send a death notification message to the local manager when determining that the proxy object of the SAMGR process is dead.
S102, after monitoring the death notification information of the SAMGR process, the electronic device 100 controls the local administrator to obtain the proxy object of the SAMGR process through the Binder driver.
In this embodiment, the SAMGR process is an administrator of the harmony os system service, and when the SA process performs Binder communication with the SAMGR process, it is necessary to obtain a proxy object of the SAMGR process to perform the Binder communication. Common system capabilities include packet management services, non-precision delay task scheduling services, distributed task scheduling services, telephony services, and the like. All of these system capabilities are registered with the SAMGR process, so the SAMGR process maintains a list of all system capabilities in the harmony os system. Any application that wants to use these system capabilities first requests a reference to these system capabilities from the SAMGR process to establish a connection with these system capabilities.
When the SAMGR process crashes, the newly started application cannot acquire the system capability required to be used by the newly started application through the SAMGR process, and the newly started application will be flashed back. By adopting the system service recovery method provided by the embodiment of the application, a local manager in the SA process can be quickly controlled to register the system capability in the SA process into the restarted SAMGR process to recover the system service of the electronic device 100, so that the electronic device 100 does not need to be restarted any more, the capability of the electronic device 100 for providing service to the outside can be quickly recovered, the recovery efficiency of system service recovery is improved, and the user experience is improved.
In this embodiment of the application, when the SAMGR process crashes, the daemon monitors the death notification information of the SAMGR process through the Binder driver, and at this time, the electronic device 100 controls the daemon to trigger a restart instruction of the SAMGR process, so as to restart the SAMGR process. After the SAMGR process is restarted, the Binder driver establishes Binder communication with the SAMGR process, so that a local manager in the SA process can perform the Binder communication through the proxy object of the SAMGR process.
Referring to fig. 5, fig. 5 is a flowchart illustrating a method for acquiring a proxy object of a SAMGR process according to an embodiment of the present application. The method for acquiring the proxy object of the SAMGR process as shown in FIG. 5 may include:
s201, the electronic device 100 controls the SAMGR process to restart.
In this embodiment of the application, the electronic device 100 controls the SAMGR process to restart through a daemon process. The daemon is used for starting the SAMGR process and for daemon and monitoring the SAMGR process. When the SAMGR process crashes, the daemon receives a process termination sigchild signal, which is used to instruct the daemon to trigger a restart instruction of the SAMGR process, so that the electronic device 100 restarts the SAMGR process according to the restart instruction. I.e., before step S201, comprising:
when monitoring the death notification information of the SAMGR process, the electronic apparatus 100 controls the daemon process to trigger a restart instruction of the SAMGR process.
S202, the electronic device 100 controls the Binder driver to perform Binder communication with the SAMGR process, and acquires a proxy object of the SAMGR process.
In this embodiment of the application, after the SAMGR process crashes, the Binder driver attempts to establish Binder communication with the proxy object of the SAMGR process all the time, and after the SAMGR process is restarted, the Binder driver may acquire the proxy object of the SAMGR process and establish Binder communication with the proxy object of the SAMGR process after being restarted, so that the SAMGR process may communicate with the proxy object of the SAMGR process.
S203, the electronic device 100 controls the Binder driver to send the proxy object of the SAMGR process to the local administrator.
In this embodiment of the present application, after controlling the Binder driver to establish Binder communication with the proxy object of the SAMGR process, the Binder driver may send the proxy object of the SAMGR process to the local administrator, so that the local administrator may obtain the proxy object of the SAMGR process, and implement the Binder communication between the local administrator and the SAMGR process.
S103, the electronic device 100 controls the local administrator to register the system capability in the SA process in the SAMGR process through the proxy object of the SAMGR process, so as to recover the system service.
In this embodiment of the application, after the SAMGR process crashes, the electronic device 100 controls the SAMGR process to restart, the restarted SAMGR process is an empty process, and a local administrator needs to register the system capability in the current SA process in the SAMGR process to recover the system service of the electronic device 100, and the local administrator needs to register the system capability in the current SA process in the SAMGR process, and then needs to perform Binder communication with the SAMGR process, that is, the local administrator needs to obtain an agent object of the SAMGR process to achieve the purpose of registering the system capability in the current SA process in the SAMGR process.
According to the embodiment of the application, the Binder driver is controlled to carry out Binder communication with the SAMGR process, so that the proxy object of the SAMGR process can be obtained; after the Binder driver acquires the proxy object of the SAMGR process, the electronic apparatus 100 controls the Binder driver to send the proxy object of the SAMGR process to the local manager, so that the electronic apparatus 100 can control the local manager to register the system capability in the SA process in the SAMGR process through the proxy object of the SAMGR process to restore the system service.
Specifically, step S103 includes:
and controlling the local manager to send system capability SA record information to the SAMGR process through the proxy object of the SAMGR process, and registering the system capability in the SA process in the SAMGR process.
In the embodiment of the present application, the SA record information records information related to system capabilities in the SA process, such as a number of the system capabilities, a proxy object of the system capabilities, and the like. After the electronic device 100 controls the proxy object of the SAMGR process and transmits SA record information to the SAMGR process, the local manager achieves the purpose of registering the system capability in the SA process in the SAMGR process.
It is to be understood that, in the process of registering the system capability in the SA process to the SAMGR process through the proxy object controlling the local manager through the SAMGR process, the local manager sends the system capability SA record information to the SAMGR process through the proxy object controlling the local manager through the SAMGR process, so that the local manager can register the system capability in the SA process to the SAMGR process. After the SAMGR process receives the SA record information sent by the local administrator, the number of the corresponding system capability, the proxy object of the corresponding system capability, and the like are recorded in the SAMGR process, so that when the application acquires the system capability required to be used by the application through the SAMGR process, the number of the system capability can be acquired through the proxy object of the system capability, and the purpose of calling the system capability by the application is achieved.
In the embodiment of the present application, a local administrator in an SA process for controlling system capability obtains an agent object of an SAMGR process, and then registers the system capability in the SA process in the SAMGR process through the agent object of the SAMGR process to recover system records, so that after the SAMGR process crashes, the electronic device 100 using the system recovery method provided in the embodiment of the present application does not need to restart the electronic device, but starts the crashed SAMGR process, which reduces the time duration required for recovering system service, and improves the efficiency of recovering system service.
Based on the system service recovery method provided by the above embodiment, the embodiment of the present application further provides an embodiment of an apparatus for implementing the above method embodiment.
Referring to fig. 6, fig. 6 is a schematic diagram of a system service recovery apparatus according to an embodiment of the present application. The units are included for performing the steps in the corresponding embodiment of fig. 3. Please refer to the related description of the embodiment in fig. 3. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 6, the system service restoring apparatus 200 includes:
an information monitoring unit 201, configured to control a local manager in a system capability SA process to monitor death notification information of a SAMGR process of the system capability manager through a Binder driver, where the local manager is configured to manage system capabilities in the SA process;
a proxy object obtaining unit 202, configured to control the local manager to obtain a proxy object of the SAMGR process through the Binder driver after monitoring death notification information of the SAMGR process;
a system capability registering unit 203, configured to control the local administrator to register the system capability in the SA process in the SAMGR process through the proxy object of the SAMGR process, so as to recover the system service.
Illustratively, the system capability registration unit 203 is specifically configured to:
and controlling the local manager to send system capability SA record information to the SAMGR process through a proxy object of the SAMGR process, and registering the system capability in the SA process into the SAMGR process, wherein the SA record information records the related information of the system capability in the SA process.
Illustratively, the proxy object obtaining unit 202 includes:
the SAMGR process restarting subunit is used for controlling the SAMGR process to restart;
the proxy object acquisition subunit is used for controlling the Binder driver to perform Binder communication with the SAMGR process and acquiring a proxy object of the SAMGR process;
and the proxy object sending subunit is used for controlling the Binder driver to send the proxy object of the SAMGR process to the local manager.
Illustratively, the proxy object obtaining unit 202 further includes:
and the restart instruction triggering subunit is configured to control the daemon process to trigger a restart instruction of the SAMGR process when the daemon process monitors death notification information of the SAMGR process, and the daemon process is configured to start the SAMGR process and to daemon and monitor the SAMGR process.
In the embodiment of the present application, a local administrator in an SA process for controlling system capability obtains an agent object of an SAMGR process, and then registers the system capability in the SA process in the SAMGR process through the agent object of the SAMGR process to recover system records, so that after the SAMGR process crashes, the electronic device 100 using the system recovery method provided in the embodiment of the present application does not need to restart the electronic device, but starts the crashed SAMGR process, which reduces the time duration required for recovering system service, and improves the efficiency of recovering system service.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores computer instructions; the computer readable storage medium, when executed on the electronic device 100, causes the electronic device 100 to perform the method as illustrated in fig. 3, fig. 4, or fig. 5. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or can comprise one or more data storage devices, such as a server, a data center, etc., that can be integrated with the medium. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium, or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Embodiments of the present application also provide a computer program product containing computer instructions, which when run on the electronic device 100, enable the electronic device 100 to perform the method shown in fig. 3, fig. 4, or fig. 5.
Fig. 7 is a schematic structural diagram of a chip according to an embodiment of the present application. The chip shown in fig. 7 may be a general-purpose processor or may be a dedicated processor. The chip includes a processor 301. The processor 301 is configured to support the communication device to execute the technical solutions shown in fig. 3, fig. 4, or fig. 5.
Optionally, the chip further includes a transceiver 302, where the transceiver 302 is configured to receive control of the processor 301, and is configured to support the communication device to execute the technical solutions shown in fig. 3, fig. 4, or fig. 5.
Optionally, the chip shown in fig. 7 may further include: a storage medium 303.
It should be noted that the chip shown in fig. 7 can be implemented by using the following circuits or devices: one or more Field Programmable Gate Arrays (FPGAs), Programmable Logic Devices (PLDs), controllers, state machines, gate logic, discrete hardware components, any other suitable circuitry, or any combination of circuitry capable of performing the various functions described throughout this application.
The electronic device 100, the computer storage medium, the computer program product, and the chip provided in the embodiments of the present application are all configured to execute the method provided above, so that the beneficial effects achieved by the electronic device can refer to the beneficial effects corresponding to the method provided above, and are not described herein again.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optics, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.
The above description is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A system service recovery method is applied to electronic equipment, and is characterized by comprising the following steps:
a local manager in an SA process of controlling system capacity monitors death notification information of an SAMGR process of the system capacity manager through a Binder driver, and the local manager is used for managing the system capacity in the SA process;
after monitoring death notification information of the SAMGR process, controlling the local manager to acquire an agent object of the SAMGR process through the Binder driver;
and controlling the local manager to register the system capability in the SA process into the SAMGR process through the proxy object of the SAMGR process so as to restore the system service.
2. The system service recovery method of claim 1, wherein the controlling the local manager to register system capabilities in the SA process into the SAMGR process through a proxy object of the SAMGR process comprises:
and controlling the local manager to send system capability SA record information to the SAMGR process through a proxy object of the SAMGR process, and registering the system capability in the SA process into the SAMGR process, wherein the SA record information records the related information of the system capability in the SA process.
3. The system service recovery method of claim 1, wherein said controlling the local manager to obtain a proxy object for the SAMGR process via the Binder driver comprises:
controlling the SAMGR process to restart;
controlling the Binder driver to carry out Binder communication with the SAMGR process, and acquiring a proxy object of the SAMGR process;
and controlling the Binder driver to send the proxy object of the SAMGR process to the local manager.
4. The system service recovery method of claim 3, prior to controlling the SAMGR process to restart, comprising:
when monitoring death notification information of the SAMGR process, controlling the daemon to trigger a restart instruction of the SAMGR process, wherein the daemon is used for starting the SAMGR process and guarding and monitoring the SAMGR process.
5. The system service recovery method of any one of claims 1 to 4, wherein there is only one local manager in each SA process, one local manager for managing system capabilities in one SA process.
6. A system service recovery apparatus, comprising:
the information monitoring unit is used for controlling a local manager in the SA process of the system capacity to monitor death notification information of the SAMGR process of the system capacity manager through a Binder driver, and the local manager is used for managing the system capacity in the SA process;
the proxy object acquisition unit is used for controlling the local manager to acquire the proxy object of the SAMGR process through the Binder driver after monitoring the death notification information of the SAMGR process;
and the system capability registration unit is used for controlling the local manager to register the system capability in the SA process into the SAMGR process through the proxy object of the SAMGR process so as to restore the system service.
7. The system service recovery apparatus of claim 6, wherein the system capability registration unit is configured to:
and controlling the local manager to send system capability SA record information to the SAMGR process through a proxy object of the SAMGR process, and registering the system capability in the SA process into the SAMGR process, wherein the SA record information records the related information of the system capability in the SA process.
8. An electronic device, comprising: a processor and a memory, the processor and the memory coupled, the memory for storing a computer program that, when executed by the processor, causes an electronic device to perform the system service recovery method of any of claims 1 to 5.
9. A computer-readable storage medium storing a computer program, which, when run on an electronic device, causes the electronic device to perform the system service recovery method according to any one of claims 1 to 5.
10. A chip comprising a processor which, when reading and executing a computer program stored in a memory, implements a system service recovery method as claimed in any one of claims 1 to 5.
CN202010855466.5A 2020-08-21 2020-08-21 System service recovery method and device and electronic equipment Active CN114077519B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010855466.5A CN114077519B (en) 2020-08-21 2020-08-21 System service recovery method and device and electronic equipment
PCT/CN2021/125423 WO2022037725A1 (en) 2020-08-21 2021-10-21 System service recovery method and apparatus, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010855466.5A CN114077519B (en) 2020-08-21 2020-08-21 System service recovery method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN114077519A true CN114077519A (en) 2022-02-22
CN114077519B CN114077519B (en) 2022-11-18

Family

ID=80282672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010855466.5A Active CN114077519B (en) 2020-08-21 2020-08-21 System service recovery method and device and electronic equipment

Country Status (2)

Country Link
CN (1) CN114077519B (en)
WO (1) WO2022037725A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048744B (en) * 2022-08-19 2023-09-12 荣耀终端有限公司 Image acquisition method and related electronic equipment

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5386544A (en) * 1991-06-03 1995-01-31 Fujitsu, Ltd. Data processing system with a standby process mechanism for saving and restoring operations
CN1464397A (en) * 2002-06-10 2003-12-31 联想(北京)有限公司 System process protection method
US20050109451A1 (en) * 2003-11-20 2005-05-26 Hauber David E. Composite tape laying apparatus and method
US20050232857A1 (en) * 2004-04-16 2005-10-20 H2Gen Innovations, Inc. Catalyst for hydrogen generation through steam reforming of hydrocarbons
US20060043328A1 (en) * 2004-09-02 2006-03-02 Invista S.A.R.L. Binder systems for microcapsule treatments to fibers, fabrics and garments
US20120084791A1 (en) * 2010-10-01 2012-04-05 Imerj LLC Cross-Environment Communication Framework
CN106371911A (en) * 2016-09-06 2017-02-01 北京海誉动想科技股份有限公司 Method for rebooting guarded process by daemon processes
CN106484461A (en) * 2016-09-13 2017-03-08 北京智能管家科技有限公司 Service keepalive method and device in intelligent terminal
CN106708641A (en) * 2016-06-20 2017-05-24 腾讯科技(深圳)有限公司 Process protection method and device
CN107066374A (en) * 2017-03-20 2017-08-18 广东欧珀移动通信有限公司 A kind of data processing method and mobile terminal
CN108345496A (en) * 2017-01-23 2018-07-31 华为技术有限公司 A kind of method and device of operation application program
CN108984321A (en) * 2018-06-29 2018-12-11 Oppo(重庆)智能科技有限公司 A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication
US20180367618A1 (en) * 2017-06-19 2018-12-20 Sap Se Event processing in background services

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0812616B2 (en) * 1991-09-11 1996-02-07 インターナショナル・ビジネス・マシーンズ・コーポレイション Passive recovery method and system for operating system kernel
JP2006065440A (en) * 2004-08-25 2006-03-09 Evolium Sas Process management system
US20070101197A1 (en) * 2005-11-03 2007-05-03 International Business Machines Corporation System and method for representing system capabilities as software packages in a software package management system
CN102436411B (en) * 2011-12-31 2015-07-22 曙光信息产业股份有限公司 Method for recovering process of computer system
US9740551B2 (en) * 2014-12-02 2017-08-22 International Business Machines Corporation Enhanced restart of a core dumping application
CN106406963B (en) * 2016-09-29 2020-09-08 杭州迪普科技股份有限公司 Initialization method and device of Linux system
CN108415734A (en) * 2018-03-22 2018-08-17 车智互联(北京)科技有限公司 A kind of application recovery device, method and mobile terminal
CN110321241A (en) * 2018-03-30 2019-10-11 华为技术有限公司 A kind of method for restarting and terminal device of application program
CN111459623B (en) * 2019-01-18 2024-04-12 华为技术有限公司 Method, device and computer for restoring running of application program
CN111008044A (en) * 2019-11-29 2020-04-14 支付宝实验室(新加坡)有限公司 Application program recovery method and system and electronic equipment

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5386544A (en) * 1991-06-03 1995-01-31 Fujitsu, Ltd. Data processing system with a standby process mechanism for saving and restoring operations
CN1464397A (en) * 2002-06-10 2003-12-31 联想(北京)有限公司 System process protection method
US20050109451A1 (en) * 2003-11-20 2005-05-26 Hauber David E. Composite tape laying apparatus and method
US20050232857A1 (en) * 2004-04-16 2005-10-20 H2Gen Innovations, Inc. Catalyst for hydrogen generation through steam reforming of hydrocarbons
US20060043328A1 (en) * 2004-09-02 2006-03-02 Invista S.A.R.L. Binder systems for microcapsule treatments to fibers, fabrics and garments
US20120084791A1 (en) * 2010-10-01 2012-04-05 Imerj LLC Cross-Environment Communication Framework
CN106708641A (en) * 2016-06-20 2017-05-24 腾讯科技(深圳)有限公司 Process protection method and device
CN106371911A (en) * 2016-09-06 2017-02-01 北京海誉动想科技股份有限公司 Method for rebooting guarded process by daemon processes
CN106484461A (en) * 2016-09-13 2017-03-08 北京智能管家科技有限公司 Service keepalive method and device in intelligent terminal
CN108345496A (en) * 2017-01-23 2018-07-31 华为技术有限公司 A kind of method and device of operation application program
CN107066374A (en) * 2017-03-20 2017-08-18 广东欧珀移动通信有限公司 A kind of data processing method and mobile terminal
US20180367618A1 (en) * 2017-06-19 2018-12-20 Sap Se Event processing in background services
CN108984321A (en) * 2018-06-29 2018-12-11 Oppo(重庆)智能科技有限公司 A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
TIANXIAO GU ET AL: "Automatic runtime recovery via error handler synthesis", 《 2016 31ST IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE)》 *
王晨等: "基于系统内核与共享内存的守护进程实现研究", 《工业控制计算机》 *
王汝言等: "Android下Binder进程通信机制的分析与研究", 《计算机技术与发展》 *

Also Published As

Publication number Publication date
WO2022037725A1 (en) 2022-02-24
CN114077519B (en) 2022-11-18

Similar Documents

Publication Publication Date Title
CN110058777B (en) Method for starting shortcut function and electronic equipment
CN110347269B (en) Empty mouse mode realization method and related equipment
CN110798568B (en) Display control method of electronic equipment with folding screen and electronic equipment
CN113795817A (en) Operation method for split screen display and electronic equipment
WO2021185105A1 (en) Method for switching between sim card and esim card, and electronic device
CN110543287A (en) Screen display method and electronic equipment
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
CN110687998A (en) Application management method and device
WO2022089000A1 (en) File system check method, electronic device, and computer readable storage medium
CN112751954A (en) Operation prompting method and electronic equipment
CN115589051B (en) Charging method and terminal equipment
CN111865646A (en) Terminal upgrading method and related device
CN113641271A (en) Application window management method, terminal device and computer readable storage medium
CN111492678B (en) File transmission method and electronic equipment
CN111104295A (en) Method and equipment for testing page loading process
CN114077519B (en) System service recovery method and device and electronic equipment
CN111061410B (en) Screen freezing processing method and terminal
CN113901485B (en) Application program loading method, electronic device and storage medium
CN115878500A (en) Memory recovery method and device, electronic equipment and readable storage medium
CN113918003A (en) Method and device for detecting time length of skin contacting screen and electronic equipment
CN110737916A (en) Communication terminal and processing method
CN113672454B (en) Screen freezing monitoring method, electronic equipment and computer readable storage medium
CN116723384B (en) Process control method, electronic device and readable storage medium
CN114125144B (en) Method, terminal and storage medium for preventing false touch
WO2023185623A1 (en) Background application recovery method, apparatus, electronic device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40069651

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant