CN108874459B - Rapid starting method and device based on virtualization technology - Google Patents

Rapid starting method and device based on virtualization technology Download PDF

Info

Publication number
CN108874459B
CN108874459B CN201710327281.5A CN201710327281A CN108874459B CN 108874459 B CN108874459 B CN 108874459B CN 201710327281 A CN201710327281 A CN 201710327281A CN 108874459 B CN108874459 B CN 108874459B
Authority
CN
China
Prior art keywords
configuration file
application
data
operating system
file
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
CN201710327281.5A
Other languages
Chinese (zh)
Other versions
CN108874459A (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 Machine Co Ltd
Original Assignee
Huawei Machine 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 Machine Co Ltd filed Critical Huawei Machine Co Ltd
Priority to CN201710327281.5A priority Critical patent/CN108874459B/en
Publication of CN108874459A publication Critical patent/CN108874459A/en
Application granted granted Critical
Publication of CN108874459B publication Critical patent/CN108874459B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Abstract

The application provides a rapid starting method and a device based on virtualization technology, the method comprises the steps of loading a mirror image file through a Virtual Machine Monitor (VMM), wherein the mirror image file comprises information which is generated in advance after snapshot is carried out on data in a memory and a first configuration file, and the first configuration file is an operating system configuration file and an application configuration file of an application program related to the setting of the operating system; starting a virtual machine according to the mirror image file; if the first configuration file in the running virtual machine has different data from the second configuration file, updating the data in the first configuration file into the data in the second configuration file, wherein the second configuration file is an operating system configuration file and an application configuration file saved by the virtual machine, and the saving time of the second configuration file is later than that of the first configuration file. The method and the device can improve the system recovery speed.

Description

Rapid starting method and device based on virtualization technology
Technical Field
The present application relates to communications technologies, and in particular, to a method and an apparatus for fast booting based on a virtualization technology.
Background
With the rapid development of terminal devices such as smart phones and vehicle-mounted navigation, intelligent operating systems such as Android/IOS platforms are increasingly applied to these products, but the service complexity of the intelligent operating systems is high, so that the startup time of the terminal devices is long.
To address this issue, virtual machine snapshot techniques can be typically utilized to speed up the boot process. When the system is started or run, making a snapshot of the whole system (including a file system in a memory and a disk) of a Guest Virtual Machine (Guest) and saving the snapshot image, and loading the whole snapshot image by a Virtual Machine Monitor (VMM) during starting so as to restore the system operation. Specifically, fig. 1 is a schematic diagram of a process of booting based on a virtual machine snapshot technology in the prior art, as shown in fig. 1, a starting process of a terminal device is as follows: (1) starting up and electrifying, and connecting the power supply according to the power supply key; (2) powering on self-test (POST), traversing system equipment, initializing, and guiding to start a loader (bootloader) program after the initialization is successful; (3) starting a loader and loading a VMM; (4) starting a VMM (virtual machine monitor) and driving initialization, and loading a Guest OS (operating system) snapshot mirror image; (5) starting a Guest Operating System (OS); (6) and entering a user operation interface.
However, when the system is started by adopting the above method, the system can only be restored to the state when the virtual machine snapshot is made.
Disclosure of Invention
The application provides a rapid starting method and device based on virtualization technology, which are used for solving the technical problem that a system can only recover to the state when a virtual machine snapshot is made when a terminal device is rapidly started.
In a first aspect, an embodiment of the present application provides a quick start method based on a virtualization technology, including:
loading a mirror image file through a Virtual Machine Monitor (VMM), wherein the mirror image file comprises information which is generated in advance after snapshot is carried out on data in a memory and a first configuration file, the first configuration file is an operating system configuration file and an application configuration file of an application program related to the setting of the operating system, the operating system configuration file is a data file used for defining the characteristics of the operating system, and the application configuration file is a file generated according to some information which is read by the operating system and is related to the running of the application;
starting a virtual machine according to the mirror image file;
if the first configuration file in the running virtual machine has different data from the second configuration file, updating the data in the first configuration file into the data in the second configuration file, wherein the second configuration file is an operating system configuration file and an application configuration file saved by the virtual machine, and the saving time of the second configuration file is later than that of the first configuration file.
In the above-mentioned fast boot method based on virtualization technology provided by the first aspect, the image file does not include data in the memory and all information on the entire disk, but only includes data in the memory and data in the first configuration file, so that the size of the image file can be reduced, and the system boot speed can be increased. In addition, the first configuration file is an operating system configuration file and an application configuration file of an application program related to operating system setting, wherein the operating system configuration file is a data file for defining operating system characteristics, the operating system characteristics generally refer to characteristics related to an operating system (but not third-party applications), namely, characteristics of the operating system, and the characteristics are generally determined by an operating system provided by a manufacturer when the device is shipped from a factory and are basic characteristics for ensuring that a user normally uses the device. The application configuration file refers to a file generated according to some information related to application running read by an operating system. Specifically, when the operating system installs an application, some information related to the running of the application is read and stored in a specific form (such as a database). At this point, the information may be generated into a file, which is the "application configuration file for the application program associated with the operating system settings". It should be noted that the system application is an application provided by a manufacturer for a system service, where the system service is provided by the manufacturer for providing a service for setting system features, such as a cell phone manager or a setting program.
In the method, the mirror image file is loaded through the VMM, after the virtual machine is started through the mirror image file, whether data different from the data in the second configuration file exists in the first configuration file in the virtual machine started through the mirror image file is judged, if the data exists, the data in the first configuration file is updated into the data in the second configuration file, and the system can be restored to the state before a certain time as the storage time of the second configuration file is later than that of the first configuration file. In addition, only the data in the memory and the first configuration file are subjected to snapshot, so that the image file is small, and the manufacturing speed of the image file and the starting speed of the system are improved.
In one possible implementation manner, the second configuration file is an operating system configuration file and an application configuration file which are saved last time before the virtual machine is restarted or powered off, and the saving time of the second configuration file is later than that of the first configuration file.
In the above possible implementation manner, since the second configuration file may be an operating system configuration file and an application configuration file that are saved last before the virtual machine is restarted, normally powered off or abnormally powered off, when data in the first configuration file is updated to data in the second configuration file, the data in the system may be restored to the latest data.
In one possible implementation, the method further includes:
controlling the application for writing data into the memory and the first configuration file to delay starting;
and creating an image file for the data in the memory and the first configuration file, wherein the image file is used for restarting or restarting the virtual machine after power failure.
In the possible implementation manner, the image file is usually made when the terminal device starts the system for the first time or starts the system for the first time after upgrading, so that the image file is made only when the data in the memory and the data in the first configuration file change, thereby avoiding the phenomenon of making the image file repeatedly before shutdown/restart, and prolonging the service life of the flash memory medium.
In addition, in order to reduce the size of the image file, in an actual application, the virtual machine generally controls other applications except the minimum system to postpone the start, and after the postponed start, the virtual machine creates the image file for the data in the memory and the first configuration file, wherein the minimum system is the most basic software environment capable of completing normal start and operation, which is an indispensable part of an operating system during working, and is capable of providing various services for system applications or system services, such as a software module composed of a kernel and a basic framework of Android in an Android system.
It should be noted that controlling other applications except the minimal system to postpone the start may include controlling other applications to be in a suspended state or in a shutdown state.
The virtual machine controls other applications except the minimum system to be started in a delayed mode to ensure that the memory is used to the minimum, so that the first configuration file is also minimum, and then the virtual machine creates the mirror image file for the data in the memory and the first configuration file, so that the size of the mirror image file can be reduced, and the recovery speed of the system can be improved.
In one possible implementation, loading an image file by a Virtual Machine Monitor (VMM) comprises:
initializing the system after the power is switched on;
starting a loader and loading a VMM;
and controlling the VMM to start and loading the image file through the VMM.
In the possible implementation manner, in the process of starting up the terminal device quickly, after the user presses the power key to turn on the power, the system is initialized, the bootloader is started, the VMM is loaded, the VMM is controlled to be started, and the image file is loaded through the VMM. Because the mirror image file is loaded through the VMM after the VMM is started, the phenomenon that the operating system needs to be started and needs to be initialized in the prior art is avoided, and therefore the starting speed of the system can be improved.
In one possible implementation, loading an image file by a Virtual Machine Monitor (VMM) comprises:
and after detecting that the virtual machine fails or is restarted, loading the mirror image file through the VMM.
In the possible implementation manner, when the VMM detects that the virtual machine fails or is restarted, the mirror image file is loaded through the VMM, and the mirror image file only includes the data in the memory and the first configuration file, so that the loaded mirror image file is relatively small, and the system starting speed can be increased.
In one possible implementation, updating data in the first configuration file to data in the second configuration file includes:
and updating the changed data in the first configuration file into the data in the second configuration file.
In the possible implementation manner, only the data changed in the first configuration file can be restored without restoring the whole first configuration file, so that partial data can be restored, and the data restoration speed can be improved.
In one possible implementation, after restoring the data in the first configuration file to the data in the second configuration file, the method further includes:
and controlling the application which is started later to continue running.
In the above possible implementation manner, after the data in the first configuration file is restored to the data in the second configuration file, the virtual machine controls the application which is delayed from starting to continue running, for example, controls the application which is in the suspended running to continue running, controls the application which is in the closed state to restart, and the like. After the system is started, the application which is controlled to be started later continues to run, so that the normal running of the system can be ensured.
In one possible implementation, the operating system configuration file includes at least one of the following files: configuration files associated with a setup application, files managed by an operating system application, or data provided by the system application to the operating system, wherein the setup application is used to make various system settings.
In the foregoing possible implementation manner, taking an Android operating system configuration file as an example, the setting application is used to perform various system settings, such as fonts, brightness, fingerprints, sounds, and the like, in a configuration file related to the setting application, and the configuration files related to these setting options all belong to the operating system configuration file. The operating system applies the managed files. For example, a desktop is a system application, a picture is set on the desktop, the picture is managed by the desktop application, and the picture managed by the desktop is also an operating system configuration file. The system applications provide data to the operating system from which the operating system can perform various operations (start, pause, resume, etc.) on the system applications.
In a possible implementation manner, the operating system is an Android operating system, and the application configuration file includes information in Android manifest.
In the above possible implementation manner, when the operating system installs the application, some information related to the running of the application is read and stored in a specific form (such as a database). At this point, the information may be generated into a file, which is the "application configuration file for the application program associated with the operating system settings". Taking an Android operating system as an example, the information read by the operating system includes: xml, such as Activity declaration, receiver declaration, uses-permission declaration, reports-screens, and so on; in addition, some information (such as an icon of an application) in the resource folder (res folder) may also be included.
In a second aspect, an embodiment of the present application provides a fast boot apparatus based on a virtualization technology, including:
the loading module is used for loading a mirror image file through a Virtual Machine Monitor (VMM), wherein the mirror image file comprises information which is generated in advance after snapshot is carried out on data in a memory and a first configuration file, the first configuration file is an operating system configuration file and an application configuration file of an application program related to the setting of the operating system, the operating system configuration file is a data file used for defining the characteristics of the operating system, and the application configuration file is a file generated according to some information read by the operating system and related to application running;
the starting module is used for starting the virtual machine according to the mirror image file;
the updating module is used for updating data in a first configuration file into data in a second configuration file when different data exist in the first configuration file and the second configuration file in the running virtual machine, wherein the second configuration file is an operating system configuration file and an application configuration file saved by the virtual machine, and the saving time of the second configuration file is later than that of the first configuration file.
In one possible implementation manner, the second configuration file is an operating system configuration file and an application configuration file which are saved last time before the virtual machine is restarted or powered off, and the saving time of the second configuration file is later than that of the first configuration file.
In one possible implementation, the apparatus further includes:
the control module is used for controlling the delayed starting of the application for writing data into the memory and the first configuration file;
and the creating module is used for creating an image file for the data in the memory and the first configuration file, and the image file is used for restarting the virtual machine again after restarting or powering off.
In a possible implementation manner, the loading module is specifically configured to:
initializing the system after the power is switched on;
starting a loader and loading a VMM;
and controlling the VMM to start and loading the image file through the VMM.
In a possible implementation manner, the loading module is specifically configured to:
and after detecting that the virtual machine fails or is restarted, loading the mirror image file through the VMM.
In a possible implementation manner, the update module is specifically configured to:
and updating the changed data in the first configuration file into the data in the second configuration file.
In one possible implementation, the control module is further configured to control the application that postpones the startup to continue running.
In one possible implementation, the operating system configuration file includes at least one of the following files: configuration files associated with a setup application, files managed by an operating system application, or data provided by the system application to the operating system, wherein the setup application is used to make various system settings.
In a possible implementation manner, the operating system is an Android operating system, and the application configuration file includes information in Android manifest.
The beneficial effects of the quick start apparatus based on the virtualization technology provided by the second aspect and each possible implementation manner of the second aspect may refer to the beneficial effects brought by the first aspect and each possible implementation manner of the first aspect, and are not described herein again.
In a third aspect, an embodiment of the present application provides a terminal device, including: a memory and a processor;
the memory is used for storing program instructions;
the processor is configured to invoke program instructions in the memory to perform the first aspect described above and various possible implementations of the first aspect.
The beneficial effects of the terminal device provided by the third aspect and each possible implementation manner of the third aspect may refer to the beneficial effects brought by the first aspect and each possible implementation manner of the first aspect, and are not described herein again.
A fourth aspect of the present application provides a fast boot apparatus based on virtualization technology, comprising at least one processing element (or chip) for performing the method of the first aspect above.
A fifth aspect of the present application provides a program for performing the method of the above first aspect when executed by a processor.
A sixth aspect of the application provides a program product, e.g. a computer readable storage medium, comprising the program of the fifth aspect.
A seventh aspect of the present application provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of the first aspect described above.
The embodiment of the application provides a quick start method and device based on virtualization technology, wherein a mirror image file is loaded through a VMM, after a virtual machine is started through the mirror image file, whether different data from those in a second configuration file exist in a first configuration file in the virtual machine started through the mirror image file is judged, if the different data exist, the data in the first configuration file are updated into the data in the second configuration file, and the system can be restored to a state before a certain time because the storage time of the second configuration file is later than that of the first configuration file. In addition, only the data in the memory and the first configuration file are subjected to snapshot, so that the image file is small, and the manufacturing speed of the image file and the recovery speed of the system are improved.
Drawings
FIG. 1 is a schematic flow chart of a prior art boot process based on a virtual machine snapshot technology;
fig. 2 is a schematic flowchart of a first embodiment of a rapid start method based on a virtualization technology according to an embodiment of the present application;
FIG. 3 is a schematic view of a process of starting up the computer;
FIG. 4 is a schematic flow chart of a fault rapid recovery;
fig. 5 is a schematic structural diagram of a first embodiment of a fast boot apparatus based on virtualization technology according to the present application;
fig. 6 is a schematic structural diagram of a second embodiment of a fast boot apparatus based on virtualization technology according to the present application;
fig. 7 is a schematic structural diagram of an embodiment of a terminal device provided in the embodiment of the present application.
Detailed Description
The rapid starting method based on the virtualization technology provided by the embodiment of the application can be applied to terminal equipment, including common computer equipment or embedded computer equipment, such as a smart phone, a vehicle-mounted intelligent terminal and the like, and is particularly applied to application scenes in which the terminal equipment needs to be rapidly started. The quick starting method related to the embodiment of the application mainly aims at the problem that when the terminal equipment is quickly started based on the virtualization technology, a system can only be restored to a state when a virtual machine snapshot is made, and the system cannot be started to a state before a certain time. In the prior art, when a system is started or operated, an image file is created for the entire system (including a file system in a memory and a disk) of a Guest virtual machine and stored, and a VMM loads the image file during starting to restore the system operation. However, if the data in the system is changed after the image file is created, when the system is quickly started by using the created image file, the system can only be restored to the state when the virtual machine snapshot is created, and cannot be restored to the state of the system before a certain time.
Therefore, the method and the device for fast starting based on the virtualization technology provided by the embodiment of the application aim to solve the technical problem that a fast starting scheme in the prior art can only restore a system to a state when a snapshot of a virtual machine is made.
The technical solution of the present application will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a schematic flowchart of a first embodiment of a rapid start method based on a virtualization technology according to an embodiment of the present application. The embodiment of the application provides a rapid starting method based on a virtualization technology, and the method can be executed by any device for executing the rapid starting method based on the virtualization technology, 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. 2, the method of this embodiment may include:
step 201, loading the image file through the VMM.
The image file comprises information which is generated in advance after data in a memory and a first configuration file are subjected to snapshot, the first configuration file is an operating system configuration file and an application configuration file of an application program related to operating system setting, the operating system configuration file is a data file used for defining operating system characteristics, and the application configuration file is a file generated according to some information read by the operating system and related to application running.
In the prior art, the image file usually contains data in the memory and all information on the entire disk, so as to start the virtual machine. In this embodiment, on one hand, in order to reduce the size of the image file and increase the system startup speed, and on the other hand, in order to restore the system to a state before a certain time, the virtual machine may only perform data backup on the data in the memory and the first configuration file to generate the image file without making a snapshot on all information in the entire disk.
In this application, the first configuration file is an operating system configuration file and an application configuration file of an application program related to operating system settings, where the operating system configuration file is a data file for defining operating system characteristics, and the operating system characteristics generally refer to characteristics related to an operating system (but not a third-party application), that is, characteristics of the operating system itself, and these characteristics are generally determined by an operating system provided by a manufacturer when the device is shipped from a factory, and are basic characteristics for ensuring that a user normally uses the device. Specifically, for example, the Android operating system configuration file may include the following types: 1) a configuration file associated with the "settings" application. The "settings" application is used to make various system settings, such as fonts, brightness, fingerprints, sounds, etc., to which the configuration files associated with these settings options belong. Similar setup options exist for other operating systems, and the configuration files associated with these setup options all belong to the operating system configuration file. 2) The operating system applies the managed files. For example, a desktop is a system application (i.e., an application that is usually provided by a vendor to provide settings for system features, such as a "settings" or "desktop" application), the desktop is provided with a picture that is managed by the desktop application, and the picture managed by the desktop is an operating system configuration file. 3) The system applications provide data to the operating system from which the operating system can perform various operations (start, pause, resume, etc.) on the system applications. For example, a WiFi application may register, for example, with a search net program, and then the operating system may invoke the search net program for WiFi if there is an application that wants to use WiFi. It should be noted that the system application refers to an application related to an operating system, and is also an application (not including a third-party application) provided by a manufacturer and required for ensuring normal operation of the system, typically, an application such as a desktop and a setup program in an Android operating system.
The application configuration file of the application program related to the operating system setting refers to a file generated according to some information related to application running read by the operating system. Specifically, when the operating system installs an application, some information related to the running of the application is read and stored in a specific form (such as a database). At this point, the information may be generated into a file, which is the "application configuration file for the application program associated with the operating system settings". Taking an Android operating system as an example, the information read by the operating system includes: 1) xml, such as Activity declaration, receiver declaration, uses-permission declaration, reports-screens, and so on; 2) some information (such as an icon of an application) in the resource folder (res folder). By storing the information, the stored information can be directly called to install the application by adopting the configuration during storage when the application is subsequently installed, so that the participation of a user is not needed, and the installation process is simplified.
Optionally, loading the image file through the VMM comprises: in the process of quickly starting the terminal equipment, after a user presses a power key to switch on a power supply, the system is initialized, a bootloader is started, a VMM is loaded, the VMM is controlled to be started, and the mirror image file is loaded through the VMM.
Specifically, fig. 3 is a schematic flowchart of a process of starting up a terminal quickly, and as shown in fig. 3, after a power supply is turned on, a terminal device performs power-on self-test (POST), traverses system devices, performs initialization, starts a loader bootloader after initialization is successful, and loads a VMM. After loading of the VMM is finished, starting and driving initialization of the control VMM, loading the mirror image file through the VMM, and then entering a user operation interface.
In this embodiment, since the mirror image file is loaded through the VMM after the VMM is started, a phenomenon that an operating system needs to be started and the operating system needs to be initialized in the prior art is avoided, so that the starting speed of the system can be increased.
Optionally, loading the image file through the VMM comprises: and after detecting that the virtual machine fails or is restarted, loading the mirror image file through the VMM.
Specifically, fig. 4 is a schematic flowchart of a failure fast recovery process, and as shown in fig. 4, when the VMM detects that the virtual machine fails or is restarted, an image file is loaded through the VMM, and then the VMM enters a user operation interface. Because the image file only comprises the data in the memory and the first configuration file, the loaded image file is small, and the system starting speed can be improved.
Optionally, no matter in the process of booting after the terminal device is normally powered off, or in the process of quickly recovering when the virtual machine fails or is restarted, before loading the image file through the VMM, the virtual machine usually needs to make the image file in advance, and in practical applications, the image file is generally made when the terminal device is first started after a system is first started or the system is upgraded, so that the image file is made only when data in the memory and data in the first configuration file change, and thus the phenomenon of repeatedly making the image file before shutdown/restart can be avoided, and the service life of the flash memory medium can be prolonged. Of course, the user may also set the time point for creating the image file according to the needs or experience of the user, for example, creating the image file once every preset time period, and the time point for creating the image file is not limited in this embodiment.
Generally, the process of making an image file by a virtual machine includes: controlling the application for writing data into the memory and the first configuration file to delay starting; and creating an image file for the data in the memory and the first configuration file, wherein the startup is postponed, and the image file is used for restarting the virtual machine again after restarting or powering off.
Specifically, in order to reduce the size of the image file, in an actual application, the VMM generally sends an instruction to the virtual machine, the virtual machine controls other applications except the minimum system to be started in a delayed manner according to the received instruction, and after the virtual machine is started in a delayed manner, the virtual machine creates the image file for the data in the memory and the first configuration file, where the minimum system is a most basic software environment capable of completing normal starting and running, and is an indispensable part of the operating system during working, and is capable of providing various services for system applications or system services, such as a software module composed of a kernel and a basic framework of Android in an Android system.
It should be noted that controlling other applications except the minimal system to postpone the start may include controlling other applications to be in a suspended state or in a shutdown state.
In addition, the step of creating the image file by the virtual machine may be executed in the process of starting the terminal device at a certain time before starting the system at this time, or may be executed in the process of starting the system at this time, and at this time, the created image file is used for restarting or restarting the virtual machine after power off.
The following describes a process for making a mirror image file by taking an example of starting a system for the first time or starting the system for the first time after upgrading the system. Specifically, after the power key is pressed to power on, the terminal device will power on self-test (POST), traverse the system device and initialize, and after the initialization is successful, start the bootloader and load the VMM. After the VMM finishes loading, the VMM is started for control and the drive is initialized, the OS is loaded through the VMM, when the data and the first configuration file in the memory are started by the OS, the virtual machine firstly controls other applications except the minimum system to delay starting so as to ensure that the memory is used for the minimum, the first configuration file is also minimum, and then the virtual machine creates a mirror image file for the data in the memory and the first configuration file, so that the size of the mirror image file can be reduced, and the recovery speed of the system can be improved.
Step 202, starting the virtual machine according to the image file.
In this embodiment, after the terminal device loads the image file through the VMM, the virtual machine is started according to the loaded image file, and because the image file includes the data in the memory and the first configuration file, the started virtual machine also includes the data in the memory and the data in the first configuration file.
Step 203, if the first configuration file in the running virtual machine has data different from the data in the second configuration file, updating the data in the first configuration file into the data in the second configuration file.
The second configuration file is an operating system configuration file and an application configuration file which are saved by the virtual machine, and the saving time of the second configuration file is later than that of the first configuration file.
In this embodiment, after the virtual machine creates the image file, the data in the operating system configuration file and the application configuration file of the application program related to the operating system setting may also change as the system continues to run, and in order to restore the system to a state before a certain time, the virtual machine needs to save the changed operating system configuration file and application configuration file, so that the saving time of the second configuration file is later than that of the first configuration file.
Optionally, the second configuration file is an operating system configuration file and an application configuration file which are saved last time before the virtual machine is restarted or powered off, and the saving time of the second configuration file is later than that of the first configuration file.
Specifically, since the second configuration file may be an operating system configuration file and an application configuration file that are saved last before the virtual machine is restarted, normally powered off or abnormally powered off, when data in the first configuration file is updated to data in the second configuration file, the data in the system may be restored to the latest data.
In practical application, when the virtual machine is in operation, the virtual machine records the update of the second configuration file at any time, that is, if a software module updates the second configuration file, the virtual machine monitors the update and records the update, for example, the update is recorded in a configuration option. More specifically, the virtual machine may further send an updated option in the second configuration file to the VMM in the form of a parameter, and after receiving the updated option, the VMM may send an instruction to the virtual machine to instruct the virtual machine to update the first configuration file.
Optionally, restoring the data in the first configuration file to the data in the second configuration file comprises: and restoring the changed data in the first configuration file into the data in the second configuration file.
Specifically, only the data that has changed in the first profile may be restored without restoring the entire first profile, and thus restoration of partial data may be performed, whereby the speed of restoring data may be increased.
In addition, when the virtual machine determines which data in the first configuration file is different from that in the second configuration file, that is, determines which option in the first configuration file is updated, the following methods may be used to implement the following steps:
the first method comprises the following steps: and the virtual machine is updated according to the recorded options and the updated numerical values in the next operation process by recording the updated options and the updated numerical values in the operation process.
Specifically, the virtual machine can record which options are updated in the running process, the updated numerical value is what, and after the virtual machine runs next time, the options with the updates are directly found for updating.
For example: the method comprises the steps of including a first configuration file A in an image file, wherein the first configuration file A comprises configuration options A1 and A2, and the default value of A1 is a 1; the default value of a2 is a2, and the configuration options and related values are shown in table 1 below:
TABLE 1
Configuration options Value of
A1 a1
A2 a2
During the operation of the virtual machine, if the value a1 of the configuration option a1 is changed to a11, the virtual machine needs to record the change, and the possible recorded information is shown in table 2:
TABLE 2
Varying configuration options Updated value
A1 a11
During the operation of the virtual machine, if the value of the configuration option a1 is changed to a13 again, the information that the virtual machine may record is shown in table 3:
TABLE 3
Varying configuration options Updated value
A1 a13
Each time the value of a configuration option changes, the virtual machine records the change, so that the virtual machine or VMM knows which options in the first configuration file have changed according to the recorded information and needs to update the value.
It should be noted that, during the running process of the virtual machine, if the value of a certain configuration option in the first configuration file changes back to the original value after several changes, the record related to the configuration option may be deleted.
And the second method comprises the following steps: and comparing the first configuration file with the second configuration file to acquire the changed data.
Specifically, after the virtual machine is started, the configuration options in the first configuration file and the configuration options in the second configuration file may be compared one by one to obtain the changed data, so that the data in the first configuration file may be updated to the data in the second configuration file.
Optionally, restoring the data in the first configuration file to the data in the second configuration file further includes: and controlling the application which is started later to continue running.
Specifically, after the data in the first configuration file is restored to the data in the second configuration file, the virtual machine controls the application which is started later to continue running, for example, controls the application which is in the suspended running to continue running, controls the application which is in the closed state to restart, and the like. After the system is started, the application which is controlled to be started later continues to run, so that the normal running of the system can be ensured.
The embodiment of the application provides a quick starting method based on a virtualization technology, which includes loading a mirror image file through a VMM (virtual machine monitor), judging whether different data from those in a second configuration file exist in a first configuration file in a virtual machine started through the mirror image file after the virtual machine is started through the mirror image file, and if the different data exist in the first configuration file, updating the data in the first configuration file into the data in the second configuration file. In addition, only the data in the memory and the first configuration file are subjected to snapshot, so that the image file is small, and the manufacturing speed of the image file and the recovery speed of the system are improved.
Fig. 5 is a schematic structural diagram of a first embodiment of a fast boot apparatus based on a virtualization technology according to an embodiment of the present disclosure. The starting device may be an independent terminal device, or may be a device integrated in a terminal device, and the device may be implemented by software, hardware, or a combination of software and hardware. As shown in fig. 5, the starting apparatus includes:
a loading module 11, configured to load an image file through a virtual machine monitor VMM, where the image file includes information that is generated in advance after a snapshot is made on data in a memory and a first configuration file, the first configuration file is an operating system configuration file and an application configuration file of an application program related to operating system settings, the operating system configuration file is a data file used for defining operating system characteristics, and the application configuration file is a file generated according to some information read by an operating system and related to application operation;
the starting module 12 is configured to start a virtual machine according to the image file;
an updating module 13, configured to update data in a first configuration file in a running virtual machine to data in a second configuration file when the first configuration file has data different from data in the second configuration file, where the second configuration file is an operating system configuration file and an application configuration file that are saved by the virtual machine, and a saving time of the second configuration file is later than a saving time of the first configuration file.
Optionally, the loading module 11, the starting module 12, and the updating module 13 may be processors in the terminal device.
The rapid starting device based on virtualization technology provided by the embodiment of the invention can execute the method embodiment, and the implementation principle and the technical effect are similar, and are not described herein again.
Optionally, the second configuration file is an operating system configuration file and the application configuration file that are saved last time before the virtual machine is restarted or powered off, and the saving time of the second configuration file is later than that of the first configuration file.
Fig. 6 is a schematic structural diagram of a second embodiment of a quick start device based on a virtualization technology according to an embodiment of the present application, as shown in fig. 6, in this embodiment, based on the embodiment shown in fig. 5, the device further includes: a control module 14 and a creation module 15, wherein,
the control module 14 is configured to control the application that writes data into the memory and the first configuration file to postpone starting;
a creating module 15, configured to create an image file for the data in the memory and the first configuration file, where the image file is used to restart the virtual machine after a reboot or power failure.
Optionally, the loading module 11 is specifically configured to:
initializing the system after the power is switched on;
starting a loader and loading the VMM;
and controlling the VMM to start and loading the mirror image file through the VMM.
Optionally, the loading module 11 is specifically configured to:
and after detecting that the virtual machine fails or is restarted, loading the image file through the VMM.
Optionally, the updating module 13 is specifically configured to:
and updating the changed data in the first configuration file into the data in the second configuration file.
Optionally, the control module 14 is further configured to control the application deferred to start to continue running.
Optionally, the operating system configuration file includes at least one of the following files: configuration files associated with a setup application, files managed by an operating system application, or data provided by the system application to the operating system, wherein the setup application is used to make various system settings.
Optionally, when the operating system is an Android operating system, the application configuration file includes information in Android manifest.
The rapid starting device based on the virtualization technology provided by the embodiment of the application can execute the method embodiment, and the implementation principle and the technical effect are similar, and are not described again here.
Fig. 7 is a schematic structural diagram of an embodiment of a terminal device provided in the embodiment of the present application. As shown in fig. 7, the terminal device may include a processor 21, a memory 22, and at least one communication bus 23. The communication bus 23 is used to realize communication connection between the elements. The memory 22 may comprise a high speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, in which various programs may be stored for performing various processing functions and implementing the method steps of the present embodiment. Optionally, the terminal device may further include a transmitter 20 and a receiver 24, where the receiver 24 may be a corresponding input interface having a communication function and a function of receiving information, and may also be a radio frequency module or a baseband module on the terminal device, and the transmitter 20 may be a corresponding output interface having a communication function and a function of transmitting information, and may also be a radio frequency module or a baseband module on the terminal device. Alternatively, the transmitter 20 and the receiver 24 may be integrated into one communication interface, or may be two independent communication interfaces.
In this embodiment, the processor 21 is configured to load an image file through a virtual machine monitor VMM, where the image file includes information that is generated in advance after a snapshot is made on data in a memory and a first configuration file, the first configuration file is an operating system configuration file and an application configuration file of an application program related to operating system settings, the operating system configuration file is a data file used for defining operating system characteristics, and the application configuration file is a file generated according to some information read by an operating system and related to application operation;
the processor 21 is further configured to start a virtual machine according to the image file;
the processor 21 is further configured to update data in a first configuration file in a running virtual machine to data in a second configuration file when the first configuration file has data different from data in the second configuration file, where the second configuration file is an operating system configuration file and an application configuration file saved by the virtual machine, and the saving time of the second configuration file is later than that of the first configuration file.
Optionally, the second configuration file is an operating system configuration file and the application configuration file that are saved last time before the virtual machine is restarted or powered off, and the saving time of the second configuration file is later than that of the first configuration file.
Optionally, the processor 21 is further configured to control the application that writes data to the memory and the first configuration file to postpone starting;
the processor 21 is further configured to create an image file for the data in the memory and the first configuration file, where the image file is used to restart the virtual machine after a reboot or power failure.
Optionally, the processor 21 is specifically configured to:
initializing the system after the power is switched on;
starting a loader and loading the VMM;
and controlling the VMM to start and loading the mirror image file through the VMM.
Optionally, the processor 21 is further configured to load the image file through the VMM after detecting that the virtual machine fails or is restarted;
the processor 21 is further configured to update the changed data in the first configuration file to the data in the second configuration file.
Optionally, the processor 21 is further configured to control the application deferred to start to continue running.
Optionally, the operating system configuration file includes at least one of the following files: configuration files associated with a setup application, files managed by an operating system application, or data provided by the system application to the operating system, wherein the setup application is used to make various system settings.
Optionally, when the operating system is an Android operating system, the application configuration file includes information in Android manifest.
The terminal device provided by the embodiment of the present application may execute the method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The operating system may be various operating systems, such as Windows, Linux, Unix, Android operating system, iOS, Mac OS, and so on.
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 capable of storing program codes, such as Read-Only Memory (ROM), Random Access Memory (RAM), magnetic disk, or optical disk.

