CN114153638A - Application exception exit repairing method and device and electronic equipment - Google Patents

Application exception exit repairing method and device and electronic equipment Download PDF

Info

Publication number
CN114153638A
CN114153638A CN202010935534.9A CN202010935534A CN114153638A CN 114153638 A CN114153638 A CN 114153638A CN 202010935534 A CN202010935534 A CN 202010935534A CN 114153638 A CN114153638 A CN 114153638A
Authority
CN
China
Prior art keywords
data
memory
file
disk
original data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010935534.9A
Other languages
Chinese (zh)
Inventor
龚晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Device Co Ltd
Original Assignee
Huawei 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 Huawei Device Co Ltd filed Critical Huawei Device Co Ltd
Priority to CN202010935534.9A priority Critical patent/CN114153638A/en
Priority to PCT/CN2021/112149 priority patent/WO2022052730A1/en
Publication of CN114153638A publication Critical patent/CN114153638A/en
Pending legal-status Critical Current

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/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Retry When Errors Occur (AREA)
  • Telephone Function (AREA)

Abstract

The application provides a method and a device for repairing application exception exit and electronic equipment, wherein the method comprises the following steps: when the abnormal exit of the target application program is detected, first position information of first data related to the abnormal exit of the target application program in a memory is obtained, the first data are cleared from the memory according to the first position information of the first data in the memory, and original data of the first data are read from a disk to the memory, so that the target application program is quickly repaired. According to the restoration method, users do not need to participate, equipment does not need to be restarted, when the target application program is abnormal, only wrong data, namely first data, is restored, all data of the target application program do not need to be reloaded into the memory, restoration is more targeted, the amount of restored data is small, restoration efficiency is high, the target application program can be automatically restored under the condition that the users and the application are unaware of the restoration, and user experience can be improved.

Description

