WO2018040802A1 - Full-image file generation method and apparatus, and computer storage medium - Google Patents

Full-image file generation method and apparatus, and computer storage medium Download PDF

Info

Publication number
WO2018040802A1
WO2018040802A1 PCT/CN2017/094282 CN2017094282W WO2018040802A1 WO 2018040802 A1 WO2018040802 A1 WO 2018040802A1 CN 2017094282 W CN2017094282 W CN 2017094282W WO 2018040802 A1 WO2018040802 A1 WO 2018040802A1
Authority
WO
WIPO (PCT)
Prior art keywords
partition
type
image file
partitions
emmc
Prior art date
Application number
PCT/CN2017/094282
Other languages
French (fr)
Chinese (zh)
Inventor
冯立彬
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2018040802A1 publication Critical patent/WO2018040802A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Definitions

  • the present invention relates to image creation, programming, and upgrading techniques, and more particularly to a method and apparatus for generating a full image file, and a computer storage medium.
  • SOC System on Chip
  • NOR FLASH NAND FLASH
  • embedded multimedia A nonvolatile memory such as an Embeded Multi Media Card (EMMC) is used as a storage medium.
  • EMMC Embeded Multi Media Card
  • kernel-booted bootloader uboot
  • kernel kernel
  • rootfs root file system
  • security mode recovery
  • App application
  • the above parts are usually stored in binary form in a non-volatile memory.
  • the non-volatile memory can be partitioned, for example, the non-volatile memory is divided into a uboot partition, a kernel partition, a rootfs partition, a recovery partition, and an app partition, and each partition stores a mirror of the corresponding partition.
  • the non-volatile memory is programmed for burning and subsequent product upgrades.
  • the capacity of EMMC is getting larger and larger.
  • the size of common EMMC is 8Gb, 16Gb and 32Gb.
  • most of the space in EMMC is reserved for users, that is to say in EMMC.
  • the traditional method of making a full-image file is to directly splicing the mirrors of the partitions in the non-volatile memory into a block, for example, splicing the uboot partition, the kernel partition, the rootfs partition, the recovery partition, and the image of the app partition into a block to form a mirror image.
  • a full image file is bulky, and it is not only time-consuming to perform programming and upgrading in the non-volatile memory, but also has low processing efficiency.
  • the embodiment of the present invention provides a method and a device for generating a full image file, and a computer storage medium, which can reduce the volume of the full image file, thereby speeding up the process of writing and upgrading, and improving the processing of the burning and upgrading process. effectiveness.
  • An embodiment of the present invention provides a method for generating a full image file, where the method includes:
  • the embedded multimedia card EMMC is partitioned according to the specified partition format to obtain at least one partition;
  • the image file of the first type of partition and the image file of the second type of partition are spliced into a full image file.
  • the EMMC is partitioned according to a specified partition format to obtain at least one partition, including:
  • the partition parameter includes a partition name, a number of partitions, and a partition size.
  • the method further includes:
  • the generating an image file corresponding to the first type of partition according to all the data includes: compressing all data extracted from each first type of partition to generate an M corresponding to each first type of partition.
  • An image file, M is a positive integer greater than or equal to 1;
  • the image file of the first type of partition and the image file of the second type of partition are spliced into a full image file, including:
  • the M image files are filled according to the start address position and the end address position of each of the first type of partitions, and the N image files are based on the start address of each of the second type partitions.
  • the location and end address locations are padded to obtain the full mirror file.
  • An embodiment of the present invention provides a device for generating a full image file, where the device includes: a first processing unit, a second processing unit, and a third processing unit;
  • the first processing unit is configured to partition the EMMC according to the specified partition format to obtain at least one partition;
  • the second processing unit is configured to extract all data included in each of the first type of partitions in the at least one partition, and generate an image file corresponding to the first type of partition according to all the data; extracting the Valid data included in each of the second type of partitions in at least one partition, and generating an image file corresponding to the second type of partition according to the valid data;
  • the third processing unit is configured to splicing the image file of the first type of partition and the image file of the second type of partition into a full image file.
  • the first processing unit is further configured to:
  • the EMMC is partitioned according to the set partition parameter to divide the EMMC into at least one partition corresponding to the partition parameter; the partition parameter includes a partition name, a partition number, and a partition size.
  • the first processing unit is further configured to partition the EMMC according to the specified partition format, and after obtaining at least one partition, according to valid data included in each of the at least one partition
  • the actual size is related to the size of the partition itself, and the at least one partition is divided into a first type partition and a second type partition.
  • the second processing unit generates an image file corresponding to the first type of partition according to all the data: compressing all data extracted from each first type of partition to generate corresponding first type M mirror files of the partition, M is a positive integer greater than or equal to 1;
  • the third processing unit is further configured to:
  • the second processing unit When the second processing unit generates M image files corresponding to each of the first class partitions, record a start address position and an end address position of each of the first type partitions;
  • the M image files are filled according to the start address position and the end address position of each of the first type of partitions, and the N image files are based on the start address of each of the second type partitions.
  • the location and end address locations are padded to obtain the full mirror file.
  • the embodiment of the invention further provides a computer storage medium storing a computer program configured to execute the method for generating the full image file.
  • the method and device for generating a full image file and the computer storage medium partition the EMMC according to the specified partition format to obtain at least one partition; and extracting each of the first type partitions included in the at least one partition All the data, and generating an image file corresponding to the first type of partition according to all the data; extracting valid data included in each of the at least one partition, and generating a corresponding data according to the valid data An image file of the second type of partition; splicing the image file of the first type of partition and the image file of the second type of partition into a full image file.
  • the valid data included in each of the second type of partitions is extracted, and an image file corresponding to the second type of partition is generated according to the valid data, and the second type of partition is reduced.
  • the size of the image file which reduces the size of the full image file, speeds up the programming and upgrade process and improves the processing efficiency of the programming and upgrading process.
  • FIG. 1 is a schematic flowchart of an implementation process of a method for generating a full image file according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a specific implementation process of a method for generating a full image file according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a device for generating a full image file according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of an implementation method of a method for generating a full image file according to an embodiment of the present invention, where the method includes:
  • Step 101 Partition the embedded multimedia card according to the specified partition format to obtain at least one partition.
  • the EMMC is partitioned according to the set partition parameter, to divide the EMMC into at least one partition corresponding to the partition parameter;
  • the partition parameter includes a partition name, a number of partitions, and a partition. size.
  • the address space in the EMMC exists in the form of a block, that is, the address space in the EMMC is composed of a plurality of blocks, each block corresponding to a number; therefore, after the EMMC is partitioned according to the set partition parameter, the Each of the at least one partition corresponds to a start number and an end number of the block, that is, the address space of each of the partitions in the EMMC can be obtained according to the start number and the end number of the block corresponding to each partition.
  • the method further includes: dividing the at least one partition into the first type partition according to the relationship between the actual size of the valid data included in each of the at least one partition and the size of the partition itself. And the second type of partition.
  • the at least one partition is divided into a first type partition and a second type partition to perform different processing on the first type partition and the second type partition separately when generating the image file.
  • the first type of partition refers to a partition having a small difference between the actual size of the valid data included in the partition and the size of the partition itself, such as the difference between the actual size of the valid data included in the partition and the size of the partition itself.
  • a partition that is less than or equal to the set first threshold refers to a difference between the actual size of the valid data included in the partition and the size of the partition itself.
  • the partition such as the partition where the difference between the actual size of the valid data contained in the partition and the size of the partition itself is greater than the first threshold set.
  • each partition of the at least one partition is, according to the address space occupied by each partition in the EMMC and the address space in the EMMC
  • Dividing the at least one partition into a first type partition and a second type partition for example, dividing a partition occupying an EMMC address space larger than a set second threshold into a second type partition, occupying an EMMC address space less than or equal to a setting
  • the partition of the second threshold is divided into the first type of partition.
  • the at least one partition may not be divided into the first type partition and the second type partition, that is, the at least one partition is all divided into the second type partition.
  • the EMMC is divided into seven partitions such as uboot, misc, kernel, rootfs, recovery, app, and data;
  • the seven partitions are divided into a first type partition and a second type partition, and the process is as follows: for any one partition, the partition is calculated. The difference between the actual size of the valid data and the size of the partition itself. If the difference is greater than the set threshold, the partition is divided into the second type partition, otherwise the partition is divided into the first type partition. .
  • Step 102 Extract all data included in each of the at least one partition, and generate an image file corresponding to the first type of partition according to all the data.
  • M is a positive integer greater than or equal to 1
  • recording a start address position and an end address position of each of the first type of partitions, and each of the M image files The starting address location and size of the image file.
  • the valid data included in each of the first type of partitions in the at least one partition may also be extracted, and the valid data extracted from each of the first type of partitions is compressed to generate M corresponding to each of the first type of partitions.
  • the image file is mirrored to reduce the size of the image file of the first type of partition, thereby further reducing the volume of the full image file.
  • the start address position is a start block number; the end address position is an end block number; all data includes valid data and invalid data; the valid data refers to a boot of the system saved by the partition, Data such as parameter configuration has an important role; the invalid data refers to data filled in the partition to make up for the gap of valid data, usually filled with the number 0.
  • the second type of partition includes four partitions: rootfs, recovery, app, and data; for uboot and kernel partitions, you can modify the existing uboot and respectively.
  • the kernel programming code compiles the image files of the uboot and the kernel partition respectively by compiling the modified programming code; for the misc partition, manually creates a binary file containing the version number of the full image file and some key parameters in the system. And then generate a misc partition image based on the binary file.
  • Step 103 Extract valid data included in each of the at least one partition, and generate an image file corresponding to the second type partition according to the valid data.
  • N is a positive integer greater than or equal to 1
  • N records the start address position and the end address position of each of the second type of partitions, and the start address position and size of each of the N image files.
  • the number of image files corresponding to each of the second type of partitions is not only greater than or equal to one, but There is a certain difference between the number of image files corresponding to each type 2 partition; the valid data extracted from each second type partition is compressed to generate N image files corresponding to each second type partition. It can be implemented by the prior art method, such as the method of making an image file under linux.
  • the second type of partition includes four partitions: rootfs, recovery, app, and data; for rootfs, recovery, app, and data partitions, each is prepared separately.
  • the rootfs, recovery, app, and data partitions are created based on the valid data contained in each partition by using the image file created by linux. The corresponding image file.
  • Step 104 splicing the image file of the first type of partition and the image file of the second type of partition into a full image file.
  • the start address position and the end address position of each of the first type partitions are recorded; and each second is generated according to the generating
  • the N image files of the class partition are recorded, the start address position and the end address position of each of the second type partitions are recorded; according to the specified data format, the M image files are classified according to each of the first type partitions.
  • the start address position and the end address position are filled, and N image files are filled according to the start address position and the end address position of each of the second type partitions to obtain the full image file.
  • the full image file includes an image file corresponding to each partition, that is, the full image file includes an image file of each first type partition and an image file of each second type partition.
  • FIG. 2 is a schematic flowchart of a specific implementation process of a method for generating a full image file according to an embodiment of the present invention, where the method includes:
  • Step 201 Partition the EMMC according to the specified partition format, and obtain uboot, misc, Kernel, rootfs, recovery, app, and data partitions;
  • the address space in the EMMC exists in the form of a block, that is, the address space in the EMMC is composed of a plurality of blocks; therefore, after EMMC is partitioned according to the specified partition format, the uboot, misc, kernel, rootfs, Each of the seven partitions, such as recovery, app, and data, respectively has a start number and an end number of the block, that is, each partition has a start address position and an end address position respectively; according to the block corresponding to each partition
  • the start number and the end number of the address space of each of the partitions in the EMMC; the start number of the block may be referred to as a start block number, and the end number of the block may be referred to as an end block number.
  • the Uboot partition is a boot partition of the kernel boot, which is used as a boot part of the embedded operating system to boot common operating systems such as Linux, VxWorks or NETBSD;
  • the Misc partition is a mixed partition for saving the version number of the full image file. , the system startup parameters or key information;
  • Kernel partition is the kernel partition, used to save the kernel image of the operating system;
  • Rootfs partition is the root file system partition, used to save the file system loaded when the system starts normally, common root files
  • the format of the system is: ext2/ext3/ext4, UBI, ramdisk, etc.;
  • Recovery partition is a secure mode partition, which is used to save the file system image during system upgrade.
  • the App partition is the application partition, which is used to save the system application and other content
  • the Data partition is the data partition, mainly for the customer. Reserved, used to save common example audio and video files and other content.
  • Step 202 Create an image file of the uboot, misc, and kernel partitions.
  • the existing uboot and kernel partition programming codes can be modified separately, and the image files of the uboot and the kernel partition are separately generated after compiling the modified programming code; for the misc partition, it can be manually created.
  • a binary file containing the version number of the full image file and some key parameters in the system and then generates a misc partition image based on the binary file.
  • Step 203 Prepare a folder, a start address, and an end address corresponding to the rootfs, recovery, app, and data partitions respectively.
  • the folder corresponding to the rootfs partition generally contains folders and files created by busybox, and some necessary files required for the product to start;
  • the folder corresponding to the recovery partition generally contains a folder created by busybox and Files, and some necessary files required for product upgrade;
  • the folder corresponding to the app partition generally contains the application content of the product;
  • the folder corresponding to the data partition generally contains examples of audio and video files.
  • the address space in the EMMC is composed of a plurality of blocks, each block corresponding to a number, and each partition is composed of one or more consecutive blocks of consecutive numbers; when the EMMC is partitioned in step 201, The start address and the end address corresponding to each of the seven partitions such as uboot, misc, kernel, rootfs, recovery, app, and data, that is, the start number and the end number of the block.
  • Step 204 Prepare the rootfs, recovery, app, and data partitions before compression
  • the loop block device is partitioned by the fdisk command under linux to divide the loop block device into four regions, corresponding to the rootfs, recovery, app, and data partitions respectively.
  • the unit of the input parameter in the fdisk command is a block; for EMMC, the size of the block is generally 512B; when the fdisk command under linux is used to partition the loop block device, You need to partition based on the starting block number and ending block number corresponding to the rootfs, recovery, app, and data partitions.
  • the partitioning device respectively corresponds to four partitions including rootfs, recovery, app, and data included in the partition table; when the partition device corresponding to the partition table is generated by using the kpartx-av command under linux, it is in /dev/ In the mapper/ directory, you can see four partition device files such as loop6p1, loop6p2, loop6p3 and loop6p4.
  • the loop6pX includes loop6p1, loop6p2, loop6p3 and loop6p4; the loop6pX is formatted by using the mke2fs command under linux, and the four partitions can be formatted into an ext4 file system.
  • the contents of the folder corresponding to the rootfs, recovery, app, and data partitions prepared in step 203 are copied to the rootfs_temp, recovery_temp, app_temp, and data_temp folders, respectively, and the contents of the folder corresponding to the rootfs partition are copied to In the rootfs_temp folder, copy the contents of the folder corresponding to the recovery partition to the recovery_temp folder, copy the contents of the folder corresponding to the app partition to the app_temp folder, and copy the contents of the folder corresponding to the data partition to the data_temp file.
  • the folder In the folder.
  • Step 205 Compress the rootfs, recovery, app, and data partitions to generate image files corresponding to the rootfs, recovery, app, and data partitions.
  • the compression is based on: for most storage media, files in the file system are generally stored in partitions and in order; if there are few files in a partition, only the beginning portion of the partition has The data, while most of the latter content is zero; thus, by extracting the valid data in the partition, the purpose of partition compression can be achieved.
  • the reading device /dev/loop6 reads 128 KB at a time; if the 128 KB content is zero, it continues to read the next 128 KB; if the 128 KB content is not zero, the next 128 KB is sequentially read until The contents read to 128KB are all zero; the contents of 128KB from the first non-zero content to 128KB between the last non-zero content are recorded in one or more fragment images, and these fragment images can be named sequentially.
  • Fragment_1, fragment_2, ..., Fragment_T record the starting block number corresponding to each fragment and the size of each fragment to the fragment_list; after the reading is completed, the mirror_1, fragment_2, ..., Fragment_T and other mirrors and the fragment_list file are obtained.
  • Step 206 Fill the full image file according to the specified data format
  • the EMMC full image file is filled with the image files of the uboot, misc, kernel, rootfs, recovery, app, and data partitions, including:
  • the total Partitions size is equal to the number of the Fragments T plus 3.
  • the starting block number and size of the Fragment_1 partition can be obtained in the fragment_list.
  • Step 207 Generate a full image file.
  • step 206 the full-mirror file consisting of image files of seven partitions such as uboot, misc, kernel, rootfs, recovery, app, and data has not been completely generated, and the finishing work needs to be completed at this time, including :
  • the image format of the uboot, misc, and kernel partitions can be obtained from the data format of the EMMC shown in Table 1 and the starting block address and size of the uboot, misc, and kernel partitions. This will allow you to upgrade the uboot, misc, and kernel partitions.
  • Partition which fragement image belongs to the app partition, and which fragement image belongs to the data partition; take out the fragment image corresponding to the rootfs partition in the full image file, and write to the rootfs partition to complete the writing of the rootfs partition image; similarly, it can be completed in sequence Write of the recovery, app, and data partition images.
  • FIG. 3 is a schematic structural diagram of a device for generating a full image file according to an embodiment of the present invention.
  • the device includes: a first processing unit 41, a second processing unit 42 and a third processing unit 43; wherein
  • the first processing unit 41 is configured to partition the EMMC according to the specified partition format to obtain at least one partition;
  • the second processing unit 42 is configured to extract all data included in each of the first class partitions of the at least one partition, and generate an image file corresponding to the first type partition according to all the data; Determining valid data included in each of the second type of partitions in the at least one partition, and generating an image file corresponding to the second type of partition according to the valid data;
  • the third processing unit 43 is configured to splicing the image file of the first type of partition and the image file of the second type of partition into a full image file.
  • the first processing unit 41 is further configured to: after acquiring the embedded multimedia card, partitioning the EMMC according to the set partition parameter, to divide the EMMC into at least one partition corresponding to the partition parameter;
  • the partition parameters include the partition name, the number of partitions, and the partition size.
  • the address space in the EMMC exists in the form of a block, that is, the address space in the EMMC is composed of a plurality of blocks, each block corresponding to a number; therefore, after the EMMC is partitioned according to the set partition parameter, the Each of the at least one partition corresponds to a start number and an end number of the block, that is, the address space of each of the partitions in the EMMC can be obtained according to the start number and the end number of the block corresponding to each partition.
  • the first processing unit 41 is further configured to divide the at least one partition into the first category according to the relationship between the actual size of the valid data included in each of the at least one partition and the size of the partition itself. Partition and second class partition.
  • the at least one partition is divided into a first type partition and a second type partition to perform different processing on the first type partition and the second type partition separately when generating the image file.
  • the first type of partition refers to a partition having a small difference between the actual size of the valid data included in the partition and the size of the partition itself, such as the difference between the actual size of the valid data included in the partition and the size of the partition itself.
  • a partition that is less than or equal to the set first threshold refers to a partition having a large difference between the actual size of the valid data included in the partition and the size of the partition itself, such as the actual size of the valid data included in the partition.
  • the at least one partition is divided into the first type partition and the second type partition; for example, the partition occupying the EMMC address space larger than the set second threshold is divided into the second type partition And partitioning the partition occupying the EMMC address space less than or equal to the set second threshold into the first type of partition.
  • the at least one partition may not be divided into the first type partition and the second type partition, that is, the at least one partition is all divided into the second type partition.
  • the EMMC is divided into seven partitions such as uboot, misc, kernel, rootfs, recovery, app, and data;
  • the seven partitions are divided into a first type partition and a second type partition, and the process is as follows: for any one partition, the partition is calculated. The difference between the actual size of the valid data and the size of the partition itself. If the difference is greater than the set threshold, the partition is divided into the second type partition, otherwise the partition is divided into the first type partition. .
  • the second processing unit 42 is further configured to: extract all data included in each of the at least one partition, and compress all the data extracted from each of the first type of partitions to generate corresponding data.
  • M image files of a first type of partition M is a positive integer greater than or equal to 1, recording the start address position and the end address position of each first type partition, and each image file in the M image files The starting address location and size.
  • the valid data included in each of the first type of partitions in the at least one partition may also be extracted, and the valid data extracted from each of the first type of partitions is compressed to generate M corresponding to each of the first type of partitions.
  • the image file is mirrored to reduce the size of the image file of the first type of partition, thereby further reducing the volume of the full image file.
  • the start address position is a start block number;
  • the end address position is an end block number; all data includes valid data and invalid Data;
  • the valid data refers to data saved by the partition that plays an important role in the startup, parameter configuration, and the like of the system;
  • the invalid data refers to data filled in the partition to make up for the vacancy of the valid data, usually using the number 0. Fill it up.
  • the second type of partition includes four partitions: rootfs, recovery, app, and data; for uboot and kernel partitions, you can modify the existing uboot and respectively.
  • the kernel programming code compiles the image files of the uboot and the kernel partition respectively by compiling the modified programming code; for the misc partition, manually creates a binary file containing the version number of the full image file and some key parameters in the system. And then generate a misc partition image based on the binary file.
  • the second processing unit 42 is further configured to: extract valid data included in each second type partition of the at least one partition, and compress valid data extracted from each second type partition to generate corresponding data N image files of a second type of partition, N is a positive integer greater than or equal to 1, recording the start address position and the end address position of each second type partition, and each of the N image files The starting address location and size.
  • the number of image files corresponding to each of the second type of partitions is not only greater than or equal to one, but each second type of partition There may be a certain difference between the number of corresponding image files; the method of compressing the valid data extracted from each second type of partition to generate N image files corresponding to each second type of partition may adopt a prior art method. Implementation, such as the method of making image files under linux.
  • the second type of partition includes four partitions: rootfs, recovery, app, and data; for rootfs, recovery, app, and data partitions, each is prepared separately.
  • the rootfs, recovery, app, and data partitions are created based on the valid data contained in each partition by using the image file created by linux. Right The image file should be.
  • the third processing unit 43 is further configured to: when the second processing unit generates the M image files corresponding to each of the first class partitions, record the start address position and end of each of the first class partitions. An address location; when the second processing unit generates N image files corresponding to each of the second class partitions, recording a start address location and an end address location of each of the second class partitions; according to the specified data format, Filling the M image files according to the start address position and the end address position of each of the first type of partitions, and performing N image files according to the start address position and the end address position of each of the second type partitions. Fill to get the full image file.
  • the full image file includes an image file corresponding to each partition, that is, the full image file includes an image file of each first type partition and an image file of each second type partition.
  • the first processing unit 41, the second processing unit 42, and the third processing unit 43 may each be implemented by a central processing unit (CPU), a digital signal processor (DSP), or the like located in the terminal.
  • CPU central processing unit
  • DSP digital signal processor
  • the apparatus for tracking the service signaling may also be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a separate product.
  • the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • program codes such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • an embodiment of the present invention further provides a computer storage medium in which a calculation is stored.
  • the computer program is configured to execute a method of generating a full image file according to an embodiment of the present invention.
  • the second type is reduced by extracting valid data included in each of the second type of partitions, and generating an image file corresponding to the second type of partition according to the valid data.
  • the size of the partitioned image file which reduces the size of the full image file, speeds up the programming and upgrade process, and improves the processing efficiency of the programming and upgrading process.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed is a full-image file generation method, comprising: partitioning an embedded multimedia card according to a specified partition format so as to obtain at least one partition; extracting all data contained in each first-type partition in the at least one partition, and generating, according to all the data, an image file corresponding to the first-type partition; extracting valid data contained in each second-type partition in the at least one partition, and generating, according to the valid data, an image file corresponding to the second-type partition; and splicing the image file of the first-type partition and the image file of the second-type partition into a full-image file. At the same time, further disclosed is a full-image file generation apparatus.

