System mirror image burning method and device

By intelligently partitioning the target media before the system image burning and automatically matching the target file partition according to the file type, the problem of partition adjustment and low efficiency in traditional burning methods is solved, and an efficient and flexible mirroring process is achieved, improving the reliability of system deployment and updates.

CN119781786AActive Publication Date: 2025-04-08WUHAN COMPUTING ECOLOGY TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411864624.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-08
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

The traditional system image burning method needs to manually adjust the partition size after burning to make full use of the space, which leads to the inflexible and intelligent process of the image file burning process, and the binary burning efficiency is low, limiting the efficiency and reliability of the system image burning, especially in scenarios of large-scale deployment and frequent updates.

Method used

By intelligently partitioning the target media according to usage needs before burning, defining the file type and transmission method of each preset file partition, and automatically matching and determining the target file partition of the file contents according to the file type after parsing the image file, burning according to the transmission form of the target file partition.

Benefits of technology

It realizes automatic intelligent partitioning before burning, ensures that the partition meets the needs of use, improves the flexibility and intelligence of burning mirror files, improves transmission efficiency, enhances the success rate and reliability of burning, and significantly improves the overall efficiency and reliability of system deployment and updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781786A_ABST
    Figure CN119781786A_ABST
Patent Text Reader

Abstract

The invention discloses a system mirror image burning method and device, relates to the technical field of system mirror image burning, and mainly aims to enable a mirror image file burning process to be flexible and intelligent so as to improve the system mirror image burning efficiency and reliability. According to the main technical scheme, when it is detected that a target medium is mounted to a burning host, intelligent partitioning is conducted on the target medium according to use requirements, multiple preset file partitions corresponding to the target medium and file types and transmission forms corresponding to all the preset file partitions are obtained, and the transmission forms comprise file copying and package decompression; analyzing the to-be-burnt mirror image file in the burning host, and extracting file contents contained in the to-be-burnt mirror image file; and determining a target file partition corresponding to the file content in a plurality of preset file partitions according to the file type, and burning the file content into the target file partition according to a transmission form corresponding to the target file partition. The method and the device are used for burning the system mirror image file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of system image burning, and in particular to a system image burning method and device. Background Art

[0002] With the rapid development of information technology, the deployment demand for operating systems and applications is increasing. System image burning is the process of packaging the pre-configured operating system, applications and their related data into an image file and writing it to the target medium where it needs to be stored. This process is widely used in the fields of large-scale deployment of computer equipment, development and testing of embedded systems, and initial configuration of servers. An efficient and reliable image burning method is of great significance for improving deployment efficiency and ensuring system consistency.

[0003] At present, the traditional system image burning method usually uses binary image files and requires that the capacity of the burning target medium is at least equal to the size of the image file. If the capacity of the target medium is larger than the size of the image file, there will be some capacity left after burning. This requires manual adjustment of the original partition size to make full use of the space, resulting in the image file burning process being inflexible and inefficient. Binary burning also results in low transmission efficiency, which in turn limits the efficiency and reliability of system image burning. These problems are particularly prominent in scenarios of large-scale deployment and frequent updates. Summary of the invention

[0004] In view of the above problems, the present application provides a system image burning method and device, the main purpose of which is to make the image file burning process flexible and intelligent, so as to improve the efficiency and reliability of system image burning.

[0005] In order to solve the above technical problems, this application proposes the following solutions:

[0006] In a first aspect, the present application provides a system image burning method, the method comprising:

[0007] When it is detected that the target medium is mounted on the burning host, the target medium is intelligently partitioned according to the use requirements to obtain a plurality of preset file partitions corresponding to the target medium, and a file type and a transmission form corresponding to each preset file partition, wherein the transmission form includes file copying and compressed package decompression;

[0008] Parsing the image file to be burned in the burning host, and extracting the file content contained in the image file to be burned;

[0009] A target file partition corresponding to the file content is determined in the plurality of preset file partitions according to the file type, and the file content is burned into the target file partition according to the transmission form corresponding to the target file partition.

[0010] In a second aspect, the present application provides a system image burning device, the device comprising:

[0011] A partitioning unit is used to intelligently partition the target medium according to usage requirements after detecting that the target medium is mounted on the burning host, and obtain a plurality of preset file partitions corresponding to the target medium, and a file type and a transmission form corresponding to each preset file partition, wherein the transmission form includes file copying and compressed package decompression;

[0012] The parsing and extracting unit is used to parse the image file to be burned in the burning host and extract the file content contained in the image file to be burned;

[0013] The first burning unit is used to determine the target file partition corresponding to the file content obtained by the parsing and extraction unit in the multiple preset file partitions according to the file type obtained by the partitioning unit, and burn the file content into the target file partition according to the transmission form corresponding to the target file partition.

[0014] In order to achieve the above-mentioned purpose, according to the third aspect of the present application, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the system image burning method of the above-mentioned first aspect.

[0015] In order to achieve the above-mentioned purpose, according to a fourth aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein when the program is running, the system image burning method of the above-mentioned first aspect is executed.