Application exception exit repairing method and device and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for repairing an application exception exit, and an electronic device.
Background
When an application program runs, information of the application program needs to be read from a disk into a memory, and a processor accesses the information of the application program from the memory. However, when the processor accesses exception information for the application, such as an exception code section, the application may exit abnormally. In some cases, the reason why the information of the application program is abnormal may be that after the information is loaded from the disk to the memory, the information loaded into the memory is abnormal due to a hardware problem of the memory, or the information in the memory is maliciously tampered.
In order to solve the technical problem, a currently adopted repair method is that when the application program is detected to be abnormally exited for multiple times within a certain time, a prompt box is popped up to prompt a user that the application program is abnormal. And the user manually restores the application program by restarting the device and the like.
The existing repair method needs user participation and equipment restarting, and has low repair efficiency.
Disclosure of Invention
The embodiment of the application exception exit repairing method and device and electronic equipment are used for improving the repairing efficiency of the application exception exit.
In a first aspect, an embodiment of the present application provides a method for repairing an application exception exit, including: when the target application program is detected to be abnormally exited, acquiring first position information of first data in a memory, wherein the first data is read-only data related to the abnormal exit of the target application program; clearing the first data from the memory according to the first position information of the first data in the memory; and reading the original data of the first data from the disk into the memory, wherein the original data of the first data is used for normal operation of the target application program.
According to the restoration method, the user does not need to participate, the device does not need to be restarted, the target application program can be automatically restored under the condition that the user and the target application program are not aware, and the restoration efficiency is high.
In some embodiments, the obtaining the first location information of the first data in the memory includes:
acquiring second position information of original data of the first data in the disk;
and obtaining first position information of the first data in the memory according to second position information of the original data of the first data in the disk.
In some embodiments, when the first data is an instruction, the obtaining second location information of the original data of the first data in the disk includes:
and acquiring second position information of the original data of the first data in the disk from the preset file.
In a possible implementation manner, before the obtaining, from the preset file, the second location information of the original data of the first data in the disk, the method further includes: obtaining the type of abnormal exit of the target application program from a preset file;
at this time, the obtaining of the second location information of the original data of the first data in the disk from the preset file includes: and when the type of the abnormal exit of the target application program is the execution of the first data, acquiring second position information of the original data of the first data in the disk from the preset file.
Optionally, the preset file may be generated when the target application program exits abnormally.
In this embodiment of the application, the second location information of the original data of the first data in the disk includes: and the information of a first file in the magnetic disk and the address offset of the original data of the first data in the first file, wherein the first file is a file for storing the original data of the first data.
Alternatively, the information of the first file may be a storage path of the first file in the disk.
In some embodiments, the obtaining first location information of the first data in the memory according to the second location information of the original data of the first data in the disk includes:
accessing the first file in the disk according to the information of the first file;
obtaining third position information of the original data of the first data in the first file according to the address offset of the original data of the first data in the first file;
and obtaining the first position information of the first data in the memory according to the mirror image of the third position information in the memory.
In some embodiments, the clearing the first data from the memory according to the first location information of the first data in the memory includes: and clearing the first data from the memory according to the first position information of the first data in the memory and the preset length of the first data.
In some embodiments, the reading the original data of the first data from the disk into the memory includes: and when detecting that the target application program is restarted, reading original data of the first data from the disk into the memory.
According to the method for repairing the abnormal exit of the application, when the abnormal exit of the target application program is detected, second position information of original data of the first data in the disk is obtained, first position information of the first data in the memory is accurately obtained according to the second position information of the original data of the first data in the disk, the first data is cleared from the memory according to the accurately obtained first position information of the first data in the memory, and accurate clearing of error-reported first data is achieved. In addition, when the target application program is detected to be restarted, the original data of the first data are read from the disk to the memory, so that the processor can realize the normal operation of the target application program according to the original data of the first data.
In a second aspect, an embodiment of the present application provides a repair apparatus for applying an exception exit, including:
the device comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is used for acquiring first position information of first data in the memory when detecting that a target application program abnormally exits, and the first data is read-only data related to the abnormal exit of the target application program;
the clearing unit is used for clearing the first data from the memory according to the first position information of the first data in the memory;
and the reading unit is used for reading the original data of the first data from the disk into the memory, wherein the original data of the first data is used for normal operation of the target application program.
In some embodiments, the obtaining unit is specifically configured to obtain second location information of original data of the first data in the disk; and obtaining first position information of the first data in the memory according to second position information of the original data of the first data in the disk.
In some embodiments, when the first data is an instruction, the obtaining unit is specifically configured to obtain, from a preset file, second location information of original data of the first data in the disk.
In some embodiments, the obtaining unit is specifically configured to obtain, from a preset file, a type of an abnormal exit of the target application program; and when the type of the abnormal exit of the target application program is the execution of the first data, acquiring second position information of the original data of the first data in the disk from the preset file.
Optionally, the preset file is generated when the target application program exits abnormally.
Optionally, the second location information of the original data of the first data in the disk includes: and the information of a first file in the magnetic disk and the address offset of the original data of the first data in the first file, wherein the first file is a file for storing the original data of the first data.
Optionally, the information of the first file is a storage path of the first file in the disk.
In some embodiments, the obtaining unit is specifically configured to access the first file in the disk according to the information of the first file; obtaining third position information of the original data of the first data in the first file according to the address offset of the original data of the first data in the first file; and obtaining the first position information of the first data in the memory according to the mirror image of the third position information in the memory.
In some embodiments, the clearing unit is specifically configured to clear the first data from the memory according to first location information of the first data in the memory and a preset length of the first data.
In some embodiments, the reading unit is specifically configured to read original data of the first data from the disk into the memory when detecting that the target application is restarted.
The beneficial effects of the device for repairing an application abnormal exit provided by the second aspect and each possible implementation manner of the second aspect may refer to the beneficial effects brought by each possible implementation manner of the first aspect and the first aspect, and are not described herein again.
In a third aspect, an embodiment of the present application provides a device for repairing an abnormal exit, where the device exists in a product form of a chip, and the device structurally includes a processor and a storage, where the storage includes a memory and a disk, the storage is used for being coupled to the processor and storing necessary program instructions and data of the device, and the processor is used for executing the program instructions stored in the storage, so that the device executes the method described above.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: memory, a disk and a processor for implementing the method according to any of the first aspect.
In a sixth aspect, the present application provides a computer storage medium including computer instructions, which when executed by a computer, cause the computer to implement the method according to any one of the first aspect.
In a seventh aspect, this application embodiment provides a computer program product, where the computer program product includes a computer program, the computer program is stored in a readable storage medium, the computer program can be read by at least one processor of an electronic device from the readable storage medium, and the computer program is executed by the at least one processor to enable the electronic device to implement the method according to any one of the first aspect.
According to the method, the device and the electronic equipment for repairing the abnormal exit of the application, when the abnormal exit of the target application is detected, the first position information of the first data related to the abnormal exit of the target application in the memory is obtained, the first data is cleared from the memory according to the first position information of the first data in the memory, and the original data of the first data is read from the disk to the memory, so that the processor can normally run the target application according to the original data of the first data, and the rapid repair of the target application is realized. According to the restoration method, users do not need to participate, equipment does not need to be restarted, when the target application program is abnormal, only wrong data, namely first data, is restored, and all data of the target application program do not need to be reloaded into the memory.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device to which the present application is applicable;
FIG. 2 is a schematic diagram of a computing device according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a method for repairing an application exception exit according to an embodiment of the present application;
FIG. 4 is a schematic illustration of a repair process according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating first location information of first data according to an embodiment of the present disclosure;
fig. 6 is another schematic flowchart of a method for repairing an application exception exit according to an embodiment of the present application;
fig. 7 is another schematic flowchart of a method for repairing an application exception exit according to an embodiment of the present application;
fig. 8 is another schematic flowchart of a method for repairing an application exception exit according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a repair apparatus applying an abnormal exit according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a repair apparatus applying an abnormal exit according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be understood that in the embodiment of the present application, "B corresponding to a" means that B is associated with a. In one implementation, B may be determined from a. It should also be understood that determining B from a does not mean determining B from a alone, but may be determined from a and/or other information. The term "plurality" herein means two or more. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings distinguish the same or similar items having substantially the same function or effect. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
Fig. 1 is a schematic structural diagram of an electronic device suitable for the present application, and as shown in fig. 1, the electronic device 100 may include: the mobile terminal includes 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 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. It is to be understood that the illustrated structure of the present embodiment does not constitute a specific limitation to the electronic apparatus 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.
The processor 110 may include one or more acquisition 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 video codec, a Digital Signal Processor (DSP), a baseband processor, a Display Processing Unit (DPU), and/or a neural-Network Processing Unit (NPU), etc. The different acquiring units may be independent devices or may be integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. 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. This avoids repeated accesses, reduces the latency of the processor 110, and thus increases the efficiency of the system of the electronic device 100.
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 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.
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 above 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 100 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 supplies power to the processor 110, the internal memory 121, 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, switch, power amplifier, low noise amplifier, etc. 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 (WLAN), bluetooth, Global Navigation Satellite System (GNSS), Frequency Modulation (FM), 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 technologies may include GSM, GPRS, CDMA, WCDMA, TD-SCDMA, LTE, GNSS, WLAN, NFC, FM, and/or IR technologies, among others. 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 may implement 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 instructions to generate or change 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 be 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), or 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.
The electronic device 100 may implement a capture function via the ISP, one or more cameras 193, video codec, GPU, one or more display screens 194, and application processor, among others.
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 DPU is also called a Display Sub-System (DSS), and is used for adjusting the color of the Display screen 194, and the DPU may adjust the color of the Display screen through a three-dimensional look-up table (3D LUT). The DPU may also perform scaling, noise reduction, contrast enhancement, backlight brightness management, hdr processing, display parameter Gamma adjustment, and the like on the picture.
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, data files such as music, photos, videos, and the like are saved in the external memory card.
Internal memory 121 may be used to store one or more computer programs, including instructions. The processor 110 may cause the electronic device 100 to execute various functional applications, data processing, and the like by executing the above-described instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Wherein, the storage program area can store an operating system; the storage area may also store one or more application programs (e.g., gallery, contacts, etc.), etc. The storage data area may store data (e.g., photos, contacts, 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. In some embodiments, the processor 110 may cause the electronic device 100 to execute various functional applications and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor 110. Optionally, the internal memory may include a memory and a magnetic disk.
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 configured to convert digital audio information into an analog audio signal for output, and also configured 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, may be an open mobile electronic device platform (OMTP) standard interface of 3.5mm, and may also be a CTIA (cellular telecommunications industry association) standard interface.
The sensors 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.
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 gyro sensor 180B may also be used for navigation, body sensing game scenes, and the like.
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.
A fingerprint sensor 180H (also referred to as a fingerprint recognizer) for collecting 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. Further description of fingerprint sensors may be found in international patent application PCT/CN2017/082773 entitled "method and electronic device for handling notifications", which is incorporated herein by reference in its entirety.
Touch sensor 180K, which may also be referred to as a touch panel or touch sensitive surface. 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 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 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.
Fig. 2 is a schematic diagram of a computing device according to an embodiment of the present application. As shown in fig. 2, the computing device 200 includes: a processor 202, memory 201, and a disk 203. Processor 202, memory 201, and disk 203 are communicatively coupled to each other. For example, the processor 202, the memory 201, and the disk 203 may be communicatively connected by a network connection. Alternatively, the computing device 200 may also include a bus 204. Processor 202, memory 201, and disks 203 are communicatively coupled to each other via bus 204. Fig. 2 is a computing device 200 with a processor 202, memory 201, and disks 203 communicatively coupled to each other via a bus 204.
The memory is also called internal memory, main memory or main memory, is a storage space which can be directly addressed by the processor, is a bridge for communicating the external memory and the processor, runs all programs in the computer in the memory, is made of semiconductor devices, and is characterized by high access speed.
The Memory 201 in the embodiment of the application is a Random Access Memory (RAM), and includes a Fast Page Mode (FPM) Memory, an Extended Data Out (EDO) Memory, a Memory bank, a Synchronous Dynamic random access Memory (Synchronous Dynamic RAM, SDRAM), a Rambus Dynamic Random Access Memory (RDRAM), a Double Data Rate (Double Data Rate SDRAM, DDR), and the like, where the DDR may include DDR2, DDR3, DDR4, and the like.
The memory 201 is used for temporarily storing data or programs currently being executed by the processor, and information in the data or programs is lost once the power is turned off or power is cut off.
Disk 203 may be understood to be an external storage device such as a magnetic or optical media, like a hard disk, floppy disk, tape, CD, etc., for storing information over long periods of time, and not relying on electricity to store information without losing information when the computing device is powered down.
The processor 202 may be implemented as a general purpose Central Processing Unit (CPU), a microprocessor, an Application Specific Integrated Circuit (ASIC), a Graphics Processing Unit (GPU), or one or more Integrated circuits.
The processor 202 may also be an integrated circuit chip having signal processing capabilities. In implementation, the functions of the AI model generation system 100 of the present application may be performed by instructions in the form of hardware, integrated logic circuits, or software in the processor 202. The processor 202 may also be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, or discrete hardware components, which may implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present application below. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the methods disclosed in connection with the embodiments described below may be embodied directly in the hardware decoding processor, or in a combination of the hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 201, and the processor 202 reads information in the memory 201, and completes the functions of the AI model generation system 100 according to the embodiment of the present application in combination with hardware thereof.
When computing device 200 includes bus 204, bus 204 may include a pathway for transferring information between various components of computing device 200 (e.g., processor 202, memory 201, and disks 203).
It is understood that the processor used in the terminal device in the present application may be a Central Processing Unit (CPU), a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others.
The bus described herein may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
In practical use, when a processor executes an application program, information of the application program needs to be read from a disk into a memory, and the processor accesses the information of the application program from the memory. However, when the processor accesses exception data for the application, such as an exception code section, the application may exit abnormally. In some cases, the reason why the information of the application program is abnormal may be that after the information is loaded from the disk to the memory, the information loaded into the memory is abnormal due to a hardware problem of the memory, or the information in the memory is maliciously tampered.
The currently adopted repair method is that when detecting that an application program exits abnormally for multiple times within a certain time, a prompt box pops up to prompt a user that the application program is abnormal. And the user manually restores the application program by restarting the device and the like. However, the repair method requires user participation and equipment restart to reload all data of the application program into the memory, and has low repair efficiency and poor user experience.
In order to solve the foregoing technical problem, an embodiment of the present application provides a method for repairing an abnormal exit of an application program, where when the abnormal exit of a target application program is detected, location information of first data related to the abnormal exit of the target application program in a memory is obtained, the first data is cleared from the memory according to the location information of the first data in the memory, and original data of the first data is read from a disk into the memory, so that a processor can normally run the target application program according to the original data of the first data, thereby implementing repair of the target application program. According to the restoration method, users do not need to participate, equipment does not need to be restarted, only the data with errors need to be restored, the whole data of the target application program does not need to be loaded into the memory, the restoration efficiency is high, the target application program can be automatically restored under the condition that the users and the target application program are not aware (namely the users are not interfered, and the target application program is not suspended), and user experience is good.
The following describes, by way of specific examples, a repair procedure for application exception exit according to an embodiment of the present application.
Fig. 3 is a schematic flowchart of a method for repairing an application exception exit according to an embodiment of the present application, and fig. 4 is a schematic diagram of a repairing process according to an embodiment of the present application. As shown in fig. 3 and 4, the method of the embodiment of the present application includes:
s101, when abnormal exit of the target application program is detected, first position information of first data in a memory is obtained.
The method for repairing application exception quit provided by the embodiment of the application can be applied to the electronic device shown in fig. 1 or the computing device shown in fig. 2.
The execution subject of the embodiment of the present application may be the processor in fig. 1 or fig. 2 described above.
Specifically, when detecting that the target application program exits abnormally (crash), the processor obtains first location information of the first data in the memory, where the first location information may be understood as storage location information, or a storage address, of the first data in the memory.
The first data is data related to abnormal exit of the target application, and is, for example, data such as parameters and program instructions related to the target application. That is to say, due to some reasons, for example, a hardware problem of the memory, or information in the memory is maliciously tampered, the first data stored in the memory is abnormal, and when the processor reads the abnormal first data, the target application program is abnormally exited. Optionally, the first data is read-only data.
S102, clearing the first data from the memory according to the first position information of the first data in the memory.
Specifically, after the processor obtains first location information of first data in the memory, which causes the target application program to exit abnormally, the processor clears the first data from the memory according to the first location information, so that the processor reads correct information.
In some embodiments, the clearing the first data from the memory according to the first location information of the first data in the memory in S102 may include step B:
and B, clearing the first data from the memory according to the first position information of the first data in the memory and the preset length of the first data.
Specifically, as shown in fig. 5, the first location information may be understood as a starting location a1 of a storage location of the first data in the memory, and the preset length of the first data is b. In this way, the processor may query the starting storage location a1 of the first data in the memory according to the first location information of the first data in the memory, shift the length b from the location a1, obtain the ending storage location a2 of the first data in the memory, and delete the first data from the location a1 to the location a2 in the memory.
It should be noted that the preset length of the first data is set according to an actual situation, and the embodiment of the present application does not limit this.
In some examples, the preset length of the first data is 8 bytes, that is, 64 bits.
S103, reading the original data of the first data from the disk to a memory.
The original data of the first data is data which is not tampered and can be used for normal operation of the target application program.
Specifically, according to the step S102, after the processor clears the first data from the memory, the processor reads the original data of the first data from the second device, and stores the read original data of the first data in the memory. In this way, the processor can read the original data of the first data which is not tampered from the memory, and normal operation of the target application program is achieved.
In this embodiment of the application, the processor reads the original data of the first data from the disk into the memory under the following several conditions.
In case 1, after the processor clears the first data from the memory, the processor immediately reads the original data of the first data from the disk into the memory. That is, the trigger condition for the processor to read the original data of the first data from the disk into the memory is that the first data in the memory is detected to be cleared.
In case 2, when detecting that the target application program is restarted, reading original data of the first data from the disk into the memory. That is, after the processor clears the first data from the memory, the original data of the first data is not immediately read from the disk to the memory, but when it is detected that the target application program is restarted and the first data cannot be read from the memory, the original data of the first data is read from the disk to the memory.
From the above, the embodiments of the present application
According to the method for repairing the abnormal exit of the application, when the abnormal exit of the target application is detected, the first position information of the first data related to the abnormal exit of the target application in the memory is obtained, the first data is cleared from the memory according to the first position information of the first data in the memory, and the original data of the first data is read from the disk to the memory, so that the processor can normally run the target application according to the original data of the first data, and the quick repair of the target application is realized. According to the restoration method, users do not need to participate, equipment does not need to be restarted, when the target application program is abnormal, only wrong data, namely first data, is restored, and all data of the target application program do not need to be reloaded into the memory.
On the basis of the foregoing embodiment, the present application describes in detail a specific process of acquiring the first location information of the first data in the memory in S101.
Fig. 6 is another schematic flow chart of the method for repairing an application exception exit provided in the embodiment of the present application, and as shown in fig. 6, the method in the embodiment of the present application includes:
s201, when abnormal exit of the target application program is detected, second position information of the original data of the first data in the disk is obtained.
Since the first data in the memory is a mirror image of the original data of the first data in the disk, the storage location of the first data in the memory can be obtained by obtaining the storage location of the original data of the first data in the disk.
Specifically, when the processor detects that the target application program exits abnormally, the processor obtains second position information of the original data of the first data in the disk. And then, obtaining first position information of the first data in the memory according to second position information of the original data of the first data in the disk.
In some examples, the original data of the first data is stored in a first file in the disk, and at this time, the second location information of the original data of the first data in the disk may include: the information of the first file in the disk, and the address offset of the original data of the first data in the first file.
Optionally, the information of the first file may be identification information of the first file, and the identification information of the first file may include a file name of the first file.
Optionally, the information of the first file may be a storage path of the first file in the disk, for example, the storage path of the first file in the disk is:
/data/dalvik-cache/arm64/system@app@iConnect@iConnect.apk@classes.dex。
in some embodiments, when the first data is an instruction related to abnormal exit of the target application, the acquiring, in S201, second location information of the original data of the first data in the disk includes step S2011:
step S2011, second position information of the original data of the first data in the disk is obtained from the preset file.
The preset file may be a preset file for storing second location information of the original data of the first data in the disk.
In some examples, the preset file may be a tombstone (tombstone) which records location information of original data of the first data in the disk.
In some examples, when the embodiment of the present application is applied to an Android operating system (Android), the preset file may be: android native dimension log, which may record some information when an exception (crash) occurs to an application, for example, including: information of the first file, an address offset of original data of the first data in the first file.
Optionally, the preset file may be generated when the processor reads the original data of the first data from the disk to the memory for the first time.
Optionally, the preset file is generated when the target application program exits abnormally. When the processor accesses the first data, the target application program exits abnormally, at this time, a preset file is generated, and second position information of the original data of the first data in the disk is stored in the preset file.
In some embodiments, as shown in fig. 7, the step S2011 of obtaining, from the preset file, second location information of the original data of the first data in the disk may include steps S2011a to S2011 b:
and S2011a, obtaining the type of the abnormal exit of the target application program from the preset file.
S2011b, when the type of the abnormal exit of the target application is to execute the first data, obtaining, from the preset file, second location information of the original data of the first data in the disk.
The preset file of the embodiment of the application comprises: and the type of the abnormal exit of the target application program and second position information of the original data of the first data in the disk.
The type of the target application program abnormal exit can integrally comprise two types, wherein the first type is as follows: the second class is due to exceptions caused by the execution of the first data: not an exception due to execution of the first data.
Based on this, when the processor detects that the target application program abnormally exits, the processor obtains the type of the abnormal exit of the target application program from the preset file, and judges whether the type of the abnormal exit of the target application program is the abnormal exit caused by executing the first data, if so, the first data in the memory is falsified. At this time, the processor obtains second position information of the original data of the first data in the disk from the preset file, and obtains first position information of the first data in the memory according to the second position information. Then, the processor may clear the first data from the memory according to first location information of the first data in the memory, and read the original data of the first data from the disk to the memory according to second location information of the original data of the first data in the disk, so as to ensure that the original data of the first data stored in the memory is normal data without tampering.
For example, taking the Android system as an example, when the processor detects that the target application program sends an abnormal exit (crash), the Android system generates a corresponding preset file (for example, a tombstone file) in a specific directory as shown below.
Figure BDA0002671785920000131
The tombstone file contains: the type of the target application abnormal exit at this time (i.e. code1(ILL _ ILLOPC)), and information such as the second location information of the original data of the first data in the disk (i.e. 00pc00000000007858e0/data/dalvik-cache/arm64/system @ app @ iConnect. apk @ classes. dex). The processor monitors generation of the tombstone file and analyzes content of the tombstone file, so that the type of crash generated by the target application program is ILL _ ILLOPC, and second position information of original data of the first data in the disk can be acquired.
The ILL _ ILLOPC indicates that the type of exception occurring in the target application is an exception caused by executing the first data.
Optionally, the first data is a PC instruction.
S202, obtaining first position information of the first data in the memory according to second position information of the original data of the first data in the magnetic disk.
Continuing with the above example, assume that the second location information of the original data of the first data in the disk is: 00pc00000000007858e 0/dara/dalvik-cache/arm64/system @ app @ iConnect @ iConnect.apk @ classes.de x. Wherein,/data/dalvik-cache/arm 64/system @ app @ iConnect @ iconnect.apk @ classes.dex is the storage path of the first file in the disk. 0x7858e0 denotes an offset of original data of the first data in the first file.
In this way, the processor may obtain the first location information of the first data in the memory according to the second location information of the original data of the first data in the disk.
In some embodiments, as shown in fig. 8, in the above S202, the processor obtains the first location information of the first data in the memory according to the second location information of the original data of the first data in the magnetic disk, which may include S2021 to S2023.
S2021, accessing the first file in the magnetic disk according to the information of the first file.
Continuing with the above example, assume that the second location information of the original data of the first data in the disk is: 00pc00000000007858e0/data/dalvik-cache/arm64/system @ app @ iConnect @ iConnect.apk @ classes.de x.
The information of the first file may be a storage path of the first file in the disk, that is:
/data/dalvik-cache/arm64/system@app@iConnect@iConnect.apk@classes.dex。
the processor accesses the first file in the disk according to the information of the first file.
In one example, the processor may access the first file in the disk according to the information of the first file by: opening a first file storing original data of the first data in the disk through an open function, and acquiring a file handle fd:
int fd=open(/data/dalvik-cache/arm64/system@app@iConnect@iConnect.apk@classes.dex,O_RDONLY)。
s2022, obtaining third location information of the original data of the first data in the first file according to the address offset of the original data of the first data in the first file.
Continuing with the example above, the address offset of the original data of the first data in the first file may be 0x7858e0 as described above.
In this way, after the processor opens the first file in the disk by the open function according to the information of the first file, the processor obtains the position information of the original data of the first data in the first file according to the address offset (for example: 0x7858e0) of the original data of the first data in the first file, and records the position information as the third position information. Specifically, the storage location of the original data of the first data in the first file is obtained by an offset of 0x7858e0 from the initial address of the first file, and the storage location is recorded as third location information of the original data of the first data in the first file.
S2023, obtaining the first location information of the first data in the memory according to the mirror image of the third location information in the memory.
Specifically, the processor obtains first location information of the first data in the memory according to a mirror image of third location information of the original data of the first data in the first file in the memory.
In this way, the processor may clear the first data from the memory according to the first location information of the first data in the memory and the preset length of the first data.
In one possible implementation, the processor may clear the first data in the memory by a posix _ fadvise function.
posix_fadvise(fd,0x7858e0,8,POSIX_FADV_DONTNEED)
Wherein fd denotes a storage path of the first file in the disk, 0x7858e0 denotes an address offset of original data of the first data in the first file, 8 is a length of the first data, and POSIX _ FADV _ dotted means that the first data is cleared from the memory.
According to the method for repairing the abnormal exit of the application, when the abnormal exit of the target application program is detected, second position information of original data of the first data in the disk is obtained, first position information of the first data in the memory is accurately obtained according to the second position information of the original data of the first data in the disk, the first data is cleared from the memory according to the accurately obtained first position information of the first data in the memory, and accurate clearing of error-reported first data is achieved.
Fig. 9 is a schematic structural diagram of a repair apparatus applying an abnormal exit according to an embodiment of the present application. The repair apparatus may be an electronic device, or may be a component (e.g., an integrated circuit, a chip, etc.) of an electronic device, as shown in fig. 9, the repair apparatus 300 may include: an acquisition unit 310, a clearing unit 320, and a reading unit 330;
an obtaining unit 310, configured to obtain first location information of first data in a memory when an abnormal exit of a target application is detected, where the first data is read-only data related to the abnormal exit of the target application;
a clearing unit 320, configured to clear the first data from the memory according to first location information of the first data in the memory;
the reading unit 330 is configured to read, from a disk, original data of the first data to the memory, where the original data of the first data is used for normal operation of the target application program.
In a possible implementation manner, the obtaining unit 310 is specifically configured to obtain second location information of original data of the first data in the disk; and acquiring first position information of the first data in the memory according to second position information of the original data of the first data in the magnetic disk.
In a possible implementation manner, the first data is an instruction, and the obtaining unit 310 is specifically configured to obtain, from a preset file, second location information of original data of the first data in the disk.
In a possible implementation manner, the obtaining unit 310 is specifically configured to obtain, from the preset file, a type of the target application program abnormal exit; and when the type of the abnormal exit of the target application program is that the first data is executed, acquiring second position information of the original data of the first data in the magnetic disk from the preset file.
Optionally, the preset file is generated when the target application program exits abnormally.
In one possible implementation manner, the second location information of the original data of the first data in the disk includes: and the information of a first file in the magnetic disk and the address offset of the original data of the first data in the first file, wherein the first file is a file for storing the original data of the first data.
Optionally, the information of the first file is a storage path of the first file in the magnetic disk.
In a possible implementation manner, the obtaining unit 310 is specifically configured to access the first file in the magnetic disk according to the information of the first file; obtaining third position information of the original data of the first data in the first file according to the address offset of the original data of the first data in the first file; and acquiring first position information of the first data in the memory according to the mirror image of the third position information in the memory.
In a possible implementation manner, the obtaining unit 310 is specifically configured to clear the first data from the memory according to first location information of the first data in the memory and a preset length of the first data.
In a possible implementation manner, the reading unit 330 is specifically configured to read, when detecting that the target application is restarted, original data of the first data from the disk to the memory.
The device for repairing an application exception exit in the embodiments of the present application may be configured to execute the technical solution of the processor in the embodiments of the foregoing methods, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 10 is a schematic structural diagram of a repair apparatus applying an abnormal exit according to an embodiment of the present application. The apparatus 800 is in the form of a chip, and the structure of the apparatus includes a processor 801 and a storage 802, optionally, the storage 802 includes a memory and a disk, the storage 802 is used for coupling with the processor 801, the storage 802 stores necessary program instructions and data of the apparatus, and the processor 801 is used for executing the program instructions stored in the storage 802, so that the apparatus executes the above-mentioned method embodiments.
The device for repairing an application exception exit in the embodiment of the present application may be configured to execute the above method embodiments, and the implementation principle and the technical effect of the device are similar, which are not described herein again.
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 11, the electronic device 500 described in this embodiment may be the computing device (or a component that may be used in the computing device) mentioned in the foregoing method embodiments. The electronic device may be configured to implement the above method embodiment, and refer to the description in the above method embodiment specifically.
The electronic device 500 may comprise one or more processors 501, which processors 501 may also be referred to as processing units, which may implement certain control or processing functions. The processor 501 may be a general purpose processor or a special purpose processor, etc. For example, a baseband processor, or a central processor. The baseband processor may be configured to process communication protocols and communication data, and the central processor may be configured to control the electronic device, execute software programs, and process data of the software programs.
In one possible design, processor 501 may also have stored instructions 503 or data (e.g., intermediate data). Wherein the instructions 503 may be executable by the processor to cause the electronic device 500 to perform the above-described method embodiments.
In yet another possible design, the electronic device 500 may include circuitry that may implement the functionality of transmitting or receiving or communicating in the foregoing method embodiments.
Optionally, the electronic device 500 may include a memory 502, and the memory 502 may also store instructions 504 or data (e.g., intermediate data), where the instructions 504 may be executed on the processor 501, so that the electronic device 500 performs the method described in the above method embodiment.
In one possible design, memory 502 may include: memory 5021 and disks 5022, instructions 504 may reside on memory 5021 or disks 5022.
In one possible design, the memory 502 may include other storage devices in addition to the memory 5021 and the disks 5022, and the instructions 504 may reside on other storage devices.
Optionally, the electronic device 500 may also include a transceiver 505 and/or an antenna 506. The processor 501 may be referred to as a processing unit for controlling the electronic device. The transceiver 505 may be referred to as a transceiver unit, a transceiver, a transceiving circuit, a transceiver, or the like, for implementing transceiving functions of the electronic device.
The processor 501 and transceiver 505 described herein may be implemented on an Integrated Circuit (IC), an analog IC, a Radio Frequency Integrated Circuit (RFIC), a mixed signal IC, an Application Specific Integrated Circuit (ASIC), a Printed Circuit Board (PCB), an electronic device, or the like. The processor 501 and the transceiver 505 may also be fabricated using various 1C process technologies, such as Complementary Metal Oxide Semiconductor (CMOS), N-type metal oxide semiconductor (NMOS), P-type metal oxide semiconductor (PMOS), Bipolar Junction Transistor (BJT), Bipolar CMOS (bicmos), silicon germanium (SiGe), gallium arsenide (GaAs), and the like.
The electronic device of the embodiment of the present application may be configured to execute the above method embodiments, and the implementation principle and the technical effect are similar, which 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 a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, 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 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 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.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In addition, the method embodiments and the device embodiments may also refer to each other, and the same or corresponding contents in different embodiments may be referred to each other, which is not described in detail.

Claims (22)

1. A method for repairing an application exception exit, comprising:
when abnormal exit of a target application program is detected, first position information of first data in a memory is acquired, wherein the first data is read-only data related to the abnormal exit of the target application program;
clearing the first data from the memory according to first position information of the first data in the memory;
and reading the original data of the first data from a disk to the memory, wherein the original data of the first data is used for normal operation of the target application program.
2. The method of claim 1, wherein the obtaining the first location information of the first data in the memory comprises:
acquiring second position information of original data of the first data in the magnetic disk;
and acquiring first position information of the first data in the memory according to second position information of the original data of the first data in the magnetic disk.
3. The method of claim 2, wherein the first data is an instruction, and the obtaining second location information of original data of the first data in the disk comprises:
and acquiring second position information of the original data of the first data in the magnetic disk from a preset file.
4. The method according to claim 3, wherein before obtaining the second location information of the original data of the first data in the disk from the preset file, the method further comprises:
obtaining the type of the abnormal exit of the target application program from the preset file;
the obtaining, from a preset file, second location information of original data of the first data in the disk includes:
and when the type of the abnormal exit of the target application program is that the first data is executed, acquiring second position information of the original data of the first data in the magnetic disk from the preset file.
5. The method of claim 3, wherein the default file is generated when the target application exits abnormally.
6. The method of any of claims 2-5, wherein the second location information of the original data of the first data in the disk comprises: and the information of a first file in the magnetic disk and the address offset of the original data of the first data in the first file, wherein the first file is a file for storing the original data of the first data.
7. The method of claim 6, wherein the information of the first file is a storage path of the first file in the disk.
8. The method according to claim 6, wherein the obtaining first location information of the first data in the memory according to second location information of original data of the first data in the disk comprises:
accessing the first file in the disk according to the information of the first file;
obtaining third position information of the original data of the first data in the first file according to the address offset of the original data of the first data in the first file;
and acquiring first position information of the first data in the memory according to the mirror image of the third position information in the memory.
9. The method according to any one of claims 1-5, wherein the clearing the first data from the memory according to the first location information of the first data in the memory comprises:
and clearing the first data from the memory according to the first position information of the first data in the memory and the preset length of the first data.
10. The method according to any one of claims 1 to 5, wherein the reading the original data of the first data from the disk into the memory comprises:
and when detecting that the target application program is restarted, reading original data of the first data from the disk into the memory.
11. A prosthetic device that applies an abnormal exit, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring first position information of first data in a memory when detecting that a target application program abnormally exits, and the first data is read-only data related to the abnormal exit of the target application program;
the clearing unit is used for clearing the first data from the memory according to first position information of the first data in the memory;
and the reading unit is used for reading the original data of the first data from a disk into the memory, wherein the original data of the first data is used for the normal operation of the target application program.
12. The apparatus of claim 11,
the acquiring unit is specifically configured to acquire second position information of original data of the first data in the disk; and acquiring first position information of the first data in the memory according to second position information of the original data of the first data in the magnetic disk.
13. The apparatus according to claim 12, wherein the first data is an instruction, and the obtaining unit is specifically configured to obtain, from a preset file, second location information of original data of the first data in the disk.
14. The apparatus of claim 13,
the obtaining unit is specifically configured to obtain, from the preset file, a type of the abnormal exit of the target application program; and when the type of the abnormal exit of the target application program is that the first data is executed, acquiring second position information of the original data of the first data in the magnetic disk from the preset file.
15. The apparatus according to claim 13, wherein the default file is generated when the target application program exits abnormally.
16. The apparatus of any of claims 12-15, wherein the second location information of the original data of the first data in the disk comprises: and the information of a first file in the magnetic disk and the address offset of the original data of the first data in the first file, wherein the first file is a file for storing the original data of the first data.
17. The apparatus of claim 16, wherein the information of the first file is a storage path of the first file in the disk.
18. The apparatus of claim 16,
the obtaining unit is specifically configured to access the first file in the magnetic disk according to the information of the first file; obtaining third position information of the original data of the first data in the first file according to the address offset of the original data of the first data in the first file; and acquiring first position information of the first data in the memory according to the mirror image of the third position information in the memory.
19. The apparatus according to any one of claims 11-15,
the clearing unit is specifically configured to clear the first data from the memory according to first location information of the first data in the memory and a preset length of the first data.
20. The apparatus according to any one of claims 11-15,
the reading unit is specifically configured to read, when it is detected that the target application program is restarted, original data of the first data from the disk into the memory.
21. An electronic device, comprising: memory, a disk and a processor, said memory, said disk and said processor being adapted to perform the method of any of the preceding claims 1-10.
22. A computer storage medium characterized by storing a computer-readable program which, when read and executed, causes an information transmission apparatus to execute the method according to any one of claims 1 to 10.
CN202010935534.9A 2020-09-08 2020-09-08 Application exception exit repairing method and device and electronic equipment Pending CN114153638A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010935534.9A CN114153638A (en) 2020-09-08 2020-09-08 Application exception exit repairing method and device and electronic equipment
PCT/CN2021/112149 WO2022052730A1 (en) 2020-09-08 2021-08-11 Method and apparatus for repairing abnormal application exit, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010935534.9A CN114153638A (en) 2020-09-08 2020-09-08 Application exception exit repairing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114153638A true CN114153638A (en) 2022-03-08

Family

ID=80460679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010935534.9A Pending CN114153638A (en) 2020-09-08 2020-09-08 Application exception exit repairing method and device and electronic equipment

Country Status (2)

Country Link
CN (1) CN114153638A (en)
WO (1) WO2022052730A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701134A (en) * 2022-10-14 2023-09-05 荣耀终端有限公司 Data processing method and electronic equipment
CN116701134B (en) * 2022-10-14 2024-05-17 荣耀终端有限公司 Data processing method and electronic equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7877635B2 (en) * 2008-01-10 2011-01-25 International Business Machines Corporation Autonomous diagnosis and repair of storage components
CN102163164B (en) * 2011-05-06 2014-06-25 北京华为数字技术有限公司 Processing method and processor for critical data in shared memory
CN102308285B (en) * 2011-07-26 2013-08-28 华为技术有限公司 Memory bug application of application program
CN107526650B (en) * 2017-09-07 2021-07-02 郑州云海信息技术有限公司 TCAM error scanning and repairing method
CN107370834B (en) * 2017-09-11 2020-12-25 北京小米移动软件有限公司 Abnormity debugging method, device, equipment and storage medium of user equipment
CN110321141A (en) * 2019-06-06 2019-10-11 武汉斗鱼鱼乐网络科技有限公司 Native layers of application program real-time restorative procedure, equipment and system
CN111581021B (en) * 2020-04-29 2023-05-09 北京字节跳动网络技术有限公司 Application program starting abnormality repairing method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701134A (en) * 2022-10-14 2023-09-05 荣耀终端有限公司 Data processing method and electronic equipment
CN116701134B (en) * 2022-10-14 2024-05-17 荣耀终端有限公司 Data processing method and electronic equipment

Also Published As

Publication number Publication date
WO2022052730A1 (en) 2022-03-17

Similar Documents

Publication Publication Date Title
CN111095723B (en) Wireless charging method and electronic equipment
WO2021185105A1 (en) Method for switching between sim card and esim card, and electronic device
CN110515646B (en) Differential upgrading method and related equipment
CN114650363B (en) Image display method and electronic equipment
WO2021209047A1 (en) Sensor adjustingt method, appratus and electronic device
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
CN110742580A (en) Sleep state identification method and device
WO2022089000A1 (en) File system check method, electronic device, and computer readable storage medium
CN114880251B (en) Memory cell access method, memory cell access device and terminal equipment
CN115589051B (en) Charging method and terminal equipment
CN111865646A (en) Terminal upgrading method and related device
CN114422340A (en) Log reporting method, electronic device and storage medium
CN116382810A (en) META mode starting method, electronic equipment and storage medium
CN113901485B (en) Application program loading method, electronic device and storage medium
CN114443109B (en) Patch repair method, electronic device and storage medium
WO2022170856A1 (en) Method for establishing connection, and electronic device
CN114828098B (en) Data transmission method and electronic equipment
CN117093068A (en) Vibration feedback method and system based on wearable device, wearable device and electronic device
CN114153638A (en) Application exception exit repairing method and device and electronic equipment
CN115373957A (en) Application killing method and device
CN114077519A (en) System service recovery method and device and electronic equipment
CN116048769B (en) Memory recycling method and device and terminal equipment
CN115993592B (en) Bluetooth ranging method, electronic equipment and storage medium
CN114942741B (en) Data transmission method and electronic equipment
CN115529379B (en) Method for preventing Bluetooth audio Track jitter, electronic equipment and 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