Description

一种全镜像文件的生成方法及装置、计算机存储介质Method and device for generating full image file, computer storage medium
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201610777619.2、申请日为2016年08月30日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is filed on the basis of the Chinese Patent Application No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域Technical field
本发明涉及镜像制作、烧写和升级技术,尤其涉及一种全镜像文件的生成方法及装置、计算机存储介质。The present invention relates to image creation, programming, and upgrading techniques, and more particularly to a method and apparatus for generating a full image file, and a computer storage medium.
背景技术Background technique
集成电路行业的快速发展,使得各式各样的电子产品相继出现,而大部分电子产品都采用以片上***(System on Chip,SOC)作为处理器、并以NOR FLASH、NAND FLASH或嵌入式多媒体卡(Embeded Multi Media Card,EMMC)等非易失性存储器作为存储介质。The rapid development of the integrated circuit industry has led to the emergence of a wide range of electronic products, most of which use System on Chip (SOC) as a processor and NOR FLASH, NAND FLASH or embedded multimedia. A nonvolatile memory such as an Embeded Multi Media Card (EMMC) is used as a storage medium.
从软件开发角度来看,电子产品的软件开发大都包含有以下几个部分:内核启动的引导程序(uboot)、内核(kernel)、根文件***(rootfs)、安全模式(recovery)和应用程序(app)等。上述几个部分,通常以二进制形式保存在非易失性存储器里。此外,可对非易失性存储器进行分区,例如将非易失性存储器划分为uboot分区、kernel分区、rootfs分区、recovery分区和app分区等,而每个分区存储相应分区的镜像。然而,从产品生产、开发以及维护的角度来看,需要一个包含有上述uboot镜像、kernel镜像、rootfs镜像、recovery镜像和app镜像等内容和版本号的全镜像文件,以便于使用烧片器对非易失性存储器进行烧写和后续产品的升级处理。 From a software development point of view, software development of electronic products mostly includes the following parts: kernel-booted bootloader (uboot), kernel (kernel), root file system (rootfs), security mode (recovery), and application ( App) and so on. The above parts are usually stored in binary form in a non-volatile memory. In addition, the non-volatile memory can be partitioned, for example, the non-volatile memory is divided into a uboot partition, a kernel partition, a rootfs partition, a recovery partition, and an app partition, and each partition stores a mirror of the corresponding partition. However, from the perspective of product production, development, and maintenance, a full image file containing the contents and version number of the above uboot image, kernel image, rootfs image, recovery image, and app image is required to facilitate the use of the burner. The non-volatile memory is programmed for burning and subsequent product upgrades.
随着半导体工艺的发展,EMMC的容量越来越大,例如常见的EMMC的大小有8Gb、16Gb和32Gb等,然而EMMC中的大部分空间都是给用户预留的,也就是说EMMC中的大部分空间内没有有效数据。传统的全镜像文件的制作方法,是直接把非易失性存储器中各分区的镜像拼接到一块,例如将uboot分区、kernel分区、rootfs分区、recovery分区以及app分区的镜像拼接到一块,以形成一个全镜像文件。但是,根据上述方法生成的全镜像文件的体积很大,在非易失性存储器进行烧写和升级时不仅费时,而且处理效率很低。With the development of semiconductor technology, the capacity of EMMC is getting larger and larger. For example, the size of common EMMC is 8Gb, 16Gb and 32Gb. However, most of the space in EMMC is reserved for users, that is to say in EMMC. There is no valid data in most spaces. The traditional method of making a full-image file is to directly splicing the mirrors of the partitions in the non-volatile memory into a block, for example, splicing the uboot partition, the kernel partition, the rootfs partition, the recovery partition, and the image of the app partition into a block to form a mirror image. A full image file. However, the full-image file generated according to the above method is bulky, and it is not only time-consuming to perform programming and upgrading in the non-volatile memory, but also has low processing efficiency.
发明内容Summary of the invention
有鉴于此,本发明实施例提供了一种全镜像文件的生成方法及装置、计算机存储介质,能够减小全镜像文件的体积,从而加速烧写和升级过程,提高烧写和升级过程的处理效率。In view of this, the embodiment of the present invention provides a method and a device for generating a full image file, and a computer storage medium, which can reduce the volume of the full image file, thereby speeding up the process of writing and upgrading, and improving the processing of the burning and upgrading process. effectiveness.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, the technical solution of the present invention is achieved as follows:
本发明实施例提供了一种全镜像文件的生成方法,所述方法包括:An embodiment of the present invention provides a method for generating a full image file, where the method includes:
按照指定的分区格式对嵌入式多媒体卡EMMC进行分区,得到至少一个分区;The embedded multimedia card EMMC is partitioned according to the specified partition format to obtain at least one partition;
提取所述至少一个分区中的每一个第一类分区所包含的所有数据,并根据所述所有数据生成对应所述第一类分区的镜像文件;Extracting all data included in each of the at least one partition, and generating an image file corresponding to the first type of partition according to all the data;
提取所述至少一个分区中的每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件;Extracting valid data included in each of the at least one partition, and generating an image file corresponding to the second type of partition according to the valid data;
将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件。The image file of the first type of partition and the image file of the second type of partition are spliced into a full image file.
上述方案中,所述按照指定的分区格式对所述EMMC进行分区,得到至少一个分区,包括:In the above solution, the EMMC is partitioned according to a specified partition format to obtain at least one partition, including:
根据设置的分区参数对EMMC进行分区,以将所述EMMC划分为与 所述分区参数对应的至少一个分区;所述分区参数包括分区名称、分区数量、分区大小。Partitioning the EMMC according to the set partitioning parameters to divide the EMMC into At least one partition corresponding to the partition parameter; the partition parameter includes a partition name, a number of partitions, and a partition size.
上述方案中,所述按照指定的分区格式对所述EMMC进行分区,得到至少一个分区后,所述方法还包括:In the above solution, after the EMMC is partitioned according to the specified partition format to obtain at least one partition, the method further includes:
根据所述至少一个分区中每一个分区所包含的有效数据的实际大小与分区自身大小的关系,将所述至少一个分区划分为第一类分区和第二类分区。And dividing the at least one partition into a first type partition and a second type partition according to a relationship between an actual size of valid data included in each of the at least one partition and a size of the partition itself.
上述方案中,所述根据所述所有数据生成对应所述第一类分区的镜像文件,包括:将从每一个第一类分区中提取的所有数据压缩后生成对应每一个第一类分区的M个镜像文件,M为大于或等于1的正整数;In the above solution, the generating an image file corresponding to the first type of partition according to all the data includes: compressing all data extracted from each first type of partition to generate an M corresponding to each first type of partition. An image file, M is a positive integer greater than or equal to 1;
所述根据所述有效数据生成对应所述第二类分区的镜像文件,包括:将从每一个第二类分区中提取的有效数据压缩后生成对应每一个第二类分区的N个镜像文件,N为大于或等于1的正整数。And generating, according to the valid data, an image file corresponding to the second type of partition, comprising: compressing valid data extracted from each second type of partition to generate N image files corresponding to each second type of partition, N is a positive integer greater than or equal to 1.
上述方案中,所述将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件,包括:In the above solution, the image file of the first type of partition and the image file of the second type of partition are spliced into a full image file, including:
所述生成对应每一个第一类分区的M个镜像文件时,记录所述每一个第一类分区的起始地址位置和结束地址位置;When the M image files corresponding to each of the first type of partitions are generated, the start address position and the end address position of each of the first type of partitions are recorded;
所述生成对应每一个第二类分区的N个镜像文件时,记录所述每一个第二类分区的起始地址位置和结束地址位置;When the N image files corresponding to each of the second type of partitions are generated, the start address position and the end address position of each of the second type partitions are recorded;
按照指定的数据格式,将M个镜像文件根据所述每一个第一类分区的起始地址位置和结束地址位置进行填充,将N个镜像文件根据所述每一个第二类分区的起始地址位置和结束地址位置进行填充,以得到所述全镜像文件。According to the specified data format, the M image files are filled according to the start address position and the end address position of each of the first type of partitions, and the N image files are based on the start address of each of the second type partitions. The location and end address locations are padded to obtain the full mirror file.
本发明实施例提供了一种全镜像文件的生成装置,所述装置包括:第一处理单元、第二处理单元、第三处理单元;其中, An embodiment of the present invention provides a device for generating a full image file, where the device includes: a first processing unit, a second processing unit, and a third processing unit;
所述第一处理单元,配置为按照指定的分区格式对EMMC进行分区,得到至少一个分区;The first processing unit is configured to partition the EMMC according to the specified partition format to obtain at least one partition;
所述第二处理单元,配置为提取所述至少一个分区中的每一个第一类分区所包含的所有数据,并根据所述所有数据生成对应所述第一类分区的镜像文件;提取所述至少一个分区中的每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件;The second processing unit is configured to extract all data included in each of the first type of partitions in the at least one partition, and generate an image file corresponding to the first type of partition according to all the data; extracting the Valid data included in each of the second type of partitions in at least one partition, and generating an image file corresponding to the second type of partition according to the valid data;
所述第三处理单元,配置为将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件。The third processing unit is configured to splicing the image file of the first type of partition and the image file of the second type of partition into a full image file.
上述方案中,所述第一处理单元,还配置为:In the above solution, the first processing unit is further configured to:
根据设置的分区参数对EMMC进行分区,以将所述EMMC划分为与所述分区参数对应的至少一个分区;所述分区参数包括分区名称、分区数量、分区大小。The EMMC is partitioned according to the set partition parameter to divide the EMMC into at least one partition corresponding to the partition parameter; the partition parameter includes a partition name, a partition number, and a partition size.
上述方案中,所述第一处理单元,还配置为在所述按照指定的分区格式对所述EMMC进行分区,得到至少一个分区后,根据所述至少一个分区中每一个分区所包含的有效数据的实际大小与分区自身大小的关系,将所述至少一个分区划分为第一类分区和第二类分区。In the above solution, the first processing unit is further configured to partition the EMMC according to the specified partition format, and after obtaining at least one partition, according to valid data included in each of the at least one partition The actual size is related to the size of the partition itself, and the at least one partition is divided into a first type partition and a second type partition.
上述方案中,所述第二处理单元根据所述所有数据生成对应所述第一类分区的镜像文件为:将从每一个第一类分区中提取的所有数据压缩后生成对应每一个第一类分区的M个镜像文件,M为大于或等于1的正整数;In the above solution, the second processing unit generates an image file corresponding to the first type of partition according to all the data: compressing all data extracted from each first type of partition to generate corresponding first type M mirror files of the partition, M is a positive integer greater than or equal to 1;
所述第二处理单元根据所述有效数据生成对应所述第二类分区的镜像文件为:将从每一个第二类分区中提取的有效数据压缩后生成对应每一个第二类分区的N个镜像文件,N为大于或等于1的正整数。And generating, by the second processing unit, the image file corresponding to the second type of partition according to the valid data: compressing valid data extracted from each second type of partition to generate N corresponding to each second type of partition Image file, N is a positive integer greater than or equal to 1.
上述方案中,所述第三处理单元,还配置为:In the above solution, the third processing unit is further configured to:
在所述第二处理单元生成对应每一个第一类分区的M个镜像文件时,记录所述每一个第一类分区的起始地址位置和结束地址位置; When the second processing unit generates M image files corresponding to each of the first class partitions, record a start address position and an end address position of each of the first type partitions;
在所述第二处理单元生成对应每一个第二类分区的N个镜像文件时,记录所述每一个第二类分区的起始地址位置和结束地址位置;When the second processing unit generates N image files corresponding to each of the second class partitions, record a start address position and an end address position of each of the second type partitions;
按照指定的数据格式,将M个镜像文件根据所述每一个第一类分区的起始地址位置和结束地址位置进行填充,将N个镜像文件根据所述每一个第二类分区的起始地址位置和结束地址位置进行填充,以得到所述全镜像文件。According to the specified data format, the M image files are filled according to the start address position and the end address position of each of the first type of partitions, and the N image files are based on the start address of each of the second type partitions. The location and end address locations are padded to obtain the full mirror file.
本发明实施例还提供一种计算机存储介质,该计算机存储介质存储有计算机程序,该计算机程序配置为执行上述全镜像文件的生成方法。The embodiment of the invention further provides a computer storage medium storing a computer program configured to execute the method for generating the full image file.
本发明实施例提供的全镜像文件的生成方法及装置、计算机存储介质,按照指定的分区格式对EMMC进行分区,得到至少一个分区;提取所述至少一个分区中的每一个第一类分区所包含的所有数据,并根据所述所有数据生成对应所述第一类分区的镜像文件;提取所述至少一个分区中的每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件;将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件。可见,本发明实施例通过提取所述每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件,减小了所述第二类分区的镜像文件的体积,即减小了全镜像文件的体积,从而可加速烧写和升级过程,提高了烧写和升级过程的处理效率。The method and device for generating a full image file and the computer storage medium provided by the embodiment of the present invention partition the EMMC according to the specified partition format to obtain at least one partition; and extracting each of the first type partitions included in the at least one partition All the data, and generating an image file corresponding to the first type of partition according to all the data; extracting valid data included in each of the at least one partition, and generating a corresponding data according to the valid data An image file of the second type of partition; splicing the image file of the first type of partition and the image file of the second type of partition into a full image file. It can be seen that, in the embodiment of the present invention, the valid data included in each of the second type of partitions is extracted, and an image file corresponding to the second type of partition is generated according to the valid data, and the second type of partition is reduced. The size of the image file, which reduces the size of the full image file, speeds up the programming and upgrade process and improves the processing efficiency of the programming and upgrading process.
附图说明DRAWINGS
图1为本发明实施例全镜像文件的生成方法的实现流程示意图;1 is a schematic flowchart of an implementation process of a method for generating a full image file according to an embodiment of the present invention;
图2为本发明实施例全镜像文件的生成方法的具体实现流程示意图;2 is a schematic flowchart of a specific implementation process of a method for generating a full image file according to an embodiment of the present invention;
图3为本发明实施例全镜像文件的生成装置的组成结构示意图。 FIG. 3 is a schematic structural diagram of a device for generating a full image file according to an embodiment of the present invention.
具体实施方式detailed description
图1为本发明实施例全镜像文件的生成方法的实现流程示意图,该方法包括:FIG. 1 is a schematic flowchart of an implementation method of a method for generating a full image file according to an embodiment of the present invention, where the method includes:
步骤101:按照指定的分区格式对嵌入式多媒体卡进行分区,得到至少一个分区;Step 101: Partition the embedded multimedia card according to the specified partition format to obtain at least one partition.
具体地,获取嵌入式多媒体卡后,根据设置的分区参数对EMMC进行分区,以将所述EMMC划分为与所述分区参数对应的至少一个分区;所述分区参数包括分区名称、分区数量、分区大小。Specifically, after acquiring the embedded multimedia card, the EMMC is partitioned according to the set partition parameter, to divide the EMMC into at least one partition corresponding to the partition parameter; the partition parameter includes a partition name, a number of partitions, and a partition. size.
这里,由于EMMC中的地址空间是以块的形式存在的,即EMMC中的地址空间由许多块组成,每个块对应有一个编号;因此,根据设置的分区参数对EMMC进行分区后,所述至少一个分区中每一个分区分别对应有块的起始编号和结束编号,即根据每一个分区所对应的块的起始编号和结束编号,可获取所述每一个分区在EMMC中的地址空间。Here, since the address space in the EMMC exists in the form of a block, that is, the address space in the EMMC is composed of a plurality of blocks, each block corresponding to a number; therefore, after the EMMC is partitioned according to the set partition parameter, the Each of the at least one partition corresponds to a start number and an end number of the block, that is, the address space of each of the partitions in the EMMC can be obtained according to the start number and the end number of the block corresponding to each partition.
进一步地,在步骤101之后,该方法还包括:根据所述至少一个分区中每一个分区所包含的有效数据的实际大小与分区自身大小的关系,将所述至少一个分区划分为第一类分区和第二类分区。Further, after the step 101, the method further includes: dividing the at least one partition into the first type partition according to the relationship between the actual size of the valid data included in each of the at least one partition and the size of the partition itself. And the second type of partition.
这里,由于所述至少一个分区中每一个分区所包含的有效数据的实际大小与分区自身大小之间存在差距,根据每一个分区所包含的有效数据的实际大小与分区自身大小之间的差距,将所述至少一个分区划分为第一类分区和第二类分区,以在生成镜像文件时对所述第一类分区和第二类分区分别进行不同的处理。Here, since there is a gap between the actual size of the valid data included in each of the at least one partition and the size of the partition itself, according to the difference between the actual size of the valid data included in each partition and the size of the partition itself, The at least one partition is divided into a first type partition and a second type partition to perform different processing on the first type partition and the second type partition separately when generating the image file.
这里,所述第一类分区是指分区所包含的有效数据的实际大小与分区自身大小之间相差较小的分区,比如分区所包含的有效数据的实际大小与分区自身大小之间的差值小于或等于设置的第一阈值的分区;所述第二类分区是指分区所包含的有效数据的实际大小与分区自身大小之间相差较大 的分区,比如分区所包含的有效数据的实际大小与分区自身大小之间的差值大于设置的第一阈值的分区。Here, the first type of partition refers to a partition having a small difference between the actual size of the valid data included in the partition and the size of the partition itself, such as the difference between the actual size of the valid data included in the partition and the size of the partition itself. a partition that is less than or equal to the set first threshold; the second type of partition refers to a difference between the actual size of the valid data included in the partition and the size of the partition itself. The partition, such as the partition where the difference between the actual size of the valid data contained in the partition and the size of the partition itself is greater than the first threshold set.
这里,也可根据所述至少一个分区中每一个分区的自身大小与所述EMMC地址空间大小之间的关系,即根据每一个分区在EMMC中所占用的地址空间与EMMC中的地址空间的关系,将所述至少一个分区划分为第一类分区和第二类分区;比如,将占用EMMC地址空间大于设置的第二阈值的分区划分为第二类分区,将占用EMMC地址空间小于或等于设置的第二阈值的分区划分为第一类分区。Here, according to the relationship between the size of each partition of the at least one partition and the size of the EMMC address space, that is, according to the address space occupied by each partition in the EMMC and the address space in the EMMC Dividing the at least one partition into a first type partition and a second type partition; for example, dividing a partition occupying an EMMC address space larger than a set second threshold into a second type partition, occupying an EMMC address space less than or equal to a setting The partition of the second threshold is divided into the first type of partition.
这里,为尽量确保后面生成的全镜像文件的体积最小,也可不将所述至少一个分区划分为第一类分区和第二类分区,即将所述至少一个分区全部划分为第二类分区。Here, in order to minimize the volume of the full-image file generated later, the at least one partition may not be divided into the first type partition and the second type partition, that is, the at least one partition is all divided into the second type partition.
例如,根据预先设置的对EMMC进行分区的分区数量、每一个分区名称、每一个分区大小等分区参数,将EMMC划分为uboot、misc、kernel、rootfs、recovery、app和data等七个分区;然后,可根据每一个分区所包含的有效数据的实际大小与分区自身大小的关系,将所述七个分区划分为第一类分区和第二类分区,过程如下:对于任意一个分区,计算该分区所包含的有效数据的实际大小与该分区自身大小之间的差值,若所述差值大于设置的阈值,则将该分区划分为第二类分区,否则将该分区划分为第一类分区。For example, according to the preset number of partitions for EMMC partitioning, each partition name, each partition size and other partition parameters, the EMMC is divided into seven partitions such as uboot, misc, kernel, rootfs, recovery, app, and data; According to the relationship between the actual size of the valid data included in each partition and the size of the partition itself, the seven partitions are divided into a first type partition and a second type partition, and the process is as follows: for any one partition, the partition is calculated. The difference between the actual size of the valid data and the size of the partition itself. If the difference is greater than the set threshold, the partition is divided into the second type partition, otherwise the partition is divided into the first type partition. .
步骤102:提取所述至少一个分区中的每一个第一类分区所包含的所有数据,并根据所述所有数据生成对应所述第一类分区的镜像文件;Step 102: Extract all data included in each of the at least one partition, and generate an image file corresponding to the first type of partition according to all the data.
具体地,提取所述至少一个分区中的每一个第一类分区所包含的所有数据,将从每一个第一类分区中提取的所有数据压缩后生成对应每一个第一类分区的M个镜像文件,M为大于或等于1的正整数,记录每一个第一类分区的起始地址位置和结束地址位置、以及所述M个镜像文件中每一个 镜像文件的起始地址位置与大小。Specifically, all the data included in each of the first type of partitions in the at least one partition is extracted, and all the data extracted from each of the first type of partitions are compressed to generate M mirrors corresponding to each of the first type of partitions. a file, M is a positive integer greater than or equal to 1, recording a start address position and an end address position of each of the first type of partitions, and each of the M image files The starting address location and size of the image file.
这里,也可提取所述至少一个分区中的每一个第一类分区所包含的有效数据,将从每一个第一类分区中提取的有效数据压缩后生成对应每一个第一类分区的M个镜像文件,以减小所述第一类分区的镜像文件的体积,从而进一步减小全镜像文件的体积。Here, the valid data included in each of the first type of partitions in the at least one partition may also be extracted, and the valid data extracted from each of the first type of partitions is compressed to generate M corresponding to each of the first type of partitions. The image file is mirrored to reduce the size of the image file of the first type of partition, thereby further reducing the volume of the full image file.
这里,所述起始地址位置为起始块编号;所述结束地址位置为结束块编号;所述所有数据包括有效数据和无效数据;所述有效数据是指分区所保存的对***的启动、参数配置等操作具有重要作用的数据;所述无效数据是指分区中为弥补有效数据的空缺而填充的数据,通常采用数字0进行填充。Here, the start address position is a start block number; the end address position is an end block number; all data includes valid data and invalid data; the valid data refers to a boot of the system saved by the partition, Data such as parameter configuration has an important role; the invalid data refers to data filled in the partition to make up for the gap of valid data, usually filled with the number 0.
例如,若第一类分区包括uboot、misc和kernel等三个分区,第二类分区包括rootfs、recovery、app和data等四个分区;对于uboot和kernel分区,可通过分别修改已有的uboot和kernel编程代码,在对所述修改后的编程代码编译分别生成uboot和kernel分区的镜像文件;对于misc分区,可手动创建一个包含全镜像文件的版本号和***中一些关键参数等内容的二进制文件,然后根据所述二进制文件生成misc分区镜像。For example, if the first type of partition includes three partitions: uboot, misc, and kernel, the second type of partition includes four partitions: rootfs, recovery, app, and data; for uboot and kernel partitions, you can modify the existing uboot and respectively. The kernel programming code compiles the image files of the uboot and the kernel partition respectively by compiling the modified programming code; for the misc partition, manually creates a binary file containing the version number of the full image file and some key parameters in the system. And then generate a misc partition image based on the binary file.
步骤103:提取所述至少一个分区中的每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件;Step 103: Extract valid data included in each of the at least one partition, and generate an image file corresponding to the second type partition according to the valid data.
具体地,提取所述至少一个分区中的每一个第二类分区所包含的有效数据,将从每一个第二类分区中提取的有效数据压缩后生成对应每一个第二类分区的N个镜像文件,N为大于或等于1的正整数,记录每一个第二类分区的起始地址位置和结束地址位置、以及所述N个镜像文件中每一个镜像文件的起始地址位置与大小。Specifically, extracting valid data included in each second type of partition of the at least one partition, compressing valid data extracted from each second type partition, and generating N mirrors corresponding to each second type partition The file, N is a positive integer greater than or equal to 1, records the start address position and the end address position of each of the second type of partitions, and the start address position and size of each of the N image files.
这里,由于所述每一个第二类分区所包含的有效数据的大小不相同,所述每一个第二类分区对应的镜像文件的数量不仅会大于或等于1个,而 且每一个第二类分区对应的镜像文件的数量之间会存在一定差异;所述将从每一个第二类分区中提取的有效数据压缩后生成对应每一个第二类分区的N个镜像文件可采用现有技术的方法实现,比如采用linux下制作镜像文件的方法。Here, since the size of the valid data included in each of the second type of partitions is different, the number of image files corresponding to each of the second type of partitions is not only greater than or equal to one, but There is a certain difference between the number of image files corresponding to each type 2 partition; the valid data extracted from each second type partition is compressed to generate N image files corresponding to each second type partition. It can be implemented by the prior art method, such as the method of making an image file under linux.
例如,若第一类分区包括uboot、misc和kernel等三个分区,第二类分区包括rootfs、recovery、app和data等四个分区;对于rootfs、recovery、app和data分区,分别准备好每个分区对应的文件夹以及每个分区在EMMC中的起始地址和结束地址后,采用linux下制作镜像文件的方法以每个分区所包含的有效数据为基础制作rootfs、recovery、app和data分区分别所对应的镜像文件。For example, if the first type of partition includes three partitions: uboot, misc, and kernel, the second type of partition includes four partitions: rootfs, recovery, app, and data; for rootfs, recovery, app, and data partitions, each is prepared separately. After the corresponding folder of the partition and the start address and end address of each partition in the EMMC, the rootfs, recovery, app, and data partitions are created based on the valid data contained in each partition by using the image file created by linux. The corresponding image file.
步骤104:将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件。Step 104: splicing the image file of the first type of partition and the image file of the second type of partition into a full image file.
具体地,根据所述生成对应每一个第一类分区的M个镜像文件时,记录的所述每一个第一类分区的起始地址位置和结束地址位置;根据所述生成对应每一个第二类分区的N个镜像文件时,记录的所述每一个第二类分区的起始地址位置和结束地址位置;按照指定的数据格式,将M个镜像文件根据所述每一个第一类分区的起始地址位置和结束地址位置进行填充,将N个镜像文件根据所述每一个第二类分区的起始地址位置和结束地址位置进行填充,以得到所述全镜像文件。Specifically, when the M image files corresponding to each of the first class partitions are generated, the start address position and the end address position of each of the first type partitions are recorded; and each second is generated according to the generating When the N image files of the class partition are recorded, the start address position and the end address position of each of the second type partitions are recorded; according to the specified data format, the M image files are classified according to each of the first type partitions. The start address position and the end address position are filled, and N image files are filled according to the start address position and the end address position of each of the second type partitions to obtain the full image file.
这里,所述全镜像文件包括对应每一个分区的镜像文件,即所述全镜像文件包括每一个第一类分区的镜像文件和每一个第二类分区的镜像文件。Here, the full image file includes an image file corresponding to each partition, that is, the full image file includes an image file of each first type partition and an image file of each second type partition.
下面将通过一个具体示例对本发明实施例作进一步地的说明,图2为本发明实施例全镜像文件的生成方法的具体实现流程示意图,该方法包括:The embodiment of the present invention is further illustrated by a specific example. FIG. 2 is a schematic flowchart of a specific implementation process of a method for generating a full image file according to an embodiment of the present invention, where the method includes:
步骤201:按照指定的分区格式对EMMC进行分区,获得uboot、misc、 kernel、rootfs、recovery、app和data分区;Step 201: Partition the EMMC according to the specified partition format, and obtain uboot, misc, Kernel, rootfs, recovery, app, and data partitions;
这里,由于EMMC中的地址空间是以块的形式存在的,即EMMC中的地址空间由许多块组成;因此,按照指定的分区格式对EMMC进行分区后,所述uboot、misc、kernel、rootfs、recovery、app和data等七个分区中的每一个分区分别对应有块的起始编号和结束编号,即每一个分区分别对应有起始地址位置和结束地址位置;根据每一个分区所对应的块的起始编号和结束编号,可获取所述每一个分区在EMMC中的地址空间;所述块的起始编号可称为起始块号,所述块的结束编号可称为结束块号。Here, since the address space in the EMMC exists in the form of a block, that is, the address space in the EMMC is composed of a plurality of blocks; therefore, after EMMC is partitioned according to the specified partition format, the uboot, misc, kernel, rootfs, Each of the seven partitions, such as recovery, app, and data, respectively has a start number and an end number of the block, that is, each partition has a start address position and an end address position respectively; according to the block corresponding to each partition The start number and the end number of the address space of each of the partitions in the EMMC; the start number of the block may be referred to as a start block number, and the end number of the block may be referred to as an end block number.
这里,Uboot分区为内核启动的引导程序分区,作为嵌入式操作***的引导部分,用于引导常见的Linux、VxWorks或NETBSD等操作***;Misc分区为混杂分区,用于保存全镜像文件的版本号、***的启动参数或关键信息等内容;Kernel分区为内核分区,用于保存操作***的内核镜像;Rootfs分区为根文件***分区,用于保存***正常启动时加载的文件***,常见的根文件***的格式有:ext2/ext3/ext4、UBI和ramdisk等;Recovery分区为安全模式分区,用于保存***升级时的文件***镜像,常用于升级过程中,即在***升级时会从该分区启动并在安全模式下进行升级,待升级完成后,***会重启并从正常启动模式启动;App分区为应用程序分区,用于保存***的应用程序等内容;Data分区为数据分区,主要是给客户预留的,用于保存常见的示例音视频文件等内容。Here, the Uboot partition is a boot partition of the kernel boot, which is used as a boot part of the embedded operating system to boot common operating systems such as Linux, VxWorks or NETBSD; the Misc partition is a mixed partition for saving the version number of the full image file. , the system startup parameters or key information; Kernel partition is the kernel partition, used to save the kernel image of the operating system; Rootfs partition is the root file system partition, used to save the file system loaded when the system starts normally, common root files The format of the system is: ext2/ext3/ext4, UBI, ramdisk, etc.; Recovery partition is a secure mode partition, which is used to save the file system image during system upgrade. It is often used in the upgrade process, that is, it will be started from the partition during system upgrade. And upgrade in safe mode, after the upgrade is completed, the system will restart and start from the normal startup mode; the App partition is the application partition, which is used to save the system application and other content; the Data partition is the data partition, mainly for the customer. Reserved, used to save common example audio and video files and other content.
步骤202:制作uboot、misc、kernel分区的镜像文件;Step 202: Create an image file of the uboot, misc, and kernel partitions.
这里,对于uboot和kernel分区,可通过分别修改已有的uboot和kernel分区编程代码,在对所述修改后的编程代码编译后分别生成uboot和kernel分区的镜像文件;对于misc分区,可手动创建一个包含全镜像文件的版本号和***中一些关键参数等内容的二进制文件,然后根据所述二进制文件生成misc分区镜像。 Here, for the uboot and kernel partitions, the existing uboot and kernel partition programming codes can be modified separately, and the image files of the uboot and the kernel partition are separately generated after compiling the modified programming code; for the misc partition, it can be manually created. A binary file containing the version number of the full image file and some key parameters in the system, and then generates a misc partition image based on the binary file.
步骤203:准备rootfs、recovery、app和data分区分别所对应的文件夹、起始地址和结束地址;Step 203: Prepare a folder, a start address, and an end address corresponding to the rootfs, recovery, app, and data partitions respectively.
这里,rootfs分区对应的文件夹一般包含有由busybox制作的文件夹和文件,以及产品启动时所需的一些必要的文件等内容;recovery分区对应的文件夹一般包含有由busybox制作的文件夹和文件,以及产品升级时所需的一些必要的文件等内容;app分区对应的文件夹一般包含产品的应用程序等内容;data分区对应的文件夹一般包含示例音视频文件等内容。Here, the folder corresponding to the rootfs partition generally contains folders and files created by busybox, and some necessary files required for the product to start; the folder corresponding to the recovery partition generally contains a folder created by busybox and Files, and some necessary files required for product upgrade; the folder corresponding to the app partition generally contains the application content of the product; the folder corresponding to the data partition generally contains examples of audio and video files.
这里,EMMC中的地址空间由许多块组成,每一个块对应有一个编号,而每一个分区由一个或一个以上的且编号连续的块组成;当步骤201中对EMMC进行分区后,则可获得所述uboot、misc、kernel、rootfs、recovery、app和data等七个分区中的每一个分区对应的起始地址和结束地址,即块的起始编号和结束编号。Here, the address space in the EMMC is composed of a plurality of blocks, each block corresponding to a number, and each partition is composed of one or more consecutive blocks of consecutive numbers; when the EMMC is partitioned in step 201, The start address and the end address corresponding to each of the seven partitions such as uboot, misc, kernel, rootfs, recovery, app, and data, that is, the start number and the end number of the block.
步骤204:对rootfs、recovery、app和data分区进行压缩前准备;Step 204: Prepare the rootfs, recovery, app, and data partitions before compression;
这里,根据步骤203中获取的每一个分区对应的起始地址和结束地址以及每一个分区的属性信息,对占用EMMC较大空间且利用率不高的rootfs、recovery、app和data等四个分区进行压缩前准备,包括:Here, according to the start address and the end address corresponding to each partition acquired in step 203 and the attribute information of each partition, four partitions such as rootfs, recovery, app, and data occupying a large space of EMMC and having low utilization rate are not used. Prepare for compression, including:
1)利用linux下的/dev/zero设备和dd命令来创建一个与EMMC大小相同的镜像文件,记为FS_on_file;1) Use the /dev/zero device under linux and the dd command to create an image file of the same size as the EMMC, denoted as FS_on_file;
2)利用linux下的loop块设备文件例如/dev/loop6和losetup命令将镜像文件FS_on_file关联到该loop块设备上;2) Associate the image file FS_on_file to the loop block device by using a loop block device file such as /dev/loop6 and a losetup command under linux;
3)利用linux下的fdisk命令,对该loop块设备进行分区;3) Using the fdisk command under linux, partition the loop block device;
这里,利用linux下的fdisk命令,对该loop块设备进行分区,以将该loop块设备分成4个区,分别对应rootfs、recovery、app和data分区。Here, the loop block device is partitioned by the fdisk command under linux to divide the loop block device into four regions, corresponding to the rootfs, recovery, app, and data partitions respectively.
这里,fdisk命令中输入参数的单位为块;对于EMMC而言,块的大小一般为512B;所述利用linux下的fdisk命令,对该loop块设备进行分区时, 需要根据rootfs、recovery、app和data分区分别对应的起始块号和结束块号进行分区。Here, the unit of the input parameter in the fdisk command is a block; for EMMC, the size of the block is generally 512B; when the fdisk command under linux is used to partition the loop block device, You need to partition based on the starting block number and ending block number corresponding to the rootfs, recovery, app, and data partitions.
4)利用linux下的kpartx-av命令生成和分区表相对应的分区设备;4) Using the kpartx-av command under linux to generate a partition device corresponding to the partition table;
这里,所述分区设备分别对应分区表所包含的rootfs、recovery、app和data等四个分区;当利用linux下的kpartx-av命令生成和分区表相对应的分区设备后,则在/dev/mapper/目录下就可以看到loop6p1,loop6p2,loop6p3和loop6p4等四个分区设备文件。Here, the partitioning device respectively corresponds to four partitions including rootfs, recovery, app, and data included in the partition table; when the partition device corresponding to the partition table is generated by using the kpartx-av command under linux, it is in /dev/ In the mapper/ directory, you can see four partition device files such as loop6p1, loop6p2, loop6p3 and loop6p4.
5)利用linux下的mke2fs命令对loop6pX进行格式化;5) Format the loop6pX using the mke2fs command under linux;
这里,所述loop6pX包括loop6p1,loop6p2,loop6p3和loop6p4;所述利用linux下的mke2fs命令对loop6pX进行格式化,可以把所述四个分区格式化为ext4文件***。Here, the loop6pX includes loop6p1, loop6p2, loop6p3 and loop6p4; the loop6pX is formatted by using the mke2fs command under linux, and the four partitions can be formatted into an ext4 file system.
6)利用linux下的mount命令对分区设备进行挂载:6) Use the mount command under linux to mount the partition device:
具体地,新建四个文件夹,分别为rootfs_temp、recovery_temp、app_temp和data_temp;然后,将loop6p1挂载到rootfs_temp,将loop6p2挂载到recovery_temp、将loop6p3挂载到app_temp,以及将loop6p4挂载到data_temp。Specifically, create four new folders, rootfs_temp, recovery_temp, app_temp, and data_temp. Then, mount loop6p1 to rootfs_temp, mount loop6p2 to recovery_temp, mount loop6p3 to app_temp, and mount loop6p4 to data_temp.
7)利用linux下的cp命令拷贝文件夹;7) Use the cp command under linux to copy the folder;
具体地,将步骤203中已准备好的rootfs、recovery、app和data分区对应的文件夹的内容分别拷贝到rootfs_temp、recovery_temp、app_temp和data_temp文件夹中,即将rootfs分区对应的文件夹的内容拷贝到rootfs_temp文件夹中、将recovery分区对应的文件夹的内容拷贝到recovery_temp文件夹中、将app分区对应的文件夹的内容拷贝到app_temp文件夹中、将data分区对应的文件夹的内容拷贝到data_temp文件夹中。Specifically, the contents of the folder corresponding to the rootfs, recovery, app, and data partitions prepared in step 203 are copied to the rootfs_temp, recovery_temp, app_temp, and data_temp folders, respectively, and the contents of the folder corresponding to the rootfs partition are copied to In the rootfs_temp folder, copy the contents of the folder corresponding to the recovery partition to the recovery_temp folder, copy the contents of the folder corresponding to the app partition to the app_temp folder, and copy the contents of the folder corresponding to the data partition to the data_temp file. In the folder.
步骤205:压缩rootfs、recovery、app和data分区,生成rootfs、recovery、app和data分区对应的镜像文件; Step 205: Compress the rootfs, recovery, app, and data partitions to generate image files corresponding to the rootfs, recovery, app, and data partitions.
这里,所述压缩的依据是:对于大部分的存储介质而言,文件***中的文件一般是按分区、顺序存放的;如果某个分区中文件很少的话,则该分区只有开始的部分有数据,而后面大部分的内容均为零;这样,通过提取出该分区中的有效数据,从而可达到对分区压缩的目的。Here, the compression is based on: for most storage media, files in the file system are generally stored in partitions and in order; if there are few files in a partition, only the beginning portion of the partition has The data, while most of the latter content is zero; thus, by extracting the valid data in the partition, the purpose of partition compression can be achieved.
具体地,读取设备/dev/loop6,一次读取128KB;如果该128KB的内容为零,则继续读取下一个128KB;如果该128KB的内容不为零,则依次读取下一个128KB,直至读取到128KB的内容全部为零;把第一个内容不为零的128KB至最后一个内容不为零的128KB之间的内容记录到一个或一个以上fragment镜像中,可以把这些fragment镜像依次命名为fragment_1、fragment_2、……、Fragment_T;记录每个fragment对应的起始块号和每个fragment的大小至fragment_list中;读取完成后,得到fragment_1、fragment_2、……、Fragment_T等镜像以及fragment_list文件。Specifically, the reading device /dev/loop6 reads 128 KB at a time; if the 128 KB content is zero, it continues to read the next 128 KB; if the 128 KB content is not zero, the next 128 KB is sequentially read until The contents read to 128KB are all zero; the contents of 128KB from the first non-zero content to 128KB between the last non-zero content are recorded in one or more fragment images, and these fragment images can be named sequentially. Fragment_1, fragment_2, ..., Fragment_T; record the starting block number corresponding to each fragment and the size of each fragment to the fragment_list; after the reading is completed, the mirror_1, fragment_2, ..., Fragment_T and other mirrors and the fragment_list file are obtained.
步骤206:按照指定的数据格式,填充全镜像文件;Step 206: Fill the full image file according to the specified data format;
这里,根据表1所示的EMMC中镜像的数据格式,以uboot、misc、kernel、rootfs、recovery、app和data分区的镜像文件填充EMMC的全镜像文件,包括:Here, according to the data format of the image in the EMMC shown in Table 1, the EMMC full image file is filled with the image files of the uboot, misc, kernel, rootfs, recovery, app, and data partitions, including:
Figure PCTCN2017094282-appb-000001
Figure PCTCN2017094282-appb-000001
Figure PCTCN2017094282-appb-000002
Figure PCTCN2017094282-appb-000002
表1Table 1
11)填充固定的镜像头,大小为128字节;11) Fill the fixed mirror head with a size of 128 bytes;
12)填充总的Partitions大小,大小为4个字节;12) Fill the total Partitions size to a size of 4 bytes;
这里,所述总的Partitions大小等于所述Fragment的个数T加3。Here, the total Partitions size is equal to the number of the Fragments T plus 3.
13)填充uboot分区的起始块号,以块(BLOCK)为单位,大小为4字节;填充uboot分区的大小,以BLOCK为单位,大小为4字节;填充00000000,大小为4字节;13) Fill the starting block number of the uboot partition, in block (BLOCK), the size is 4 bytes; fill the size of the uboot partition, in BLOCK, the size is 4 bytes; padding 00000000, size is 4 bytes ;
14)填充misc分区的起始块号,以BLOCK为单位,大小为4字节;填充misc分区的大小,以BLOCK为单位,大小为4字节;填充00000000,大小为4字节;14) Fill the starting block number of the misc partition, in BLOCK, the size is 4 bytes; fill the size of the misc partition, in BLOCK, the size is 4 bytes; padding 00000000, the size is 4 bytes;
15)填充kernel分区的起始块号,以BLOCK为单位,大小为4字节; 填充kernel分区的大小,以BLOCK为单位,大小为4字节;填充00000000,大小为4字节;15) Fill the starting block number of the kernel partition, in BLOCK, the size is 4 bytes; Fill the size of the kernel partition, in BLOCK, the size is 4 bytes; padding 00000000, the size is 4 bytes;
16)填充Fragment_1分区的起始块号,以BLOCK为单位,大小为4字节;填充Fragment_1分区的大小,以BLOCK为单位,大小为4字节;填充00000000,大小为4字节;16) Fill the starting block number of the Fragment_1 partition, in BLOCK, the size is 4 bytes; fill the size of the Fragment_1 partition, in BLOCK, the size is 4 bytes; padding 00000000, the size is 4 bytes;
这里,所述Fragment_1分区的起始块号和大小可在所述fragment_list中获得。Here, the starting block number and size of the Fragment_1 partition can be obtained in the fragment_list.
17)依次填充Fragment_2、Fragment_3、……、Fragment_T的起始块号、大小和00000000;17) sequentially fill the starting block number, size and 00000000 of Fragment_2, Fragment_3, ..., Fragment_T;
18)填充uboot的镜像;18) Fill the image of uboot;
19)填充misc的镜像;19) Fill the mirror of the misc;
20)填充kernel的镜像;20) Fill the image of the kernel;
21)填充Fragment_1的镜像;21) Fill the image of Fragment_1;
22)依次填充Fragment_2、Fragment_3、……、Fragment_T的镜像。22) Fill in the mirror images of Fragment_2, Fragment_3, ..., Fragment_T in sequence.
步骤207:生成全镜像文件;Step 207: Generate a full image file.
这里,当步骤206执行完毕后,还未完全生成由uboot、misc、kernel、rootfs、recovery、app和data等七个分区的镜像文件所组成的全镜像文件,此时还需进行收尾工作,包括:Here, after the execution of step 206, the full-mirror file consisting of image files of seven partitions such as uboot, misc, kernel, rootfs, recovery, app, and data has not been completely generated, and the finishing work needs to be completed at this time, including :
31)利用linux下的umount命令卸载rootfs_temp、recovery_temp、app_temp、data_temp;31) Uninstall rootfs_temp, recovery_temp, app_temp, data_temp using the umount command under linux;
32)利用linux下的kpartx-dv命令卸载/dev/mapper/下的loop6p1、loop6p2、loop6p3和loop6p4等四个设备;32) Use the kpartx-dv command under linux to uninstall four devices such as loop6p1, loop6p2, loop6p3 and loop6p4 under /dev/mapper/;
33)利用linux下的losetup-d命令卸载/dev/loop6块设备:33) Uninstall the /dev/loop6 block device using the losetup-d command under Linux:
34)利用linux下的rm命令删除文件FS_on_file。34) Use the rm command under linux to delete the file FS_on_file.
这里,利用uboot镜像和制作出来的所述全镜像文件,可以使用EMMC 烧片器将所述全镜像文件烧写到EMMC中。Here, using the uboot image and the resulting full image file, you can use EMMC. The burner burns the full image file into the EMMC.
对于uboot、misc、kernel分区的镜像,从表1所示的EMMC中镜像的数据格式以及根据uboot、misc、kernel分区的起始块地址和大小,可以分别获取到uboot、misc、kernel分区的镜像,这样便可以对uboot、misc、kernel分区进行升级。For the uboot, misc, and kernel partition images, the image format of the uboot, misc, and kernel partitions can be obtained from the data format of the EMMC shown in Table 1 and the starting block address and size of the uboot, misc, and kernel partitions. This will allow you to upgrade the uboot, misc, and kernel partitions.
对于rootfs、recovery、app和data分区的镜像,可通过rootfs、recovery、app和data分区的起始地址和结束地址以及根据表1所示的EMMC中镜像的数据格式得到的各个fragement镜像的起始地址和大小进行获取;根据rootfs、recovery、app和data分区的起始地址和结束地址,比对各个fragement镜像的起始地址和大小,便可以知道哪些fragement镜像属于rootfs分区、哪些fragement镜像属于recovery分区、哪些fragement镜像属于app分区、以及哪些fragement镜像属于data分区;取出全镜像文件中rootfs分区对应的fragment镜像,并写入rootfs分区,以完成rootfs分区镜像的写入;类似的,可依次完成recovery、app和data分区镜像的写入。For the mirroring of the rootfs, recovery, app, and data partitions, the start and end addresses of the rootfs, recovery, app, and data partitions, and the start of each fragement image obtained from the data format of the mirror in the EMMC shown in Table 1. Get the address and size; according to the start address and end address of the rootfs, recovery, app, and data partitions, compare the starting address and size of each fragement image, you can know which fragement image belongs to the rootfs partition, and which fragement mirror belongs to recovery. Partition, which fragement image belongs to the app partition, and which fragement image belongs to the data partition; take out the fragment image corresponding to the rootfs partition in the full image file, and write to the rootfs partition to complete the writing of the rootfs partition image; similarly, it can be completed in sequence Write of the recovery, app, and data partition images.
为实现上述方法,本发明实施例还提供了一种全镜像文件的生成装置,图3为本发明实施例全镜像文件的生成装置的组成结构示意图,该装置包括:第一处理单元41、第二处理单元42、第三处理单元43;其中,In order to achieve the above method, the embodiment of the present invention further provides a device for generating a full image file, and FIG. 3 is a schematic structural diagram of a device for generating a full image file according to an embodiment of the present invention. The device includes: a first processing unit 41, a second processing unit 42 and a third processing unit 43; wherein
所述第一处理单元41,配置为按照指定的分区格式对EMMC进行分区,得到至少一个分区;The first processing unit 41 is configured to partition the EMMC according to the specified partition format to obtain at least one partition;
所述第二处理单元42,配置为提取所述至少一个分区中的每一个第一类分区所包含的所有数据,并根据所述所有数据生成对应所述第一类分区的镜像文件;提取所述至少一个分区中的每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件;The second processing unit 42 is configured to extract all data included in each of the first class partitions of the at least one partition, and generate an image file corresponding to the first type partition according to all the data; Determining valid data included in each of the second type of partitions in the at least one partition, and generating an image file corresponding to the second type of partition according to the valid data;
所述第三处理单元43,配置为将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件。 The third processing unit 43 is configured to splicing the image file of the first type of partition and the image file of the second type of partition into a full image file.
其中,所述第一处理单元41,还配置为:获取嵌入式多媒体卡后,根据设置的分区参数对EMMC进行分区,以将所述EMMC划分为与所述分区参数对应的至少一个分区;所述分区参数包括分区名称、分区数量、分区大小。The first processing unit 41 is further configured to: after acquiring the embedded multimedia card, partitioning the EMMC according to the set partition parameter, to divide the EMMC into at least one partition corresponding to the partition parameter; The partition parameters include the partition name, the number of partitions, and the partition size.
这里,由于EMMC中的地址空间是以块的形式存在的,即EMMC中的地址空间由许多块组成,每个块对应有一个编号;因此,根据设置的分区参数对EMMC进行分区后,所述至少一个分区中每一个分区分别对应有块的起始编号和结束编号,即根据每一个分区所对应的块的起始编号和结束编号,可获取所述每一个分区在EMMC中的地址空间。Here, since the address space in the EMMC exists in the form of a block, that is, the address space in the EMMC is composed of a plurality of blocks, each block corresponding to a number; therefore, after the EMMC is partitioned according to the set partition parameter, the Each of the at least one partition corresponds to a start number and an end number of the block, that is, the address space of each of the partitions in the EMMC can be obtained according to the start number and the end number of the block corresponding to each partition.
进一步地,所述第一处理单元41,还配置为根据所述至少一个分区中每一个分区所包含的有效数据的实际大小与分区自身大小的关系,将所述至少一个分区划分为第一类分区和第二类分区。Further, the first processing unit 41 is further configured to divide the at least one partition into the first category according to the relationship between the actual size of the valid data included in each of the at least one partition and the size of the partition itself. Partition and second class partition.
这里,由于所述至少一个分区中每一个分区所包含的有效数据的实际大小与分区自身大小之间存在差距,根据每一个分区所包含的有效数据的实际大小与分区自身大小之间的差距,将所述至少一个分区划分为第一类分区和第二类分区,以在生成镜像文件时对所述第一类分区和第二类分区分别进行不同的处理。Here, since there is a gap between the actual size of the valid data included in each of the at least one partition and the size of the partition itself, according to the difference between the actual size of the valid data included in each partition and the size of the partition itself, The at least one partition is divided into a first type partition and a second type partition to perform different processing on the first type partition and the second type partition separately when generating the image file.
这里,所述第一类分区是指分区所包含的有效数据的实际大小与分区自身大小之间相差较小的分区,比如分区所包含的有效数据的实际大小与分区自身大小之间的差值小于或等于设置的第一阈值的分区;所述第二类分区是指分区所包含的有效数据的实际大小与分区自身大小之间相差较大的分区,比如分区所包含的有效数据的实际大小与分区自身大小之间的差值大于设置的第一阈值的分区。Here, the first type of partition refers to a partition having a small difference between the actual size of the valid data included in the partition and the size of the partition itself, such as the difference between the actual size of the valid data included in the partition and the size of the partition itself. a partition that is less than or equal to the set first threshold; the second type of partition refers to a partition having a large difference between the actual size of the valid data included in the partition and the size of the partition itself, such as the actual size of the valid data included in the partition. A partition that differs from the partition's own size by a first threshold that is set.
这里,也可根据所述至少一个分区中每一个分区的自身大小与所述EMMC地址空间大小之间的关系,即根据每一个分区在EMMC中所占用的 地址空间与EMMC中的地址空间的关系,将所述至少一个分区划分为第一类分区和第二类分区;比如,将占用EMMC地址空间大于设置的第二阈值的分区划分为第二类分区,将占用EMMC地址空间小于或等于设置的第二阈值的分区划分为第一类分区。Here, according to the relationship between the size of each of the at least one partition and the size of the EMMC address space, that is, according to each partition occupied in the EMMC The relationship between the address space and the address space in the EMMC, the at least one partition is divided into the first type partition and the second type partition; for example, the partition occupying the EMMC address space larger than the set second threshold is divided into the second type partition And partitioning the partition occupying the EMMC address space less than or equal to the set second threshold into the first type of partition.
这里,为尽量确保后面生成的全镜像文件的体积最小,也可不将所述至少一个分区划分为第一类分区和第二类分区,即将所述至少一个分区全部划分为第二类分区。Here, in order to minimize the volume of the full-image file generated later, the at least one partition may not be divided into the first type partition and the second type partition, that is, the at least one partition is all divided into the second type partition.
例如,根据预先设置的对EMMC进行分区的分区数量、每一个分区名称、每一个分区大小等分区参数,将EMMC划分为uboot、misc、kernel、rootfs、recovery、app和data等七个分区;然后,可根据每一个分区所包含的有效数据的实际大小与分区自身大小的关系,将所述七个分区划分为第一类分区和第二类分区,过程如下:对于任意一个分区,计算该分区所包含的有效数据的实际大小与该分区自身大小之间的差值,若所述差值大于设置的阈值,则将该分区划分为第二类分区,否则将该分区划分为第一类分区。For example, according to the preset number of partitions for EMMC partitioning, each partition name, each partition size and other partition parameters, the EMMC is divided into seven partitions such as uboot, misc, kernel, rootfs, recovery, app, and data; According to the relationship between the actual size of the valid data included in each partition and the size of the partition itself, the seven partitions are divided into a first type partition and a second type partition, and the process is as follows: for any one partition, the partition is calculated. The difference between the actual size of the valid data and the size of the partition itself. If the difference is greater than the set threshold, the partition is divided into the second type partition, otherwise the partition is divided into the first type partition. .
所述第二处理单元42,还配置为:提取所述至少一个分区中的每一个第一类分区所包含的所有数据,将从每一个第一类分区中提取的所有数据压缩后生成对应每一个第一类分区的M个镜像文件,M为大于或等于1的正整数,记录每一个第一类分区的起始地址位置和结束地址位置、以及所述M个镜像文件中每一个镜像文件的起始地址位置与大小。The second processing unit 42 is further configured to: extract all data included in each of the at least one partition, and compress all the data extracted from each of the first type of partitions to generate corresponding data. M image files of a first type of partition, M is a positive integer greater than or equal to 1, recording the start address position and the end address position of each first type partition, and each image file in the M image files The starting address location and size.
这里,也可提取所述至少一个分区中的每一个第一类分区所包含的有效数据,将从每一个第一类分区中提取的有效数据压缩后生成对应每一个第一类分区的M个镜像文件,以减小所述第一类分区的镜像文件的体积,从而进一步减小全镜像文件的体积。这里,所述起始地址位置为起始块编号;所述结束地址位置为结束块编号;所述所有数据包括有效数据和无效 数据;所述有效数据是指分区所保存的对***的启动、参数配置等操作具有重要作用的数据;所述无效数据是指分区中为弥补有效数据的空缺而填充的数据,通常采用数字0进行填充。Here, the valid data included in each of the first type of partitions in the at least one partition may also be extracted, and the valid data extracted from each of the first type of partitions is compressed to generate M corresponding to each of the first type of partitions. The image file is mirrored to reduce the size of the image file of the first type of partition, thereby further reducing the volume of the full image file. Here, the start address position is a start block number; the end address position is an end block number; all data includes valid data and invalid Data; the valid data refers to data saved by the partition that plays an important role in the startup, parameter configuration, and the like of the system; the invalid data refers to data filled in the partition to make up for the vacancy of the valid data, usually using the number 0. Fill it up.
例如,若第一类分区包括uboot、misc和kernel等三个分区,第二类分区包括rootfs、recovery、app和data等四个分区;对于uboot和kernel分区,可通过分别修改已有的uboot和kernel编程代码,在对所述修改后的编程代码编译分别生成uboot和kernel分区的镜像文件;对于misc分区,可手动创建一个包含全镜像文件的版本号和***中一些关键参数等内容的二进制文件,然后根据所述二进制文件生成misc分区镜像。For example, if the first type of partition includes three partitions: uboot, misc, and kernel, the second type of partition includes four partitions: rootfs, recovery, app, and data; for uboot and kernel partitions, you can modify the existing uboot and respectively. The kernel programming code compiles the image files of the uboot and the kernel partition respectively by compiling the modified programming code; for the misc partition, manually creates a binary file containing the version number of the full image file and some key parameters in the system. And then generate a misc partition image based on the binary file.
所述第二处理单元42,还配置为:提取所述至少一个分区中的每一个第二类分区所包含的有效数据,将从每一个第二类分区中提取的有效数据压缩后生成对应每一个第二类分区的N个镜像文件,N为大于或等于1的正整数,记录每一个第二类分区的起始地址位置和结束地址位置、以及所述N个镜像文件中每一个镜像文件的起始地址位置与大小。The second processing unit 42 is further configured to: extract valid data included in each second type partition of the at least one partition, and compress valid data extracted from each second type partition to generate corresponding data N image files of a second type of partition, N is a positive integer greater than or equal to 1, recording the start address position and the end address position of each second type partition, and each of the N image files The starting address location and size.
这里,由于所述每一个第二类分区所包含的有效数据的大小不相同,所述每一个第二类分区对应的镜像文件的数量不仅会大于或等于1个,而且每一个第二类分区对应的镜像文件的数量之间会存在一定差异;所述将从每一个第二类分区中提取的有效数据压缩后生成对应每一个第二类分区的N个镜像文件可采用现有技术的方法实现,比如采用linux下制作镜像文件的方法。Here, since the size of the valid data included in each of the second type of partitions is different, the number of image files corresponding to each of the second type of partitions is not only greater than or equal to one, but each second type of partition There may be a certain difference between the number of corresponding image files; the method of compressing the valid data extracted from each second type of partition to generate N image files corresponding to each second type of partition may adopt a prior art method. Implementation, such as the method of making image files under linux.
例如,若第一类分区包括uboot、misc和kernel等三个分区,第二类分区包括rootfs、recovery、app和data等四个分区;对于rootfs、recovery、app和data分区,分别准备好每个分区对应的文件夹以及每个分区在EMMC中的起始地址和结束地址后,采用linux下制作镜像文件的方法以每个分区所包含的有效数据为基础制作rootfs、recovery、app和data分区分别所对 应的镜像文件。For example, if the first type of partition includes three partitions: uboot, misc, and kernel, the second type of partition includes four partitions: rootfs, recovery, app, and data; for rootfs, recovery, app, and data partitions, each is prepared separately. After the corresponding folder of the partition and the start address and end address of each partition in the EMMC, the rootfs, recovery, app, and data partitions are created based on the valid data contained in each partition by using the image file created by linux. Right The image file should be.
所述第三处理单元43,还配置为:在所述第二处理单元生成对应每一个第一类分区的M个镜像文件时,记录所述每一个第一类分区的起始地址位置和结束地址位置;在所述第二处理单元生成对应每一个第二类分区的N个镜像文件时,记录所述每一个第二类分区的起始地址位置和结束地址位置;按照指定的数据格式,将M个镜像文件根据所述每一个第一类分区的起始地址位置和结束地址位置进行填充,将N个镜像文件根据所述每一个第二类分区的起始地址位置和结束地址位置进行填充,以得到所述全镜像文件。The third processing unit 43 is further configured to: when the second processing unit generates the M image files corresponding to each of the first class partitions, record the start address position and end of each of the first class partitions. An address location; when the second processing unit generates N image files corresponding to each of the second class partitions, recording a start address location and an end address location of each of the second class partitions; according to the specified data format, Filling the M image files according to the start address position and the end address position of each of the first type of partitions, and performing N image files according to the start address position and the end address position of each of the second type partitions. Fill to get the full image file.
这里,所述全镜像文件包括对应每一个分区的镜像文件,即所述全镜像文件包括每一个第一类分区的镜像文件和每一个第二类分区的镜像文件。Here, the full image file includes an image file corresponding to each partition, that is, the full image file includes an image file of each first type partition and an image file of each second type partition.
在实际应用中,所述第一处理单元41、第二处理单元42、第三处理单元43均可由位于终端中的中央处理器(CPU)、数字信号处理器(DSP)等实现。In practical applications, the first processing unit 41, the second processing unit 42, and the third processing unit 43 may each be implemented by a central processing unit (CPU), a digital signal processor (DSP), or the like located in the terminal.
本发明实施例上述业务信令跟踪的装置如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。The apparatus for tracking the service signaling according to the embodiment of the present invention may also be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a separate product. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
相应地,本发明实施例还提供一种计算机存储介质,其中存储有计算 机程序,该计算机程序配置为执行本发明实施例的全镜像文件的生成方法。Correspondingly, an embodiment of the present invention further provides a computer storage medium in which a calculation is stored. The computer program is configured to execute a method of generating a full image file according to an embodiment of the present invention.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和范围之内所作的任何修改、等同替换和改进等,均包含在本发明的保护范围之内。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present invention are included in the scope of the present invention.
工业实用性Industrial applicability
本发明实施例的技术方案,通过提取所述每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件,减小了所述第二类分区的镜像文件的体积,即减小了全镜像文件的体积,从而可加速烧写和升级过程,提高了烧写和升级过程的处理效率。 According to the technical solution of the embodiment of the present invention, the second type is reduced by extracting valid data included in each of the second type of partitions, and generating an image file corresponding to the second type of partition according to the valid data. The size of the partitioned image file, which reduces the size of the full image file, speeds up the programming and upgrade process, and improves the processing efficiency of the programming and upgrading process.

