WO2014201915A1 - 软件修复方法和装置、计算机可读存储介质 - Google Patents

软件修复方法和装置、计算机可读存储介质 Download PDF

Info

Publication number
WO2014201915A1
WO2014201915A1 PCT/CN2014/076713 CN2014076713W WO2014201915A1 WO 2014201915 A1 WO2014201915 A1 WO 2014201915A1 CN 2014076713 W CN2014076713 W CN 2014076713W WO 2014201915 A1 WO2014201915 A1 WO 2014201915A1
Authority
WO
WIPO (PCT)
Prior art keywords
main program
software
running file
file
running
Prior art date
Application number
PCT/CN2014/076713
Other languages
English (en)
French (fr)
Inventor
李丹华
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2014201915A1 publication Critical patent/WO2014201915A1/zh

Links

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/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • 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/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

Definitions

  • the present invention relates to computer application technologies, and in particular, to a software repair method and apparatus, and a computer readable storage medium.
  • Operating system platforms often provide users with more and more functions by installing a large amount of software, which brings great convenience to users. At the same time, however, the user cannot run the installed software, and the installed software needs to be repaired.
  • the traditional software repair is achieved by accessing the server through the Internet and downloading and obtaining the corresponding installation package. It requires a lot of traffic, and the software cannot be repaired out of the Internet.
  • a software repair method includes the following steps:
  • a software repair device comprising:
  • the main program judging module is configured to judge whether the main program of the software is damaged according to the characteristic value of the main program, and if not, notify the information acquiring module;
  • the information acquiring module is configured to acquire a pre-backed main program and relationship information of the main program
  • a main program repairing module configured to repair the damaged main program by using the pre-backed main program and relationship information of the main program
  • the repair run module is used to run the repaired main program.
  • a computer readable storage medium for storing computer executable instructions
  • the computer readable storage medium stores one or more programs, the one or more programs being used by one or more processors to execute instructions for performing a software repair method, the method comprising:
  • the software repair method and apparatus, and the computer readable storage medium determine whether the main program of the software is damaged according to the characteristic value of the main program, and if it is determined that the main program of the software is damaged, acquiring the main program and the main program backed up in advance The relationship information, the damaged main program is repaired by the pre-backed main program and the relationship information of the main program, and finally the repaired main program is run. At this time, the software can be repaired without leaving the Internet, and no traffic is required.
  • FIG. 1 is a flow chart of a software repair method in an embodiment
  • FIG. 2 is a flow chart of a software repair method in another embodiment
  • FIG. 3 is a flow chart of the method for scanning and verifying the running file of the software by the running of the main program in FIG. 2 to obtain an abnormal running file;
  • FIG. 4 is a flow chart of a method for repairing an abnormal running file in FIG. 2;
  • FIG. 5 is a schematic structural diagram of a software repair apparatus in an embodiment
  • FIG. 6 is a schematic structural diagram of a software repair device in another embodiment
  • FIG. 7 is a schematic structural view of the scan verification module of FIG. 6;
  • FIG. 8 is a schematic structural diagram of a running file repair module in FIG. 6;
  • FIG. 9 is a schematic structural diagram of a terminal running a software repair device in an embodiment.
  • a software repair method includes the following steps:
  • step S110 it is determined whether the main program of the software is damaged according to the feature value of the main program. If not, the process proceeds to step S130, and if yes, the process proceeds to step S190.
  • the feature value of the main program and the feature value corresponding to the main program stored in the local program are acquired, and then the feature value of the main program is determined and stored locally. Whether the eigenvalues corresponding to the program are consistent. If they are not consistent, the main program is not operational. The main program of the software has been damaged. The main program needs to be repaired. If the main program can be run, the main program running the software directly can.
  • Step S130 acquiring the relationship information of the main program backed up in advance and the main program.
  • the relationship information of the main program includes the directory information and the installation file structure information of the main program when the software is installed, and the directory information of the main program indicates where the main program is placed during installation, and the file structure is installed. The information is used to indicate whether the software will generate files in the main program-related directory during installation and whether the generated files need to be registered with the system.
  • step S150 the damaged main program is repaired by the main program backed up in advance and the relationship information of the main program.
  • the directory corresponding to the main program when the software is installed is obtained, so as to obtain the placement position of the main program when the software is installed, and the damaged main program is replaced by the placement position.
  • the obtained pre-backed main program, at this time, the main program of the software will be restored to the state at the time of installation.
  • Step S170 running the repaired main program.
  • step S190 the main program of the software is run.
  • the method before the step S110, the method further includes:
  • the software installation in the operating system platform when the software installation in the operating system platform is completed, all the initial data and relationship information of the software are collected and stored locally to complete the backup of the software, wherein the collected data includes the main obtained after installation.
  • the program and other files different from the main program that is, the running file;
  • the collected relationship information is the directory information and the installation file structure information generated after the installation, and the directory information generated after the installation is used to indicate the directory tree structure generated after the installation.
  • the location of a file can be known through the directory tree structure; the installation file structure information is used to identify which directories will generate files, and whether the generated files need to be registered with the system.
  • the method further includes:
  • step S210 the running file of the software is scanned and verified by the running of the main program, and an abnormal running file is obtained.
  • the running file of the software is scanned to verify whether the running file of the software is correct, and then the running file with abnormality is obtained, and the abnormal running file may be damaged, missing, redundant, and the like.
  • step S230 the abnormal running file is repaired.
  • the abnormal running file is repaired by the locally backed up data and the relationship information, so that the abnormal running files obtained by the scan verification are all repaired, and the local repair of the software is realized, thereby ensuring the order of the software.
  • the operation makes it possible for the user to successfully repair the software that has an abnormality even if it cannot connect to the Internet.
  • the foregoing step S210 includes:
  • Step S211 acquiring the feature value corresponding to the running file and the feature value backed up locally.
  • the feature value backed up locally is the feature value of the correct running file corresponding to the running file that is backed up when the software is installed, and may be the information digest value of the correct running file, for example, a hash value (HASH) Value); can also be the value calculated by the information digest algorithm such as the size, creation date and signature of the running file.
  • the feature value backed up locally and the feature value corresponding to the running file will be the same form. That is, the feature values backed up locally and the feature values corresponding to the running file will be in the form of feature values, or may be in other forms.
  • step S213 it is determined whether the feature value corresponding to the running file and the feature value backed up locally are consistent. If not, the process proceeds to step S215, and if yes, the process proceeds to step S217.
  • the running file is abnormal according to the feature value, that is, the feature value of the running file and the feature value corresponding to the correct running file backed up locally are consistently judged to obtain the feature value and backed up.
  • the running file of the local correct running file corresponding to the feature value is not consistent, and the running file is an abnormal running file.
  • step S215 the abnormal running file is located.
  • an abnormal running file is located in a plurality of running files, so as to directly repair the abnormal running file.
  • step S217 the running file is run.
  • the running file can be directly run, and no repair is needed.
  • the foregoing step S230 includes:
  • step S231 the relationship information of the abnormal running file is obtained.
  • the software in which the running file needs to be repaired can be sequentially run.
  • Corresponding relationship information is obtained according to the directory where the abnormal running file is located.
  • Step S233 searching for a local backup running file according to the relationship information.
  • the abnormal running files are mostly damaged, missing, or redundant. Therefore, the abnormal running files and the correct running files when the software is installed are in the same directory, that is, the abnormal running files. And the correct running file is placed in the same location, according to the relationship information will be able to locally find the running file of the local backup corresponding to the abnormal running file.
  • step S235 the abnormal running file is replaced by the obtained running file.
  • the location of the abnormal running file is obtained according to the relationship information, and the abnormal running file is replaced with the found running file according to the location of the abnormal running file, thereby completing the repair of the abnormal running file.
  • the relationship information of the missing running file is obtained, and then the backup running file is obtained according to the directory in the relationship information, and the missing running file is restored and restored by the backup running file, so that the software Even if the running file is missing, the local recovery can be smoothly performed, which ensures the smooth running of the software.
  • the software is monitored to know the main program or the running file where the abnormality has occurred, the abnormal running file is identified according to the characteristic value of the local backup, and the abnormal program or the running file is repaired by the local backup performed. You can accurately identify the abnormal main program or running files without accessing the Internet, and then repair the damaged software through local backup.
  • a software repair apparatus includes a main program determination module 110, an information acquisition module 130, a main program repair module 150, a repair operation module 170, and a main program execution module 190.
  • the main program determining module 110 is configured to determine whether the main program of the software is damaged according to the feature value of the main program. If not, the information acquiring module 130 is notified, and if so, the main program running module 190 is notified.
  • the main program determining module 110 acquires the feature value of the main program and the feature value corresponding to the main program stored in the local, and then determines the feature value and storage of the main program. Whether the local eigenvalues corresponding to the main program are consistent. If they are not consistent, the main program is not operational. The main program of the software is damaged. The main program needs to be repaired. If the main program can run, notify the main program. The running module 190 can directly run the main program of the software.
  • the information obtaining module 130 is configured to acquire the pre-backed main program and the relationship information of the main program.
  • the information acquiring module 130 acquires the relationship information of the main program backed up locally and the main program.
  • the relationship information of the main program includes the directory information and the installation file structure information of the main program when the software is installed, and the directory information of the main program indicates where the main program is placed during installation, and the file structure is installed.
  • the information is used to indicate whether the software will generate files in the main program-related directory during installation and whether the generated files need to be registered with the system.
  • the main program repairing module 150 is configured to repair the damaged main program by using the pre-backed main program and the relationship information of the main program.
  • the main program repair module 150 obtains the directory corresponding to the main program when the software is installed according to the relationship information of the main program, so as to obtain the placement position of the main program when the software is installed, and the damaged position according to the placement position.
  • the main program is replaced with the obtained pre-backed main program. At this time, the main program of the software will be restored to the state at the time of installation.
  • the repair operation module 170 is configured to run the repaired main program.
  • the main program running module 190 is configured to run the main program of the software by determining that the main program of the software is not broken by triggering the operation of the software running.
  • the main program running module 190 can directly run the main program.
  • the software repair apparatus further includes a backup module 210, and the backup module 210 is configured to back up the main program and the running file obtained after the installation, and the feature values and relationship information corresponding to the main program and the running file.
  • the backup module 210 collects all the initial data and relationship information of the software, and stores it locally to complete the backup of the software.
  • the data collected by the backup module 210 includes The main program obtained after installation and other files different from the main program, that is, the running file; the relationship information collected by the backup module 210 is the directory information and the installation file structure information generated after the installation, and the directory information generated after the installation is used.
  • the directory tree structure generated after the installation is instructed, and the location of a file is known through the directory tree structure; the installation file structure information is used to identify which directories will generate files, and whether the generated files need to be registered with the system.
  • the apparatus further includes a scan verification module 310 and a run file repair module 330.
  • the scan verification module 310 is configured to trigger a line scan check on the running file of the software by running the main program to obtain an abnormal running file.
  • the scan verification module 310 scans the running file of the software to verify whether the running file of the software is correct, and then obtains an abnormal running file, and the abnormal running file may be damaged, missing, redundant, etc. .
  • the file repair module 330 is run to repair the abnormal running file.
  • the running file repair module 330 repairs the abnormal running file by using the locally backed up data and the relationship information, so that the abnormal running files obtained by the scan verification are all repaired, and the local repair of the software is realized, and then The software is guaranteed to run in sequence, so that even if the user cannot connect to the Internet, the software can be successfully repaired.
  • the scan verification module 310 includes a feature acquisition unit 311, a consistency determination unit 313, a file location unit 315, and a file execution unit 317.
  • the feature obtaining unit 311 is configured to acquire the feature value corresponding to the running file and the feature value backed up locally.
  • the feature value backed up locally is the feature value of the correct running file corresponding to the running file that is backed up when the software is installed, and may be the information digest value of the correct running file, for example, a hash value (HASH) Value); can also be the value calculated by the information digest algorithm such as the size, creation date and signature of the running file.
  • the feature value backed up locally and the feature value corresponding to the running file will be the same form. That is, the feature values backed up locally and the feature values corresponding to the running file will be in the form of feature values, or may be in other forms.
  • the consistency determining unit 313 is configured to determine whether the feature value corresponding to the running file is consistent with the feature value backed up locally, and if not, notify the file positioning unit 315, and if yes, notify the file running unit 317.
  • the consistency determining unit 313 determines whether the running file is abnormal according to the feature value, that is, the feature value of the running file and the feature value corresponding to the correct running file backed up locally are consistently judged to obtain A running file whose eigenvalue is inconsistent with the eigenvalue corresponding to the correct running file backed up locally.
  • the running file is an abnormal running file.
  • the file locating unit 315 is configured to locate an abnormal running file.
  • the file positioning unit 315 locates an abnormal running file in a plurality of running files, so as to directly repair the abnormal running file.
  • the file running unit 317 is configured to run the running file.
  • the file running unit 317 directly runs the running file, and does not need to perform any repair.
  • the above-described running file repairing module 330 includes a relationship information acquiring unit 331, a searching unit 333, and a replacing unit 335.
  • the relationship information obtaining unit 331 is configured to acquire relationship information of an abnormal running file.
  • the relationship information acquiring unit 331 obtains the corresponding relationship information based on the directory in which the abnormal running file is located.
  • the searching unit 333 is configured to search for a running file of the local backup according to the relationship information.
  • the abnormal running files are mostly damaged, missing, or redundant. Therefore, the abnormal running files and the correct running files when the software is installed are in the same directory, that is, the abnormal running files. And the correct running file is placed in the same location, and the searching unit 333 will be able to locally find the running file of the local backup corresponding to the abnormal running file according to the relationship information.
  • the replacing unit 335 is configured to replace the abnormal running file to find the obtained running file.
  • the replacing unit 335 obtains the location of the abnormal running file according to the relationship information, and replaces the abnormal running file with the found running file according to the location of the abnormal running file, thereby completing the abnormal running file. repair.
  • the replacement unit 335 monitors that the running file is missing, the relationship information of the missing running file is obtained, and then the backup running file is obtained according to the directory in the relationship information, and the missing running file is restored and restored by the backup running file. In order to make the software recover smoothly even if the running file is missing in the software, the software can run smoothly.
  • the software is monitored to know the main program or the running file where the abnormality has occurred, the abnormal running file is identified according to the characteristic value of the local backup, and the abnormal program or the running file is repaired by the local backup performed. You can accurately identify the abnormal main program or running files without accessing the Internet, and then repair the damaged software through local backup.
  • the software repair method and apparatus, and the computer readable storage medium determine whether the main program of the software is damaged according to the characteristic value of the main program, and if it is determined that the main program of the software is damaged, acquiring the main program and the main program backed up in advance The relationship information, the damaged main program is repaired by the pre-backed main program and the relationship information of the main program, and finally the repaired main program is run. At this time, the software can be repaired without leaving the Internet, and no traffic is required.
  • the storage medium may be a magnetic disk, an optical disk, or a read-only storage memory (Read-Only) Memory, ROM) or Random Access Memory (RAM).
  • the embodiment of the present invention further provides another terminal for running the software repairing device.
  • FIG. 9 for the convenience of description, only parts related to the embodiment of the present invention are shown. If the specific technical details are not disclosed, please refer to this embodiment.
  • the terminal can be a mobile phone, a tablet, a PDA (Personal) Digital Assistant, personal digital assistant), POS (Point of Sales), on-board computer and other terminal devices, taking the terminal as a mobile phone as an example:
  • FIG. 9 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention.
  • the mobile phone includes: radio frequency (Radio Frequency, RF) circuit 910, memory 920, input unit 930, display unit 940, sensor 950, audio circuit 960, wireless fidelity (wireless Fidelity, WiFi) module 970, processor 980, and power supply 990 and the like.
  • radio frequency Radio Frequency, RF
  • memory 920 input unit 930
  • display unit 940 sensor 950
  • audio circuit 960 includes a wireless fidelity (wireless Fidelity, WiFi) module 970, processor 980, and power supply 990 and the like.
  • wireless fidelity wireless Fidelity, WiFi
  • the RF circuit 910 can be used for receiving and transmitting signals during and after receiving or transmitting information, in particular, after receiving the downlink information of the base station, and processing it to the processor 980; in addition, transmitting the designed uplink data to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low) Noise Amplifier, LNA), duplexer, etc.
  • RF circuitry 90 can also communicate with the network and other devices via wireless communication. The above wireless communication may use any communication standard or protocol, including but not limited to the global mobile communication system.
  • GSM Global System of Mobile communication
  • General Packet Radio Service General Packet Radio Service
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • Wideband Code Division Multiple Access Wideband Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • the memory 920 can be used to store software programs and modules, and the processor 980 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 920.
  • the memory 920 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of the mobile phone (such as audio data, phone book, etc.).
  • memory 920 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the input unit 930 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the handset 900.
  • the input unit 930 may include a touch panel 931 and other input devices 932.
  • the touch panel 931 also referred to as a touch screen, can collect touch operations on or near the user (such as a user using a finger, a stylus, or the like on the touch panel 931 or near the touch panel 931. Operation), and drive the corresponding connecting device according to a preset program.
  • the touch panel 931 can include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 980 is provided and can receive commands from the processor 980 and execute them.
  • the touch panel 931 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 930 may also include other input devices 932.
  • other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
  • the display unit 940 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone.
  • the display unit 940 can include a display panel 941, and optionally, a liquid crystal display can be used (Liquid Crystal Display, LCD), Organic Light-Emitting Diode,
  • the display panel 941 is configured in the form of an OLED or the like.
  • the touch panel 931 can cover the display panel 941. When the touch panel 931 detects a touch operation on or near the touch panel 931, the touch panel 931 transmits to the processor 980 to determine the type of the touch event, and then the processor 980 according to the touch event. The type provides a corresponding visual output on display panel 941.
  • touch panel 931 and the display panel 941 are used as two independent components to implement the input and input functions of the mobile phone in FIG. 9, in some embodiments, the touch panel 931 and the display panel 941 may be integrated. Realize the input and output functions of the phone.
  • the handset 900 can also include at least one type of sensor 950, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 941 according to the brightness of the ambient light, and the proximity sensor may close the display panel 941 and/or when the mobile phone moves to the ear. Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • Other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like that can be configured in the mobile phone are not described herein.
  • An audio circuit 960, a speaker 961, and a microphone 962 can provide an audio interface between the user and the handset.
  • the audio circuit 960 can transmit the converted electrical data of the received audio data to the speaker 961, and convert it into a sound signal output by the speaker 961.
  • the microphone 962 converts the collected sound signal into an electrical signal, and the audio circuit 960 After receiving, it is converted into audio data, and then processed by the audio data output processor 980, sent to the other mobile phone via the RF circuit 910, or outputted to the memory 920 for further processing.
  • WiFi is a short-range wireless transmission technology
  • the mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 970, which provides users with wireless broadband Internet access.
  • FIG. 9 shows the WiFi module 970, it can be understood that it does not belong to the essential configuration of the mobile phone 900, and may be omitted as needed within the scope of not changing the essence of the invention.
  • the processor 980 is the control center of the handset, which connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 920, and invoking data stored in the memory 920, executing The phone's various functions and processing data, so that the overall monitoring of the phone.
  • the processor 980 may include one or more processing units; preferably, the processor 980 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 980.
  • the mobile phone 900 also includes a power source 990 (such as a battery) that supplies power to various components.
  • a power source 990 such as a battery
  • the power source can be logically coupled to the processor 980 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the mobile phone 900 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
  • the processor 980 included in the terminal further has the following functions:
  • the main program of the software is run.
  • the running of the software is triggered by the running of the main program to obtain an abnormal running file.
  • the running of the running file of the software is triggered by the running of the main program, and the steps of obtaining the abnormal running file include:
  • steps of repairing the abnormal running file include:
  • the method further includes:

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