Claims (18)

1. A quick starting method based on virtualization technology is characterized by comprising the following steps:
loading a mirror image file through a Virtual Machine Monitor (VMM), wherein the mirror image file comprises information which is generated in advance after snapshot is carried out on data in a memory and a first configuration file, the first configuration file is an operating system configuration file and an application configuration file of an application program related to the setting of the operating system, the operating system configuration file is a data file used for defining the characteristics of the operating system, and the application configuration file is a file generated according to some information read by the operating system and related to the running of the application;
starting a virtual machine according to the image file;
if different data exist in a first configuration file and a second configuration file in the running virtual machine, updating the data in the first configuration file into the data in the second configuration file, wherein the second configuration file is an operating system configuration file and an application configuration file saved by the virtual machine, and the saving time of the second configuration file is later than that of the first configuration file.
2. The method of claim 1, wherein the second configuration file is an operating system configuration file and the application configuration file that are saved last before the virtual machine is restarted or powered off, and wherein the saving time of the second configuration file is later than the saving time of the first configuration file.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
controlling the application for writing data into the memory and the first configuration file to delay starting;
and creating an image file for the data in the memory and the first configuration file, wherein the image file is used for restarting the virtual machine again after restarting or powering off.
4. The method of claim 1 or 2, wherein loading an image file by a Virtual Machine Monitor (VMM) comprises:
initializing the system after the power is switched on;
starting a loader and loading the VMM;
and controlling the VMM to start and loading the mirror image file through the VMM.
5. The method of claim 1 or 2, wherein loading an image file by a Virtual Machine Monitor (VMM) comprises:
and after detecting that the virtual machine fails or is restarted, loading the image file through the VMM.
6. The method according to claim 1 or 2, wherein the updating the data in the first configuration file to the data in the second configuration file comprises:
and updating the changed data in the first configuration file into the data in the second configuration file.
7. The method of claim 1 or 2, wherein after restoring the data in the first configuration file to the data in the second configuration file, the method further comprises:
and controlling the application which is started later to continue running.
8. The method of claim 1 or 2, wherein the operating system configuration file comprises at least one of: configuration files associated with a setup application, files managed by an operating system application, or data provided by the system application to the operating system, wherein the setup application is used to make various system settings.
9. Method according to claim 1 or 2, wherein the operating system is an Android operating system and the application configuration file comprises information in Android Manifest.xml and/or information in a resource folder.
10. A rapid starting device based on virtualization technology is characterized by comprising:
the loading module is used for loading an image file through a Virtual Machine Monitor (VMM), wherein the image file comprises information which is generated in advance after snapshot is carried out on data in a memory and a first configuration file, the first configuration file is an operating system configuration file and an application configuration file of an application program related to the setting of an operating system, the operating system configuration file is a data file used for defining the characteristics of the operating system, and the application configuration file is a file generated according to some information read by the operating system and related to application running;
the starting module is used for starting the virtual machine according to the mirror image file;
the updating module is used for updating data in a first configuration file into data in a second configuration file when different data exist in the first configuration file and the second configuration file in the running virtual machine, wherein the second configuration file is an operating system configuration file and an application configuration file which are saved by the virtual machine, and the saving time of the second configuration file is later than that of the first configuration file.
11. The apparatus of claim 10, wherein the second configuration file is an operating system configuration file and the application configuration file that were last saved by the virtual machine before the virtual machine was restarted or powered off, and wherein a saving time of the second configuration file is later than a saving time of the first configuration file.
12. The apparatus of claim 10 or 11, further comprising:
the control module is used for controlling the application for writing data into the memory and the first configuration file to delay starting;
and the creating module is used for creating an image file for the data in the memory and the first configuration file, wherein the image file is used for restarting or restarting the virtual machine after power failure.
13. The apparatus according to claim 10 or 11, wherein the loading module is specifically configured to:
initializing the system after the power is switched on;
starting a loader and loading the VMM;
and controlling the VMM to start and loading the mirror image file through the VMM.
14. The apparatus according to claim 10 or 11, wherein the loading module is specifically configured to:
and after detecting that the virtual machine fails or is restarted, loading the image file through the VMM.
15. The apparatus according to claim 10 or 11, wherein the update module is specifically configured to:
and updating the changed data in the first configuration file into the data in the second configuration file.
16. The apparatus of claim 10 or 11, wherein the control module is further configured to control the application that postpones the launch to continue running.
17. The apparatus of claim 10 or 11, wherein the operating system configuration file comprises at least one of: configuration files associated with a setup application, files managed by an operating system application, or data provided by the system application to the operating system, wherein the setup application is used to make various system settings.
18. The apparatus according to claim 10 or 11, wherein the operating system is an Android operating system, and the application configuration file includes information in Android manifest.
CN201710327281.5A 2017-05-10 2017-05-10 Rapid starting method and device based on virtualization technology Active CN108874459B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710327281.5A CN108874459B (en) 2017-05-10 2017-05-10 Rapid starting method and device based on virtualization technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710327281.5A CN108874459B (en) 2017-05-10 2017-05-10 Rapid starting method and device based on virtualization technology