[0016] By means of the above technical scheme, a system image burning method and device provided by the present application is that when it is necessary to burn a system image file, after detecting that a target medium is mounted to a burning host, the target medium is intelligently partitioned according to usage requirements to obtain multiple preset file partitions corresponding to the target medium, and the file type and transmission form corresponding to each preset file partition, the transmission form includes file copying and compressed package decompression, parsing the image file to be burned in the burning host, and extracting the file content contained in the image file to be burned, determining the target file partition corresponding to the file content in multiple preset file partitions according to the file type, and burning the file content to the target file partition according to the transmission form corresponding to the target file partition. By the technical solution provided by the present application, the target medium can be automatically partitioned intelligently according to the use requirements before burning, and the file type and transmission mode of each preset file partition after the partition are defined. After parsing the file content of the image file, the target file partition that the file content is most suitable for storage can be automatically matched and determined according to the file type, and the file content is burned according to the transmission mode of the target file partition, which not only avoids manual adjustment of the partition after burning, but also ensures that the partition is more in line with the use requirements, improves flexibility and intelligence, and enables the system to use storage resources more effectively and avoid unnecessary space waste. In addition, the most suitable transmission form (such as file copy or compressed package decompression) can be determined according to the file type, which not only effectively improves the transmission efficiency, but also avoids the mismatch between the file type and the partition, further improving the success rate and reliability of burning. That is, the intelligent level of system image burning is significantly improved, the flexibility of the partition scheme and the efficiency of file transmission are ensured, thereby greatly improving the overall efficiency and reliability of system deployment and update.

[0017] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0019] Figure 1 A flow chart of a system image burning method provided by an embodiment of the present application is shown;

[0020] Figure 2 Another flow chart of a system image burning method provided by an embodiment of the present application is shown;

[0021] Figure 3 A block diagram of a system image burning device provided by an embodiment of the present application is shown;

[0022] Figure 4 A block diagram showing the composition of another system image burning device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0023] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0024] At present, the traditional system image burning method usually uses binary image files and requires that the capacity of the burning target medium is at least equal to the size of the image file. If the capacity of the target medium is larger than the size of the image file, there will be some capacity left after burning. This requires manual adjustment of the original partition size to make full use of the space, especially for the Rootfs partition, which makes the image file burning process not flexible and intelligent enough. In addition, binary burning will also make the transmission efficiency low, which in turn limits the efficiency and reliability of system image burning. These problems are particularly prominent in scenarios of large-scale deployment and frequent updates.

[0025] After research, the inventor found that the target medium can be intelligently partitioned according to the usage requirements such as purpose and scenario before burning, and the file type and transmission mode corresponding to each preset file partition can be defined, where the file types include ext3, xfs, btrfs, etc., and the transmission mode includes file copying, compressed package decompression, etc. After parsing and extracting the file content in the image file, the target file partition can be determined according to the file type, and then burned according to the transmission form of the target file partition. In this way, not only can the manual adjustment of the partition after burning be avoided, but also the problem of low transmission efficiency caused by binary burning is avoided, that is, the intelligent level of system image burning is significantly improved, the flexibility of the partition scheme and the efficiency of file transmission are ensured, thereby greatly improving the overall efficiency and reliability of system deployment and update.

[0026] Based on the above considerations, the embodiment of the present application provides a system image burning method, through which the image file burning process can be made flexible and intelligent, so as to improve the efficiency and reliability of system image burning. The specific execution steps are as follows: Figure 1 As shown, including:

[0027] 101. When it is detected that the target medium is mounted on the burning host, the target medium is intelligently partitioned according to the use requirements to obtain multiple preset file partitions corresponding to the target medium, and the file type and transmission form corresponding to each preset file partition.

[0028] It should be noted that the execution subject of this embodiment is a burning host, and the target medium includes but is not limited to a HDD, an SSD, a USB drive, etc.

[0029] In this step, the usage requirements are used to characterize the user's specific use of the target medium. For example, the user can select preset uses such as "office", "development" or "server", and the user's information about the use can be collected through the user interface or configuration file. Due to different uses, the storage capacity allocation for the target medium is also different. For example, office use: a larger Home partition, a smaller Root partition, and the use of the ext4 file system; development use: a larger Root partition to accommodate development tools, a medium-sized Home partition, and support for ext4 or xfs file systems; server use: a larger Var partition for logs and caches, a smaller Tmp partition, and the use of ext4 or btrfs file systems. Therefore, after determining the usage requirements, a specific partition strategy template can be pre-set for each usage requirement based on the specific usage information. These templates should cover different types of file systems, as well as the recommended number of partitions, capacity allocation, and content transmission forms. By finding the partition strategy template corresponding to the usage requirements and intelligently partitioning the target medium according to the partition strategy template, the preset file partitions obtained by the target medium after intelligent partitioning meet the user's usage requirements, that is, they meet the user's specific purposes. The partition strategy template may include the number of partitions, the capacity of the partition, the file type corresponding to the partition (such as ext3, xfs, btrfs, etc.) and the transmission form, wherein the transmission form includes file copying and compressed package decompression. In addition, a real-time custom demand configuration template may also be set, which also includes the number of partitions, the capacity of the partition, the file type corresponding to the partition (such as ext3, xfs, btrfs, etc.) and the transmission form. The user defines how to intelligently partition by entering specific parameters in the custom demand configuration template.