提供了一种软件修复方法和装置、计算机可读存储介质。所述方法包括:根据主程序的特征值判断软件的主程序是否破损,若否,则获取预先备份的主程序以及主程序的关系信息;通过预先备份的主程序以及主程序的关系信息修复所述破损的主程序;运行修复后的主程序。所述装置包括:主程序判断模块,用于根据主程序的特征值判断软件的主程序是否破损,若否,则通知信息获取模块;所述信息获取模块用于获取预先备份的主程序以及主程序的关系信息;主程序修复模块,用于通过所述预先备份的主程序以及所述主程序的关系信息修复所述破损的主程序;修复运行模块,用于运行所述修复后的主程序。采用本方法和装置无需耗费流量,脱离互联网络也能进行软件修复。

Description

软件修复方法和装置、计算机可读存储介质
本申请要求于 2013 年 06 月 19 日提交中国专利局、申请号为 201310244544.8 、发明名称为 ' 软件修复方法和装置 ' 的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
【技术领域】
本发明涉及计算机应用技术,特别是涉及一种软件修复方法和装置、计算机可读存储介质。
【背景技术】
操作系统平台中常常通过安装大量软件为用户提供越来越丰富的功能,给用户带来了极大的方便。但与此同时,用户无法运行安装的软件的情况也时有发生,因此,需要对安装的软件进行修复。
传统的软件修复是通过互联网络访问服务器,以下载得到相应的安装包实现的,需要耗费流量,脱离互联网络则无法进行软件的修复。
【发明内容】
基于此,有必要针对脱离互联网络则无法进行软件修复的技术问题,提供一种无需耗费流量,脱离互联网络也能进行软件修复的软件修复方法。
此外,还有必要提供一种无需耗费流量,脱离互联网络也能进行软件修复的软件修复装置。
另外,还有必要提供一种无需耗费流量,脱离互联网络也能进行软件修复的计算机可读存储介质。
一种软件修复方法,包括如下步骤:
根据主程序的特征值判断所述软件的主程序是否破损,若否,则
获取预先备份的主程序以及所述主程序的关系信息;
通过所述预先备份的主程序以及所述主程序的关系信息修复所述破损的主程序;
运行所述修复后的主程序。
一种软件修复装置,包括:
主程序判断模块,用于根据主程序的特征值判断所述软件的主程序是否破损,若否,则通知信息获取模块;
所述信息获取模块用于获取预先备份的主程序以及所述主程序的关系信息;
主程序修复模块,用于通过所述预先备份的主程序以及所述主程序的关系信息修复所述破损的主程序;
修复运行模块,用于运行所述修复后的主程序。
一种用于存储计算机可执行指令的计算机可读存储介质, 所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序被一个或者一个以上的处理器用来 执行指令用于执行软件修复方法,所述方法包括:
根据主程序的特征值判断所述软件的主程序是否破损,若否,则
获取预先备份的主程序以及所述主程序的关系信息;
通过所述预先备份的主程序以及所述主程序的关系信息修复所述破损的主程序;
运行所述修复后的主程序。
上述软件修复方法和装置、计算机可读存储介质,根据主程序的特征值判断该软件的主程序是否破损,若判断到该软件的主程序是破损的,则获取预先备份的主程序以及主程序的关系信息,通过预先备份的主程序以及主程序的关系信息修复破损的主程序,最后再运行修复后的主程序,此时脱离互联网络也能够进行软件的修复,无需耗费流量。
【附图说明】
图1为一个实施例中软件修复方法的流程图;
图2为另一个实施例中软件修复方法的流程图;
图3为图2中通过主程序的运行触发对软件的运行文件进行扫描校验,得到异常的运行文件的方法流程图;
图4为图2中修复异常的运行文件的方法流程图;
图5为一个实施例中软件修复装置的结构示意图;
图6为另一个实施例中软件修复装置的结构示意图;
图7为图6中扫描校验模块的结构示意图;
图8为图6中运行文件修复模块的结构示意图;
图9为一个实施例中运行软件修复装置的终端的结构示意图。
【具体实施方式】
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
如图1所示,在一个实施例中,一种软件修复方法,包括如下步骤:
步骤S110,根据主程序的特征值判断该软件的主程序是否破损,若否,则进入步骤S130,若是,则进入步骤S190。
本实施例中,通过触发软件运行的操作运行软件时,将获取主程序的特征值以及存储于本地的与主程序对应的特征值,进而通过判断主程序的特征值和存储于本地的与主程序对应的特征值是否一致,若不相一致,则说明主程序不可运行,该软件的主程序已经破损,需要对主程序进行修复,若主程序可运行,则直接运行该软件的主程序即可。
步骤S130,获取预先备份的主程序以及主程序的关系信息。
本实施例中,由于主程序破损而导致了当前主程序是无法运行的,因此将获取备份于本地的主程序和该主程序的关系信息。其中,该主程序的关系信息将包括了该软件安装完成时主程序所在的目录信息和安装文件结构信息,该主程序所在的目录信息将指示了安装时主程序被放置在哪里,安装文件结构信息则用于指示该软件在安装时会在主程序相关的目录中产生的文件以及产生的文件是否需要与系统交互注册。
步骤S150,通过预先备份的主程序以及主程序的关系信息修复破损的主程序。
本实施例中,根据主程序的关系信息得到该软件完成安装时主程序所对应的目录,以得到该软件安装完成时主程序的放置位置,按照这一放置位置将破损的主程序替换为获取得到的预先备份的主程序,此时,该软件的主程序将恢复为安装时的状态。
步骤S170,运行修复后的主程序。
步骤S190,运行软件的主程序。
本实施例中,判断到软件的主程序未破损,则不需要对主程序进行任何修复,直接运行主程序即可。
在一个实施例中,上述步骤S110之前,该方法还包括:
备份安装后得到的主程序和运行文件,以及主程序和运行文件所对应的特征值和关系信息。
本实施例中,操作系统平台中软件安装完成时,将收集该软件初始的所有数据以及关系信息,并存储于本地以完成该软件的备份,其中,所收集的数据包括了安装后得到的主程序和区别于主程序的其它文件,即运行文件;所收集的关系信息则是安装后所产生的目录信息和安装文件结构信息,安装后产生的目录信息用于指示安装后产生的目录树结构,通过目录树结构可获知某一文件所放置的位置;安装文件结构信息用于标识哪些目录将产生文件,以及产生的文件是否需要与系统交互注册。
如图2所示,在一个实施例中,该方法还包括:
步骤S210,通过主程序的运行触发对软件的运行文件进行扫描校验,得到异常的运行文件。
本实施例中,扫描软件的运行文件,以校验软件的运行文件是否正确,进而得到发生了异常的运行文件,该异常的运行文件可能发生了破损、缺失和冗余等。
步骤S230,修复异常的运行文件。
本实施例中,通过本地备份的数据和关系信息对异常的运行文件进行修复,以使得扫描校验所得到的异常的运行文件均被修复,实现了软件的本地修复,进而保证了软件的顺序运行,使得用户即使无法连接互联网络仍然能够顺利修复发生了异常的软件。
如图3所示,在一个实施例中,上述步骤S210包括:
步骤S211,获取运行文件所对应的特征值和备份于本地的特征值。
本实施例中,备份于本地的特征值是软件安装完成时备份的与运行文件所对应的正确的运行文件的特征值,可以是正确的运行文件的信息摘要值,例如,哈希值(HASH值);也可以是对运行文件的大小、创建日期和签名等通过信息摘要算法进行计算得到的数值,相应的,备份于本地的特征值与运行文件所对应的特征值将是一样的形式,即备份于本地的特征值与运行文件所对应的特征值将同为特征值的形式,也可以同为其它的一些形式。
步骤S213,判断运行文件所对应的特征值和备份于本地的特征值是否一致,若否,则进入步骤S215,若是则进入步骤S217。
本实施例中,根据特征值判断运行文件是否异常,也就是说,将运行文件的特征值和备份于本地的正确的运行文件所对应的特征值进行一致性判断,以得到特征值与备份于本地的正确的运行文件所对应的特征值不相一致的运行文件,该运行文件即为异常的运行文件。
步骤S215,定位得到异常的运行文件。
本实施例中,在若干个运行文件中定位出异常的运行文件,以便于后续直接对异常的运行文件进行修复。
步骤S217,运行该运行文件。
本实施例中,若运行文件无异常,直接运行该运行文件即可,不需要进行任何的修复。
如图4所示,在一个实施例中,上述步骤S230包括:
步骤S231,获取异常的运行文件所在的关系信息。
本实施例中,在得到异常的运行文件之后,需要对运行文件进行修复方可顺序运行的运行文件所在的软件。根据异常的运行文件所在的目录得到对应的关系信息。
步骤S233,根据关系信息查找得到本地备份的运行文件。
本实施例中,由于异常的运行文件大都是发生了破损、缺失或冗余等状况的,因此,异常的运行文件和软件安装完成时正确的运行文件是处于相同目录的,即异常的运行文件和正确的运行文件是放置于同一位置的,根据关系信息将能够在本地查找得到与异常的运行文件对应的本地备份的运行文件。
步骤S235,替换异常的运行文件为查找得到的运行文件。
本实施例中,根据关系信息得到异常的运行文件所在位置,以按照异常的运行文件所在位置将异常的运行文件替换为查找得到的运行文件,进而完成对异常的运行文件所进行的修复。
此外,若监控到运行文件缺失,则获取缺失的运行文件所在的关系信息,进而根据关系信息中的目录获取备份的运行文件,通过备份的运行文件对缺失的运行文件进行还原恢复,以使得软件中即使发生了运行文件缺失的情况也能顺利进行本地恢复,保证了软件的顺利运行。
上述软件修复方法中,对软件进行监控以获知发生了异常的主程序或运行文件,根据本地备份的特征值识别出异常的运行文件,通过所进行的本地备份对异常的程序或运行文件进行修复,不需要访问互联网络即可准确识别出异常的主程序或运行文件,进而通过本地备份即可对自身破损的软件进行修复。
如图5所示,在一个实施例中,一种软件修复装置,包括主程序判断模块110、信息获取模块130、主程序修复模块150、修复运行模块170和主程序运行模块190。
主程序判断模块110,用于根据主程序的特征值判断软件的主程序是否破损,若否,则通知信息获取模块130,若是,则通知主程序运行模块190。
本实施例中,通过触发软件运行的操作运行软件时,主程序判断模块110将获取主程序的特征值以及存储于本地的与主程序对应的特征值,进而通过判断主程序的特征值和存储于本地的与主程序对应的特征值是否一致,若不相一致,则说明主程序不可运行,该软件的主程序已经破损,需要对主程序进行修复,若主程序可运行,则通知主程序运行模块190直接运行该软件的主程序即可。
信息获取模块130,用于获取预先备份的主程序以及主程序的关系信息。
本实施例中,由于主程序破损而导致了当前主程序是无法运行的,因此信息获取模块130将获取备份于本地的主程序和该主程序的关系信息。其中,该主程序的关系信息将包括了该软件安装完成时主程序所在的目录信息和安装文件结构信息,该主程序所在的目录信息将指示了安装时主程序被放置在哪里,安装文件结构信息则用于指示该软件在安装时会在主程序相关的目录中产生的文件以及产生的文件是否需要与系统交互注册。
主程序修复模块150,用于通过预先备份的主程序以及主程序的关系信息修复破损的主程序。
本实施例中,主程序修复模块150根据主程序的关系信息得到该软件完成安装时主程序所对应的目录,以得到该软件安装完成时主程序的放置位置,按照这一放置位置将破损的主程序替换为获取得到的预先备份的主程序,此时,该软件的主程序将恢复为安装时的状态。
修复运行模块170,用于运行修复后的主程序。
主程序运行模块190,用于通过触发软件运行的操作判断到软件的主程序未破损,则运行软件的主程序。
本实施例中,判断到软件的主程序未破损,则不需要对主程序进行任何修复,主程序运行模块190直接运行主程序即可。
在一个实施例中,上述软件修复装置还包括备份模块210,该备份模块210用于备份安装后得到的主程序和运行文件,以及主程序和运行文件所对应的特征值和关系信息。
本实施例中,操作系统平台中软件安装完成时,备份模块210将收集该软件初始的所有数据以及关系信息,并存储于本地以完成该软件的备份,其中,备份模块210所收集的数据包括了安装后得到的主程序和区别于主程序的其它文件,即运行文件;备份模块210所收集的关系信息则是安装后所产生的目录信息和安装文件结构信息,安装后产生的目录信息用于指示安装后产生的目录树结构,通过目录树结构可获知某一文件所放置的位置;安装文件结构信息用于标识哪些目录将产生文件,以及产生的文件是否需要与系统交互注册。
如图6所示,在一个实施例中,上述装置还包括扫描校验模块310和运行文件修复模块330。
扫描校验模块310,用于通过主程序的运行触发对软件的运行文件时行扫描校验,得到异常的运行文件。
本实施例中,扫描校验模块310扫描软件的运行文件,以校验软件的运行文件是否正确,进而得到发生了异常的运行文件,该异常的运行文件可能发生了破损、缺失和冗余等。
运行文件修复模块330,用于修复异常的运行文件。
本实施例中,运行文件修复模块330通过本地备份的数据和关系信息对异常的运行文件进行修复,以使得扫描校验所得到的异常的运行文件均被修复,实现了软件的本地修复,进而保证了软件的顺序运行,使得用户即使无法连接互联网络仍然能够顺利修复发生了异常的软件。
如图7所示,在一个实施例中,上述扫描校验模块310包括特征获取单元311、一致性判断单元313、文件定位单元315和文件运行单元317。
特征获取单元311,用于获取运行文件所对应的特征值和备份于本地的特征值。
本实施例中,备份于本地的特征值是软件安装完成时备份的与运行文件所对应的正确的运行文件的特征值,可以是正确的运行文件的信息摘要值,例如,哈希值(HASH值);也可以是对运行文件的大小、创建日期和签名等通过信息摘要算法进行计算得到的数值,相应的,备份于本地的特征值与运行文件所对应的特征值将是一样的形式,即备份于本地的特征值与运行文件所对应的特征值将同为特征值的形式,也可以同为其它的一些形式。
一致性判断单元313,用于判断运行文件所对应的特征值与备份于本地的特征值是否一致,若否,则通知文件定位单元315,若是,则通知文件运行单元317。
本实施例中,一致性判断单元313根据特征值判断运行文件是否异常,也就是说,将运行文件的特征值和备份于本地的正确的运行文件所对应的特征值进行一致性判断,以得到特征值与备份于本地的正确的运行文件所对应的特征值不相一致的运行文件,该运行文件即为异常的运行文件。
文件定位单元315,用于定位得到异常的运行文件。
本实施例中,文件定位单元315在若干个运行文件中定位出异常的运行文件,以便于后续直接对异常的运行文件进行修复。
文件运行单元317,用于运行该运行文件。
本实施例中,若运行文件无异常,文件运行单元317直接运行该运行文件即可,不需要进行任何的修复。
如图8所示,在一个实施例中,上述运行文件修复模块330包括关系信息获取单元331、查找单元333和替换单元335。
关系信息获取单元331,用于获取异常的运行文件所在的关系信息。
本实施例中,在得到异常的运行文件之后,需要对运行文件进行修复方可顺序运行的运行文件所在的软件。关系信息获取单元331根据异常的运行文件所在的目录得到对应的关系信息。
查找单元333,用于根据关系信息查找得到本地备份的运行文件。
本实施例中,由于异常的运行文件大都是发生了破损、缺失或冗余等状况的,因此,异常的运行文件和软件安装完成时正确的运行文件是处于相同目录的,即异常的运行文件和正确的运行文件是放置于同一位置的,查找单元333根据关系信息将能够在本地查找得到与异常的运行文件对应的本地备份的运行文件。
替换单元335,用于替换异常的运行文件为查找得到的运行文件。
本实施例中,替换单元335根据关系信息得到异常的运行文件所在位置,以按照异常的运行文件所在位置将异常的运行文件替换为查找得到的运行文件,进而完成对异常的运行文件所进行的修复。
此外,替换单元335若监控到运行文件缺失,则获取缺失的运行文件所在的关系信息,进而根据关系信息中的目录获取备份的运行文件,通过备份的运行文件对缺失的运行文件进行还原恢复,以使得软件中即使发生了运行文件缺失的情况也能顺利进行本地恢复,保证了软件的顺利运行。
上述软件修复装置中,对软件进行监控以获知发生了异常的主程序或运行文件,根据本地备份的特征值识别出异常的运行文件,通过所进行的本地备份对异常的程序或运行文件进行修复,不需要访问互联网络即可准确识别出异常的主程序或运行文件,进而通过本地备份即可对自身破损的软件进行修复。
上述软件修复方法和装置、计算机可读存储介质,根据主程序的特征值判断该软件的主程序是否破损,若判断到该软件的主程序是破损的,则获取预先备份的主程序以及主程序的关系信息,通过预先备份的主程序以及主程序的关系信息修复破损的主程序,最后再运行修复后的主程序,此时脱离互联网络也能够进行软件的修复,无需耗费流量。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
本发明实施例还提供了另一种运行软件修复装置的终端,如图9所示,为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该终端可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等任意终端设备,以终端为手机为例:
图9示出的是与本发明实施例提供的终端相关的手机的部分结构的框图。参考图9,手机包括:射频 (Radio Frequency,RF) 电路910、存储器920、输入单元930、显示单元940、传感器950、音频电路960、无线保真(wireless fidelity,WiFi)模块970、处理器980、以及电源990等部件。本领域技术人员可以理解,图9中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图9对手机的各个构成部件进行具体的介绍:
RF电路910可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器980处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路90还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统 (Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access, WCDMA)、长期演进 (Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。
存储器920可用于存储软件程序以及模块,处理器980通过运行存储在存储器920的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器920可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器920可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元930可用于接收输入的数字或字符信息,以及产生与手机900的用户设置以及功能控制有关的键信号输入。具体地,输入单元930可包括触控面板931以及其他输入设备932。触控面板931,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板931上或在触控面板931附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板931可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器980,并能接收处理器980发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板931。除了触控面板931,输入单元930还可以包括其他输入设备932。具体地,其他输入设备932可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元940可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元940可包括显示面板941,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode, OLED)等形式来配置显示面板941。进一步的,触控面板931可覆盖显示面板941,当触控面板931检测到在其上或附近的触摸操作后,传送给处理器980以确定触摸事件的类型,随后处理器980根据触摸事件的类型在显示面板941上提供相应的视觉输出。虽然在图9中,触控面板931与显示面板941是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板931与显示面板941集成而实现手机的输入和输出功能。
手机900还可包括至少一种传感器950,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板941的亮度,接近传感器可在手机移动到耳边时,关闭显示面板941和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等; 至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路960、扬声器961,传声器962可提供用户与手机之间的音频接口。音频电路960可将接收到的音频数据转换后的电信号,传输到扬声器961,由扬声器961转换为声音信号输出;另一方面,传声器962将收集的声音信号转换为电信号,由音频电路960接收后转换为音频数据,再将音频数据输出处理器980处理后,经RF电路910以发送给比如另一手机,或者将音频数据输出至存储器920以便进一步处理。
WiFi属于短距离无线传输技术,手机通过WiFi模块970可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图9示出了WiFi模块970,但是可以理解的是,其并不属于手机900的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
处理器980是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器920内的软件程序和/或模块,以及调用存储在存储器920内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器980可包括一个或多个处理单元;优选的,处理器980可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器980中。
手机900还包括给各个部件供电的电源990(比如电池),优选的,电源可以通过电源管理系统与处理器980逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
尽管未示出,手机900还可以包括摄像头、蓝牙模块等,在此不再赘述。
在本发明实施例中,该终端所包括的处理器980还具有以下功能:
根据主程序的特征值判断软件的主程序是否破损,若否,则
获取预先备份的主程序以及主程序的关系信息;
通过预先备份的主程序以及主程序的关系信息修复破损的主程序;
运行修复后的主程序。
进一步的,通过触发软件运行的操作判断到软件的主程序未破损,则运行软件的主程序。
进一步的,还包括:
通过主程序的运行触发对软件的运行文件进行扫描校验,得到异常的运行文件;
修复异常的运行文件。
进一步的,通过主程序的运行触发对软件的运行文件进行扫描校验,得到异常的运行文件的步骤包括:
获取运行文件所对应的特征值和备份于本地的特征值;
判断运行文件所对应的特征值与备份于本地的特征值是否一致,若否,则
定位得到异常的运行文件。
进一步的,修复异常的运行文件的步骤包括:
获取异常的运行文件所在的关系信息;
根据关系信息查找得到本地备份的运行文件;
替换异常的运行文件为查找得到的运行文件。
进一步的,通过触发软件进行运行的操作判断软件的主程序是否破损的步骤之前,还包括:
备份安装后得到的主程序和运行文件,以及主程序和运行文件所对应的特征值和关系信息。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (15)

  1. 一种软件修复方法,包括如下步骤:
    根据主程序的特征值判断所述软件的主程序是否破损,若否,则
    获取预先备份的主程序以及所述主程序的关系信息;
    通过所述预先备份的主程序以及所述主程序的关系信息修复所述破损的主程序;
    运行所述修复后的主程序。
  2. 根据权利要求 1 所述的方法,其特征在于,所述根据所述主程序的特征值判断所述软件的主程序是否破损的步骤包括:
    通过触发软件运行的操作运行软件时,将获取主程序的特征值以及存储于本地的与主程序对应的特征值,判断主程序的特征值和存储于本地的与主程序对应的特征值是否一致,若否,则
    进入所述获取预先备份的主程序以及所述主程序的关系信息的步骤。
  3. 根据权利要求 1 所述的方法,其特征在于,所述方法还包括:
    根据主程序的特征值判断到所述软件的主程序未破损,则运行所述软件的主程序。
  4. 根据权利要求 1 或 3 所述的方法,其特征在于,所述方法还包括:
    通过所述主程序的运行触发对所述软件的运行文件进行扫描校验,得到异常的运行文件;
    修复所述异常的运行文件。
  5. 根据权利要求 4 所述的方法,其特征在于,所述通过所述主程序的运行触发对所述软件的运行文件进行扫描校验,得到异常的运行文件的步骤包括:
    获取所述运行文件所对应的特征值和备份于本地的特征值;
    判断所述运行文件所对应的特征值与备份于本地的特征值是否一致,若否,则
    定位得到所述异常的运行文件。
  6. 根据权利要求 4 所述的方法,其特征在于,所述修复所述异常的运行文件的步骤包括:
    获取所述异常的运行文件所在的关系信息;
    根据所述关系信息查找得到本地备份的运行文件;
    替换所述异常的运行文件为所述查找得到的运行文件。
  7. 根据权利要求 1 所述的方法,其特征在于,所述根据主程序的特征值判断所述软件的主程序是否破损的步骤之前,所述方法还包括:
    备份安装后得到的主程序和运行文件,以及所述主程序和运行文件所对应的特征值和关系信息。
  8. 一种软件修复装置,其特征在于,包括:
    主程序判断模块,用于根据主程序的特征值判断所述软件的主程序是否破损,若否,则通知信息获取模块;
    所述信息获取模块用于获取预先备份的主程序以及所述主程序的关系信息;
    主程序修复模块,用于通过所述预先备份的主程序以及所述主程序的关系信息修复所述破损的主程序;
    修复运行模块,用于运行所述修复后的主程序。
  9. 根据权利要求 8 所述的装置,其特征在于,通过触发软件运行的操作运行软件时,所述主程序判断模块将获取主程序的特征值以及存储于本地的与主程序对应的特征值,判断主程序的特征值和存储于本地的与主程序对应的特征值是否一致,若否,则通知所述信息获取模块。
  10. 根据权利要求 8 所述的装置,其特征在于,所述装置还包括:
    主程序运行模块,用于根据主程序的特征值判断到所述软件的主程序未破损,则运行所述软件的主程序。
  11. 根据权利要求 8 或 10 所述的装置,其特征在于,所述装置还包括:
    扫描校验模块,用于通过所述主程序的运行触发对所述软件的运行文件进行扫描校验,得到异常的运行文件;
    运行文件修复模块,用于修复所述异常的运行文件。
  12. 根据权利要求 11 所述的装置,其特征在于,所述扫描校验模块包括:
    特征获取单元,用于获取所述运行文件所对应的特征值和备份于本地的特征值;
    一致性判断单元,用于判断所述运行文件所对应的特征值与备份于本地的特征值是否一致,若否,则通知文件定位单元;
    所述文件定位单元用于定位得到所述异常的运行文件。
  13. 根据权利要求 11 所述的装置,其特征在于,所述运行文件修复模块包括:
    关系信息获取单元,用于获取所述异常的运行文件所在的关系信息;
    查找单元,用于根据所述关系信息查找得到本地备份的运行文件;
    替换单元,用于替换所述异常的运行文件为所述查找得到的运行文件。
  14. 根据权利要求 8 所述的装置,其特征在于,所述装置还包括:
    备份模块,用于备份安装后得到的主程序和运行文件,以及所述主程序和运行文件所对应的特征值和关系信息。
  15. 一种用于存储计算机可执行指令的计算机可读存储介质, 所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序被一个或者一个以上的处理器用来 执行指令用于执行软件修复方法,其特征在于,所述方法包括:
    根据主程序的特征值判断所述软件的主程序是否破损,若否,则
    获取预先备份的主程序以及所述主程序的关系信息;
    通过所述预先备份的主程序以及所述主程序的关系信息修复所述破损的主程序;
    运行所述修复后的主程序。