Claims (11)

  1. 一种全镜像文件的生成方法,所述方法包括:A method for generating a full image file, the method comprising:
    按照指定的分区格式对嵌入式多媒体卡EMMC进行分区,得到至少一个分区;The embedded multimedia card EMMC is partitioned according to the specified partition format to obtain at least one partition;
    提取所述至少一个分区中的每一个第一类分区所包含的所有数据,并根据所述所有数据生成对应所述第一类分区的镜像文件;Extracting all data included in each of the at least one partition, and generating an image file corresponding to the first type of partition according to all the data;
    提取所述至少一个分区中的每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件;Extracting valid data included in each of the at least one partition, and generating an image file corresponding to the second type of partition according to the valid data;
    将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件。The image file of the first type of partition and the image file of the second type of partition are spliced into a full image file.
  2. 根据权利要求1所述的方法,其中,所述按照指定的分区格式对所述EMMC进行分区,得到至少一个分区,包括:The method of claim 1, wherein the partitioning the EMMC according to a specified partition format to obtain at least one partition comprises:
    根据设置的分区参数对EMMC进行分区,以将所述EMMC划分为与所述分区参数对应的至少一个分区;所述分区参数包括分区名称、分区数量、分区大小。The EMMC is partitioned according to the set partition parameter to divide the EMMC into at least one partition corresponding to the partition parameter; the partition parameter includes a partition name, a partition number, and a partition size.
  3. 根据权利要求1所述的方法,其中,所述按照指定的分区格式对所述EMMC进行分区,得到至少一个分区后,所述方法还包括:The method of claim 1, wherein the EMMC is partitioned according to a specified partition format to obtain at least one partition, the method further comprising:
    根据所述至少一个分区中每一个分区所包含的有效数据的实际大小与分区自身大小的关系,将所述至少一个分区划分为第一类分区和第二类分区。And dividing the at least one partition into a first type partition and a second type partition according to a relationship between an actual size of valid data included in each of the at least one partition and a size of the partition itself.
  4. 根据权利要求1所述的方法,其中,The method of claim 1 wherein
    所述根据所述所有数据生成对应所述第一类分区的镜像文件,包括:将从每一个第一类分区中提取的所有数据压缩后生成对应每一个第一类分区的M个镜像文件,M为大于或等于1的正整数;And generating, according to the all the data, the image file corresponding to the first type of partition, comprising: compressing all data extracted from each first type of partition to generate M image files corresponding to each first type of partition, M is a positive integer greater than or equal to 1;
    所述根据所述有效数据生成对应所述第二类分区的镜像文件,包括: 将从每一个第二类分区中提取的有效数据压缩后生成对应每一个第二类分区的N个镜像文件,N为大于或等于1的正整数。And generating, according to the valid data, an image file corresponding to the second type of partition, including: The N image files corresponding to each of the second class partitions are generated by compressing the valid data extracted from each of the second type partitions, and N is a positive integer greater than or equal to 1.
  5. 根据权利要求4所述的方法,其中,所述将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件,包括:The method according to claim 4, wherein the splicing the image file of the first type of partition and the image file of the second type of partition into a full image file comprises:
    所述生成对应每一个第一类分区的M个镜像文件时,记录所述每一个第一类分区的起始地址位置和结束地址位置;When the M image files corresponding to each of the first type of partitions are generated, the start address position and the end address position of each of the first type of partitions are recorded;
    所述生成对应每一个第二类分区的N个镜像文件时,记录所述每一个第二类分区的起始地址位置和结束地址位置;When the N image files corresponding to each of the second type of partitions are generated, the start address position and the end address position of each of the second type partitions are recorded;
    按照指定的数据格式,将M个镜像文件根据所述每一个第一类分区的起始地址位置和结束地址位置进行填充,将N个镜像文件根据所述每一个第二类分区的起始地址位置和结束地址位置进行填充,以得到所述全镜像文件。According to the specified data format, the M image files are filled according to the start address position and the end address position of each of the first type of partitions, and the N image files are based on the start address of each of the second type partitions. The location and end address locations are padded to obtain the full mirror file.
  6. 一种全镜像文件的生成装置,所述装置包括:第一处理单元、第二处理单元、第三处理单元;其中,A device for generating a full image file, the device comprising: a first processing unit, a second processing unit, and a third processing unit; wherein
    所述第一处理单元,配置为按照指定的分区格式对EMMC进行分区,得到至少一个分区;The first processing unit is configured to partition the EMMC according to the specified partition format to obtain at least one partition;
    所述第二处理单元,配置为提取所述至少一个分区中的每一个第一类分区所包含的所有数据,并根据所述所有数据生成对应所述第一类分区的镜像文件;提取所述至少一个分区中的每一个第二类分区所包含的有效数据,并根据所述有效数据生成对应所述第二类分区的镜像文件;The second processing unit is configured to extract all data included in each of the first type of partitions in the at least one partition, and generate an image file corresponding to the first type of partition according to all the data; extracting the Valid data included in each of the second type of partitions in at least one partition, and generating an image file corresponding to the second type of partition according to the valid data;
    所述第三处理单元,配置为将所述第一类分区的镜像文件和所述第二类分区的镜像文件拼接成全镜像文件。The third processing unit is configured to splicing the image file of the first type of partition and the image file of the second type of partition into a full image file.
  7. 根据权利要求6所述的装置,其中,所述第一处理单元,还配置为:The apparatus according to claim 6, wherein the first processing unit is further configured to:
    根据设置的分区参数对EMMC进行分区,以将所述EMMC划分为与所述分区参数对应的至少一个分区;所述分区参数包括分区名称、分区数 量、分区大小。Configuring EMMC according to the set partition parameter to divide the EMMC into at least one partition corresponding to the partition parameter; the partition parameter includes a partition name and a partition number Quantity, partition size.
  8. 根据权利要求6所述的装置,其中,所述第一处理单元,还配置为在所述按照指定的分区格式对所述EMMC进行分区,得到至少一个分区后,根据所述至少一个分区中每一个分区所包含的有效数据的实际大小与分区自身大小的关系,将所述至少一个分区划分为第一类分区和第二类分区。The apparatus according to claim 6, wherein the first processing unit is further configured to partition the EMMC in the specified partition format to obtain at least one partition, according to each of the at least one partition The relationship between the actual size of the valid data contained in one partition and the size of the partition itself, and the at least one partition is divided into a first type partition and a second type partition.
  9. 根据权利要求6所述的装置,其中,The apparatus according to claim 6, wherein
    所述第二处理单元根据所述所有数据生成对应所述第一类分区的镜像文件为:将从每一个第一类分区中提取的所有数据压缩后生成对应每一个第一类分区的M个镜像文件,M为大于或等于1的正整数;And generating, by the second processing unit, the image file corresponding to the first type of partition according to all the data: compressing all data extracted from each first type of partition to generate M corresponding to each first type of partition Image file, M is a positive integer greater than or equal to 1;
    所述第二处理单元根据所述有效数据生成对应所述第二类分区的镜像文件为:将从每一个第二类分区中提取的有效数据压缩后生成对应每一个第二类分区的N个镜像文件,N为大于或等于1的正整数。And generating, by the second processing unit, the image file corresponding to the second type of partition according to the valid data: compressing valid data extracted from each second type of partition to generate N corresponding to each second type of partition Image file, N is a positive integer greater than or equal to 1.
  10. 根据权利要求9所述的装置,其中,所述第三处理单元,还配置为:The apparatus according to claim 9, wherein the third processing unit is further configured to:
    在所述第二处理单元生成对应每一个第一类分区的M个镜像文件时,记录所述每一个第一类分区的起始地址位置和结束地址位置;When the second processing unit generates M image files corresponding to each of the first class partitions, record a start address position and an end address position of each of the first type partitions;
    在所述第二处理单元生成对应每一个第二类分区的N个镜像文件时,记录所述每一个第二类分区的起始地址位置和结束地址位置;When the second processing unit generates N image files corresponding to each of the second class partitions, record a start address position and an end address position of each of the second type partitions;
    按照指定的数据格式,将M个镜像文件根据所述每一个第一类分区的起始地址位置和结束地址位置进行填充,将N个镜像文件根据所述每一个第二类分区的起始地址位置和结束地址位置进行填充,以得到所述全镜像文件。According to the specified data format, the M image files are filled according to the start address position and the end address position of each of the first type of partitions, and the N image files are based on the start address of each of the second type partitions. The location and end address locations are padded to obtain the full mirror file.
  11. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令配置为执行权利要求1-5任一项所述的全镜像文件的生成方法。 A computer storage medium storing computer executable instructions configured to perform the method of generating a full image file according to any one of claims 1-5.
