[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN104750579B - The method and apparatus for making memory mirror - Google Patents

The method and apparatus for making memory mirror Download PDF

Info

Publication number
CN104750579B
CN104750579B CN201510174738.4A CN201510174738A CN104750579B CN 104750579 B CN104750579 B CN 104750579B CN 201510174738 A CN201510174738 A CN 201510174738A CN 104750579 B CN104750579 B CN 104750579B
Authority
CN
China
Prior art keywords
mirror image
memory
memory mirror
database
terminal equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510174738.4A
Other languages
Chinese (zh)
Other versions
CN104750579A (en
Inventor
沙金川
汤晓迪
任学亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510174738.4A priority Critical patent/CN104750579B/en
Publication of CN104750579A publication Critical patent/CN104750579A/en
Application granted granted Critical
Publication of CN104750579B publication Critical patent/CN104750579B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present invention provides a kind of method and apparatus for making memory mirror, and this method includes:Terminal device judges terminal device state in which, if terminal device is in memory mirror and makes state, then terminal device is before first application file starts, memory mirror making processing is carried out under the triggering opening pattern of database service, terminal device starts first application file after memory mirror completes.The method and apparatus provided in an embodiment of the present invention for making memory mirror can improve the reliability of system.

Description

Method and device for manufacturing memory mirror image
Technical Field
The present invention relates to communications technologies, and in particular, to a method and an apparatus for making a memory mirror image.
Background
The memory mirror image is to copy the memory data in two copies, and to put them in the main memory and the mirror image memory, respectively, to prevent the permanent loss of data caused by the memory failure, therefore, the terminal device can use this characteristic to make a memory mirror image of the memory state at a certain moment and to perform the on-site recovery according to the memory mirror image, thereby achieving the purpose of fast booting.
In the prior art, when a memory mirror image technology is used for realizing quick startup, if a memory mirror image is manufactured before a user uses a terminal device, and after the user uses the terminal device, a system, an application state or a setting value may be changed due to certain operations, the changes are stored in a storage medium through a file system, and if the user uses the terminal device for a period of time, the quick startup is realized through the memory mirror image technology, at the moment, data in the memory mirror image may not be consistent with data in the storage medium, so that the file system is directly crashed, and the file system is not usable any more. In order to solve this problem, in the prior art, a memory mirror image is generally performed on the latest memory state before the terminal device is turned off each time, so as to ensure that the memory mirror image is consistent with data in the storage medium.
However, in the process of manufacturing the memory mirror image each time, it is necessary to ensure stable power supply of the terminal device, and if the power is suddenly cut off, the memory mirror image manufacturing fails, which results in the memory mirror image manufacturing failure, and the memory mirror image technology cannot be used to realize quick start-up when the system is started next time, so that the reliability of the system is not high.
Disclosure of Invention
The embodiment of the invention provides a method and a device for manufacturing a memory mirror image, which are used for improving the reliability of a system.
In a first aspect, an embodiment of the present invention provides a method for manufacturing a memory mirror image, including:
the terminal equipment judges the state of the terminal equipment;
if the terminal equipment is in the memory mirror image manufacturing state, before the terminal equipment starts the first application file, memory mirror image manufacturing processing is carried out in a triggering opening mode of database service;
and the terminal equipment starts the first application file after the memory mirror image is manufactured.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the triggered opening mode is a processing mode that opens a database file when the terminal device detects a database operation request, and closes the database file when the terminal device does not detect the database operation request or detects that access to the database operation request is completed.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, before the performing the memory mirroring creation processing in the triggered open mode of the database service, the method further includes:
the terminal equipment configures a compiling item for the system file so as to release the coupling between the data in the memory and the data in the storage medium;
then, the performing memory mirroring in the triggered open mode of the database service includes:
and after the terminal equipment releases the coupling between the data in the memory and the data in the storage medium, performing memory mirror image manufacturing processing in a triggering opening mode of the database service.
With reference to the first aspect and any one of the first to the second possible implementation manners of the first aspect, in a third possible implementation manner of the first aspect, before performing the memory mirroring manufacturing process in the triggered open mode of the database service, the method further includes:
the terminal equipment judges whether the working mode of the database service is a long-term open mode or not;
and if the working mode of the database service is a long-term opening mode, switching the working mode of the database service from the long-term opening mode to the trigger opening mode.
With reference to the first aspect, in a fourth possible implementation manner of the first aspect, the method further includes:
if the terminal equipment is in the mirror image recovery state, switching the working mode of the database service from the trigger opening mode to a long-term opening mode;
and the terminal equipment reads the memory mirror image in a long-term open mode of the database service so as to start a local application file.
With reference to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the reading the memory image to start a local application file specifically includes:
the terminal device triggers a background service for restoring the memory mirror image to send a notification message to other background services except the background service for restoring the memory mirror image, so that the other background services read the memory mirror image when recognizing that the notification message is a memory mirror image restoring message;
and the terminal equipment starts a local application file according to the read memory mirror image.
In a second aspect, an embodiment of the present invention provides a method for manufacturing a memory mirror image, including:
the terminal equipment judges the state of the terminal equipment;
if the terminal equipment is in the memory mirror image manufacturing state, before the terminal equipment starts the first application file and before the terminal equipment starts the database service, memory mirror image manufacturing processing is carried out;
and the terminal equipment starts the first application file after the memory mirror image is manufactured.
In a third aspect, an embodiment of the present invention provides an apparatus for manufacturing a memory mirror, including:
the judging module is used for judging the state of the terminal equipment;
the processing module is used for carrying out mirror image manufacturing processing in a triggering opening mode of a database service before starting a first application file when the judging module judges that the terminal equipment is in a memory mirror image manufacturing state;
and the starting module is used for starting the first application file after the memory mirror image is manufactured.
With reference to the third aspect, in a first possible implementation manner of the third aspect, the apparatus further includes: the detection module is used for detecting whether a database operation request exists or whether the access of the database operation request is finished;
the triggered opening mode is a processing mode for opening a database file when the detection module detects a database operation request, and closing the database file when the detection module does not detect the database operation request or detects that the access of the database operation request is finished.
With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the processing module is further configured to configure a compilation item for the system file to decouple data in the memory from data in the storage medium;
the processing module is further configured to perform memory mirroring in the triggered open mode of the database service after decoupling the data in the memory from the data in the storage medium.
With reference to the third aspect and the second possible implementation manner of any one of the first to third aspects of the third aspect, in a third possible implementation manner of the third aspect, the apparatus further includes a switching module; wherein,
the judging module is also used for judging whether the working mode of the database service is a long-term open mode;
the switching module is configured to switch the working mode of the database service from the long-term open mode to the trigger open mode when the working mode of the database service is the long-term open mode.
With reference to the third aspect, in a fourth possible implementation manner of the third aspect, the apparatus further includes a switching module; wherein,
the switching module is used for switching the working mode of the database service from the trigger opening mode to a long-term opening mode if the judging module judges that the terminal equipment is in the mirror image recovery state;
the starting module is further configured to read the memory mirror image in a long-term open mode of the database service to start a local application file.
With reference to the fourth possible implementation manner of the third aspect, in a fifth possible implementation manner of the third aspect, the starting module includes:
the trigger unit is used for triggering the background service for restoring the memory mirror image to send a notification message to other background services except the background service for restoring the memory mirror image, so that the other background services read the memory mirror image when recognizing that the notification message is the memory mirror image restoring message;
and the starting unit is used for starting the local application file according to the read memory mirror image.
In a fourth aspect, an embodiment of the present invention provides an apparatus for manufacturing a memory mirror image, including:
the judging module is used for judging the state of the terminal equipment;
the processing module is used for carrying out memory mirror image manufacturing processing before starting the first application file and before starting the database service when the judging module judges that the terminal equipment is in the memory mirror image manufacturing state;
and the starting module is used for starting the first application file after the memory mirror image is manufactured.
According to the method and the device for manufacturing the memory mirror image, provided by the embodiment of the invention, the terminal device judges the state of the terminal device, if the terminal device is judged to be in the memory mirror image manufacturing state, the terminal device performs mirror image manufacturing processing in a triggering opening mode of a database service before starting a first application file, and the terminal device starts the first application file after the memory mirror image is manufactured. Because the memory mirror image is manufactured in the triggering opening mode of the database service and before the first application file is started, the data coupling can be effectively removed, the dependence between the data of the file system in the memory and the data in the storage medium is removed, and the reliability of the system is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic flowchart illustrating a first embodiment of a method for manufacturing a memory mirror image according to the present invention;
FIG. 2 is a flowchart illustrating a second embodiment of a method for manufacturing a memory mirror image according to the present invention;
FIG. 3 is a flowchart illustrating a third embodiment of a method for manufacturing a memory mirror image according to the present invention;
FIG. 4 is a schematic structural diagram of a first apparatus for manufacturing a memory mirror image according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a second apparatus for manufacturing a memory mirror image according to the present invention;
FIG. 6 is a schematic structural diagram of a third apparatus for manufacturing a memory mirror image according to the present invention;
FIG. 7 is a schematic structural diagram illustrating a fourth apparatus for manufacturing a memory mirror image according to the present invention;
fig. 8 is a schematic structural diagram of a first terminal device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a second terminal device according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating a first embodiment of a method for manufacturing a memory mirror image according to the present invention. The embodiment of the invention provides a method for manufacturing a memory mirror image, which can be executed by any device for executing the method for manufacturing the memory mirror image, and the device can be realized by software and/or hardware. In this embodiment, the apparatus may be integrated in a terminal device. As shown in fig. 1, the method of this embodiment may include:
step 101, the terminal device judges the state of the terminal device.
In this embodiment, after the terminal device is powered on, it may be determined whether the terminal device is in the memory mirror image making state or the mirror image recovery state. In practical applications, the state of the terminal device can be determined by setting a configuration value in the system, for example: if the configuration value is 0, it can be determined that the terminal device is in the mirror image making state, and if the configuration value is 1, it can be determined that the terminal device is in the mirror image recovery state. It should be noted that the corresponding relationship between the configuration value and the state of the terminal device may be set according to actual needs, which is not limited in the present invention.
Step 102, if the terminal device is in the memory mirror image making state, before the terminal device starts the first application file, performing memory mirror image making processing in a triggered open mode of the database service.
In this embodiment, after the terminal device is started, the boot subsystem is generally started first, and after the boot subsystem is successfully started, the hardware device is initialized, and then the main system is started, and the main system sequentially loads application files, including loading database services, an application manager, and the like. For example: in an embedded operating system, a BootLoader of a boot small system is generally started first to initialize hardware equipment, establish a memory space map and the like, so that the software and hardware environment of the system is brought to a proper state to prepare for loading a main system and other application files. Optionally, the terminal device may be an intelligent terminal device, such as a smart phone, a PAD, and the like.
It should be noted that, in the prior art, after the database service is started, the database file is continuously opened and the handle of the file is held for a long time, so as to perform operations such as querying, inserting, or deleting data. At this time, when a background application file is started, the system, the application state or the setting value may be changed, and since the database file is in an open state, the changed data is stored in the database file, so that dependency is generated between the data of the file system in the memory and the data in the storage medium. To solve this problem, in this embodiment, the operation mode of the database service needs to be the toggle-on mode. In practical application, the database service may be directly started in a default trigger open mode, or the terminal device may detect the entire system when the database service is started, and if it is known that the system is in a state of making a memory mirror image at this time, the working mode of the database service is switched from a long-term open mode to the trigger open mode. It should be noted that, in this embodiment, the working mode of the database service may be a default mode, or may also be a subsequent setting mode, but may also be another mode, as long as the working mode is guaranteed to be the trigger open mode, which is not limited in the present invention. In addition, the storage medium includes a database, a magnetic disk, and other systems or devices that can store data, and the embodiment is not particularly limited in this regard as to the specific form of the storage medium.
For example, taking the Android system as an example for detailed description, after the Android system is started for the first time, the Service Manager (Service Manager) is started by an initialization (Init) process, and the Service Manager sequentially starts other background services including database services (Sqlite), and the like, where the database services may be started directly in a default trigger open mode, or the terminal device may detect the entire system when the database services are started, and if it is known that the system is in a state of making a memory mirror image at this time, the working mode of the database services is switched from a long-term open mode to the trigger open mode.
In this embodiment, after the terminal device finishes scanning all the application files, when the application management service in the terminal device prepares to start the first application file, the memory mirror image manufacturing process is triggered, so as to manufacture the memory mirror image. At this time, because all the application files are not started, and the working mode of the database service is still the trigger open mode, i.e. the database operation is in the loose coupling state, no dependency is generated between the data in the file system in the memory and the data in the storage medium. Meanwhile, all files required by starting are ready at the moment, and the system is at the moment of starting the first application file, so that the moment is the optimal time for manufacturing the memory mirror image, and the manufactured memory mirror image meets the time requirement of quick starting. For example: in the Android system, after an Application Manager (Application Manager) is started by a service Manager, the Application Manager prepares to start an Application file, and before an Application server starts a first Application file, a memory mirror image manufacturing process is triggered to complete the manufacturing of a memory mirror image.
And 103, after the terminal equipment finishes the manufacture of the memory mirror image, starting the first application file.
In this embodiment, after the memory mirror image is manufactured, the terminal device starts a first application file, and starts local application files, including a desktop starter and other preloaded applications, in sequence from the first application file to complete a boot process.
It should be noted that, in the triggered open mode of the database service, after the memory image is made before the first application file is started, when the terminal device is powered on again or restarted again, the memory image can be used for performing field recovery, so as to achieve the purpose of fast startup. The platform services include system background services which exist in the memory image and are started, such as network services, power supply services and the like. For the application files, all the application files are not started when the memory mirror image is manufactured, so that the application files can be loaded by using the latest data value without any modification, and therefore, the memory mirror image manufactured by adopting the method not only avoids the phenomenon that the memory mirror image is required to be manufactured for one time in the latest memory state before the terminal equipment is closed every time in the prior art, but also improves the practicability of the system.
In the method for manufacturing a memory mirror image provided in the embodiment of the present invention, the terminal device determines the state of the terminal device, and if the terminal device is determined to be in the memory mirror image manufacturing state, the terminal device performs memory mirror image manufacturing processing in a triggered open mode of a database service before starting the first application file, and starts the first application file after the memory mirror image is manufactured. Because the memory mirror image is manufactured in the triggering opening mode of the database service and before the first application file is started, the data coupling can be effectively removed, the dependence between the data of the file system in the memory and the data in the storage medium is removed, and the reliability of the system is improved.
Optionally, the triggered opening mode is a processing mode that the database file is opened when the terminal device detects a database operation request, and the database file is closed when the terminal device detects that the database operation request is not detected or detects that the access of the database operation request is finished.
Specifically, when a specific database operation request is detected, the terminal device opens the database file, and when the database operation request is not detected or the access of the database operation request is finished, the database file is immediately closed, and the long-term dependence of the data on the storage medium can be relieved by adopting a triggered opening mode, wherein the database operation request can be, for example, operations such as query, addition, deletion and the like.
Optionally, the terminal device configures a compilation item for the system file to decouple data in the memory from data in the storage medium;
then, the memory mirroring is performed in a triggered open mode of the database service, which includes:
and after the terminal equipment releases the coupling between the data in the memory and the data in the storage medium, performing memory mirroring manufacturing processing in a triggered opening mode of the database service.
Specifically, if there is a phenomenon that some function options are not coupled through the database, the coupling can be released in the compiling stage. In practical application, the terminal device can close some function options for generating data coupling by configuring the compiling item of the system file to remove the compiling options for generating the dependency, so that the coupling between the data in the memory and the data in the storage medium is removed, and the purpose of removing the dependency between the data in the file system in the memory and the data in the storage medium is achieved. For example: for the Android system, a user compiling mode can be adopted for static compiling, and then odex files generated by a dalvik virtual machine for debugging are generated under the condition that the eng mode is not generated during running. And after the generated data coupling is released in the compiling stage, carrying out memory mirror image manufacturing processing in a triggering opening mode of database service.
Optionally, before performing the memory mirroring manufacturing process in the triggered open mode of the database service, the method further includes: the terminal equipment judges whether the working mode of the database service is a long-term open mode or not; and if the working mode of the database service is the long-term opening mode, switching the working mode of the database service from the long-term opening mode to the trigger opening mode.
In the method for manufacturing a memory mirror image provided in the embodiment of the present invention, the terminal device determines the state of the terminal device, and if the terminal device is determined to be in the memory mirror image manufacturing state, the terminal device manufactures the memory mirror image in the triggered open mode of the database service before starting the first application file, and starts the first application file after the memory mirror image is manufactured. Because the memory mirror image is manufactured in the triggering opening mode of the database service and before the first application file is started, the data coupling can be effectively removed, the dependence between the data of the file system in the memory and the data in the storage medium is removed, and the reliability of the system is improved. In addition, when the terminal device configures the compiling item of the system file, the compiling option generating the dependency can be removed to release the coupling of the data, and the consistency of the data in the memory mirror image and the data in the storage medium is ensured.
Fig. 2 is a schematic flow chart of a second method for manufacturing a memory mirror image according to the present invention, and this embodiment describes in detail an embodiment in which a terminal device uses a memory mirror image to realize a fast boot based on the first method for manufacturing a memory mirror image. As shown in fig. 2, the method of this embodiment may include:
step 201, the terminal device determines the state of the terminal device.
Step 201 is similar to step 101 and will not be described herein again.
Step 202, if the terminal device is in the mirror image recovery state, switching the working mode of the database service from the trigger open mode to the long-term open mode.
In this embodiment, when the user powers on the terminal device again and performs field recovery from the memory mirror image, the terminal device performs judgment, and if it is known that the system is in the mirror image recovery state at this time, the working mode of the database service is switched from the trigger open mode to the long-term open mode again, and at this time, the database service is continuously opened and holds a handle of a file for a long time, that is, the performance of the database service is recovered to the normal use state, so as to complete operations such as query, insertion, or deletion of data. For example: in the Android system, after a user powers on a terminal device again, the BootLoader performs mirror image recovery, at this time, the working mode of a database service (Sqlite) is switched to a long-term open mode again from a trigger open mode, and the database service holds db file handles for a long time.
Step 203, the terminal device reads the memory mirror image in the long-term open mode of the database service to start the local application file.
In this embodiment, after the working mode of the database service is switched to the long-term open mode, the terminal device may read the memory image according to the manufactured memory image to complete the boot process of the terminal device, in a specific implementation process, the terminal device only needs to synchronously refresh some data values in the latest state of the platform service, in the specific implementation process, the background service responsible for image recovery sends a notification message to other background services except the background service responsible for memory image recovery, and after receiving the notification message, if it is identified that the data value in the database is recovered from the memory image according to the notification message, the other background services only need to re-read the data in the database and apply the data value in the latest state. The platform services include system background services which exist in the memory image and are started, such as network services, power supply services and the like. For the application files, all the application files are not started when the memory mirror image is manufactured, so that the application files can be loaded by using the latest data value without any modification. In addition, because the data in the memory mirror image and the data in the storage medium are in a loose coupling state, the system can not be crashed in the process of quick startup. Therefore, the terminal device can smoothly start the desktop application and other services defined as preloaded, for example, the desktop Launcher and other preloaded applications.
In the method for manufacturing a memory mirror image provided in the embodiment of the present invention, the terminal device determines the state of the terminal device, and if the terminal device is determined to be in the memory mirror image manufacturing state, the terminal device manufactures the memory mirror image in the triggered open mode of the database service before starting the first application file, and starts the first application file after the memory mirror image is manufactured. Because the memory mirror image is manufactured in the triggering opening mode of the database service and before the first application file is started, the data coupling can be effectively removed, the dependence between the data of the file system in the memory and the data in the storage medium is removed, and the reliability of the system is improved. In addition, when the terminal equipment is in the mirror image recovery state, the working mode of the database service is switched to a long-term opening mode, and the memory mirror image is read in the working mode, so that the aim of quickly starting the terminal equipment by using the memory mirror image is fulfilled.
Fig. 3 is a flowchart illustrating a third embodiment of a method for manufacturing a memory mirror image according to the present invention. The embodiment of the invention provides a method for manufacturing a memory mirror image, which can be executed by any device for executing the method for manufacturing the memory mirror image, and the device can be realized by software and/or hardware. In this embodiment, the apparatus may be integrated in a terminal device. As shown in fig. 3, the method of this embodiment may include:
step 301, the terminal device determines the state of the terminal device.
In this embodiment, after the terminal device is powered on, it may be determined whether the terminal device is in the memory mirror image making state or the mirror image recovery state. In practical applications, the state of the terminal device can be determined by setting a configuration value in the system, for example: if the configuration value is 0, it can be determined that the terminal device is in the mirror image making state, and if the configuration value is 1, it can be determined that the terminal device is in the mirror image recovery state. It should be noted that the corresponding relationship between the configuration value and the state of the terminal device may be set according to actual needs, which is not limited in the present invention.
Step 302, if the terminal device is in the memory mirror image making state, the terminal device performs memory mirror image making processing before starting the first application file and before starting the database service.
In the prior art, after a database service is started, a database file is continuously opened and a handle of the file is held for a long time to perform operations such as query, insertion or deletion of data, at this time, when a background application file is started, a system, an application state or a setting value may be changed, and since the database file is in an open state, the changed data is stored in the database file, so that dependency is generated between data of a file system in a memory and data in a storage medium. In order to solve this problem, in this embodiment, if the terminal device is in the memory mirror image making state, after the terminal device finishes scanning all the application files, before starting the first application file and before starting the database service, a memory mirror image making process is triggered, so as to make a memory mirror image. At this time, since all the application files are not started and the database service is not started, there is no dependency between the data in the file system in the memory and the data in the storage medium.
Step 303, after the terminal device completes the manufacture of the memory mirror image, starting the first application file.
In this embodiment, after the memory mirror image is manufactured, the terminal device starts a first application file, and starts local application files, including a desktop starter and other preloaded applications, in sequence from the first application file to complete a boot process.
In the method for manufacturing a memory mirror image provided in the embodiment of the present invention, the terminal device determines the state of the terminal device, and if the terminal device is determined to be in the memory mirror image manufacturing state, the terminal device performs memory mirror image manufacturing processing before starting the first application file and before starting the database service, and starts the first application file after the memory mirror image is manufactured. Because the memory mirror image is manufactured before the first application file is started and before the database service is started, the data coupling can be effectively released, the dependence between the data of the file system in the memory and the data in the storage medium is released, and the reliability of the system is improved.
Fig. 4 is a schematic structural diagram of a first apparatus for manufacturing a memory mirror image according to an embodiment of the present invention. As shown in fig. 4, the apparatus 400 for manufacturing a memory image according to an embodiment of the present invention includes a determining module 401, a processing module 402, and a starting module 403.
The judging module 401 is configured to judge the state of the terminal device; the processing module 402 is configured to perform memory mirroring processing in a triggered open mode of a database service before starting the first application file when the determining module 401 determines that the terminal device is in the memory mirroring processing state; the starting module 403 is configured to start the first application file after the memory image is manufactured.
In the apparatus for manufacturing a memory mirror image according to the embodiment of the present invention, by determining the state of the terminal device, if it is determined that the terminal device is in the memory mirror image manufacturing state, before starting the first application file, the memory mirror image manufacturing process is performed in a triggered open mode of a database service, and after the memory mirror image manufacturing is completed, the first application file is started. Because the memory mirror image is manufactured in the triggering opening mode of the database service and before the first application file is started, the data coupling can be effectively removed, the dependence between the data of the file system in the memory and the data in the storage medium is removed, and the reliability of the system is improved.
Fig. 5 is a schematic structural diagram of a second apparatus for manufacturing a memory mirror image according to the present invention, and as shown in fig. 5, in this embodiment, on the basis of the embodiment shown in fig. 4, the apparatus 400 further includes a detection module 404.
The detecting module 404 is configured to detect whether a database operation request exists, or whether access of the database operation request is finished; the triggered open mode is a processing mode that opens a database file when the detection module 404 detects a database operation request, and closes the database file when the detection module 404 does not detect the database operation request or detects that access of the database operation request is finished.
Optionally, the processing module 402 is further configured to perform configuration of compiled items on the system file to decouple data in the memory and data in the storage medium;
the processing module 402 is further configured to perform memory mirroring in the triggered open mode of the database service after decoupling data in the memory from data in the storage medium.
Optionally, the apparatus 400 further comprises a switching module 405, wherein,
the judging module 401 is further configured to judge whether a working mode of the database service is a long-term open mode;
the switching module 405 is configured to switch the working mode of the database service from the long-term open mode to the triggered open mode when the determining module 401 determines that the working mode of the database service is the long-term open mode.
The apparatus for manufacturing a memory mirror image in this embodiment may be used to implement the technical solution of the method for manufacturing a memory mirror image provided in any embodiment of the present invention, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of a third embodiment of the apparatus for manufacturing a memory mirror image according to the present invention, and as shown in fig. 6, in this embodiment, on the basis of the embodiment shown in fig. 4, the apparatus 400 further includes a switching module 406.
The switching module 406 is configured to switch the working mode of the database service from the triggered open mode to a long-term open mode when the determining module 401 determines that the terminal device is in the mirror image recovery state;
the starting module 403 is further configured to read the memory mirror image in a long-term open mode of the database service, so as to start a local application file.
Optionally, the starting module 403 includes:
the triggering unit 4031 is configured to trigger the background service for memory mirror recovery to send a notification message to other background services except the background service for memory mirror recovery, so that when the other background services recognize that the notification message is a memory mirror recovery message, the other background services read the memory mirror;
the starting unit 4032 is configured to start the local application file according to the read memory image.
The apparatus for manufacturing a memory mirror image in this embodiment may be used to implement the technical solution of the method for manufacturing a memory mirror image provided in any embodiment of the present invention, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of a fourth apparatus for manufacturing a memory mirror image according to the present invention. As shown in fig. 7, the apparatus 700 for manufacturing a memory image according to an embodiment of the present invention includes a determining module 701, a processing module 702, and a starting module 703.
The judging module 701 is configured to judge a state of the terminal device; the processing module 702 is configured to perform memory mirroring processing before starting the first application file and before starting the database service when the determining module 701 determines that the terminal device is in the memory mirroring state; the starting module 703 is configured to start the first application file after the memory image is manufactured.
The apparatus for manufacturing a memory mirror image according to the embodiment of the present invention determines the state of the terminal device, and if it is determined that the terminal device is in the memory mirror image manufacturing state, performs memory mirror image manufacturing processing before starting the first application file and before starting the database service, and starts the first application file after the memory mirror image is manufactured. Because the memory mirror image is manufactured before the first application file is started and before the database service is started, the data coupling can be effectively released, the dependence between the data of the file system in the memory and the data in the storage medium is released, and the reliability of the system is improved.
Fig. 8 is a schematic structural diagram of a terminal device according to a first embodiment of the present invention. As shown in fig. 8, the terminal device 800 provided in this embodiment includes a processor 801 and a memory 802, where the memory 802 stores an execution instruction, and when the terminal device is operated, the processor 801 communicates with the memory 802, and the processor 801 calls the execution instruction in the memory 802 to perform the following operations:
judging the state of the terminal equipment;
if the terminal equipment is in the memory mirror image manufacturing state, before starting the first application file, performing memory mirror image manufacturing processing in a triggering opening mode of database service;
and after the memory mirror image is manufactured, starting the first application file.
Optionally, the triggered opening mode is a processing mode that opens a database file when a database operation request is detected, and closes the database file when the database operation request is not detected or an access end of the database operation request is detected.
Optionally, before the memory mirroring is performed in the triggered open mode of the database service, the method further includes:
configuring a compilation item for the system file to decouple data in the memory from data in the storage medium;
then, the performing memory mirroring in the triggered open mode of the database service specifically includes:
and after the coupling between the data in the memory and the data in the storage medium is released, carrying out memory mirroring manufacturing processing in a triggered opening mode of the database service.
Optionally, before the memory mirroring is performed in the triggered open mode of the database service, the method further includes:
judging whether the working mode of the database service is a long-term open mode or not;
and if the working mode of the database service is a long-term opening mode, switching the working mode of the database service from the long-term opening mode to the trigger opening mode.
Optionally, the method further comprises:
if the terminal equipment is in the mirror image recovery state, switching the working mode of the database service from the trigger opening mode to a long-term opening mode;
and the terminal equipment reads the memory mirror image in a long-term open mode of the database service so as to start a local application file.
Optionally, the reading the memory mirror image to start a local application file specifically includes:
triggering the background service for restoring the memory mirror image to send a notification message to other background services except the background service for restoring the memory mirror image, so that the other background services read the memory mirror image when recognizing that the notification message is a memory mirror image restoring message;
and starting a local application file according to the read memory mirror image.
The terminal device provided in this embodiment may be configured to execute the technical solution of the apparatus for manufacturing a memory mirror image provided in any embodiment of the present invention, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 9 is a schematic structural diagram of a second terminal device according to the embodiment of the present invention. As shown in fig. 9, the terminal device 900 provided in this embodiment includes a processor 901 and a memory 902, where the memory 902 stores execution instructions, when the terminal device is running, the processor 901 communicates with the memory 902, and the processor 901 calls the execution instructions in the memory 902 to perform the following operations:
judging the state of the terminal equipment;
if the terminal equipment is in a memory mirror image manufacturing state, before starting the first application file and before starting the database service, performing memory mirror image manufacturing processing;
and after the memory mirror image is manufactured, starting the first application file.
The terminal device provided in this embodiment may be configured to execute the technical solution of the apparatus for manufacturing a memory mirror image provided in any embodiment of the present invention, and the implementation principle and the technical effect are similar, which are not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (14)

1. A method of making a memory mirror, comprising:
the terminal equipment judges the state of the terminal equipment;
if the terminal equipment is in the memory mirror image manufacturing state, before the terminal equipment starts the first application file, memory mirror image manufacturing processing is carried out in a triggering opening mode of database service;
and the terminal equipment starts the first application file after the memory mirror image is manufactured.
2. The method according to claim 1, wherein the triggered opening mode is a processing mode for opening a database file when the terminal device detects a database operation request, and closing the database file when the terminal device does not detect the database operation request or detects that access to the database operation request is finished.
3. The method according to claim 1 or 2, wherein before the memory mirroring process in the triggered open mode of the database service, the method further comprises:
the terminal equipment configures a compiling item for the system file so as to release the coupling between the data in the memory and the data in the storage medium;
then, the performing memory mirroring in the triggered open mode of the database service includes:
and after the terminal equipment releases the coupling between the data in the memory and the data in the storage medium, performing memory mirror image manufacturing processing in a triggering opening mode of the database service.
4. The method according to claim 1 or 2, wherein before the memory mirroring process is performed in the triggered open mode of the database service, the method further comprises:
the terminal equipment judges whether the working mode of the database service is a long-term open mode or not;
and if the working mode of the database service is a long-term opening mode, switching the working mode of the database service from the long-term opening mode to the trigger opening mode.
5. The method of claim 1, further comprising:
if the terminal equipment is in the mirror image recovery state, switching the working mode of the database service from the trigger opening mode to a long-term opening mode;
and the terminal equipment reads the memory mirror image in a long-term open mode of the database service so as to start a local application file.
6. The method according to claim 5, wherein the reading the memory image to start a local application file specifically comprises:
the terminal device triggers a background service for restoring the memory mirror image to send a notification message to other background services except the background service for restoring the memory mirror image, so that the other background services read the memory mirror image when recognizing that the notification message is a memory mirror image restoring message;
and the terminal equipment starts a local application file according to the read memory mirror image.
7. A method of making a memory mirror, comprising:
the terminal equipment judges the state of the terminal equipment;
if the terminal equipment is in the memory mirror image manufacturing state, before the terminal equipment starts the first application file and before the terminal equipment starts the database service, memory mirror image manufacturing processing is carried out;
and the terminal equipment starts the first application file after the memory mirror image is manufactured.
8. An apparatus for making a memory mirror, comprising:
the judging module is used for judging the state of the terminal equipment;
the processing module is used for carrying out memory mirror image manufacturing processing in a triggering opening mode of database service before starting the first application file when the judging module judges that the terminal equipment is in the memory mirror image manufacturing state;
and the starting module is used for starting the first application file after the memory mirror image is manufactured.
9. The apparatus of claim 8, further comprising: the detection module is used for detecting whether a database operation request exists or whether the access of the database operation request is finished;
the triggered opening mode is a processing mode for opening a database file when the detection module detects a database operation request, and closing the database file when the detection module does not detect the database operation request or detects that the access of the database operation request is finished.
10. The apparatus of claim 8 or 9, wherein the processing module is further configured to configure a compilation item for decoupling data in the memory from data in the storage medium;
the processing module is further configured to perform memory mirroring in the triggered open mode of the database service after decoupling the data in the memory from the data in the storage medium.
11. The apparatus of claim 8 or 9, further comprising a switching module; wherein,
the judging module is also used for judging whether the working mode of the database service is a long-term open mode;
the switching module is configured to switch the working mode of the database service from the long-term open mode to the trigger open mode when the judging module judges that the working mode of the database service is the long-term open mode.
12. The apparatus of claim 8, further comprising a switching module; wherein,
the switching module is used for switching the working mode of the database service from the triggering opening mode to a long-term opening mode when the judging module judges that the terminal equipment is in the mirror image recovery state;
the starting module is further configured to read the memory mirror image in a long-term open mode of the database service to start a local application file.
13. The apparatus of claim 12, wherein the activation module comprises:
the trigger unit is used for triggering the background service for restoring the memory mirror image to send a notification message to other background services except the background service for restoring the memory mirror image, so that the other background services read the memory mirror image when recognizing that the notification message is the memory mirror image restoring message;
and the starting unit is used for starting the local application file according to the read memory mirror image.
14. An apparatus for making a memory mirror, comprising:
the judging module is used for judging the state of the terminal equipment;
the processing module is used for carrying out memory mirror image manufacturing processing before starting the first application file and before starting the database service when the judging module judges that the terminal equipment is in the memory mirror image manufacturing state;
and the starting module is used for starting the first application file after the memory mirror image is manufactured.
CN201510174738.4A 2015-04-14 2015-04-14 The method and apparatus for making memory mirror Active CN104750579B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510174738.4A CN104750579B (en) 2015-04-14 2015-04-14 The method and apparatus for making memory mirror

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510174738.4A CN104750579B (en) 2015-04-14 2015-04-14 The method and apparatus for making memory mirror

Publications (2)

Publication Number Publication Date
CN104750579A CN104750579A (en) 2015-07-01
CN104750579B true CN104750579B (en) 2017-12-29

Family

ID=53590316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510174738.4A Active CN104750579B (en) 2015-04-14 2015-04-14 The method and apparatus for making memory mirror

Country Status (1)

Country Link
CN (1) CN104750579B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718263B (en) * 2016-01-19 2018-11-13 合肥联宝信息技术有限公司 A kind of method and system for realizing distributed computer based on cloud
US10474653B2 (en) * 2016-09-30 2019-11-12 Oracle International Corporation Flexible in-memory column store placement

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101794232A (en) * 2009-06-23 2010-08-04 深圳市朗科科技股份有限公司 Method for quickly starting system
CN102207881A (en) * 2011-07-07 2011-10-05 电子科技大学 Quick operation system start-up method based on Android
US8959321B1 (en) * 2009-11-25 2015-02-17 Sprint Communications Company L.P. Fast restart on a virtual machine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7694177B2 (en) * 2003-07-15 2010-04-06 International Business Machines Corporation Method and system for resynchronizing data between a primary and mirror data storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101794232A (en) * 2009-06-23 2010-08-04 深圳市朗科科技股份有限公司 Method for quickly starting system
US8959321B1 (en) * 2009-11-25 2015-02-17 Sprint Communications Company L.P. Fast restart on a virtual machine
CN102207881A (en) * 2011-07-07 2011-10-05 电子科技大学 Quick operation system start-up method based on Android

Also Published As

Publication number Publication date
CN104750579A (en) 2015-07-01

Similar Documents

Publication Publication Date Title
US9146839B2 (en) Method for pre-testing software compatibility and system thereof
JP6319609B2 (en) Reliable kernel booting method and apparatus
TWI576764B (en) A computer system
CN105607972B (en) A kind of method and device repaired extremely
KR20160110504A (en) Initialization trace of a computing device
CN105867962A (en) System upgrading method and device
CN112882734A (en) Upgrading method and device, computer equipment and medium
CN108874459B (en) Rapid starting method and device based on virtualization technology
CN104572354A (en) Backup and restoration method for operating system based on restoration service and equipment thereof
KR101974989B1 (en) Method and apparatus for determining behavior information corresponding to a dangerous file
CN110209525B (en) Operating system restoration method and device
CN104750579B (en) The method and apparatus for making memory mirror
WO2018049798A1 (en) Method and apparatus for reconstructing cache partition
CN112579361B (en) Backup data reconstruction method, device, equipment and storage medium
CN113485755B (en) Device driver verification method, device and storage medium
CN117112313B (en) Service disaster tolerance switching method, device, equipment and storage medium
CN105279011A (en) Method for performing system restoring on virtual machine according to mirror image
WO2017096889A1 (en) Method and device for upgrading and downgrading system
CN110968852B (en) Virtual machine password management method, system, equipment and computer storage medium
CN116089135A (en) Function control method, device, equipment and storage medium
KR101420026B1 (en) A method, apparatus and computer program for loading files during a boot-up process
US10095589B2 (en) System and method for optimization of operating system restore
CN112579348A (en) Method for restoring factory settings by counting system starting times
CN112579358B (en) Backup point detection method, device, equipment and storage medium
CN110197067B (en) File searching and killing method, device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant