WO2020119213A1 - 一种镜像文件的生成及加载方法、设备 - Google Patents

一种镜像文件的生成及加载方法、设备 Download PDF

Info

Publication number
WO2020119213A1
WO2020119213A1 PCT/CN2019/107170 CN2019107170W WO2020119213A1 WO 2020119213 A1 WO2020119213 A1 WO 2020119213A1 CN 2019107170 W CN2019107170 W CN 2019107170W WO 2020119213 A1 WO2020119213 A1 WO 2020119213A1
Authority
WO
WIPO (PCT)
Prior art keywords
system memory
physical
memory
page
image 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.)
Ceased
Application number
PCT/CN2019/107170
Other languages
English (en)
French (fr)
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.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology 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 Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Publication of WO2020119213A1 publication Critical patent/WO2020119213A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

Definitions

  • the invention relates to computer technology, in particular to a method for generating and loading image files.
  • smart devices based on Linux technology usually prestore the recovered data in double-rate synchronous dynamic random access memory (Double Data Rate).
  • the smart device will adopt the standby to memory (Suspend To Ram, STR) technology, that is, to retain the power supply of DDR during standby, make it enter the self-refresh mode, and save the recovered data in DDR. , Read the recovery data directly from DDR to recover to the state before standby and continue to run.
  • Standby to memory Suspend To Ram, STR
  • the standby to hard disk (Suspend To Dis, STD) technology is usually used, which describes the system operating status before standby, makes a corresponding image file, and saves it to non-volatile memory.
  • STD Standby to hard disk
  • EMMC Embedded Multimedia Card
  • the Linux kernel when creating an image file, the Linux kernel will only create the corresponding image file for the original data stored in the system memory, and ignore the original data stored in the non-system memory.
  • the non-system memory The original data saved in may also record the key data of the boot operation, such as the image frame buffer (framebuffer) data, therefore, it will cause the TV to display abnormally after booting.
  • an embodiment of the present invention provides a method for generating an image file, including:
  • Compress the saved original data of each non-system memory and the corresponding physical address and save the saved original data of each system memory and the corresponding physical address, and generate a corresponding image file.
  • an embodiment of the present application provides a method for loading an image file, including:
  • the physical address of the non-system memory physical memory page is mapped to a corresponding kernel virtual address
  • the kernel virtual address of the non-system memory physical memory page read the corresponding non-system memory raw data from the decompressed image file, and according to the non-system memory physical memory page physical address, the non-system The original memory data is saved to a corresponding location in non-system memory.
  • an embodiment of the present application provides an intelligent device, including a processor and a memory;
  • the memory is used to store computer programs
  • the processor executes the computer program to execute:
  • Compress the saved original data of each non-system memory and the corresponding physical address and save the saved original data of each system memory and the corresponding physical address, and generate a corresponding image file.
  • an embodiment of the present application provides an intelligent device, including a processor and a memory, where:
  • the memory is used to store computer programs
  • the processor is configured to execute the computer program to execute:
  • the physical address of the non-system memory physical memory page is mapped to a corresponding kernel virtual address
  • the kernel virtual address of the non-system memory physical memory page read the corresponding non-system memory raw data from the decompressed image file, and according to the non-system memory physical memory page physical address, the non-system The original memory data is saved to a corresponding location in non-system memory.
  • an embodiment of the present application provides a storage medium that stores a program for implementing a method of generating an image file.
  • the program is executed by a processor, the following steps are performed:
  • an embodiment of the present application provides a storage medium that stores a program for implementing a method of loading an image file.
  • the program is executed by a processor, the following steps are performed:
  • the physical address of the non-system memory physical memory page is mapped to a corresponding kernel virtual address
  • the kernel virtual address of the non-system memory physical memory page read the corresponding non-system memory raw data from the decompressed image file, and according to the non-system memory physical memory page physical address, the non-system The original memory data is saved to a corresponding location in non-system memory.
  • Figure 1 is a schematic diagram of the system memory architecture in physical memory under the prior art
  • FIG. 2 is a schematic diagram of a functional structure of a smart device in an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a process of generating a mirror file by a smart device in an embodiment of the present invention
  • FIG. 4 is a schematic diagram of physical memory allocation in an embodiment of the present invention.
  • FIG. 5 is a schematic diagram comparing the contents of a mirror file in the prior art and the embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a process of loading a mirror file by a smart device in an embodiment of the present invention.
  • the DDR of the smart device is divided into system memory and non-system memory.
  • the system memory is a memory that the Linux kernel has permission to manage, while the non-system memory is memory that the Linux kernel has no right to manage.
  • the system memory is composed of a three-level architecture of a memory node (Node), a memory zone (Zone), and a physical memory page (page).
  • Node memory node
  • Zone memory zone
  • page physical memory page
  • Memory node a method of describing physical memory in a computer system
  • a bus master device costs the same cost to access any memory unit located in the same memory node, and it costs the same to access memory units in any two different nodes The cost is different.
  • the memory area is located in the same memory node. There are mainly direct read memory area (ZONE_DMA), ordinary memory area (ZONE_NORMAL), and high-end memory area (ZONE_HIGHMEM).
  • ZONE_DMA direct read memory area
  • ZONE_NORMAL ordinary memory area
  • ZONE_HIGHMEM high-end memory area
  • Physical memory pages System memory is usually managed in units of "pages". The size of a physical memory page is 4K bytes.
  • STD technology is similar to STR, and it is a method to speed up the startup of smart devices. The difference is that STD technology will save the image file used for recovery to EMMC, so that the image file will not be lost after AC power failure.
  • the smart device collects the system operating state description information before standby.
  • the system operating state description information includes at least: physical memory page usage state, processor operating state, external device operating state, etc.; then, the smart device will Make the obtained system operating state description information into a corresponding image file according to the set format and save it in EMMC; the next time the smart device performs AC boot, it will be read from EMMC in the bootloader stage before the kernel or system startup Image file, and then perform the recovery process to restore to the last standby state.
  • a smart device is configured with 1.5G of physical memory, where the size of ZONE_NORMAL is 295M, and the size of ZONE_HIGHMEM is 634M, that is, the system memory occupies 929M of physical memory, and the remaining 607M of physical memory is used as
  • the non-system memory is reserved for other hardware modules of the main chip for special purposes, for example, 100M of physical memory is reserved for the frame module from the non-system memory for the display module.
  • Non-system memory is not within the scope of the Linux kernel's management authority, so when creating an image file, the smart device will not use data saved in non-system memory. However, during the STD boot process, some processes may need to use data saved in non-system memory. Because it is an AC boot, the initial value of all data in non-system memory before initialization is 0xff. Some of the above processes are abnormal. If some of the above processes are related to the display, it will cause the screen and white screen problems during the STD boot process.
  • the smart device using the Linux kernel selectively saves the specified important non-system memory and system memory during the image file process. Data to generate the corresponding image file.
  • the smart device eg, smart TV
  • the smart device includes at least a processor 20, physical memory 21 (eg, DDR), and memory 22 (eg, EMMC), where the processor 20 , Used to carry the Linux kernel, and perform related operations to generate an image file, the physical memory 21 is used to cache various data generated during the operation of the system, and the memory 22 is used to save the image file.
  • processor 20 Used to carry the Linux kernel, and perform related operations to generate an image file
  • the physical memory 21 is used to cache various data generated during the operation of the system
  • the memory 22 is used to save the image file.
  • the detailed process of the smart device generating the image file is as follows:
  • Step 300 Based on the preset configuration information, the smart device determines whether it is necessary to save the original data of non-system memory? If yes, go to step 301; otherwise, go to step 305.
  • the smart device may directly perform the image file generation process from step 310 without performing a judgment operation.
  • Step 301 Based on the total amount of data that needs to be saved in the non-system memory, the smart device applies for the corresponding non-system memory mirror area in the system memory.
  • the physical memory is set in the form of physical memory pages. Therefore, the smart device needs to first determine the physical memory occupied by the total amount of non-system memory original data that needs to be saved in the non-system memory The total amount of pages, and then, based on the total amount of physical memory pages occupied by the total data amount of the original data of the non-system memory, apply for the total amount of physical memory pages of corresponding size in the system memory, also known as the non-system memory mirror area.
  • the above non-system memory mirror area can be located in ZONE_NORMAL or ZONE_HIGHMEM, depending on the idle state of the system memory at that time, as shown in Figure 4.
  • Step 302 The smart device maps the physical address of a non-system memory physical memory page to the corresponding kernel virtual address.
  • the addresses used in the Linux system are all virtual addresses.
  • the Linux kernel will provide the same size virtual memory address space for each running process, which allows multiple processes to work simultaneously. Run without interfering with each other, the virtual address space range is 0-4G. Therefore, in order to allow the Lunix kernel carried by the processor 20 to access non-system memory, the ioremap function needs to be called to map the physical address of the non-system memory physical memory page to the kernel virtual address space to obtain the corresponding memory virtual address to facilitate the processor 20 to read and write.
  • Step 303 The smart device reads the non-system memory raw data from the one non-system memory physical memory page, and saves the non-system memory raw data and the corresponding physical address based on the kernel virtual address to the Non-system memory mirror area.
  • a non-system memory mirror area is added on the basis of the system memory mirror area.
  • the non-system memory mirror area can be discontinuous in physical address. Specifically, it can be divided into a first area that stores non-system memory original data and a second area that stores non-system memory metadata.
  • metadata also known as intermediary data, relay data, is data describing data (data about data), mainly describing information of data properties (property), used to support, for example, indicating storage location, historical data, resource search, file records And other functions.
  • the metadata is used to record the physical address of the corresponding original data. Therefore, when step 303 is performed, the smart device saves the original data of the non-system memory saved in a physical memory page of the non-system memory to the non-system memory
  • the first area in the mirror area also stored in a system memory physical memory page, which will not be repeated here
  • the corresponding physical address is saved in the form of metadata to the second area in the non-system memory mirror area.
  • mapping relationship between the original data of the non-system memory and the corresponding physical addresses can be saved in the set mirror header area, as shown in Figure 5.
  • the real-time data lossless compression (Lempel-Ziv-Oberhumer, LZO) format is usually used for compression. Therefore, it is necessary to distinguish between non-system memory metadata and system memory metadata Open, and distinguish the non-system memory raw data from the system memory raw data, and the storage location of the non-system memory metadata needs to be placed in front of the non-system memory raw data, that is, between the first area and the mirror head area The distance is greater than the distance between the second area and the mirror head area. Similarly, the storage location of the system memory metadata must be placed in front of the original data in the system memory. In this way, after the mirror file is generated, the mirror file When decompressing, it will not cause data confusion, and will not cause the metadata to be unmatched with the original data, causing boot failure.
  • LZO real-time data lossless compression
  • Step 304 The smart device determines whether all non-system memory physical memory pages have been processed? If yes, go to step 305; otherwise, go to step 302.
  • Step 305 The smart device applies the corresponding system memory mirror area in the system memory based on the total amount of data to be saved in the system memory.
  • Smart devices store the original data in the system memory in the system memory in a similar way to the original data in the non-system memory. The difference is that when reading the original data in the system memory, there is no need to map the physical address to the virtual address of the memory. Because the original storage location of the original data of the system memory is also located in the system memory, and the system memory belongs to the memory area that the Linux kernel has permission to manage, so the smart device can clearly know the memory virtual address of the original storage location of the original data of the system memory.
  • Step 306 The smart device copies the original data of the system memory and the corresponding physical address to be saved in the physical memory pages of each system memory to the system memory mirror area.
  • smart devices also need to use page-by-page processing to separately copy the original data of the system memory saved in the physical memory page of each page of system memory to be processed to the third area in the system memory mirror area, and copy the above system
  • the physical address corresponding to the original memory data is copied to the fourth area in the mirror area of the system memory, and, in an embodiment of the present application, as shown in FIG. 5, the distance between the third area and the mirror head area Is larger than the distance between the fourth area and the mirror head area.
  • Step 307 The smart device saves the specified boot information in the image header area.
  • the smart device saves the mapping relationship between each non-system memory original data in the non-system memory mirror area and the corresponding physical address in the mirror header area; and, saves each system memory original data in the system memory mirror area and the corresponding The mapping relationship between the physical addresses.
  • Step 308 The smart device compresses various types of data stored in the system memory mirror area and the non-system memory mirror area according to the set format, generates a corresponding mirror file, and saves it in the EMMC.
  • the image file has been generated, and the smart device can save the image file in the EMMC.
  • the system recovery can be performed based on the image file.
  • Step 600 Start the AC after the smart device is turned off
  • Step 601 The smart device reads the pre-stored image file from the EMMC, saves it to the DDR and decompresses it.
  • the smart device first decompresses the compressed image file in the system memory, and then reads the metadata therein.
  • the metadata stores the physical address of the original storage location of the non-system memory original data and the system memory original data. .
  • Step 602 The smart device reads the metadata of one physical memory page from the decompressed image file, and determines the physical address of the one physical memory page based on the metadata.
  • Step 603 The intelligent device determines whether the physical address of the one physical memory page belongs to non-system memory? If yes, go to step 604; otherwise, go to step 606.
  • Step 604 The smart device determines that the physical memory page is a non-system memory physical memory page, and maps the physical address of the non-system memory physical memory page to a corresponding kernel virtual address.
  • the smart device needs to use the ioremap function to map the physical address of the physical memory page to the corresponding kernel virtual address.
  • Step 605 The smart device reads the corresponding non-system memory raw data from the decompressed image file according to the kernel virtual address of the non-system memory physical memory page, and according to the physical address of the non-system memory physical memory page, The original data in the non-system memory is saved to a corresponding location in the non-system memory, and then step 607 is executed.
  • the smart device restores the non-system memory original data in the image file to the original storage device in the system memory.
  • Step 606 The smart device determines that the processed memory page is a non-system memory physical memory, and reads the corresponding system memory raw data from the decompressed image file according to the kernel virtual address of the system memory physical memory page, and according to The physical address of the physical memory page of the system memory saves the original data of the system memory to a corresponding location in the system memory.
  • the smart device restores the original data of the system memory in the image file to the original storage device in the system memory.
  • Step 607 The smart device determines whether all physical memory pages in the image file have been processed? If yes, go to step 608; otherwise, go back to step 602.
  • the smart device will restore the non-system memory original data or system memory original data corresponding to each physical memory page page by page from the image file in a certain order, until all data is restored.
  • Step 607 The smart device determines that the image file is loaded and restores the system to the image file indication state.
  • the smart device can restore the system to the state indicated by the last image file saved.
  • a smart device eg, a smart TV
  • a smart device includes at least a processor 20, a physical memory 21, and a memory 22.
  • the physical memory 21 is divided into non-system memory and system memory. among them,
  • the processor 20 is used to apply for a corresponding non-system memory mirror area in the system memory based on the total amount of data that needs to be saved in the non-system memory;
  • Virtual address save the original data of the non-system memory and the corresponding physical address to the mirror area of the non-system memory;
  • Compress the saved original data of each non-system memory and the corresponding physical address and save the saved original data of each system memory and the corresponding physical address, and generate a corresponding image file.
  • the processor 20 is further used to:
  • the preset configuration information it is determined that the data saved in the non-system memory needs to be used to generate the image file.
  • the processor 20 when the original data of the non-system memory and the corresponding physical address are stored in the non-system memory mirror area, the processor 20 is used to:
  • the distance between the first area and the mirror head area set in the mirror area of the system memory is greater than the distance between the second area and the mirror head area.
  • the processor 20 is used to pre-compress the saved original data of each non-system memory and the corresponding physical address, and the saved original data of each system memory and the corresponding physical address in a preset format Further use:
  • mapping relationship between the original data of each non-system memory and the corresponding physical address in the non-system memory mirror area is stored in the set mirror header area;
  • mapping relationship between the original data of each system memory and the corresponding physical address in the system memory mirror area is stored in the mirror head area.
  • the processor 20 is further used to:
  • the processor 20 is used to,
  • the physical address of the non-system memory physical memory page is mapped to a corresponding kernel virtual address
  • the kernel virtual address of the non-system memory physical memory page read the corresponding non-system memory raw data from the decompressed image file, and according to the non-system memory physical memory page physical address, the non-system The original memory data is saved to a corresponding location in non-system memory.
  • the processor 20 is further used to:
  • the corresponding system memory is read from the decompressed image file according to the kernel virtual address of the system memory physical memory page Raw data;
  • the original data of the system memory is saved to a corresponding location in the system memory.
  • a storage medium which stores a program for implementing a method of generating an image file.
  • the program is executed by the processor 20, the following steps are performed:
  • a storage medium stores a program for implementing a method for loading an image file, and when the program is executed by the processor 20, the following steps are performed:
  • the physical address of the non-system memory physical memory page is mapped to a corresponding kernel virtual address
  • the kernel virtual address of the non-system memory physical memory page read the corresponding non-system memory raw data from the decompressed image file, and according to the non-system memory physical memory page physical address, the non-system The original memory data is saved to a corresponding location in non-system memory.
  • the smart device maps the non-system memory raw data to the kernel virtual space for processing and storage according to the physical address, and compresses the system memory raw data to generate the corresponding image file, so that it can In the image file, comprehensively record all important data required for system recovery, thereby ensuring the integrity of the image file, and thereby avoiding the problem of flower screen and white screen due to the loss of important data when the smart device performs system recovery based on the image file. Ensure the smooth and quick boot of the smart device.
  • the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
  • computer usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • each flow and/or block in the flowchart and/or block diagram and a combination of the flow and/or block in the flowchart and/or block diagram may be implemented by computer program instructions.
  • These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processing machine, or other programmable data processing device to produce a machine that enables the generation of instructions executed by the processor of the computer or other programmable data processing device
  • These computer program instructions may also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, the instructions
  • the device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device
  • the instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