[0030] When setting the partition capacity, some redundant space is usually added on the basis of ensuring the minimum necessary space required for the file type to fully meet its resource requirements and ensure that the space of each preset file partition is large enough, thereby improving the reliability of burning.

[0031] By intelligently partitioning the target medium, a plurality of preset file partitions corresponding to the target medium and the file type and transmission form corresponding to each preset file partition are obtained. The file partitions include but are not limited to Boot partition, Rootfs partition, Swap partition, Var partition, Tmp partition and Home partition, etc. Each preset file partition is mounted to the burning host to facilitate the burning operation of step 103.

[0032] 102. Parse the image file to be burned in the burning host, and extract the file content contained in the image file to be burned.

[0033] In this step, first determine the storage location of the image file to be burned, which can be achieved by user specification or system default settings. Parse the internal structure of the image file, identify different types of files and their metadata (such as file name, size, permissions, etc.), and for image files in the form of compressed packages, the system will first decompress and then parse. Extract all file contents that need to be burned from the parsed image file. This process includes not only the data of the file itself, but also the attribute information of the file (such as timestamp, permissions, etc.) to ensure that the file can be completely restored to the target medium. Classify the extracted files according to the content and extension of the file so that they can accurately match the appropriate target file partition in step 103.

[0034] 103. Determine a target file partition corresponding to the file content from among a plurality of preset file partitions according to the file type, and burn the file content into the target file partition according to a transmission format corresponding to the target file partition.

[0035] In this step, since each preset file partition has defined its corresponding file type and transfer form, the file content of each type can be matched to the most appropriate preset file partition, i.e., the target file partition, by using the file type and the classification result when extracting the file content. For example, the operating system files will be placed in the Boot partition, the application files will be placed in the Rootfs partition, and the multimedia files will be placed in the Data partition, etc.

[0036] For each type of file content, the most appropriate transmission form is selected according to the corresponding target file partition, and the file content is written to the corresponding target file partition according to the selected transmission form. For example, the Boot content is copied to the Boot file partition of the target medium in the form of a file copy, and the Rootfs content is decompressed to the Rootfs file partition of the target medium in the form of a compressed package. That is, files that occupy less resources can be directly copied to the target location using a file copy, while files that occupy more resources are compressed first and then decompressed after transmission to save space and improve efficiency. In addition, during the burning process, data corruption can be prevented by verification and checking. After the burning is completed, the burning results can also be confirmed to ensure that all file contents of the image file to be burned are correctly written to the target partition. If there are any problems, a detailed error report can be generated and solutions can be provided.

[0037] Based on the above Figure 1 It can be seen from the implementation method that, through the above technical scheme, a system image burning method provided by the present application is that when it is necessary to burn the system image file, when it is detected that the target medium is mounted to the burning host, the target medium is intelligently partitioned according to the usage requirements to obtain multiple preset file partitions corresponding to the target medium, and the file type and transmission form corresponding to each preset file partition, the transmission form includes file copying and compressed package decompression, parsing the image file to be burned in the burning host, and extracting the file content contained in the image file to be burned, determining the target file partition corresponding to the file content in multiple preset file partitions according to the file type, and burning the file content to the target file partition according to the transmission form corresponding to the target file partition. By the technical solution provided by the present application, the target medium can be automatically partitioned intelligently according to the use requirements before burning, and the file type and transmission mode of each preset file partition after the partition are defined. After parsing the file content of the image file, the target file partition that the file content is most suitable for storage can be automatically matched and determined according to the file type, and the file content is burned according to the transmission mode of the target file partition, which not only avoids manual adjustment of the partition after burning, but also ensures that the partition is more in line with the use requirements, improves flexibility and intelligence, and enables the system to use storage resources more effectively and avoid unnecessary space waste. In addition, the most suitable transmission form (such as file copy or compressed package decompression) can be determined according to the file type, which not only effectively improves the transmission efficiency, but also avoids the mismatch between the file type and the partition, further improving the success rate and reliability of burning. That is, the intelligent level of system image burning is significantly improved, the flexibility of the partition scheme and the efficiency of file transmission are ensured, thereby greatly improving the overall efficiency and reliability of system deployment and update.

[0038] Further, the preferred embodiment of the present application is in the above Figure 1 Based on this, a detailed description of the system image burning process is given. The specific steps are as follows Figure 2 As shown, including:

[0039] 201. Determine a partition policy template corresponding to the target medium based on usage requirements.

[0040] Among them, one usage requirement corresponds to one partition strategy template, and the partition strategy template includes the number of partitions, the capacity of the partition, the file type corresponding to the partition, and the transmission format corresponding to the partition.

