WO2019019672A1 - 应用程序数据恢复方法和装置、计算机设备和存储介质 - Google Patents

应用程序数据恢复方法和装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2019019672A1
WO2019019672A1 PCT/CN2018/080051 CN2018080051W WO2019019672A1 WO 2019019672 A1 WO2019019672 A1 WO 2019019672A1 CN 2018080051 W CN2018080051 W CN 2018080051W WO 2019019672 A1 WO2019019672 A1 WO 2019019672A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
main process
memory address
memory
application main
Prior art date
Application number
PCT/CN2018/080051
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 WO2019019672A1 publication Critical patent/WO2019019672A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Definitions

  • the application relates to an application data recovery method and apparatus, a computer device and a storage medium.
  • an application data recovery method, apparatus, computer device, and non-transitory computer readable storage medium are provided.
  • An application data recovery method includes:
  • the obtained memory address is written into the application main process that is opened again, so that the application main process performs application data recovery according to the written memory address.
  • An application data recovery device includes:
  • An instruction acquisition module configured to acquire an application open instruction
  • a process opening module configured to start an application main process and an application auxiliary process according to the application opening instruction, where the application main process and the application auxiliary process share a memory
  • An abnormality detecting module configured to detect whether the main process of the application is abnormally closed
  • Running a hold module configured to keep the application auxiliary process in a running state when an abnormal shutdown is detected
  • An address obtaining module configured to obtain a memory address from the application auxiliary process when the application main process is turned on again;
  • the address writing module is configured to write the obtained memory address to the application main process that is opened again, so that the application main process performs application data recovery according to the written memory address.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps:
  • the obtained memory address is written into the application main process that is opened again, so that the application main process performs application data recovery according to the written memory address.
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of:
  • the obtained memory address is written into the application main process that is opened again, so that the application main process performs application data recovery according to the written memory address.
  • FIG. 1 is an application environment diagram of an application data recovery method in accordance with one or more embodiments
  • FIG. 2 is a structural block diagram of a terminal in an application data recovery system in accordance with one or more embodiments
  • FIG. 3 is a flow diagram of an application data recovery method in accordance with one or more embodiments.
  • FIG. 4 is a flow diagram showing the steps of an application process for enabling shared memory in accordance with one or more embodiments
  • FIG. 5 is a schematic flowchart of steps of re-opening an application main process in accordance with one or more embodiments
  • FIG. 6 is a flow diagram showing the steps of comparing memory addresses in accordance with one or more embodiments
  • FIG. 7 is a structural block diagram of an application data recovery device in accordance with one or more embodiments.
  • FIG. 8 is a structural block diagram of a process open module in accordance with one or more embodiments.
  • FIG. 9 is a structural block diagram of an application data recovery apparatus in another embodiment.
  • Figure 10 is a block diagram showing the structure of an application data recovery device in still another embodiment.
  • FIG. 1 is an application environment diagram of an application data recovery method in an embodiment.
  • the application data recovery method is applied to an application data recovery system.
  • the application data recovery system includes a terminal 110 and a server 120, wherein the terminal 110 is connected to the server 120 via a network.
  • the terminal 110 may be a fixed terminal or a mobile terminal, and the fixed terminal may specifically be at least one of a printer, a scanner, and a monitor, and the mobile terminal may specifically be at least one of a tablet computer, a smart phone, a personal data assistant, and a digital camera. .
  • FIG. 2 is a schematic diagram showing the internal structure of the terminal 110 in the application data recovery system of FIG. 1 in an embodiment.
  • the terminal 110 includes a processor coupled through a system bus, a non-transitory computer readable storage medium, an internal memory, and a network interface.
  • the processor of terminal 110 is used to provide computing and control capabilities to support the operation of the entire terminal 110, the memory is used to store data, code instructions, etc., and the network interface is used for network communication with server 120.
  • At least one computer readable instruction is stored on the memory, and the computer readable instructions are executable by the processor to implement the application data recovery method applicable to the terminal 110 provided in the embodiments of the present application.
  • the memory may include a non-volatile computer readable storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
  • the memory includes a non-transitory computer readable storage medium and an internal memory; the non-transitory computer readable storage medium stores an operating system and computer readable instructions that can be processed The processor executes to implement the above described service number assignment method; the internal memory provides a cached operating environment for the operating system and computer readable instructions in the non-transitory computer readable storage medium.
  • an application data recovery method is provided.
  • the method is applied to the terminal 110 for example.
  • the method specifically includes the following steps:
  • an application is installed in the terminal 110, and an application icon of the application is displayed in the display screen of the terminal 110, and the user opens the application installed in the terminal 110 by using the application icon.
  • the server 120 is a server corresponding to an application installed in the terminal 110.
  • the terminal 110 detects a click operation of the application icon, and when detecting the click operation of the application icon, the terminal 110 triggers an application open command corresponding to the application icon.
  • the application main process and the application auxiliary process are started according to the application open command, and the application main process and the application auxiliary process share the memory.
  • the terminal 110 extracts the application identifier in the application opening instruction, and starts the application main process and the application auxiliary process corresponding to the application identifier.
  • the memory address in the address space of the application main process and the application auxiliary process is the same, and the application main process and the application auxiliary process share the memory space corresponding to the memory address through the same memory address.
  • the application main process performs data processing on the shared application data in the memory, and the application auxiliary program does not perform any data processing on the shared in-memory application data.
  • the terminal 110 acquires the process parameter corresponding to the application main process, and the acquired process parameter corresponds to the application main process.
  • the process parameters in the normal range are compared by parameters, and the parameter comparison is used to determine whether the application main program is abnormally closed.
  • the terminal 110 may acquire the number of threads in the application main process, and compare the obtained number of threads with the preset number of threads. When the number of threads of the application main process exceeds the preset number of threads, the application main program detected by the terminal 110 is closed as an abnormal shutdown of the application main program.
  • the terminal 110 may also acquire the processor occupancy rate corresponding to the application main process, and compare the obtained processor occupancy rate with the preset occupancy rate. When it is detected that the processor usage rate corresponding to the application main process exceeds the preset occupancy rate, the application main program detected by the terminal 110 is closed as an abnormal shutdown of the application main program.
  • the terminal 110 when detecting that the application main process is abnormally closed, the terminal 110 does not perform any processing on the application auxiliary process, and keeps the application auxiliary process still in a running state.
  • the application worker process When the application worker process is running, the application data in the memory shared by the application main process and the application worker process is not lost and will still be stored in the shared memory.
  • the step S308 further includes the step of closing the application assistance process, where the step specifically includes the steps of: monitoring whether the application main process is turned on again within a preset time period; and when the application main process is detected to be turned on again, the application is The memory address is obtained in the auxiliary process; when it is detected that the application main process is not started again, the application auxiliary process corresponding to the application main process is closed.
  • the terminal 110 starts timing after detecting that the application main process is abnormally closed, and monitors whether the application main process is turned on again. When the measured time reaches the preset time period, the terminal 110 still does not detect that the application main process is turned on again, and the terminal 110 queries the application auxiliary process corresponding to the application main process, and closes the queried application auxiliary process. When it is detected that the application main process is turned on again, the memory address is obtained from the application auxiliary process.
  • the terminal 110 determines the address space of the application auxiliary process when detecting that the application main process is turned on again, and acquires the memory address from the address space of the application auxiliary process.
  • the memory address is a unique identifier corresponding to the memory space in which the application data is stored.
  • the same address space identifier is set in the application main process and the application helper.
  • the terminal 110 starts the application main process and the application auxiliary process according to the application opening instruction, the terminal 110 respectively writes the address space corresponding to the address space identifier in the main process and the application auxiliary process to write the same memory address.
  • the terminal 110 acquires the address space identifier in the application main process that is opened again when detecting that the application main process is turned on again.
  • the terminal 110 determines an address space in the application auxiliary process according to the obtained address space identifier, and obtains a memory address from the determined address space.
  • S312 Write the obtained memory address to the application main process that is opened again, so that the application main process performs application data recovery according to the written memory address.
  • the terminal 110 after obtaining the memory address from the address space in the application auxiliary process in the running state, the terminal 110 writes the obtained memory address into the application main process that is opened again, so that the application main process is written according to the application.
  • the memory address accesses the memory space, and the application data before the application main process is abnormally closed is obtained from the accessed memory space.
  • the terminal 110 acquires the application data before the application main process abnormally closes by using the application main process, and closes the application page before the main process abnormally closes according to the acquired application.
  • the application auxiliary process is kept in the running state.
  • the application main process and the application auxiliary process share the memory, and the application main process and the application auxiliary process have the same memory address.
  • the application data in the memory space corresponding to the memory address is not lost. .
  • the memory address in the application auxiliary process is written to the application main process that is opened again, so that the application main process obtains the application data before the abnormal shutdown according to the written memory address, and the data recovery is avoided, thereby avoiding The application's abnormal shutdown causes the application data to be lost, which improves the security of the application data.
  • S304 specifically includes the step of starting an application process of sharing memory, and the step specifically includes the following:
  • the application open command includes the memory capacity required by the application corresponding to the application.
  • the terminal 110 parses the application open command and obtains the memory capacity required by the application in the application open command by parsing.
  • the terminal 110 determines a free memory space according to the required memory capacity of the application, and acquires a memory address of the determined memory space.
  • the terminal 110 extracts an application identifier in the application open command, obtains a process parameter according to the application identifier, and starts an application main process and an application assist process corresponding to the application identifier according to the process parameter.
  • the terminal 110 queries the address space of the open application main process and the application auxiliary process respectively, and writes the obtained memory address into the address space of the application main process and the application auxiliary process respectively, so as to obtain the obtained memory.
  • the memory space corresponding to the address is allocated to the application main process and the application auxiliary process, so that the application main process and the application auxiliary process share the memory space corresponding to the obtained memory address.
  • the idle memory space is determined according to the memory capacity required by the application in the application open command, and the memory address corresponding to the determined memory space is written into the address space of the application main process and the application auxiliary process to ensure the application main process and The application worker process can share the memory space corresponding to the written memory address.
  • the method further includes the step of starting the application main process again, and the step specifically includes the following:
  • the terminal 110 acquires an application identifier corresponding to the application main process, generates a prompt message for whether to open the application again according to the application identifier, and displays the generated prompt information on whether to open the application. Confirm in the window.
  • the confirmation window displays prompt information of whether to open the application, and the confirmation window is provided with two buttons of “Yes” and “No”, and the user clicks the button in the confirmation window through the input device of the terminal 110 to trigger and Click the corresponding command on the button.
  • the terminal 110 detects that the "Yes” button is clicked, triggering the application to open the command; the terminal 110 detects that the "No” button is clicked, and cancels the display confirmation window.
  • the terminal 110 obtains the triggered application open command, and starts the application main process again according to the triggered application open command, so that the application corresponding to the application identifier in the application open command is in a normal running state.
  • the method before S312, the method includes: comparing the memory address, the step specifically includes the following:
  • the terminal 110 acquires an address space identifier of the application main process that is opened again, and extracts a memory address in the address space corresponding to the address space identifier.
  • the terminal 110 obtains a memory address from an address space of an application-assisted process in a running state according to the same address space identifier in the application main process, and compares the extracted memory address with the obtained memory address. If the extracted memory address is the same as the obtained memory address, there is no need to replace the memory address in the address space of the application main process.
  • the terminal 110 replaces the memory address in the application main process that is opened again with the memory address obtained from the application auxiliary process, and applies the main process. Reads the corresponding memory space according to the replaced memory address, and reads the application data in the memory space. The terminal 110 restores the page of the application before the application main process abnormally closes according to the application data read by the application main process.
  • the application that is to be opened again The memory address in the main process is replaced with the memory address in the application auxiliary process, ensuring the correctness of the memory address in the application main process that is started again, and ensuring that the application main process that is started again can perform application data recovery according to the correct memory address.
  • FIGS. 3-6 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 3-6 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
  • an application data recovery apparatus 700 is provided.
  • the apparatus specifically includes the following: an instruction acquisition module 702, a process startup module 704, an exception detection module 706, a run hold module 708, and an address.
  • the instruction acquisition module 702 is configured to acquire an application open instruction.
  • the process opening module 704 is configured to start the application main process and the application auxiliary process according to the application opening instruction, and the application main process and the application auxiliary process share the memory.
  • the abnormality detecting module 706 is configured to detect whether the application main process is abnormally closed.
  • the run hold module 708 is configured to keep the application auxiliary process in a running state when an abnormal shutdown is detected.
  • the address obtaining module 710 is configured to obtain a memory address from the application assisting process when the application main process is turned on again.
  • the address writing module 712 is configured to write the obtained memory address to the application main process that is opened again, so that the application main process performs application data recovery according to the written memory address.
  • the application auxiliary process is kept in the running state.
  • the application main process and the application auxiliary process share the memory, and the application main process and the application auxiliary process have the same memory address.
  • the application data in the memory space corresponding to the memory address is not lost. .
  • the memory address in the application auxiliary process is written to the application main process that is opened again, so that the application main process obtains the application data before the abnormal shutdown according to the written memory address, and the data recovery is avoided, thereby avoiding The application's abnormal shutdown causes the application data to be lost, which improves the security of the application data.
  • the process open module 704 specifically includes the following: a memory capacity acquisition module 704a, a memory space determination module 704b, an application process open module 704c, and a memory address write module 704d.
  • the memory capacity obtaining module 704a is configured to acquire a memory capacity required by the application in the application open command.
  • the memory space determining module 704b is configured to determine a memory space according to the required memory capacity of the application, and obtain a memory address of the determined memory space.
  • the application process opening module 704c is used to start the application main process and the application auxiliary process.
  • the memory address writing module 704d is configured to separately write the obtained memory address into the address space of the application main process and the application auxiliary process.
  • the idle memory space is determined according to the memory capacity required by the application in the application open command, and the memory address corresponding to the determined memory space is written into the address space of the application main process and the application auxiliary process to ensure the application main process and The application worker process can share the memory space corresponding to the written memory address.
  • the application data recovery apparatus 700 specifically includes an open monitoring module 714 , a process shutdown module 716 , a window confirmation module 718 , and a reopening module 720 .
  • the monitoring module 714 is turned on to monitor whether the application main process is turned on again within a preset time period.
  • the process shutdown module 716 is configured to: when it is detected that the application main process is not restarted, close the application auxiliary process corresponding to the application main process.
  • the window confirmation module 718 is configured to display whether to open the confirmation window of the application.
  • the module 720 is opened again for acquiring an application open command triggered according to the confirmation window; and the application main process is started again according to the application open command.
  • the address obtaining module 710 is further configured to obtain a memory address from the application assisting process when it is detected that the application main process is turned on again.
  • the application main process is re-enabled in the preset time period, and the corresponding application auxiliary process is closed to prevent the application auxiliary process from occupying too many computing resources and reducing the utilization of computing resources.
  • the application main process of the application After the application main process of the application is abnormally closed, it displays whether the application confirmation window is enabled, and ensures that the user can determine whether to open the application instruction according to the need, which simplifies the operation of opening the application.
  • the application data recovery apparatus 700 specifically includes the following: an address extraction module 722 and an address comparison module 724.
  • the address extraction module 722 is configured to extract a memory address in the application main process that is turned on again.
  • the address comparison module 724 is configured to compare the extracted memory address with the obtained memory address.
  • the address writing module 712 is further configured to: if the extracted memory address is different from the obtained memory address, write the obtained memory address to the application main process that is opened again, so that the application main process applies according to the written memory address. Program data recovery.
  • the application that is to be opened again The memory address in the main process is replaced with the memory address in the application auxiliary process, ensuring the correctness of the memory address in the application main process that is started again, and ensuring that the application main process that is started again can perform application data recovery according to the correct memory address.
  • the various modules in the application data recovery device described above may be implemented in whole or in part by software, hardware, and combinations thereof. Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
  • a computer device comprising a memory and one or more processors, the memory storing computer readable instructions, the computer readable instructions being executed by the processor, causing the one or more processors to perform the step of: acquiring an application open command Open the application main process and the application auxiliary process according to the application open command, and the application main process and the application auxiliary process share the memory; detect whether the application main process is abnormally closed; and when the abnormal shutdown is detected, keep the application auxiliary process in the running state; When the main process is started again, the memory address is obtained from the application auxiliary process; the obtained memory address is written into the application main process that is opened again, so that the application main process performs application data recovery according to the written memory address.
  • the application main process and the application auxiliary process are started according to the application open command, and the application main process and the application auxiliary process share the memory, including: acquiring the memory capacity required by the application in the application open instruction; The capacity determines the memory space, and obtains the memory address of the determined memory space; starts the application main process and the application auxiliary process; and writes the obtained memory address into the address space of the application main process and the application auxiliary process respectively.
  • the processor further implements the following steps: monitoring whether the application main process is turned on again within a preset time period; When the application main process is started again, the step of obtaining the memory address from the application auxiliary process is performed; when it is detected that the application main process is not started again, the application auxiliary process corresponding to the application main process is closed.
  • the processor further implements the following steps when executing the computer program: displaying whether to open the confirmation window of the application; acquiring the application triggered according to the confirmation window The program opens the instruction; the application main process is started again according to the application opening instruction.
  • the obtained memory address is written to the application main process that is turned on again, so that the application main process performs the application data recovery according to the written memory address
  • the processor further implements the following steps: The memory address in the application main process that is opened again; the extracted memory address is compared with the obtained memory address; if the extracted memory address is different from the obtained memory address, the obtained memory is obtained. The address is written to the application main process that is turned on again, so that the application main process performs application data recovery according to the written memory address.
  • the application auxiliary process is kept in the running state.
  • the application main process and the application auxiliary process share the memory, and the application main process and the application auxiliary process have the same memory address.
  • the application data in the memory space corresponding to the memory address is not lost. .
  • the memory address in the application auxiliary process is written to the application main process that is opened again, so that the application main process obtains the application data before the abnormal shutdown according to the written memory address, and the data recovery is avoided, thereby avoiding The application's abnormal shutdown causes the application data to be lost, which improves the security of the application data.
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: acquiring an application open The instruction starts the application main process and the application auxiliary process according to the application opening instruction, and the application main process and the application auxiliary process share the memory; detects whether the application main process is abnormally closed; and when the abnormal shutdown is detected, keeps the application auxiliary process in a running state; When the application main process is started again, the memory address is obtained from the application auxiliary process; the obtained memory address is written into the application main process that is opened again, so that the application main process performs application data recovery according to the written memory address.
  • the application main process and the application auxiliary process are started according to the application open command, and the application main process and the application auxiliary process share the memory, including: acquiring the memory capacity required by the application in the application open instruction; The capacity determines the memory space, and obtains the memory address of the determined memory space; starts the application main process and the application auxiliary process; and writes the obtained memory address into the address space of the application main process and the application auxiliary process respectively.
  • the processor further performs the steps of: monitoring whether the application main process is turned on again within the preset time period; when the application main process is detected again When it is enabled, the memory address is obtained from the application auxiliary process; when it is detected that the application main process is not started again, the application auxiliary process corresponding to the application main process is closed.
  • the processor after detecting the abnormal shutdown, after the application auxiliary process is kept in the running state, the processor further performs the steps of: displaying whether to open the confirmation window of the application; acquiring an application opening instruction triggered according to the confirmation window; Open the application main process again according to the application open command.
  • the obtained memory address is written to the application main process that is turned on again, so that the application main process performs application data recovery according to the written memory address
  • the processor further performs the following steps: extracting the application that is opened again The memory address in the main process; the extracted memory address is compared with the obtained memory address; if the extracted memory address is different from the obtained memory address, the obtained memory address is written to the application owner that is opened again.
  • the process causes the application main process to perform application data recovery based on the written memory address.
  • the application auxiliary process is kept in the running state.
  • the application main process and the application auxiliary process share the memory, and the application main process and the application auxiliary process have the same memory address.
  • the application data in the memory space corresponding to the memory address is not lost. .
  • the memory address in the application auxiliary process is written to the application main process that is opened again, so that the application main process obtains the application data before the abnormal shutdown according to the written memory address, and the data recovery is avoided, thereby avoiding The application's abnormal shutdown causes the application data to be lost, which improves the security of the application data.
  • the foregoing storage medium may be a non-volatile computer readable storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM). .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Retry When Errors Occur (AREA)