PCT/CN2017/094282 2016-08-30 2017-07-25 Full-image file generation method and apparatus, and computer storage medium WO2018040802A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610777619.2A CN107783724A (en) 2016-08-30 2016-08-30 A kind of generation method and device of full image file
CN201610777619.2 2016-08-30

Publications (1)

Publication Number Publication Date
WO2018040802A1 true WO2018040802A1 (en) 2018-03-08

Family

ID=61299986

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/094282 WO2018040802A1 (en) 2016-08-30 2017-07-25 Full-image file generation method and apparatus, and computer storage medium

Country Status (2)

Country Link
CN (1) CN107783724A (en)
WO (1) WO2018040802A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463178A (en) * 2020-12-10 2021-03-09 福州创实讯联信息技术有限公司 File system programming method and terminal of embedded equipment
CN113377391A (en) * 2021-07-21 2021-09-10 北京百度网讯科技有限公司 Method, device, equipment and medium for making and burning mirror image file

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111158697B (en) * 2019-12-25 2023-07-04 惠州华阳通用电子有限公司 Method for manufacturing burning mirror image
CN111176665B (en) * 2019-12-26 2024-02-09 晶晨半导体(深圳)有限公司 High-capacity emmc mirror image manufacturing method and device
CN112527745B (en) * 2020-12-18 2022-07-12 厦门市美亚柏科信息股份有限公司 Embedded file system multi-partition analysis method, terminal device and storage medium
CN117289956B (en) * 2023-10-12 2024-06-11 北京首都在线科技股份有限公司 Mirror image manufacturing method, apparatus, electronic device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317618A (en) * 2014-10-24 2015-01-28 福州瑞芯微电子有限公司 Firmware partitioning method and device
CN105590072A (en) * 2015-12-18 2016-05-18 上海华测导航技术股份有限公司 Method for achieving automatic burning of embedded system
CN105653330A (en) * 2015-12-30 2016-06-08 国家电网公司 SD card based NorFlash programming system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4782060B2 (en) * 2007-03-30 2011-09-28 アイシン・エィ・ダブリュ株式会社 Data update system and computer program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317618A (en) * 2014-10-24 2015-01-28 福州瑞芯微电子有限公司 Firmware partitioning method and device
CN105590072A (en) * 2015-12-18 2016-05-18 上海华测导航技术股份有限公司 Method for achieving automatic burning of embedded system
CN105653330A (en) * 2015-12-30 2016-06-08 国家电网公司 SD card based NorFlash programming system and method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463178A (en) * 2020-12-10 2021-03-09 福州创实讯联信息技术有限公司 File system programming method and terminal of embedded equipment
CN113377391A (en) * 2021-07-21 2021-09-10 北京百度网讯科技有限公司 Method, device, equipment and medium for making and burning mirror image file
CN113377391B (en) * 2021-07-21 2023-11-21 北京百度网讯科技有限公司 Method, device, equipment and medium for making and burning image file