[0041] In this step, specific usage requirements are collected in advance through the user interface or predefined configuration files. Including but not limited to: operating system type (such as Linux, Windows), application requirements (such as database server, Web server), storage capacity allocation (such as Boot partition size, Rootfs partition size, Home partition size, etc.), file system type (such as ext3, xfs, btrfs, etc.). According to the collected usage requirements, a most suitable partition strategy template is selected from the preset partition strategy library, and a corresponding relationship between the partition strategy template and the usage requirements is established, that is, each usage requirement corresponds to a specific partition strategy template, and the following contents are specified in detail in the partition strategy template: number of partitions: the total number of partitions to be created; partition capacity: the specific capacity size of each partition; file type corresponding to the partition: the file system type that each partition should use (such as ext4, XFS, btrfs); transmission format corresponding to the partition: the transmission form that each partition should use (such as file copy, compressed package decompression). It should be noted that if the partition preset template in the partition strategy library cannot fully meet the specific requirements, the user can further customize the partition preset template. For example, users can resize certain partitions or change the file system type.

[0042] 202. Determine whether the sum of the capacities corresponding to the partition capacities in the partition strategy template is less than or equal to the total capacity of the target medium.

[0043] Normally, the target medium has versions with different capacity sizes. Therefore, in order to enable the partition strategy template to be applied to target media of different capacities, to achieve intelligent partitioning that meets usage requirements and ensure the optimality of the partition. In this step, the sum of the capacities corresponding to the partition capacities in the partition strategy template can be compared with the total capacity of the target medium to ensure that all preset file partitions can be accommodated on the physical storage resources. Specifically, the sum of the capacities of all partitions in the selected partition strategy template can be calculated, that is, each partition in the template is traversed, and the specified capacity values ​​are accumulated, and the calculated sum of the partition capacities is compared with the actual total capacity of the target medium. If the sum of the capacities is less than or equal to the total capacity of the target medium, step 203 is executed, otherwise the adjustment step is entered, that is, step 204 is executed.

[0044] 203. Intelligently partition the target medium according to the partition strategy template to obtain multiple preset file partitions, and the file type and transmission form corresponding to each preset file partition.

[0045] In this step, the total capacity of the target medium is greater than the sum of the capacities corresponding to the partition capacities in the partition strategy template, which means that the smart partition is not limited by the total capacity of the target medium. At this time, the target medium can be partitioned according to the selected partition strategy template. Specifically, it includes creating a specified number of partitions and setting the corresponding capacity size, file system type and transmission form for each partition. At the same time, the partition information is saved to a log file or configuration file so that the information can be accurately referenced in subsequent steps. This includes the identifier of each partition (such as / dev / sdb1), file system type (such as ext4), transmission form (such as file copy), etc.

[0046] 204. Adjust the partition capacity in the partition strategy template according to the total capacity of the target medium, and intelligently partition the target medium according to the adjusted partition strategy template to obtain multiple preset file partitions, as well as the file type and transmission mode corresponding to each preset file partition.

[0047] In this step, the total capacity of the target medium is less than the sum of the capacities corresponding to the partition capacities in the partition strategy template, which means that the intelligent partition is limited by the total capacity of the target medium. At this time, the partition capacity in the partition strategy template needs to be adjusted so that the final intelligent partition fits the total capacity of the target medium. Specifically, a priority can be set in advance for each preset file partition, and the partition capacity of the preset file partition with a low priority can be reduced according to the total capacity of the target medium, so that the sum of the capacity of the partition capacity is less than or equal to the total capacity of the target medium. Categories can also be defined in advance for each preset file partition, including key partitions and non-key partitions, and the partition capacity of non-key partitions can be reduced according to the total capacity of the target medium, so that the sum of the capacity of the partition capacity is less than or equal to the total capacity of the target medium. It is also possible to pre-define which partitions are deletable, directly delete the deletable partitions, and divide the partition capacity of the deletable partition into other non-deletable partitions or partitions with expansion requirements in proportion, or divide it into partitions with expansion requirements according to pre-defined directional labels. This embodiment does not limit this.

[0048] With respect to the description of adjusting the partition capacity in the partition strategy template in comparison with the total capacity of the target medium, the specific implementation process is: calculating the capacity difference between the total capacity of the target medium and the sum of the capacities corresponding to the partition capacities; reducing the partition capacity of the non-critical partition according to a preset gradient or preset ratio based on the capacity difference, until the sum of the capacities corresponding to the partition capacities in the adjusted partition strategy template is less than or equal to the total capacity of the target medium.

[0049] Among them, the partition strategy template also includes partition categories, and the partition categories include key partitions and non-key partitions. Key partitions specifically refer to preset file partitions that are necessary for system startup and basic function operation, which can be Boot partitions, Rootfs partitions, etc., to ensure that they retain enough space to meet the basic requirements of system startup and operation. Only in extreme cases, the capacity of key partitions is appropriately reduced, but the minimum necessary space must still be guaranteed. Non-key partitions specifically refer to preset file partitions that are not necessary for system startup and basic function operation, which can be Swap partitions, Var partitions, Tmp partitions, Home partitions, etc. Specifically, the capacity difference between the total capacity of the target medium and the sum of the capacities of all partitions in the partition strategy template is calculated, and the capacity difference determines the extent of adjustment required. According to the capacity difference, the non-key partition is reduced, and the reduction method can gradually reduce the partition capacity of the non-key partition according to a preset gradient or a preset ratio, until the sum of the capacities of all partitions in the adjusted partition strategy template is less than or equal to the total capacity of the target medium, and the adjusted partition strategy template is obtained. After adjustment, the adjustment information is saved to a log file or a configuration file so that the information can be accurately referenced in subsequent steps. This includes the number of partitions, the original capacity of each partition, the adjusted capacity, the file system type (such as ext4), the transfer method (such as file copy), etc.