Abstract

一种应用程序数据恢复方法,包括:获取应用程序开启指令;根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;检测所述应用主进程是否异常关闭;在检测到异常关闭时,保持所述应用辅助进程处于运行状态;当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址;及将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。

Description

应用程序数据恢复方法和装置、计算机设备和存储介质
本申请要求于2017年7月24日提交中国专利局、申请号为2017106085219、发明名称为“应用程序数据恢复方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种应用程序数据恢复方法和装置、计算机设备和存储介质。
背景技术
随着计算机技术的发展,各种各样的应用程序层出不穷。各种各样的应用程序的可以为用户提供多种多样的服务,为用户带来了极大的便利。
但是在应用程序的运行过程中,应用程序的部分数据需要在计算机的内存中存储或处理,当应用程序运行发生异常关闭时,内存中应用程序的相关数据也随之丢失,出现了在应用程序异常关闭时丢失数据的情况。
发明内容
根据本申请公开的各种实施例,提供一种应用程序数据恢复方法、装置、计算机设备和非易失性计算机可读存储介质。
一种应用程序数据恢复方法,包括:
获取应用程序开启指令;
根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;
检测所述应用主进程是否异常关闭;
在检测到异常关闭时,保持所述应用辅助进程处于运行状态;
当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址;及
将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。
一种应用程序数据恢复装置,包括:
指令获取模块,用于获取应用程序开启指令;
进程开启模块,用于根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;
异常检测模块,用于检测所述应用主进程是否异常关闭;
运行保持模块,用于在检测到异常关闭时,保持所述应用辅助进程处于运行状态;
地址获取模块,用于当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地 址;及
地址写入模块,用于将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
获取应用程序开启指令;
根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;
检测所述应用主进程是否异常关闭;
在检测到异常关闭时,保持所述应用辅助进程处于运行状态;
当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址;及
将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
获取应用程序开启指令;
根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;
检测所述应用主进程是否异常关闭;
在检测到异常关闭时,保持所述应用辅助进程处于运行状态;
当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址;及
将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为根据一个或多个实施例中应用程序数据恢复方法的应用环境图;
图2为根据一个或多个实施例中应用程序数据恢复系统中的终端的结构框图;
图3为根据一个或多个实施例中应用程序数据恢复方法的流程示意图;
图4为根据一个或多个实施例中开启共享内存的应用进程的步骤的流程示意图;
图5为根据一个或多个实施例中再次开启应用主进程的步骤的流程示意图;
图6为根据一个或多个实施例中比较内存地址的步骤的流程示意图;
图7为根据一个或多个实施例中应用程序数据恢复装置的结构框图;
图8为根据一个或多个实施例中进程开启模块的结构框图;
图9为另一个实施例中应用程序数据恢复装置的结构框图;
图10为再一个实施例中应用程序数据恢复装置的结构框图。
具体实施方式
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
图1为一个实施例中应用程序数据恢复方法的应用环境图。参照图1,该应用程序数据恢复方法应用于应用程序数据恢复系统。应用程序数据恢复系统包括终端110和服务器120,其中终端110通过网络与服务器120连接。终端110可以是固定终端或移动终端,固定终端具体可以是打印机、扫描仪和监控器中的至少一种,移动终端具体可以是平板电脑、智能手机、个人数据助理和数码相机中的至少一种。
图2为一个实施例中图1应用程序数据恢复系统中的终端110的内部结构示意图。如图2所示,该终端110包括通过系统总线连接的处理器、非易失性计算机可读存储介质、内存储器和网络接口。终端110的处理器用于提供计算和控制能力,支撑整个终端110的运行,存储器用于存储数据、代码指令等,网络接口用于与服务器120进行网络通信。存储器上存储有至少一个计算机可读指令,该计算机可读指令可被处理器执行,以实现本申请实施例中提供的适用于终端110的应用程序数据恢复方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性计算机可读存储介质,或随机存储记忆体(Random Access Memory,RAM)等。例如,在一些实施例中,存储器包括非易失性计算机可读存储介质及内存储器;非易失性计算机可读存储介质存储有操作系统和计算机可读指令,该计算机可读指令可被处理器执行以实现上述的业务编号分配方法;内存储器为非易失性计算机可读存储介质中的操作系统及计算机可读指令提供高速缓存的运行环境。
如图3所示,在一些实施例中,提供一种应用程序数据恢复方法,本实施例以该方法应用在终端110来举例说明,该方法具体包括以下步骤:
S302,获取应用程序开启指令。
在一些实施例中,终端110中安装有应用程序,终端110的显示屏中显示应用程序的应用图标,用户通过应用图标开启终端110中安装的应用程序。服务器120为终端110安装的应用程序对应的服务器。终端110检测应用图标的点击操作,终端110在检测到应用图标的点击操作时,触发应用图标对应的应用程序开启指令。
S304,根据应用程序开启指令开启应用主进程和应用辅助进程,应用主进程和应用辅助进程共享内存。
在一些实施例中,终端110获取应用程序开启指令后,提取应用程序开启指令中的应用标识,开启应用标识对应的应用主进程和应用辅助进程。应用主进程和应用辅助进程的地址空间中的内存地址相同,应用主进程和应用辅助进程通过相同的内存地址共享内存地址对应的内存空间。其中,应用主进程对共享的内存中的应用程序数据进行数据处理,而应用辅助程序不对共享的内存中的应用程序数据进行任何数据处理。
S306,检测应用主进程是否异常关闭。
在一些实施例中,终端110在开启应用主进程和应用辅助进程后,终端110在检测到应用主进程关闭时,获取应用主进程对应的进程参数,将获取到的进程参数与应用主进程对应的处于正常范围的进程参数进行参数比较,通过参数比较确定应用主程序是否为异常关闭。
在一些实施例中,终端110在检测到应用主进程关闭时,可以获取应用主进程中的线程数量,将获取到的线程数量与预设线程数量相比较。当应用主进程的线程数量超过预设线程数量时,则终端110检测到的应用主程序关闭为应用主程序的异常关闭。
在一些实施例中,终端110在检测到应用主进程关闭时,还可以获取应用主进程对应的处理器占用率,将获取到的处理器占用率与预设占用率相比较。当检测到应用主进程对应的处理器占用率超过预设占用率,则终端110检测到的应用主程序关闭为应用主程序的异常关闭。
S308,在检测到异常关闭时,保持应用辅助进程处于运行状态。
在一些实施例中,终端110在检测到应用主进程异常关闭时,不对应用辅助进程做任何处理,保持应用辅助进程仍然处于运行状态。在应用辅助进程处于运行状态时,应用主进程和应用辅助进程所共享的内存中的应用程序数据不会丢失,仍然会被存储在共享的内存中。
在一些实施例中,S308之后还包括关闭应用辅助进程的步骤,该步骤具体包括以下步骤:监测在预设时间段内应用主进程是否再次开启;当监测到应用主进程再次开启时,从应用辅助进程中获取内存地址;当监测到应用主进程未再次开启,关闭应用主进程对应的应用辅助进程。
在一些实施例中,终端110在检测到应用主进程异常关闭后,开始计时,并监测应用主进程是否再次开启。当所计时间达到预设时间段时,终端110仍未监测到应用主进程再次开启时,终端110查询与该应用主进程对应的应用辅助进程,并关闭查询到的应用辅助进程。当监测到应用主进程再次开启时,从应用辅助进程中获取内存地址。
S310,当应用主进程再次开启时,从应用辅助进程中获取内存地址。
在一些实施例中,在应用主进程异常关闭后,终端110在检测到应用主进程再次开启时,确定应用辅助进程的地址空间,从应用辅助进程的地址空间获取内存地址。内存地址为存储应用程序数据的内存空间所对应的唯一标识。
在一些实施例中,在应用主进程和应用辅助程序中设置有相同的地址空间标识。终端110在根据应用程序开启指令开启应用主进程和应用辅助进程时,分别应用主进程和应用辅助进 程中的地址空间标识对应的地址空间写入相同的内存地址。在应用主进程异常关闭后,终端110在检测到应用主进程再次开启时,获取再次开启的应用主进程中的地址空间标识。终端110根据获取的地址空间标识确定应用辅助进程中的地址空间,从确定的地址空间中获取内存地址。
S312,将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复。
在一些实施例中,终端110在从处于运行状态的应用辅助进程中的地址空间获取到内存地址后,将获取到的内存地址写入再次开启的应用主进程中,使应用主进程根据写入的内存地址访问内存空间,从访问的内存空间中获取应用主进程异常关闭前的应用程序数据。终端110通过应用主进程获取应用主进程异常关闭前的应用程序数据,根据获取到的应用程序关闭数据恢复应用主进程异常关闭前应用程序页面。
本实施例中,根据应用程序开启指令开启应用主进程和应用辅助进程后,在检测到应用主进程异常关闭时,保持应用辅助进程处于运行状态。其中,应用主进程和应用辅助进程共享内存,应用主进程和应用辅助进程的内存地址相同,在保持应用辅助进程处于运行状态时,保证了内存地址对应的内存空间中的应用程序数据不会丢失。当应用主进程再次开启时,将应用辅助进程中的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址获取异常关闭前的应用程序数据进行数据恢复,避免了由于应用程序异常关闭导致应用程序数据丢失的情况,提高了应用程序数据的安全性。
如图4所示,在一些实施例中,S304具体包括开启共享内存的应用进程的步骤,该步骤具体包括以下内容:
S402,获取应用程序开启指令中的应用所需内存容量。
在一些实施例中,应用程序开启指令中包括应用程序对应的应用所需内存容量。终端110对应用程序开启指令进行解析,通过解析获取应用程序开启指令中的应用所需内存容量。
S404,根据应用所需内存容量确定内存空间,并获取确定的内存空间的内存地址。
在一些实施例中,终端110提取到应用所需内存容量后,根据应用所需内存容量确定空余的内存空间,并获取确定的内存空间的内存地址。
S406,开启应用主进程和应用辅助进程。
在一些实施例中,终端110提取应用程序开启指令中的应用标识,根据应用标识获取进程参数,根据进程参数开启与应用标识对应的应用主进程和应用辅助进程。
S408,将获取的内存地址分别写入应用主进程和应用辅助进程的地址空间。
在一些实施例中,终端110分别查询开启的应用主进程和应用辅助进程中的地址空间,将获取到的内存地址分别写入应用主进程和应用辅助进程的地址空间,以将获取到的内存地址对应的内存空间分配至应用主进程和应用辅助进程,使应用主进程和应用辅助进程共享获取到的内存地址对应的内存空间。
本实施例中,根据应用程序开启指令中的应用所需内存容量确定空闲的内存空间,将确定的内存空间对应的内存地址写入应用主进程和应用辅助进程的地址空间,保证应用主进程 和应用辅助进程可以共享写入的内存地址对应的内存空间。
如图5所示,在一些实施例中,S308之后具体还包括再次开启应用主进程的步骤,该步骤具体包括以下内容:
S502,展示是否开启应用程序的确认窗口。
在一些实施例中,终端110在应用主进程异常关闭后,获取应用主进程对应的应用标识,根据应用标识生成是否再次开启应用程序的提示信息,将生成的提示信息展示在是否开启应用程序的确认窗口中。
S504,获取根据确认窗口中触发的应用主进程开启指令。
在一些实施例中,确认窗口中展示有是否开启应用程序的提示信息,确认窗口中设置有“是”和“否”两个按钮,用户通过终端110的输入设备点击确认窗口中的按钮触发与点击的按钮相应的指令。终端110检测到“是”按钮被点击,触发应用程序开启指令;终端110检测到“否”按钮被点击,取消展示确认窗口。
S506,根据应用程序开启指令再次开启应用主进程。
在一些实施例中,终端110在获取到触发的应用程序开启指令,根据触发的应用程序开启指令再次开启应用主进程,使应用程序开启指令中应用标识对应的应用程序处于正常运行状态。
本实施例中,在应用程序的应用主进程异常关闭后,展示是否开启应用程序的确认窗口,保证用户可根据需要来确定相应的是否开启应用程序的指令,简化了开启应用程序的操作。
如图6所示,在一些实施例中,S312之前具体包括比较内存地址的步骤,该步骤具体包括以下内容:
S602,提取再次开启的应用主进程中的内存地址。
在一些实施例中,终端110在再次开启应用主进程后,获取再次开启的应用主进程的地址空间标识,提取地址空间标识对应的地址空间中的内存地址。
S604,将提取到的内存地址与获取到的内存地址进行比较。
在一些实施例中,终端110根据与应用主进程中相同的地址空间标识从处于运行状态的应用辅助进程的地址空间中获取内存地址,将提取到的内存地址与获取到的内存地址进行比较,若提取到的内存地址与获取到的内存地址相同,则无需对应用主进程的地址空间中的内存地址进行替换。
S606,若提取到的内存地址与所述获取到的内存地址不相同,将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复。
在一些实施例中,若提取到的内存地址与获取到的内存地址不相同,终端110将再次开启的应用主进程中的内存地址替换为从应用辅助进程中获取到的内存地址,应用主进程根据替换的内存地址访问对应的内存空间,读取内存空间中的应用程序数据。终端110根据应用主进程读取到的应用程序数据恢复应用主进程异常关闭之前应用程序的页面。
本实施例中,通过将再次开启的应用主进程和应用辅助进程中的内存地址进行比较,通过比较确定再次开启的应用主进程和应用辅助进程中的内存地址不相同时,将再次开启的应 用主进程中的内存地址替换为应用辅助进程中的内存地址,保证再次开启的应用主进程中的内存地址的正确性,确保再次开启的应用主进程可以根据正确的内存地址进行应用程序数据恢复。
应该理解的是,虽然图3-6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3-6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
如图7所示,在一些实施例中,提供一种应用程序数据恢复装置700,该装置具体包括以下内容:指令获取模块702、进程开启模块704、异常检测模块706、运行保持模块708、地址获取模块710和地址写入模块712。
指令获取模块702,用于获取应用程序开启指令。
进程开启模块704,用于根据应用程序开启指令开启应用主进程和应用辅助进程,应用主进程和应用辅助进程共享内存。
异常检测模块706,用于检测应用主进程是否异常关闭。
运行保持模块708,用于在检测到异常关闭时,保持应用辅助进程处于运行状态。
地址获取模块710,用于当应用主进程再次开启时,从应用辅助进程中获取内存地址。
地址写入模块712,用于将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复。
本实施例中,根据应用程序开启指令开启应用主进程和应用辅助进程后,在检测到应用主进程异常关闭时,保持应用辅助进程处于运行状态。其中,应用主进程和应用辅助进程共享内存,应用主进程和应用辅助进程的内存地址相同,在保持应用辅助进程处于运行状态时,保证了内存地址对应的内存空间中的应用程序数据不会丢失。当应用主进程再次开启时,将应用辅助进程中的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址获取异常关闭前的应用程序数据进行数据恢复,避免了由于应用程序异常关闭导致应用程序数据丢失的情况,提高了应用程序数据的安全性。
如图8所示,在一些实施例中,进程开启模块704具体包括以下内容:内存容量获取模块704a、内存空间确定模块704b、应用进程开启模块704c和内存地址写入模块704d。
内存容量获取模块704a,用于获取应用程序开启指令中的应用所需内存容量。
内存空间确定模块704b,用于根据应用所需内存容量确定内存空间,并获取确定的内存空间的内存地址。
应用进程开启模块704c,用于开启应用主进程和应用辅助进程。
内存地址写入模块704d,用于将获取的内存地址分别写入应用主进程和应用辅助进程的地址空间。
本实施例中,根据应用程序开启指令中的应用所需内存容量确定空闲的内存空间,将确 定的内存空间对应的内存地址写入应用主进程和应用辅助进程的地址空间,保证应用主进程和应用辅助进程可以共享写入的内存地址对应的内存空间。
如图9所示,在一些实施例中,应用程序数据恢复装置700具体还包括:开启监测模块714、进程关闭模块716、窗口确认模块718和再次开启模块720。
开启监测模块714,用于监测在预设时间段内所述应用主进程是否再次开启。
进程关闭模块716,用于当监测到应用主进程未再次开启,关闭所述应用主进程对应的所述应用辅助进程。
窗口确认模块718,用于展示是否开启应用程序的确认窗口。
再次开启模块720,用于获取根据所述确认窗口中触发的应用程序开启指令;根据所述应用程序开启指令再次开启所述应用主进程。
地址获取模块710还用于当监测到应用主进程再次开启时,从应用辅助进程中获取内存地址。
本实施例中,在预设时间段内位检测到应用主进程的再次开启,关闭相应的应用辅助进程,避免应用辅助进程占用过多运算资源,降低运算资源的利用率。在应用程序的应用主进程异常关闭后,展示是否开启应用程序的确认窗口,保证用户可根据需要来确定相应的是否开启应用程序的指令,简化了开启应用程序的操作。
如图10所示,在一些实施例中,应用程序数据恢复装置700具体还包括以下内容:地址提取模块722和地址比较模块724。
地址提取模块722,用于提取再次开启的应用主进程中的内存地址。
地址比较模块724,用于将提取到的内存地址与获取到的内存地址进行比较。
地址写入模块712还用于若提取到的内存地址与获取到的内存地址不相同,将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复。
本实施例中,通过将再次开启的应用主进程和应用辅助进程中的内存地址进行比较,通过比较确定再次开启的应用主进程和应用辅助进程中的内存地址不相同时,将再次开启的应用主进程中的内存地址替换为应用辅助进程中的内存地址,保证再次开启的应用主进程中的内存地址的正确性,确保再次开启的应用主进程可以根据正确的内存地址进行应用程序数据恢复。
关于应用程序数据恢复装置的具体限定可以参见上文中对于应用程序数据恢复方法的限定,在此不再赘述。上述应用程序数据恢复装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器执行以下步骤:获取应用程序开启 指令;根据应用程序开启指令开启应用主进程和应用辅助进程,应用主进程和应用辅助进程共享内存;检测应用主进程是否异常关闭;在检测到异常关闭时,保持应用辅助进程处于运行状态;当应用主进程再次开启时,从应用辅助进程中获取内存地址;将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复。
在一些实施例中,根据应用程序开启指令开启应用主进程和应用辅助进程,应用主进程和应用辅助进程共享内存,包括:获取应用程序开启指令中的应用所需内存容量;根据应用所需内存容量确定内存空间,并获取确定的内存空间的内存地址;开启应用主进程和应用辅助进程;将获取的内存地址分别写入应用主进程和应用辅助进程的地址空间。
在一些实施例中,在检测到异常关闭时,保持应用辅助进程处于运行状态之后,处理器执行计算机程序时还实现以下步骤:监测在预设时间段内应用主进程是否再次开启;当监测到应用主进程再次开启时,执行从应用辅助进程中获取内存地址的步骤;当监测到应用主进程未再次开启,关闭应用主进程对应的应用辅助进程。
在一些实施例中,在检测到异常关闭时,保持应用辅助进程处于运行状态之后,处理器执行计算机程序时还实现以下步骤:展示是否开启应用程序的确认窗口;获取根据确认窗口中触发的应用程序开启指令;根据应用程序开启指令再次开启应用主进程。
在一些实施例中,将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复之前,处理器执行计算机程序时还实现以下步骤:提取再次开启的应用主进程中的内存地址;将提取到的内存地址与获取到的内存地址进行比较;若所述提取到的内存地址与所述获取到的内存地址不相同,将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复。
本实施例中,根据应用程序开启指令开启应用主进程和应用辅助进程后,在检测到应用主进程异常关闭时,保持应用辅助进程处于运行状态。其中,应用主进程和应用辅助进程共享内存,应用主进程和应用辅助进程的内存地址相同,在保持应用辅助进程处于运行状态时,保证了内存地址对应的内存空间中的应用程序数据不会丢失。当应用主进程再次开启时,将应用辅助进程中的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址获取异常关闭前的应用程序数据进行数据恢复,避免了由于应用程序异常关闭导致应用程序数据丢失的情况,提高了应用程序数据的安全性。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:获取应用程序开启指令;根据应用程序开启指令开启应用主进程和应用辅助进程,应用主进程和应用辅助进程共享内存;检测应用主进程是否异常关闭;在检测到异常关闭时,保持应用辅助进程处于运行状态;当应用主进程再次开启时,从应用辅助进程中获取内存地址;将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复。
在一些实施例中,根据应用程序开启指令开启应用主进程和应用辅助进程,应用主进程和应用辅助进程共享内存,包括:获取应用程序开启指令中的应用所需内存容量;根据应用 所需内存容量确定内存空间,并获取确定的内存空间的内存地址;开启应用主进程和应用辅助进程;将获取的内存地址分别写入应用主进程和应用辅助进程的地址空间。
在一些实施例中,在检测到异常关闭时,保持应用辅助进程处于运行状态之后,处理器还执行以下步骤:监测在预设时间段内应用主进程是否再次开启;当监测到应用主进程再次开启时,从应用辅助进程中获取内存地址;当监测到应用主进程未再次开启,关闭应用主进程对应的应用辅助进程。
在一些实施例中,在检测到异常关闭时,保持应用辅助进程处于运行状态之后,处理器还执行以下步骤:展示是否开启应用程序的确认窗口;获取根据确认窗口中触发的应用程序开启指令;根据应用程序开启指令再次开启应用主进程。
在一些实施例中,将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复之前,处理器还执行以下步骤:提取再次开启的应用主进程中的内存地址;将提取到的内存地址与获取到的内存地址进行比较;若提取到的内存地址与获取到的内存地址不相同,将获取到的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址进行应用程序数据恢复。
本实施例中,根据应用程序开启指令开启应用主进程和应用辅助进程后,在检测到应用主进程异常关闭时,保持应用辅助进程处于运行状态。其中,应用主进程和应用辅助进程共享内存,应用主进程和应用辅助进程的内存地址相同,在保持应用辅助进程处于运行状态时,保证了内存地址对应的内存空间中的应用程序数据不会丢失。当应用主进程再次开启时,将应用辅助进程中的内存地址写入再次开启的应用主进程,使应用主进程根据写入的内存地址获取异常关闭前的应用程序数据进行数据恢复,避免了由于应用程序异常关闭导致应用程序数据丢失的情况,提高了应用程序数据的安全性。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性计算机可读存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种应用程序数据恢复方法,包括:
    获取应用程序开启指令;
    根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;
    检测所述应用主进程是否异常关闭;
    在检测到异常关闭时,保持所述应用辅助进程处于运行状态;
    当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址;及
    将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存,包括:
    获取所述应用程序开启指令中的应用所需内存容量;
    根据所述应用所需内存容量确定内存空间,并获取确定的内存空间的内存地址;
    开启应用主进程和应用辅助进程;及
    将获取的内存地址分别写入所述应用主进程和所述应用辅助进程的地址空间。
  3. 根据权利要求2所述的方法,其特征在于,所述在检测到异常关闭时,保持所述应用辅助进程处于运行状态之后,还包括:
    监测在预设时间段内所述应用主进程是否再次开启;
    当监测到所述应用主进程再次开启时,执行所述从所述应用辅助进程中获取内存地址的步骤;及
    当监测到所述应用主进程未再次开启,关闭所述应用主进程对应的所述应用辅助进程。
  4. 根据权利要求2所述的方法,其特征在于,所述在检测到异常关闭时,保持所述应用辅助进程处于运行状态之后,还包括:
    展示是否开启应用程序的确认窗口;
    获取根据所述确认窗口中触发的应用程序开启指令;及
    根据所述应用程序开启指令再次开启所述应用主进程。
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复之前,包括:
    提取再次开启的应用主进程中的内存地址;
    将提取到的内存地址与所述获取到的内存地址进行比较;及
    若所述提取到的内存地址与所述获取到的内存地址不相同,执行所述将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数 据恢复的步骤。
  6. 一种应用程序数据恢复装置,包括:
    指令获取模块,用于获取应用程序开启指令;
    进程开启模块,用于根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;
    异常检测模块,用于检测所述应用主进程是否异常关闭;
    运行保持模块,用于在检测到异常关闭时,保持所述应用辅助进程处于运行状态;
    地址获取模块,用于当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址;及
    地址写入模块,用于将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。
  7. 根据权利要求6所述的装置,其特征在于,所述进程开启模块包括:
    内存容量获取模块,用于获取所述应用程序开启指令中的应用所需内存容量;
    内存空间确定模块,用于根据所述应用所需内存容量确定内存空间,并获取确定的内存空间的内存地址;
    应用进程开启模块,用于开启应用主进程和应用辅助进程;及
    内存地址写入模块,用于将获取的内存地址分别写入所述应用主进程和所述应用辅助进程的地址空间。
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    开启监测模块,用于监测在预设时间段内所述应用主进程是否再次开启;
    进程关闭模块,用于当监测到所述应用主进程未再次开启,关闭所述应用主进程对应的所述应用辅助进程;及
    所述地址获取模块还用于当监测到所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址。
  9. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    窗口确认模块,用于展示是否开启应用程序的确认窗口;
    再次开启模块,用于获取根据所述确认窗口中触发的应用程序开启指令;及根据所述应用程序开启指令再次开启所述应用主进程。
  10. 根据权利要求6-9所述的装置,其特征在于,所述装置还包括:
    地址提取模块,用于提取再次开启的应用主进程中的内存地址;
    地址比较模块,用于将提取到的内存地址与所述获取到的内存地址进行比较;及
    所述地址写入模块还用于若所述提取到的内存地址与所述获取到的内存地址不相同,执行所述将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复的步骤。
  11. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取应用程序开启指令;
    根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;
    检测所述应用主进程是否异常关闭;
    在检测到异常关闭时,保持所述应用辅助进程处于运行状态;
    当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址;及
    将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存,包括:
    获取所述应用程序开启指令中的应用所需内存容量;
    根据所述应用所需内存容量确定内存空间,并获取确定的内存空间的内存地址;
    开启应用主进程和应用辅助进程;及
    将获取的内存地址分别写入所述应用主进程和所述应用辅助进程的地址空间。
  13. 根据权利要求12所述的计算机设备,其特征在于,所述在检测到异常关闭时,保持所述应用辅助进程处于运行状态之后,所述处理器执行所述计算机可读指令时还执行以下步骤:
    监测在预设时间段内所述应用主进程是否再次开启;
    当监测到所述应用主进程再次开启时,执行所述从所述应用辅助进程中获取内存地址的步骤;及
    当监测到所述应用主进程未再次开启,关闭所述应用主进程对应的所述应用辅助进程。
  14. 根据权利要求12所述的计算机设备,其特征在于,所述在检测到异常关闭时,保持所述应用辅助进程处于运行状态之后,所述处理器执行所述计算机可读指令时还执行以下步骤:
    展示是否开启应用程序的确认窗口;
    获取根据所述确认窗口中触发的应用程序开启指令;及
    根据所述应用程序开启指令再次开启所述应用主进程。
  15. 根据权利要求11-14中任一项所述的计算机设备,其特征在于,所述将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程 序数据恢复之前,所述处理器执行所述计算机可读指令时还执行以下步骤:
    提取再次开启的应用主进程中的内存地址;
    将提取到的内存地址与所述获取到的内存地址进行比较;及
    若所述提取到的内存地址与所述获取到的内存地址不相同,执行所述将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复的步骤。
  16. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取应用程序开启指令;
    根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存;
    检测所述应用主进程是否异常关闭;
    在检测到异常关闭时,保持所述应用辅助进程处于运行状态;
    当所述应用主进程再次开启时,从所述应用辅助进程中获取内存地址;及
    将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复。
  17. 根据权利要求16所述的存储介质,其特征在于,所述根据所述应用程序开启指令开启应用主进程和应用辅助进程,所述应用主进程和所述应用辅助进程共享内存,包括:
    获取所述应用程序开启指令中的应用所需内存容量;
    根据所述应用所需内存容量确定内存空间,并获取确定的内存空间的内存地址;
    开启应用主进程和应用辅助进程;及
    将获取的内存地址分别写入所述应用主进程和所述应用辅助进程的地址空间。
  18. 根据权利要求17所述的存储介质,其特征在于,所述在检测到异常关闭时,保持所述应用辅助进程处于运行状态之后,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    监测在预设时间段内所述应用主进程是否再次开启;
    当监测到所述应用主进程再次开启时,执行所述从所述应用辅助进程中获取内存地址的步骤;及
    当监测到所述应用主进程未再次开启,关闭所述应用主进程对应的所述应用辅助进程。
  19. 根据权利要求17所述的存储介质,其特征在于,所述在检测到异常关闭时,保持所述应用辅助进程处于运行状态之后,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    展示是否开启应用程序的确认窗口;
    获取根据所述确认窗口中触发的应用程序开启指令;及
    根据所述应用程序开启指令再次开启所述应用主进程。
  20. 根据权利要求16-19中任一项所述的存储介质,其特征在于,所述将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复之前,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    提取再次开启的应用主进程中的内存地址;
    将提取到的内存地址与所述获取到的内存地址进行比较;及
    若所述提取到的内存地址与所述获取到的内存地址不相同,执行所述将获取到的内存地址写入再次开启的应用主进程,使所述应用主进程根据写入的内存地址进行应用程序数据恢复的步骤。