一种镜像文件的生成及加载方法、设备,包括:智能设备将非系统内存原始数据,按照物理地址映射至内核虚拟空间进行处理及保存,与系统内存原始数据一起压缩生成相应的镜像文件,这样,便能够在镜像文件中,全面记录系统恢复所需要的所有重要数据,从而保证了镜像文件的完整性,进而可以避免智能设备基于镜像文件进行系统恢复时,因重要数据丢失而出现花屏、白屏问题,确保了智能设备的顺利快速开机。

Description

一种镜像文件的生成及加载方法、设备
相关申请的交叉引用
本申请要求在2018年12月11日提交中国专利局、申请号为201811510641.6申请名称为″一种镜像文件的生成及加载方法、设备″的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机技术,特别涉及一种镜像文件的生成及加载方法。
背景技术
目前,基于Linux技术的智能设备(如,智能电视)为了加快开机或亮屏速度,提升用户体验,通常会在双倍速率同步动态随机存储器(Double Data Rate,DDR)中预存恢复数据。
在直流开关机过程中,智能设备会采用待机到内存(Suspend To Ram,STR)技术,即在待机时保留DDR的供电,使其进入自刷新模式,并将恢复数据保存在DDR中,开机后,直接从DDR中读取恢复数据从而恢复至待机前的状态,继续运行。
而在交流开关机过程中,加快开机速度,通常采用待机到硬盘(Suspend To  Dis,STD)技术,即将待机前的系统运行状态描述,制作成相应的镜像文件,保存到非易失性存储器,如,嵌入式多媒体存储卡(Embedded Multi Media Card,EMMC)中,开机后,从EMMC中读取镜像文件,然后解压、跳转、运行。
然而,已有技术下,在制作镜像文件时,Linux内核只会针对系统内存中保存的原始数据制作相应的镜像文件,而无视非系统内存中保存的原始数据,而实际应用中,非系统内存中保存的原始数据也有可能记录有开机运行的关键数据,如,图像的帧缓存(framebuffer)数据,因此,就会导致开机后电视显示异常。
发明内容
一方面,本发明实施例提供一种镜像文件的生成方法,包括:
基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区;
针对待处理的各个非系统内存物理内存页,分别执行以下操作:
将非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
从所述非系统内存物理内存页中读取非系统内存原始数据,并基于所述内核虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区;
在系统内存中申请相应的系统内存镜像区,并将需要保存的系统内存原始数据及相应的物理地址保存至所述系统内存镜像区;
对保存的各个非系统内存原始数据及相应的物理地址,和保存的各个系统内存原始数据及相应的物理地址进行压缩,生成相应的镜像文件。
另一方面,本申请实施例提供一种镜像文件的加载方法,包括:
在交流开机后,获取预存的镜像文件,在系统内存中进行解压,
针对解压后的镜像文件中记录的各个物理内存页,分别执行以下操作:
根据解压后的镜像文件中记录的元数据,确定物理内存页的物理地址;
根据所述物理内存页的物理地址,确定所述物理内存页为非系统内存物理内存页时,将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应位置。
另一方面,本申请实施例提供一种智能设备,包括处理器、和存储器;
所述存储器,用于存储计算机程序;
所述处理器,执行所述计算机程序以执行:
基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区;
针对待处理的各个非系统内存物理内存页,分别执行以下操作:
将非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
从所述非系统内存物理内存页中读取非系统内存原始数据,并基于所述内 核虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区;
在系统内存中申请相应的系统内存镜像区,并将需要保存的系统内存原始数据及相应的物理地址保存至所述系统内存镜像区;
对保存的各个非系统内存原始数据及相应的物理地址,和保存的各个系统内存原始数据及相应的物理地址进行压缩,生成相应的镜像文件。
另一方面,本申请实施例提供一种智能设备,包括处理器和存储器,其中:
所述存储器,用于存储计算机程序;
所述处理器,用于执行所述计算机程序以执行:
在进行交流开机之后,获取预存的镜像文件,在系统内存中进行解压;
针对解压后的镜像文件中记录的各个物理内存页,分别执行以下操作:
根据解压后的镜像文件中记录的元数据,确定物理内存页的物理地址;
根据所述物理内存页的物理地址,确定所述物理内存页为非系统内存物理内存页时,将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应位置。
另一方面,本申请实施例提供一种存储介质,存储有用于实现镜像文件的生成方法的程序,所述程序被处理器运行时,执行以下步骤:
基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区;
针对待处理的各个非系统内存物理内存页,分别执行以下操作:
将非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
从所述非系统内存物理内存页中读取非系统内存原始数据,并基于所述内核虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区;
在系统内存中申请相应的系统内存镜像区,并将需要保存的系统内存原始数据及相应的物理地址保存至所述系统内存镜像区;
对保存的各个非系统内存原始数据及相应的物理地址,和各个系统内存原始数据及相应的物理地址进行压缩,生成相应的镜像文件。
另一方面,本申请实施例提供一种存储介质,存储有用于实现镜像文件的加载方法的程序,所述程序被处理器运行时,执行以下步骤:
在交流开机之后,获取预存的镜像文件,在系统内存中进行解压;
针对解压后的镜像文件中记录的各个物理内存页,执行以下操作:
根据解压后的镜像文件中记录的元数据,确定物理内存页的物理地址;
根据所述物理内存页的物理地址,确定所述物理内存页为非系统内存物理内存页时,将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中 读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应位置。
附图说明
图1为已有技术下物理内存中系统内存架构示意图;
图2为本发明实施例中智能设备功能结构示意图;
图3为本发明实施例中智能设备生成镜像文件流程示意图;
图4为本发明实施例中物理内存分配示意图;
图5为已有技术下和本发明实施例中镜像文件内容对比示意图;
图6为本发明实施例中智能设备加载镜像文件流程示意图。
具体实施方式
相关技术,基于Linux技术的智能设备在DDR管理层面采用了与具体体系架构不相关的设计模型,实现了良好的可伸缩性。具体的,智能设备的DDR被划分为系统内存和非系统内存,系统内存为Linux内核有权限管理的内存,而非系统内存为Linux内核无权管理的内存。
参阅图1所示,系统内存又是由内存节点(Node),内存区域(Zone)和物理内存页(page)三级架构组成。
内存节点,计算机系统中对物理内存的一种描述方法,一个总线主设备访问位于同一个内存节点中的任意内存单元所花的代价相同,而访问任意两个不 同节点中的内存单元所花的代价不同。
内存区域,位于同一个内存节点之内,主要有直接读取内存区域(ZONE_DMA)、普通内存区域(ZONE_NORMAL)、高端内存区域(ZONE_HIGHMEM)几种。
物理内存页,系统内存通常是以″页″为单位管理进行内存管理的,一个物理内存页的大小为4K Byte。
STD技术与STR类似,都是加快智能设备启动的方法,不同的是STD技术会将用于恢复的镜像文件保存至EMMC中,这样,可以保证交流断电后镜像文件不丢失。
具体的,智能设备会采集待机前的系统运行状态描述信息,所述系统运行状态描述信息至少包括:物理内存页使用状态、处理器运行状态、外部设备的运行状态等等;然后,智能设备会将获得的系统运行状态描述信息按照设定格式制作成相应的镜像文件保存在EMMC中;下次智能设备进行交流开机时,会在内核或系统启动之前的启动加载(bootloader)阶段从EMMC读取镜像文件,然后执行恢复流程,恢复到上次待机的状态。
示例性的,假设某一智能设备配置有物理内存1.5G Byte,其中ZONE_NORMAL的大小为295M,ZONE_HIGHMEM的大小为634M,即系统内存共占用929M的物理内存,而剩下的607M的物理内存被作为非系统内存预留给主芯片的其它硬件模块使用,用作特殊用途,如,从非系统内存中为显示模块预留100M的物理内存用于framebuffer。
非系统内存不在Linux内核的管理权限范围内,因此在制作镜像文件时,智 能设备不会使用非系统内存中保存的数据。然而,在STD开机过程中,某些进程可能需要使用到非系统内存中保存的数据,由于是交流开机,因此,在初始化前非系统内存中所有数据的初始值均为0xff此时,会导致上述某些进程异常,如果上述某些进程是与显示相关的进程,就会导致STD开机过程中出现花屏、白屏问题。
为了保证镜像文件的完整性,以确保智能设备顺利快速开机,本发明实话例中,使用Linux内核的智能设备在镜像文件的过程中,有选择地保存非系统内存和系统内存中的指定的重要数据,从而生成相应的镜像文件。
下面结合附图对本发明实施方式作进一步详细说明。
参阅图2所示,本发明实施例中,智能设备(如,智能电视)中至少包含有处理器20、物理内存21(如,DDR)和存储器22(如,EMMC),其中,处理器20,用于承载Linux内核,并执行相关操作生成镜像文件,物理内存21用于缓存系统运行过程中产生的各类数据,存储器22用于保存镜像文件。
基于上述智能设备,参阅图3所示,本发明实施例中,智能设备生成镜像文件的详细流程如下:
步骤300:智能设备根据预设的配置信息,判断是否需要保存非系统内存原始数据?若是,则执行步骤301;否则,执行步骤305。
当然,如何智能设备的默认配置是需要保存非系统内存原始数据,则智能设备也可以不用执行判断操作,而是直接从步骤310开始执行镜像文件的生成流程。
步骤301:智能设备基于非系统内存中需要保存的数据总量,在系统内存中 申请相应的非系统内存镜像区。
具体的,由于在DDR中,物理内存均是以物理内存页的形式设置的,因此,智能设备需要先确定,非系统内存中需要保存的非系统内存原始数据的总数据量所占用的物理内存页总量,然后,基于上述非系统内存原始数据的总数据量所占用的物理内存页总量,在系统内存中申请相应大小的物理内存页总量,也称为非系统内存镜像区。
上述非系统内存镜像区,可以位于ZONE_NORMAL中,也可以位于ZONE_HIGHMEM中,这取决于当时系统内存的空闲情况,具体如图4所示。
步骤302:智能设备将一个非系统内存物理内存页的物理地址映射为相应的内核虚拟地址。
实际应用中,Linux系统运行过程中,使用的地址都是虚拟地址,以32位系统为例,Linux内核会为每个运行的进程提供大小相同的内存虚拟地址空间,这使得多个进程可以同时运行而又不会互相干扰,虚拟地址的空间范围为0-4G。因此,为了让处理器20承载的Lunix内核能够访问到非系统内存,需要调用ioremap函数将非系统内存物理内存页的物理地址映射到内核虚拟地址空间,获得相应的内存虚拟地址,以便于处理器20进行读写。
步骤303:智能设备从所述一个非系统内存物理内存页中读取非系统内存原始数据,并基于所述内核虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区。
具体的,参阅图5所示,本申请实施例,在系统内存镜像区的基础上,增添了非系统内存镜像区。非系统内存镜像区在物理地址上可以是不连续的,具体的,可以分为存储非系统内存原始数据的第一区域,和存储非系统内存元数 据的第二区域,其中,元数据(Metadata),又称中介数据、中继数据,为描述数据的数据(data about data),主要是描述数据属性(property)的信息,用来支持如,指示存储位置、历史数据、资源查找、文件记录等功能。
本申请实施例中,元数据用于记录相应的原始数据的物理地址,因此,在执行步骤303时,智能设备将一个非系统内存物理内存页中保存的非系统内存原始数据保存至非系统内存镜像区中的第一区域(也是保存在一个系统内存物理内存页中,在此不再赘述),以及将相应的物理地址以元数据的形式保存至非系统内存镜像区中的第二区域。
非系统内存原始数据和相应的物理地址之间的映射关系,可以保存在设定的镜像头区域中,具体如图5所示。
在本申请的一种实施方式中,由于生成镜像文件时,通常采用实时数据无损压缩(Lempel-Ziv-Oberhumer,LZO)格式进行压缩,因此,需要将非系统内存元数据和系统内存元数据区分开,以及将非系统内存原始数据和系统内存原始数据区分开,并且,需要将非系统内存元数据的存储位置放置在非系统内存原始数据的前面,即令上述第一区域与镜像头区域之间的距离,大于上述第二区域与镜像头区域之间的距离,同理,也需要将系统内存元数据的存储位置放置在系统内存原始数据的前面,这样,生成镜像文件后,在进行镜像文件解压时,才不会引起数据混乱,不会导致元数据与原始数据无法匹配,造成开机启动失败。
步骤304:智能设备判断是否所有的非系统内存物理内存页处理完毕?若是,则执行步骤305;否则,执行步骤302。
步骤305:智能设备基于系统内存中需要保存的数据总量,在系统内存中申 请相应的系统内存镜像区。
智能设备,在系统内存中保存系统内存原始数据的方式,与保存非系统内存原始数据的方式相类似,其区别在于,读取系统内存原始数据时,无需进行物理地址到内存虚拟地址的映射,因为,系统内存原始数据的原始存储位置也位于系统内存中,而系统内存属于Linux内核有权限管理的内存区域,因此,智能设备可以明确知道系统内存原始数据的原始存储位置的内存虚拟地址。
步骤306:智能设备将各个系统内存物理内存页中需要保存的系统内存原始数据及相应的物理地址,复制至所述系统内存镜像区。
同理,智能设备也需要采用按页处理的方式,分别将待处理的每一页系统内存物理内存页中保存的系统内存原始数据复制到系统内存镜像区中的第三区域,以及将上述系统内存原始数据对应的物理地址复制到系统内存镜像区中的第四区域,以及,在本申请的一种实施方式中,如图5所示,令上述第三区域与镜像头区域之间的距离,大于上述第四区域与镜像头区域之间的距离。
步骤307:智能设备在镜像头区域中保存指定的引导信息。
具体的,智能设备会在镜像头区域中保存非系统内存镜像区中各个非系统内存原始数据及相应的物理地址之间的映射关系;以及,保存系统内存镜像区中各个系统内存原始数据及相应的物理地址之间的映射关系。
步骤308:智能设备按照设定格式,对系统内存镜像区和非系统内存镜像区中保存的各类数据进行压缩,生成相应的镜像文件,并保存至EMMC中。
至此,镜像文件便已生成完毕,智能设备可以将镜像文件保存在EMMC中, 在智能设备关机并重启时,可以基于镜像文件进行系统恢复。
基于上述实施例,参阅图6所示,本发明实施例中,智能设备加载镜像文件的详细流程如下:
步骤600:智能设备关机后进行交流开机
步骤601:智能设备从EMMC中读取预存的镜像文件,保存至DDR中并进行解压。
具体的,智能设备首先会在系统内存中将压缩后的镜像文件解压完毕,然后读取其中的元数据,元数据中保存有非系统内存原始数据和系统内存原始数据的原始存储位置的物理地址。
步骤602:智能设备从解压后的镜像文件中读取一个物理内存页的元数据,基于所述元数据确定所述一个物理内存页的物理地址。
步骤603:智能设备判断所述一个物理内存页的物理地址是否归属于非系统内存?若是,则执行步骤604;否则,执行步骤606。
步骤604:智能设备确定所述物理内存页为非系统内存物理内存页,并将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地址。
同理,智能设备需要采用ioremap函数,将所述物理内存页的物理地址映射为相应的内核虚拟地址。
步骤605:智能设备按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应 位置,接着,执行步骤607。
这样,智能设备便在系统内存中将镜像文件中的非系统内存原始数据,恢复至了原始存储装置。
步骤606:智能设备确定所述处理内存页为非系统内存物理内存,并按照所述系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的系统内存原始数据,以及按照所述系统内存物理内存页的物理地址,将所述系统内存原始数据保存至系统内存中的对应位置。
这样,智能设备便在系统内存中将镜像文件中的系统内存原始数据,恢复至了原始存储装置。
步骤607:智能设备判断镜像文件中所有的物理内存页是否处理完毕?若是,执行步骤608;否则,返回步骤602。
智能设备会按照一定的顺序,从镜像文件中逐页恢复每一个物理内存页对应的非系统内存原始数据或系统内存原始数据,直至全部数据恢复完毕。
步骤607:智能设备确定镜像文件加载完毕,将系统恢复至镜像文件指示状态。
至此,镜像文件已加载完毕,智能设备可以将系统恢复至最后一次保存的镜像文件所指示的状态。
基于上述实施例,参阅图2所示,本发明实施例中,智能设备(如,智能电视)至少包括处理器20、物理内存21和存储器22,物理内存21划分为非系统内存和系统内存,其中,
在一个实施例中,
处理器20,用于基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区;
针对待处理的各个非系统内存物理内存页,分别执行以下操作:
将非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
从所述非系统内存物理内存页中读取非系统内存原始数据,并基于所述内核
虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区;
在系统内存中申请相应的系统内存镜像区,并将需要保存的系统内存原始数据及相应的物理地址保存至所述系统内存镜像区;
对保存的各个非系统内存原始数据及相应的物理地址,和保存的各个系统内存原始数据及相应的物理地址进行压缩,生成相应的镜像文件。
在本申请的一种实施方式中,基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区之前,处理器20进一步用于:
根据预设的配置信息,确定需要使用非系统内存中保存的数据生成镜像文件。
在本申请的一种实施方式中,所述将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区时,处理器20用于:
将所述非系统内存原始数据保存在所述非系统内存镜像区的第一区域;
将所述非系统内存原始数据对应的物理地址,以元数据形式保存在所述非 系统内存镜像区的第二区域;
其中,所述第一区域与系统内存镜像区中设定的镜像头区域之间的距离,大于所述第二区域与所述镜像头区域之间的距离。
在本申请的一种实施方式中,采用预设格式,对保存的各个非系统内存原始数据及相应的物理地址,和保存的各个系统内存原始数据及相应的物理地址进行压缩之前,处理器20进一步用于:
将非系统内存镜像区中各个非系统内存原始数据及相应的物理地址之间的映射关系,保存在设定的镜像头区域中;以及,
将系统内存镜像区中各个系统内存原始数据及相应的物理地址之间的映射关系,保存在所述镜像头区域中。
在本申请的一种实施方式中,处理器20进一步用于:
将所述镜像文件保存至存储器的指定位置。
在又一个实施例中,
在进行交流开机之后,处理器20用于,
获取预存的镜像文件,在系统内存中进行解压;
针对解压后的镜像文件中记录的各个物理内存页,分别执行以下操作:
根据解压后的镜像文件中记录的元数据,确定物理内存页的物理地址;
根据所述物理内存页的物理地址,确定所述物理内存页为非系统内存物理内存页时,将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应位置。
在本申请的一种实施方式中,处理器20进一步用于:
根据所述物理内存页的物理地址,确定所述物理内存页为系统内存物理内存页时,按照所述系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的系统内存原始数据;
按照所述系统内存物理内存页的物理地址,将所述系统内存原始数据保存至系统内存中的对应位置。
基于同一发明构思,在一个实施例中,提供一种存储介质,存储有用于实现镜像文件的生成方法的程序,所述程序被处理器20运行时,执行以下步骤:
基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区;
针对待处理的各个非系统内存物理内存页,分别执行以下操作:
将非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
从所述非系统内存物理内存页中读取非系统内存原始数据,并基于所述内核虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区;
在系统内存中申请相应的系统内存镜像区,并将需要保存的系统内存原始数据及相应的物理地址保存至所述系统内存镜像区;
对保存的各个非系统内存原始数据及相应的物理地址,和各个系统内存原始数据及相应的物理地址进行压缩,生成相应的镜像文件。
基于同一发明构思,在一个实施例中,提供一种存储介质,存储有用于实现镜像文件的加载方法的程序,所述程序被处理器20运行时,执行以下步骤:
获取预存的镜像文件,在系统内存中进行解压;
针对解压后的镜像文件中记录的各个物理内存页,执行以下操作:
根据解压后的镜像文件中记录的元数据,确定物理内存页的物理地址;
根据所述物理内存页的物理地址,确定所述物理内存页为非系统内存物理内存页时,将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应位置。
综上所述,本发明实施例中,智能设备将非系统内存原始数据,按照物理地址映射至内核虚拟空间进行处理及保存,与系统内存原始数据一起压缩生成相应的镜像文件,这样,便能够在镜像文件中,全面记录系统恢复所需要的所有重要数据,从而保证了镜像文件的完整性,进而可以避免智能设备基于镜像文件进行系统恢复时,因重要数据丢失而出现花屏、白屏问题,确保了智能设备的顺利快速开机。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结 合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要 求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (11)

  1. 一种镜像文件的生成方法,其特征在于,包括:
    基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区;
    针对待处理的各个非系统内存物理内存页,分别执行以下操作:
    将非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
    从所述非系统内存物理内存页中读取非系统内存原始数据,并基于所述内核虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区;
    在系统内存中申请相应的系统内存镜像区,并将需要保存的系统内存原始数据及相应的物理地址保存至所述系统内存镜像区;
    对保存的各个非系统内存原始数据及相应的物理地址,和保存的各个系统内存原始数据及相应的物理地址进行压缩,生成相应的镜像文件。
  2. 如权利要求1所述的方法,其特征在于,基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区之前,进一步包括:
    根据预设的配置信息,确定需要使用非系统内存中保存的数据生成镜像文件。
  3. 如权利要求1所述的方法,其特征在于,所述将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区,包括:
    将所述非系统内存原始数据保存在所述非系统内存镜像区的第一区域;
    将所述非系统内存原始数据对应的物理地址,以元数据形式保存在所述非系统内存镜像区的第二区域;
    其中,所述第一区域与系统内存镜像区中设定的镜像头区域之间的距离,大于所述第二区域与所述镜像头区域之间的距离。
  4. 如权利要求3所述的方法,其特征在于,采用预设格式,对保存的各个非系统内存原始数据及相应的物理地址,和保存的各个系统内存原始数据及相应的物理地址进行压缩之前,进一步包括:
    将非系统内存镜像区中各个非系统内存原始数据及相应的物理地址之间的映射关系,保存在设定的镜像头区域中;以及,
    将系统内存镜像区中各个系统内存原始数据及相应的物理地址之间的映射关系,保存在所述镜像头区域中。
  5. 如权利要求1-4任一项所述的方法,其特征在于,进一步包括:
    将所述镜像文件保存至存储器的指定位置。
  6. 一种镜像文件的加载方法,其特征在于,包括:
    在进行交流开机之后,获取预存的镜像文件,在系统内存中进行解压,
    针对解压后的镜像文件中记录的各个物理内存页,分别执行以下操作:
    根据解压后的镜像文件中记录的元数据,确定物理内存页的物理地址;
    根据所述物理内存页的物理地址,确定所述物理内存页为非系统内存物理内存页时,将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地 址;
    按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应位置。
  7. 如权利要求6所述的方法,其特征在于,进一步包括:
    根据所述物理内存页的物理地址,确定所述物理内存页为系统内存物理内存页时,按照所述系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的系统内存原始数据;
    按照所述系统内存物理内存页的物理地址,将所述系统内存原始数据保存至系统内存中的对应位置。
  8. 一种智能设备,其特征在于,包括处理器和存储器,其中:
    所述存储器,用于存储计算机指令;
    所述处理器,用于执行所述计算机指令以执行:
    基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区;
    针对待处理的各个非系统内存物理内存页,分别执行以下操作:
    将非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
    从所述非系统内存物理内存页中读取非系统内存原始数据,并基于所述内核虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区;
    在系统内存中申请相应的系统内存镜像区,并将需要保存的系统内存原始数据及相应的物理地址保存至所述系统内存镜像区;
    对保存的各个非系统内存原始数据及相应的物理地址,和保存的各个系统内存原始数据及相应的物理地址进行压缩,生成相应的镜像文件。
  9. 一种智能设备,其特征在于,至少包括处理器和存储器,其中:
    所述存储器,用于存储计算机指令;
    所述处理器,用于执行所述计算机指令以执行:
    在进行交流开机之后,获取预存的镜像文件,在系统内存中进行解压;
    针对解压后的镜像文件中记录的各个物理内存页,分别执行以下操作:
    根据解压后的镜像文件中记录的元数据,确定物理内存页的物理地址;
    根据所述物理内存页的物理地址,确定所述物理内存页为非系统内存物理内存页时,将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
    按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应位置。
  10. 一种存储介质,其特征在于,存储有用于实现镜像文件的生成方法的程序,所述程序被处理器运行时,执行以下步骤:
    基于非系统内存中需要保存的数据总量,在系统内存中申请相应的非系统内存镜像区;
    针对待处理的各个非系统内存物理内存页,分别执行以下操作:
    将非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
    从所述非系统内存物理内存页中读取非系统内存原始数据,并基于所述内核虚拟地址,将所述非系统内存原始数据及相应的物理地址,保存至所述非系统内存镜像区;
    在系统内存中申请相应的系统内存镜像区,并将需要保存的系统内存原始数据及相应的物理地址保存至所述系统内存镜像区;
    对保存的各个非系统内存原始数据及相应的物理地址,和各个系统内存原始数据及相应的物理地址进行压缩,生成相应的镜像文件。
  11. 一种存储介质,其特征在于,存储有用于实现镜像文件的加载方法的程序,所述程序被处理器运行时,执行以下步骤:
    获取预存的镜像文件,在系统内存中进行解压;
    针对解压后的镜像文件中记录的各个物理内存页,执行以下操作:
    根据解压后的镜像文件中记录的元数据,确定物理内存页的物理地址;
    根据所述物理内存页的物理地址,确定所述物理内存页为非系统内存物理内存页时,将所述非系统内存物理内存页的物理地址映射为相应的内核虚拟地址;
    按照所述非系统内存物理内存页的内核虚拟地址,从解压后的镜像文件中读取相应的非系统内存原始数据,并按照所述非系统内存物理内存页的物理地址,将所述非系统内存原始数据保存至非系统内存中的对应位置。