[0050] Through steps 201-204, an automated and intelligent partitioning process can be achieved, reducing manual intervention, avoiding errors that may occur in manual partition adjustment, and improving the accuracy and efficiency of partitioning. The optimal partitioning scheme is dynamically generated based on specific usage requirements to ensure that it can adapt to different application scenarios and hardware configurations, thereby enhancing flexibility and applicability.

[0051] 205. Parse the image file to be burned in the burning host, and extract the file content contained in the image file to be burned.

[0052] This step is combined with the description of step 102 in the above method, and the same contents are not repeated here.

[0053] 206. Get the historical mount records of the burning host.

[0054] It should be noted that, since the target medium may not be burned for the first time for the burning host, as can be seen from steps 201-204, when it is detected that the target medium is mounted to the burning host, the system will perform intelligent partitioning on it, and for the target medium mounted for the second time, under the premise that its use demand does not change, it does not need to be re-intelligently partitioned, and only needs to use the preset file partition obtained by intelligently partitioning the target medium according to the use demand after it is first mounted to the burning host. Therefore, in this step, a built-in or externally stored mount record database can be accessed, which records all target media and related information that have been mounted on the burning host, and the historical mount record of the burning host is extracted therefrom, and the historical mount record includes but is not limited to: the device identifier of the target medium, the mount time, the mount point (such as / mnt / sdX), the partition information (such as the partition identifier, the file system type) and the burning operation result (success or failure), etc. The historical mounting records are traversed. If the existence of the target medium is detected therein, it means that the target medium is mounted for the first time, and step 207 is executed at this time. Otherwise, it means that the target medium is mounted for the second time, and steps 208-211 are executed at this time.

[0055] 207. Intelligently partition the target medium according to usage requirements to obtain multiple preset file partitions corresponding to the target medium and a transmission format corresponding to each preset file partition.

[0056] In this step, since the target medium is mounted for the first time, it needs to be intelligently partitioned. Combined with the description of step 103 in the above method, the same content will not be repeated here.

[0057] 208. Acquire multiple preset file partitions corresponding to the target medium, and the file type and transmission format corresponding to each preset file partition.

[0058] Among them, the multiple preset file partitions are obtained by intelligently partitioning the target medium according to usage requirements after the target medium is mounted to the burning host for the first time.

[0059] In this step, since the target medium is mounted for the second time, there is no need to re-partition it intelligently. Therefore, the multiple preset file partitions obtained by intelligent partitioning when it is first mounted to the burning host can be directly obtained, as well as the file type and transmission form corresponding to each preset file partition, so as to execute step 209.

[0060] 209. Compare the file hash value and the file version number corresponding to the burned image file in the target medium with the file hash value and the file version number corresponding to the image file to be burned to obtain a comparison result.

[0061] In practical applications, the image file to be burned may be an image file for secondary burning of the target medium, and during this period, the image file to be burned may have version updates or content changes, so in order to avoid repeated burning without version updates or content changes, in this step, the hash values ​​and version numbers of all files can be extracted from the target medium and the image file to be burned, and a comparison list can be generated, listing the hash values ​​and version numbers of each pair of files, so as to facilitate item-by-item comparison. By comparing the hash values ​​and version numbers, the system determines which files already exist on the target medium and have the same content, which files have differences or are missing, and generates a detailed comparison report, listing the comparison results of all files, including consistent files, inconsistent files, and newly added or deleted files, as comparison results. If the comparison results are inconsistent, it means that the image file to be burned actually has version updates or content changes, and step 210a is executed at this time. On the contrary, if the comparison results are consistent, it means that there is no need to repeat the burning of files with the same version and content again, and step 210b is executed at this time.

[0062] 210a. Extract difference file content from the image file to be burned by comparing it with the burned image file, and generate incremental file content from the difference file content.

[0063] In this step, all inconsistent files, i.e., files that need to be updated, are identified according to the comparison report generated in step 209. The contents of these difference files are extracted from the image file to be burned, i.e., only the parts that actually need to be updated are extracted to reduce the amount of transmission and improve efficiency. All difference files are packaged into incremental file contents, usually stored in the form of a compressed package, i.e., an incremental update package, for subsequent transmission and application.

[0064] 210b. Generate an alarm message based on the comparison result, and control the burning host to stop the burning operation of the burning image file.