PCT/CN2018/080051 2017-07-24 2018-03-22 应用程序数据恢复方法和装置、计算机设备和存储介质 WO2019019672A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710608521.9 2017-07-24
CN201710608521.9A CN107729128B (zh) 2017-07-24 2017-07-24 应用程序数据恢复方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2019019672A1 true WO2019019672A1 (zh) 2019-01-31

Family

ID=61201121

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/080051 WO2019019672A1 (zh) 2017-07-24 2018-03-22 应用程序数据恢复方法和装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN107729128B (zh)
WO (1) WO2019019672A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729128B (zh) * 2017-07-24 2019-09-24 深圳壹账通智能科技有限公司 应用程序数据恢复方法、装置、计算机设备和存储介质
CN111198812B (zh) * 2018-11-20 2024-02-09 深圳市优必选科技有限公司 一种应用故障检测方法、应用故障检测装置及终端设备
CN113568748B (zh) * 2021-07-27 2024-06-18 Oppo广东移动通信有限公司 一种应用进程处理方法、装置、存储介质及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102308285A (zh) * 2011-07-26 2012-01-04 华为技术有限公司 一种应用程序的内存错误修复方法
CN104216771A (zh) * 2013-05-30 2014-12-17 华为技术有限公司 软件程序的重启方法及装置
CN104714861A (zh) * 2013-12-16 2015-06-17 阿里巴巴集团控股有限公司 场景恢复数据保存方法、应用运行方法、装置及系统
CN105204977A (zh) * 2014-06-30 2015-12-30 中兴通讯股份有限公司 一种系统异常的捕获方法、主系统、影子系统及智能设备
CN107729128A (zh) * 2017-07-24 2018-02-23 上海壹账通金融科技有限公司 应用程序数据恢复方法、装置、计算机设备和存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955817A (zh) * 2011-08-30 2013-03-06 腾讯数码(深圳)有限公司 一种基于共享内存的对象管理与恢复方法及系统
CN105335171B (zh) * 2014-06-24 2019-05-10 北京奇虎科技有限公司 应用程序常驻操作系统后台的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102308285A (zh) * 2011-07-26 2012-01-04 华为技术有限公司 一种应用程序的内存错误修复方法
CN104216771A (zh) * 2013-05-30 2014-12-17 华为技术有限公司 软件程序的重启方法及装置
CN104714861A (zh) * 2013-12-16 2015-06-17 阿里巴巴集团控股有限公司 场景恢复数据保存方法、应用运行方法、装置及系统
CN105204977A (zh) * 2014-06-30 2015-12-30 中兴通讯股份有限公司 一种系统异常的捕获方法、主系统、影子系统及智能设备
CN107729128A (zh) * 2017-07-24 2018-02-23 上海壹账通金融科技有限公司 应用程序数据恢复方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CN107729128B (zh) 2019-09-24
CN107729128A (zh) 2018-02-23