Also Published As

Publication number Publication date
CN107783724A (en) 2018-03-09

Similar Documents

Publication Publication Date Title
WO2018040802A1 (en) Full-image file generation method and apparatus, and computer storage medium
KR101384438B1 (en) Capturing and naming dynamic storage tiering configurations to support data pre-staging
JP2014513338A5 (en) Method, computer readable storage medium and system for optimal compression of a virtual disk
US20200012624A1 (en) Systems and methods for fail-safe operations of storage devices
CN111258666B (en) Method and device for reading computer file, computer system and storage medium
US10346368B2 (en) Method and apparatus of per-block-group journaling for ordered mode journaling file system
CN107463467B (en) Method and system capable of quickly restoring virtualization platform
CN107111726B (en) File encryption support for FAT file system
JP2007233638A (en) Information processor, information processing method, and computer program
US10185573B2 (en) Caching based operating system installation
US11068181B2 (en) Generating and storing monotonically-increasing generation identifiers
CN106709014B (en) File system conversion method and device
US9588884B2 (en) Systems and methods for in-place reorganization of device storage
CN107148612B (en) Method and device for expanding user partition
US10776342B2 (en) Systems and methods for recovering lost clusters from a mounted volume
WO2018028321A1 (en) Method and apparatus for managing virtual external storage device, and terminal
JP2004362221A (en) Hard disk backup recovery system, hard disk backup recovery method and information processing device
CN110287064B (en) Method and device for restoring disk data and electronic equipment
US20110078391A1 (en) Information recording apparatus, information recording method, and computer-readable medium
US10732870B2 (en) Method and apparatus for triggering raid reconstruction
WO2017050029A1 (en) Method, device, and equipment for data block processing
JP5500201B2 (en) Information processing apparatus and program
JPWO2018186455A1 (en) Method of managing free space in nonvolatile memory, access device for recording data in information recording device including nonvolatile memory, information recording device, and information recording system
CN106557275B (en) A kind of method and device of data processing
JP2008134777A (en) Caching method of file allocation table

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: 17845104

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: 17845104

Country of ref document: EP

Kind code of ref document: A1