[0065] In this step, according to the comparison report generated in step 209, an alarm message is generated to inform the user that the file on the target medium is completely consistent with the image file to be burned and does not need to be updated. Specifically, the user may be advised to confirm whether it is indeed not necessary to update or whether there are other tasks that need to be processed. At the same time, the burning host is controlled to immediately stop any further burning operations to avoid unnecessary duplication of work and save time and resources.

[0066] 211. Determine a target file partition corresponding to the incremental file content from among a plurality of preset file partitions according to the file type, and burn the incremental file content into the target file partition in a transmission format corresponding to the target file partition.

[0067] In this step, combined with the description of step 103 in the above method, it is only necessary to replace the file content with the incremental file content, and the same content will not be repeated here.

[0068] Furthermore, when the target medium is mounted on the burning host, the multiple preset file partitions divided by the intelligent partition may also be mounted by other processes except the burning host, which will affect the efficiency and reliability of the system image burning. Therefore, before parsing the image file to be burned in the burning host and extracting the file content contained in the image file to be burned, the method also includes: detecting whether the multiple preset file partitions corresponding to the target medium are mounted by other processes outside the burning host; if so, first unmounting the preset file partitions mounted by other processes and then remounting them to the burning host, and after detecting that they are remounted to the burning host, parsing the image file to be burned in the burning host and extracting the file content contained in the image file to be burned; if not, parsing the image file to be burned in the burning host and extracting the file content contained in the image file to be burned.

[0069] In this step, the mounting status of multiple preset file partitions of the target medium can be checked, and the information of all current mount points, including the mount point path, device identifier, file system type, etc., can be obtained through operating system commands (such as the mount command) or API interfaces. The obtained current mount information is compared with the multiple preset file partitions of the target medium to identify which partitions have been mounted and the location of the mount point. For each preset file partition that has been mounted, further check whether it is being used by other processes. This can be achieved by checking the system's process table (such as the l sof command) to determine whether any process has opened files or directories on the partition.

[0070] According to the above inspection results, if there is no preset file partition being used by other processes, the image file to be burned in the burning host is parsed normally to extract the file content contained in the image file to be burned. If there is a preset file partition being used by other processes, a list of preset file partitions that need to be uninstalled can be generated, that is, a list of preset file partitions being used by other processes. The preset file partitions in the list are uninstalled through operating system commands (such as umount commands) or API interfaces to ensure that each preset file partition mounted by other processes is safely uninstalled, and a prompt message is generated to inform the user of the upcoming operation and provide options for the user to confirm whether to continue. If some preset file partitions cannot be successfully uninstalled because other processes are reading and writing a lot, try to terminate the relevant process or wait for a period of time before trying again. If multiple attempts still fail, a detailed error report is generated and the user is prompted to handle it manually. After all preset file partitions that need to be uninstalled are successfully uninstalled, these partitions are remounted on the burning host. When remounting, make its mount point consistent with the previous setting, ensure that all preset file partitions are correctly mounted to the expected location and are not used by other processes, and record the new mount information. After the burning host re-detects that multiple preset file partitions are successfully mounted, parse the image file to be burned in the burning host and extract the file content contained in the image file to be burned.

[0071] By checking the mounting status of multiple preset file partitions of the target medium, it can be ensured that each preset file partition of the target medium is in the correct mounting state and no other processes occupy these partitions before parsing and extracting the image file content. This not only improves the efficiency and reliability of system image burning, but also avoids data corruption or inconsistency caused by interference from other processes.

[0072] Furthermore, as a response to the above Figure 1-2 The implementation of the method embodiment shown in the figure, the embodiment of the present application provides a system image burning device, which is used to make the image file burning process flexible and intelligent, so as to improve the efficiency and reliability of system image burning. The embodiment of the device corresponds to the aforementioned method embodiment. For the convenience of reading, this embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Specifically, Figure 3 As shown, the device comprises:

[0073] The partition unit 301 is used to intelligently partition the target medium according to the use requirements after detecting that the target medium is mounted on the burning host, and obtain a plurality of preset file partitions corresponding to the target medium, and a file type and a transmission form corresponding to each preset file partition, wherein the transmission form includes file copying and compressed package decompression;

[0074] The parsing and extracting unit 302 is used to parse the image file to be burned in the burning host and extract the file content contained in the image file to be burned;

[0075] The first burning unit 303 is used to determine the target file partition corresponding to the file content obtained by the parsing and extraction unit 302 in the multiple preset file partitions according to the file type obtained by the partitioning unit 301, and burn the file content into the target file partition according to the transmission form corresponding to the target file partition.

[0076] Further, such as Figure 4 As shown, the partition unit 301 includes:

[0077] The first determination module 3011 is used to determine the partition strategy template corresponding to the target medium based on the usage requirement, one usage requirement corresponds to one partition strategy template, and the partition strategy template includes the number of partitions, the capacity of the partition, the file type corresponding to the partition, and the transmission format corresponding to the partition;

[0078] A judging module 3012, configured to judge whether the sum of the capacities corresponding to the partition capacities in the partition strategy template obtained by the first determining module 3011 is less than or equal to the total capacity of the target medium;