Publications (2)

Publication Number Publication Date
CN108874459A CN108874459A (en) 2018-11-23
CN108874459B true CN108874459B (en) 2021-06-29

Family

ID=64319354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710327281.5A Active CN108874459B (en) 2017-05-10 2017-05-10 Rapid starting method and device based on virtualization technology

Country Status (1)

Country Link
CN (1) CN108874459B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032870B (en) * 2019-03-29 2020-10-02 网御安全技术(深圳)有限公司 Safety guiding method and system of virtual machine monitor and hardware safety monitoring card
CN110209468A (en) * 2019-05-24 2019-09-06 北京百度网讯科技有限公司 For starting the method, apparatus, equipment and medium of virtual machine
CN111782342A (en) * 2020-06-30 2020-10-16 联想(北京)有限公司 Virtual machine starting method and device
CN112131052B (en) * 2020-10-23 2024-02-09 北京安石科技有限公司 Method and system for quickly recovering operating system
CN114510278A (en) * 2022-01-21 2022-05-17 武汉噢易云计算股份有限公司 Data static recovery method, device and equipment and readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088367A (en) * 2010-12-10 2011-06-08 北京世纪互联工程技术服务有限公司 Method for quickly deploying in virtualization environment
CN106598653A (en) * 2016-11-24 2017-04-26 合肥中科云巢科技有限公司 Method and device used for solving boot storm of virtual machine