Similar Documents

Publication Publication Date Title
EP2763034B1 (en) Method and device for image-capturing application screen for use in mobile terminal
WO2018120722A1 (zh) 异步接口测试方法、终端、设备、系统及存储介质
WO2019019672A1 (zh) 应用程序数据恢复方法和装置、计算机设备和存储介质
US20170104861A1 (en) Electronic device monitoring method and apparatus
US20150205498A1 (en) Automatic wallpaper image changer for a computing device
CN108364670B (zh) 读写压力测试方法、装置、设备及存储介质
CN103514075B (zh) 在移动终端中监控api函数调用的方法和装置
KR20170046714A (ko) 단말기 장치에서 스크린 캡처 서비스를 제공하는 방법, 장치, 저장 매체 및 기기
US20240348590A1 (en) Delayed user authentication
WO2019019356A1 (zh) 应用程序测试方法、装置、计算机设备和存储介质
US20240171485A1 (en) Standardizing analysis metrics across multiple devices
CN114184885A (zh) 一种故障检测方法、装置及存储介质
WO2024022399A1 (zh) 基于rpa和ai的ia机器人监控方法及装置
CN112486838A (zh) 接口测试方法、装置、计算机设备和存储介质
US10063558B2 (en) Method for blocking unauthorized data access and computing device with feature of blocking unauthorized data access
WO2017193475A1 (zh) 应用程序的管理方法及装置
CN109324822B (zh) Pwa项目检测方法、计算机可读存储介质及终端设备
JP2007279682A (ja) メッセージウィンドウ表示制御装置、方法、プログラム及びコンピュータ読み取り可能な記録媒体
US10621015B2 (en) Notification for unsaved data
CN114826886B (zh) 一种应用软件容灾方法、装置及电子设备
US11907599B2 (en) Information processing method, apparatus, electronic device, and storage medium
CN105893867A (zh) 终端设备的操作方法和终端设备
WO2022083190A1 (zh) 数据下载方法、装置、计算机设备和存储介质
CN112559248B (zh) 预处理服务恢复方法、装置、设备及存储介质
CN110704247B (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: 18837827

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18837827

Country of ref document: EP

Kind code of ref document: A1

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 28.05.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18837827

Country of ref document: EP

Kind code of ref document: A1