[0079] The first processing module 3013 is used to intelligently partition the target medium according to the partition strategy template to obtain a plurality of preset file partitions, and the file type and the transmission form corresponding to each preset file partition, if the judgment module 3012 judges that the sum of the capacities corresponding to the partition capacities in the partition strategy template is less than or equal to the total capacity of the target medium;

[0080] The second processing module 3014 is used to adjust the partition capacity in the partition strategy template according to the total capacity of the target medium if the judgment module 3012 judges that the sum of the capacities corresponding to the partition capacities in the partition strategy template is greater than the total capacity of the target medium, and intelligently partition the target medium according to the adjusted partition strategy template to obtain multiple preset file partitions, as well as the file type and the transmission form corresponding to each preset file partition.

[0081] Further, such as Figure 4 As shown, the partition strategy template also includes a partition category, and the partition category includes a key partition and a non-key partition; the second processing module 3014 is specifically used to:

[0082] Calculating a capacity difference between a total capacity of the target medium and a sum of capacities corresponding to the partition capacities;

[0083] According to the capacity difference, the partition capacity of the non-critical partition is reduced according to a preset gradient or a preset ratio until the sum of the capacities corresponding to the partition capacities in the adjusted partition strategy template is less than or equal to the total capacity of the target medium.

[0084] Further, such as Figure 4 As shown, the device also includes:

[0085] The first acquisition unit 304 is used to acquire the historical mounting record of the burning host before the first burning unit 303;

[0086] The first burning unit 303 is specifically used for:

[0087] If it is determined according to the historical mounting record that the target medium is mounted for the first time, the target medium is intelligently partitioned according to usage requirements to obtain a plurality of preset file partitions corresponding to the target medium and a transmission form corresponding to each of the preset file partitions.

[0088] Further, such as Figure 4 As shown, the device also includes:

[0089] The second acquisition unit 305 is used to acquire a plurality of preset file partitions corresponding to the target medium, and a file type and a transmission form corresponding to each preset file partition if it is determined according to the historical mounting record that the target medium is mounted for the second time, wherein the plurality of preset file partitions are obtained by intelligently partitioning the target medium according to usage requirements after the target medium is mounted to the burning host for the first time;

[0090] A comparison unit 306 is used to compare the file hash value and the file version number corresponding to the burned image file in the target medium with the file hash value and the file version number corresponding to the image file to be burned, and obtain a comparison result;

[0091] The generating unit 307 is configured to extract difference file contents from the image file to be burned by comparing the burned image file, and generate incremental file contents from the difference file contents if the comparison result obtained by the comparing unit 306 is inconsistent;

[0092] The second burning unit 308 is used to determine the target file partition corresponding to the incremental file content obtained by the generation unit 37 in multiple preset file partitions according to the file type obtained by the second acquisition unit 35, and burn the incremental file content into the target file partition according to the transmission form corresponding to the target file partition.

[0093] Further, such as Figure 4 As shown, the device also includes:

[0094] The alarm unit 309 is used to generate an alarm message based on the comparison result if the comparison result obtained by the comparison unit 306 is consistent, and control the burning host to stop the burning operation of the image file to be burned.

[0095] Further, such as Figure 4 As shown, the device also includes:

[0096] A detection unit 310, used for detecting whether the plurality of preset file partitions corresponding to the target medium are mounted by other processes other than the burning host before the parsing and extracting unit 302;

[0097] The processing unit 311 is used for, if the detection unit 310 detects that the plurality of preset file partitions corresponding to the target medium have been mounted by other processes other than the burning host, first unmounting the preset file partitions mounted by other processes and then remounting them to the burning host, and after detecting that the preset file partitions are remounted to the burning host, parsing the image file to be burned in the burning host, and extracting the file content contained in the image file to be burned;

[0098] The parsing and extracting unit 302 is specifically used to:

[0099] If the detection unit 310 detects that the plurality of preset file partitions corresponding to the target medium are not mounted by other processes other than the burning host, the image file to be burned in the burning host is parsed to extract the file content contained in the image file to be burned.

[0100] Furthermore, an embodiment of the present application further provides a storage medium, wherein the storage medium is used to store a computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the above Figure 1-2 The system image burning method described in .

[0101] Furthermore, the embodiment of the present application also provides a processor, the processor is used to run a program, wherein the program executes the above Figure 1-2 The system image burning method described in .

[0102] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0103] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.

[0104] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0105] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the application is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the application described herein, and the description of the specific language above is for the purpose of disclosing the best mode of implementation of the application.

[0106] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0108] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0109] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0111] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0112] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash memory (flashRAM). The memory is an example of a computer-readable medium.

[0113] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory media such as modulated data signals and carrier waves.

[0114] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0115] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0116] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A system image burning method, characterized in that: The method comprises: When it is detected that the target medium is mounted on the burning host, the target medium is intelligently partitioned according to the use requirements to obtain a plurality of preset file partitions corresponding to the target medium, and a file type and a transmission form corresponding to each preset file partition, wherein the transmission form includes file copying and compressed package decompression; Parsing the image file to be burned in the burning host, and extracting the file content contained in the image file to be burned; A target file partition corresponding to the file content is determined in the plurality of preset file partitions according to the file type, and the file content is burned into the target file partition according to the transmission form corresponding to the target file partition.