PCT/CN2019/107170 2018-12-11 2019-09-23 一种镜像文件的生成及加载方法、设备 Ceased WO2020119213A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811510641.6A CN109683983B (zh) 2018-12-11 2018-12-11 一种镜像文件的生成及加载方法、设备
CN201811510641.6 2018-12-11

Publications (1)

Publication Number Publication Date
WO2020119213A1 true WO2020119213A1 (zh) 2020-06-18

Family

ID=66186618

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/107170 Ceased WO2020119213A1 (zh) 2018-12-11 2019-09-23 一种镜像文件的生成及加载方法、设备

Country Status (2)

Country Link
CN (1) CN109683983B (zh)
WO (1) WO2020119213A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020504A (zh) * 2021-10-19 2022-02-08 北京五八信息技术有限公司 一种数据处理方法、装置、电子设备及存储介质
CN115145597A (zh) * 2022-06-15 2022-10-04 武汉噢易云计算股份有限公司 一种快速生成种子文件的方法及系统
CN115599592A (zh) * 2021-07-08 2023-01-13 超聚变数字技术有限公司(Cn) 内存镜像方法及计算设备
CN115904402A (zh) * 2022-10-21 2023-04-04 济南浪潮数据技术有限公司 一种智能网卡系统镜像制作方法、装置、设备及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109683983B (zh) * 2018-12-11 2021-09-24 海信视像科技股份有限公司 一种镜像文件的生成及加载方法、设备
CN110647753B (zh) * 2019-09-30 2021-04-16 Oppo广东移动通信有限公司 内核文件的获取方法、装置、设备及存储介质
CN113835872B (zh) * 2020-06-24 2025-08-26 北京小米移动软件有限公司 一种用于减少内存开销的数据处理方法、装置及存储介质
CN113656184B (zh) * 2021-08-31 2025-09-12 北京沃东天骏信息技术有限公司 数据处理方法及装置
CN120353723B (zh) * 2025-06-18 2025-09-19 浪潮电子信息产业股份有限公司 一种内存访问方法、程序产品、设备及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6195749B1 (en) * 2000-02-10 2001-02-27 Advanced Micro Devices, Inc. Computer system including a memory access controller for using non-system memory storage resources during system boot time
CN103336736A (zh) * 2013-05-27 2013-10-02 华为技术有限公司 系统日志获取方法和装置
CN105739982A (zh) * 2016-01-29 2016-07-06 浪潮(北京)电子信息产业有限公司 一种系统休眠的方法及装置
CN107765990A (zh) * 2016-08-17 2018-03-06 中兴通讯股份有限公司 一种系统磁盘管理方法和装置
CN107894932A (zh) * 2016-09-29 2018-04-10 厦门雅迅网络股份有限公司 保持系统重启前后数据一致性的方法及其系统
CN109683983A (zh) * 2018-12-11 2019-04-26 青岛海信电器股份有限公司 一种镜像文件的生成及加载方法、设备

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100342353C (zh) * 2006-04-07 2007-10-10 浙江大学 嵌入式操作系统中进程映射实现方法
CN101464835A (zh) * 2007-12-18 2009-06-24 英业达股份有限公司 操作系统的物理内存存取的方法
CN101639782A (zh) * 2009-07-14 2010-02-03 上海市共进通信技术有限公司 基于嵌入式操作系统的系统引导载入方法
CN101917350B (zh) * 2010-09-13 2012-08-15 南京中兴特种软件有限责任公司 一种Linux下基于网卡驱动的零拷贝以太网报文捕获及发送的实现方法
JP2012243287A (ja) * 2011-05-24 2012-12-10 Sony Corp 情報処理装置および情報処理方法
US9158550B2 (en) * 2011-06-16 2015-10-13 Vmware, Inc. Caching based operating system installation
CN102207881B (zh) * 2011-07-07 2014-01-22 电子科技大学 一种基于Android的操作系统快速启动方法
CN103955389B (zh) * 2014-05-06 2017-09-29 中国科学院微电子研究所 一种基于pcm的系统启动方法
CN104461643B (zh) * 2014-12-16 2017-12-19 中科创达软件股份有限公司 电子设备的控制方法、控制装置及电子设备
CN104503788A (zh) * 2014-12-16 2015-04-08 电子科技大学 一种缩短安卓操作系统启动时间的设置方法
CN105302663B (zh) * 2015-09-19 2019-02-01 华为技术有限公司 一种镜像开机方法和终端设备
CN107315598A (zh) * 2016-04-26 2017-11-03 中国科学院微电子研究所 一种系统恢复方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6195749B1 (en) * 2000-02-10 2001-02-27 Advanced Micro Devices, Inc. Computer system including a memory access controller for using non-system memory storage resources during system boot time
CN103336736A (zh) * 2013-05-27 2013-10-02 华为技术有限公司 系统日志获取方法和装置
CN105739982A (zh) * 2016-01-29 2016-07-06 浪潮(北京)电子信息产业有限公司 一种系统休眠的方法及装置
CN107765990A (zh) * 2016-08-17 2018-03-06 中兴通讯股份有限公司 一种系统磁盘管理方法和装置
CN107894932A (zh) * 2016-09-29 2018-04-10 厦门雅迅网络股份有限公司 保持系统重启前后数据一致性的方法及其系统
CN109683983A (zh) * 2018-12-11 2019-04-26 青岛海信电器股份有限公司 一种镜像文件的生成及加载方法、设备

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115599592A (zh) * 2021-07-08 2023-01-13 超聚变数字技术有限公司(Cn) 内存镜像方法及计算设备
CN114020504A (zh) * 2021-10-19 2022-02-08 北京五八信息技术有限公司 一种数据处理方法、装置、电子设备及存储介质
CN114020504B (zh) * 2021-10-19 2022-08-09 北京五八信息技术有限公司 一种数据处理方法、装置、电子设备及存储介质
CN115145597A (zh) * 2022-06-15 2022-10-04 武汉噢易云计算股份有限公司 一种快速生成种子文件的方法及系统
CN115904402A (zh) * 2022-10-21 2023-04-04 济南浪潮数据技术有限公司 一种智能网卡系统镜像制作方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN109683983B (zh) 2021-09-24
CN109683983A (zh) 2019-04-26