PCT/CN2014/076713 2013-06-19 2014-05-04 软件修复方法和装置、计算机可读存储介质 WO2014201915A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310244544.8 2013-06-19
CN201310244544.8A CN104239163B (zh) 2013-06-19 2013-06-19 软件修复方法和装置

Publications (1)

Publication Number Publication Date
WO2014201915A1 true WO2014201915A1 (zh) 2014-12-24

Family

ID=52103922

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/076713 WO2014201915A1 (zh) 2013-06-19 2014-05-04 软件修复方法和装置、计算机可读存储介质

Country Status (3)

Country Link
CN (1) CN104239163B (zh)
TW (1) TWI494755B (zh)
WO (1) WO2014201915A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107276789A (zh) * 2017-05-19 2017-10-20 努比亚技术有限公司 日志上传方法、装置及计算机可读存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183508B (zh) * 2015-08-26 2019-02-15 北京元心科技有限公司 容器系统内应用程序的监控方法以及智能终端
CN107608707A (zh) * 2017-07-31 2018-01-19 努比亚技术有限公司 具有热修复功能之应用检测方法、终端及可读存储介质
CN108509291B (zh) * 2018-02-27 2019-09-10 Oppo广东移动通信有限公司 应用程序运行异常修复方法及系统,以及移动终端
CN110825396B (zh) * 2019-10-31 2023-07-25 Oppo(重庆)智能科技有限公司 异常处理方法及相关设备
CN111679938A (zh) * 2020-06-08 2020-09-18 深圳市豪恩汽车电子装备股份有限公司 机动车软件运行装置及方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001297021A (ja) * 2000-04-12 2001-10-26 Nec Software Hokkaido Ltd データ復元方法及びデータ復元方法を実行させるプログラムを記録した記録媒体
CN1371050A (zh) * 2001-02-20 2002-09-25 英业达股份有限公司 一种生成具有自检测和自修复功能的应用程序的方法
CN1549131A (zh) * 2003-05-06 2004-11-24 联想(北京)有限公司 一种计算机操作系统的修复方法
US20080016564A1 (en) * 2005-08-16 2008-01-17 Emc Corporation Information protection method and system
CN101950263A (zh) * 2010-09-27 2011-01-19 深圳市江波龙电子有限公司 一种存储设备的修复方法、系统及存储设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6067410A (en) * 1996-02-09 2000-05-23 Symantec Corporation Emulation repair system
TW200723018A (en) * 2005-12-14 2007-06-16 Inventec Corp Image file data pre-installation system and method
TW200725406A (en) * 2005-12-27 2007-07-01 Inventec Besta Co Ltd Booting program backup system and method thereof
CN101425028B (zh) * 2007-10-31 2012-01-25 华硕电脑股份有限公司 计算机系统与计算机系统的韧体修复方法
US7472420B1 (en) * 2008-04-23 2008-12-30 Kaspersky Lab, Zao Method and system for detection of previously unknown malware components
CN103034560B (zh) * 2011-09-29 2015-11-11 腾讯科技(深圳)有限公司 一种修复应用软件的方法、装置及系统
CN102402470A (zh) * 2011-12-19 2012-04-04 青岛海信网络科技股份有限公司 闪存程序自动纠错修复方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001297021A (ja) * 2000-04-12 2001-10-26 Nec Software Hokkaido Ltd データ復元方法及びデータ復元方法を実行させるプログラムを記録した記録媒体
CN1371050A (zh) * 2001-02-20 2002-09-25 英业达股份有限公司 一种生成具有自检测和自修复功能的应用程序的方法
CN1549131A (zh) * 2003-05-06 2004-11-24 联想(北京)有限公司 一种计算机操作系统的修复方法
US20080016564A1 (en) * 2005-08-16 2008-01-17 Emc Corporation Information protection method and system
CN101950263A (zh) * 2010-09-27 2011-01-19 深圳市江波龙电子有限公司 一种存储设备的修复方法、系统及存储设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107276789A (zh) * 2017-05-19 2017-10-20 努比亚技术有限公司 日志上传方法、装置及计算机可读存储介质