2. The method according to claim 1, characterized in that: Intelligently partitioning the target medium according to usage requirements to obtain a plurality of preset file partitions corresponding to the target medium, and a file type and a transmission form corresponding to each of the preset file partitions, including: Determine a partition strategy template corresponding to the target medium based on the usage requirement, one usage requirement corresponds to one partition strategy template, and the partition strategy template includes the number of partitions, the capacity of the partition, the file type corresponding to the partition, and the transmission format corresponding to the partition; Determining whether the sum of the capacities corresponding to the partition capacities in the partition strategy template is less than or equal to the total capacity of the target medium; If so, intelligently partition the target medium according to the partition strategy template to obtain a plurality of the preset file partitions, and the file type and the transmission form corresponding to each of the preset file partitions; If not, the partition capacity in the partition strategy template is adjusted according to the total capacity of the target medium, and the target medium is intelligently partitioned according to the adjusted partition strategy template to obtain multiple preset file partitions, as well as the file type and the transmission form corresponding to each preset file partition.

3. The method according to claim 2, characterized in that The partition strategy template also includes partition categories, and the partition categories include key partitions and non-key partitions; Adjusting the partition capacity in the partition strategy template according to the total capacity of the target medium includes: Calculating a capacity difference between a total capacity of the target medium and a sum of capacities corresponding to the partition capacities; According to the capacity difference, the partition capacity of the non-critical partition is reduced according to a preset gradient or a preset ratio until the sum of the capacities corresponding to the partition capacities in the adjusted partition strategy template is less than or equal to the total capacity of the target medium.

4. The method according to claim 1, characterized in that: Before determining a target file partition corresponding to the file content in the plurality of preset file partitions according to the file type, and burning the file content into the target file partition according to the transmission form corresponding to the target file partition, the method further includes: Get the historical mount records of the burning host; If it is determined according to the historical mounting record that the target medium is mounted for the first time, the target medium is intelligently partitioned according to usage requirements to obtain a plurality of preset file partitions corresponding to the target medium and a transmission form corresponding to each of the preset file partitions.

5. The method according to claim 4, characterized in that If it is determined according to the historical mounting record that the target medium is mounted for the second time, the method further includes: Acquire multiple preset file partitions corresponding to the target medium, and the file type and transmission form corresponding to each preset file partition, wherein the multiple preset file partitions are obtained by intelligently partitioning the target medium according to usage requirements after the target medium is mounted to the burning host for the first time; Compare the file hash value and file version number corresponding to the burned image file in the target medium with the file hash value and file version number corresponding to the image file to be burned to obtain a comparison result; if the comparison result is inconsistent, extract the difference file content from the image file to be burned by comparing with the burned image file, and generate incremental file content from the difference file content; The target file partition corresponding to the incremental file content is determined in the plurality of preset file partitions according to the file type, and the incremental file content is burned into the target file partition according to the transmission form corresponding to the target file partition.

6. The method according to claim 5, characterized in that If the comparison result is consistent, the method further comprises: Based on the comparison result, an alarm message is generated, and the burning host is controlled to stop the burning operation of the image file to be burned.

7. The method according to any one of claims 1 to 6, characterized in that Before parsing the image file to be burned in the burning host and extracting the file content contained in the image file to be burned, the method further includes: Detecting whether the plurality of preset file partitions corresponding to the target medium are mounted by other processes other than the burning host; If so, the preset file partition mounted by other processes is first unmounted and then remounted to the burning host, and after detecting that it is remounted to the burning host, the image file to be burned in the burning host is parsed to extract the file content contained in the image file to be burned; If not, the image file to be burned in the burning host is parsed to extract the file content contained in the image file to be burned.

8. A system image burning device, characterized in that: The device comprises: A partitioning unit is used to intelligently partition the target medium according to the use requirements after detecting that the target medium is mounted on the burning host, and obtain a plurality of preset file partitions corresponding to the target medium, and a file type and a transmission form corresponding to each preset file partition, wherein the transmission form includes file copying and compressed package decompression; The parsing and extracting unit is used to parse the image file to be burned in the burning host and extract the file content contained in the image file to be burned; The first burning unit is used to determine the target file partition corresponding to the file content obtained by the parsing and extraction unit in the multiple preset file partitions according to the file type obtained by the partitioning unit, and burn the file content into the target file partition according to the transmission form corresponding to the target file partition.

9. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the system image burning method according to any one of claims 1 to 7.

10. A processor, characterized in that: The processor is used to run a program, wherein the system image burning method according to any one of claims 1 to 7 is executed when the program is run.

Citation Information

Patent Citations

  • Method and device for installing embedded operating system

    CN101859251A

  • Production method of INAND / NAND-based multi-partition storage device

    CN102520981A

  • System installation method supporting flexible partition layout

    CN116301940A

  • Target software upgrading method and system, computer equipment and readable storage medium

    CN118760453A

  • Computer operating system installation

    US6351850B1