Also Published As

Publication number Publication date
CN108874459A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN108874459B (en) Rapid starting method and device based on virtualization technology
CN105745617B (en) Selective power management for pre-boot firmware updates
EP2831722B1 (en) Method and system for verifying proper operation of a computing device after a system change
KR102042022B1 (en) System operation method and intelligent terminal
CN101232397B (en) Apparatus and method for renovating multi controller systems
CN105917306B (en) System and method for configuring system firmware configuration data
US8171276B2 (en) Minimal startup mode for performing multiple-reboot configuration
WO2017219861A1 (en) Method and device for controlling system start-up mode
CN112612524A (en) Method, device and equipment for starting Linux system and storage medium
CN109582372B (en) System starting method and device
CN108345464A (en) A kind of the startup method and Android vehicle device of Android system
CN111240753A (en) Loading method of bootstrap program, storage medium and embedded terminal
WO2018049798A1 (en) Method and apparatus for reconstructing cache partition
CN111433747A (en) Virtual memory for loading an operating system
TWI764454B (en) Firmware corruption recovery
CN112214353A (en) Firmware recovery method and device, computer equipment and storage medium
US10509646B2 (en) Software update rollbacks using file system volume snapshots
CN113721959A (en) Information processing method and device and electronic equipment
CN112083964B (en) Method for deploying an operating system
CN112667444A (en) System upgrading method, storage medium and terminal equipment
KR20090023863A (en) System and method for updating firmware
CN117112313B (en) Service disaster tolerance switching method, device, equipment and storage medium
CN112825054B (en) Data processing method and electronic equipment
CN109271191B (en) Information processing method and electronic equipment
CN107562466B (en) Method and equipment for installing computer operating system

Legal Events

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