Also Published As

Publication number Publication date
CN104239163B (zh) 2016-04-13
TWI494755B (zh) 2015-08-01
CN104239163A (zh) 2014-12-24
TW201500916A (zh) 2015-01-01

Similar Documents

Publication Publication Date Title
WO2014201915A1 (zh) 软件修复方法和装置、计算机可读存储介质
WO2018129977A1 (zh) 一种充电控制方法、装置、存储介质和计算机设备
WO2017142293A1 (en) Electronic device and method of application data display therefor
WO2018151505A1 (en) Electronic device and method for displaying screen thereof
WO2018026059A1 (ko) 이동 단말기 및 그 제어방법
WO2018018772A1 (zh) 一种后台进程管理方法及终端设备
WO2017142373A1 (en) Method of controlling the sharing of videos and electronic device adapted thereto
WO2018076818A1 (zh) 数据的备份方法、装置、电子设备、存储介质及系统
WO2018076819A1 (zh) 数据的上传方法、装置、存储介质、电子设备及系统
WO2018072567A1 (zh) 移动终端基于指纹识别的紧急求救方法及系统、移动终端
WO2017209502A1 (ko) 전자 장치와 충전 장치간의 연결을 제어하는 방법 및 이를 제공하는 장치
WO2018076864A1 (zh) 一种数据同步方法、装置、存储介质及电子设备
WO2016036135A1 (en) Method and apparatus for processing touch input
WO2018056641A1 (ko) 전자 장치 및 그 제어 방법
WO2018035930A1 (zh) 一种系统解锁方法和设备
WO2016188285A1 (zh) 一种终端应用的进程管理方法及装置
WO2016184330A1 (zh) 一种屏幕解锁方法、装置及存储介质
EP2529487A1 (en) Mobile terminal and control method thereof
WO2015026197A1 (ko) 전자 장치에서 절전 모드를 수행하는 방법 및 이를 위한 전자 장치
WO2014092389A1 (en) Application execution method and apparatus
WO2018076842A1 (zh) 一种数据备份方法、装置、系统、存储介质及电子设备
WO2018164445A1 (en) Electronic device and method for controlling application thereof
WO2018026164A1 (en) Method of processing touch events and electronic device adapted thereto
WO2018076881A1 (zh) 数据同步方法、装置、存储介质及服务器
WO2018076830A1 (zh) 数据同步周期的调整方法、装置、电子设备、存储介质及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14814535

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 20.05.2016)

122 Ep: pct application non-entry in european phase

Ref document number: 14814535

Country of ref document: EP

Kind code of ref document: A1