Similar Documents

Publication Publication Date Title
CN109683983B (zh) 一种镜像文件的生成及加载方法、设备
CN105718217B (zh) 一种精简配置存储池数据一致性维护的方法及装置
US9396107B2 (en) Memory system having memory controller with cache memory and NVRAM and method of operating same
CN103218224B (zh) 一种提高存储空间利用率的方法和终端
TWI596541B (zh) 資料存取系統、資料存取裝置及資料存取方法
US11422860B2 (en) Optimizing save operations for OS/hypervisor-based persistent memory
US20120311240A1 (en) Information processing apparatus, information processing method, and storage medium
CN102831069A (zh) 内存处理方法、内存管理设备
JP2016504700A (ja) ストレージシステムにおけるオブジェクトベースのトランザクションのための方法およびシステム
US9535796B2 (en) Method, apparatus and computer for data operation
KR102533726B1 (ko) 전자 장치 및 그의 제어방법
CN113448722B (zh) 进程内存的映射方法和基于无服务器架构的实例处理方法
CN103229150B (zh) 数据控制方法及系统
CN107924350A (zh) 电子设备及其数据压缩方法
CN104866388B (zh) 数据处理方法及装置
CN107315598A (zh) 一种系统恢复方法及装置
CN107908755A (zh) 一种快照文件处理方法及装置
US9904559B2 (en) Information processing apparatus and activation method therefor for processing data of a hibernation image
CN110308861B (zh) 存储数据保存方法、装置、电子设备和可读存储介质
CN104268005B (zh) 虚拟机唤醒方法和装置
US9372700B2 (en) Network boot system
JP6080492B2 (ja) 情報処理装置、起動方法およびプログラム
US11221985B2 (en) Metadata space efficient snapshot operation in page storage
CN104603754B (zh) 网络启动系统
CN120276874B (zh) 一种计算机显存共享方法、装置、设备及存储介质

Legal Events

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

Ref document number: 19896104

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19896104

Country of ref document: EP

Kind code of ref document: A1