Installation package generation method and device, equipment, medium and product

By building a public data set and using hierarchical storage technology, we can identify the shared data between images and generate streamlined images. This solves the problems of large software installation packages and slow transmission, and enables more efficient installation package generation.

CN120631387APending Publication Date: 2025-09-12SANGFOR TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510788970.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-12

Smart Images

  • Figure CN120631387A_ABST
    Figure CN120631387A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of mirror images, in particular to an installation package generation method and device, equipment, a medium and a product, and the method comprises the steps: constructing a common data set based on common data among a plurality of to-be-merged mirror images, and determining independent data of each to-be-merged mirror image; for any to-be-merged mirror image, the simplified mirror image is constructed according to the target data block in the public data set and the independent data of the to-be-merged mirror image, the data block in the public data set can be multiplexed to each simplified mirror image, and the data volume of the simplified mirror image is smaller than or equal to the data volume of the corresponding to-be-merged mirror image, so that the data volume is effectively reduced, and the merging efficiency is improved. The occupation of storage resources is reduced; in the embodiment of the invention, the merged mirror image is constructed according to the public data set, the corresponding relationship between each simplified mirror image and the target data block and the corresponding relationship between each simplified mirror image and the independent data, so that the merged mirror image does not have repeated data, the size of the merged mirror image is reduced, and the transmission efficiency is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of mirroring technology, and in particular to a method, apparatus, device, medium, and product for generating an installation package. Background Art

[0002] Currently, software product installation packages are generally becoming bloated across the industry. For example, security operations platform products often involve big data computing and storage, and therefore utilize numerous components, resulting in installation packages potentially reaching tens of GB in size. In recent years, large model technologies have been increasingly adopted in many fields, including cybersecurity. These large models are typically enormous (often reaching several GB), further expanding the installation packages of software using these technologies. This presents several challenges for software installation, deployment, and upgrades. Specifically, these large installation packages can be inconvenient to transmit (or download), significantly increasing installation and upgrade times. This is primarily due to the fact that the installation packages often contain multiple image files, which are not only individually large but often need to exist simultaneously.

[0003] To address this issue, the following solutions are commonly used in the industry: Base packages are distinguished from upgrade packages. Base packages are only used during initial installation or installed by default on devices. Upgrade packages are reduced in size by subtracting from the base package, retaining only the modified content. While distinguishing between base and upgrade packages, the overall package size remains unchanged. Alternatively, the size of a single image can be reduced by reducing the number of image layers, removing unnecessary files, and removing redundancy.

[0004] However, this only separates the installation package by business, but does not reduce the overall size. By only analyzing and processing a single image, including removing redundant data, the streamlining effect is modest, and the installation package size remains large.

[0005] Therefore, how to improve the streamlining effect of software installation packages is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0006] The purpose of this application is to provide a method, device, equipment, medium and product for generating an installation package, which can improve the streamlining effect of the software installation package.

[0007] In a first aspect, a method for generating an installation package is provided, comprising:

[0008] Based on the shared data among multiple images to be merged, a common data set is constructed, and the independent data of each image to be merged is determined;

[0009] For any image to be merged, construct a simplified image corresponding to the image to be merged based on the target data blocks in the public data set and the independent data of the image to be merged; wherein the public data set includes multiple data blocks, the data blocks are used to be multiplexed into each simplified image, the target data blocks correspond to the original data blocks in the image to be merged, and the data volume of the simplified image is less than or equal to the data volume of the corresponding image to be merged;

[0010] A merged image is constructed according to the public data set, the corresponding relationship between each simplified image and the target data block, and the corresponding relationship between each simplified image and the independent data.

[0011] In a preferred example, the present application may be further configured as follows: the public data set includes: a first data set and a second data set; and constructing the public data set based on the shared data between the multiple images to be merged includes:

[0012] Scanning system environments of multiple images to be merged, and constructing a first data set based on a common operating system among the multiple images to be merged;

[0013] The data blocks other than the system environment of the multiple images to be merged are scanned, and a second data set is constructed based on the common data blocks among the multiple images to be merged.

[0014] In a preferred example, the present application may be further configured as follows: the original data block of the image to be merged includes: a first data block and a second data block, wherein the first data block represents the operating system corresponding to the image to be merged,

[0015] The step of constructing a simplified image corresponding to any image to be merged based on the target data blocks in the public data set and the independent data of the image to be merged includes:

[0016] For any image to be merged, construct a simplified image corresponding to the image to be merged based on the target shared operating system in the first data set, the shared data blocks in the second data set, and the independent data of the image to be merged;

[0017] The target shared operating system corresponds to the operating system in the image to be merged, and the shared data block corresponds to the second data block in the image to be merged.

[0018] In a preferred example, the present application may be further configured as follows: scanning the system environments of the multiple images to be merged and constructing a first data set based on the common operating systems among the multiple images to be merged include:

[0019] Scanning system environments of the multiple images to be merged, and constructing a first data set based on target operating systems of the multiple images to be merged, wherein the target operating systems of the multiple images to be merged are deduplicated operating systems of the multiple images to be merged;

[0020] or,

[0021] Scan the system environments of multiple images to be merged to obtain the system type of the operating system of each image to be merged; and read the simplified operating system corresponding to the system type from the storage module according to the system type to construct a first data set.

[0022] In a preferred example, the present application may be further configured as follows: scanning data blocks other than the system environment of the plurality of images to be merged, and constructing a second data set based on the common data blocks between the plurality of images to be merged, includes:

[0023] Scanning data blocks other than system environments of a plurality of images to be merged, and determining duplicate data blocks;

[0024] Using preset rules, duplicate data blocks are screened to obtain common data blocks among the multiple images to be merged; and a second data set is constructed based on the common data blocks among the multiple images to be merged;

[0025] The preset rules include at least one of the following:

[0026] Filtering out duplicate data blocks whose number of repetitions is greater than a preset repetition number threshold from the duplicate data blocks as shared data blocks between the multiple images to be merged;

[0027] From the duplicate data blocks, duplicate data blocks with a data volume greater than a preset data volume threshold are screened out as common data blocks between the multiple mirrors to be merged.

[0028] In a preferred example, the present application may be further configured as follows: the public data set includes a first data set, or the public data set includes a first data set and a second data set, the first data set represents a common operating system among the multiple images to be merged, and the second data set represents a common data block among the multiple images to be merged;

[0029] After constructing the merged image according to the public data set, the correspondence between each streamlined image and the target data block, and the correspondence between each streamlined image and the independent data, the method further includes:

[0030] If the public data set only includes the first data set, an installation package is obtained according to the first data set and the second data set, so that when the installation package is started in the container, the second data set can be copied into the container in the form of external data.

[0031] In a second aspect, a device for generating an installation package is provided, comprising:

[0032] A determination module, configured to construct a common data set based on the shared data among the multiple images to be merged, and to determine the independent data of each image to be merged;

[0033] a streamlined image construction module, configured to construct, for any image to be merged, a streamlined image corresponding to the image to be merged based on a target data block in the public data set and independent data of the image to be merged; wherein the public data set includes a plurality of data blocks, the data blocks being multiplexed into each streamlined image, the target data blocks corresponding to the original data blocks in the image to be merged, and the data volume of the streamlined image being less than or equal to the data volume of the corresponding image to be merged;

[0034] The merged image construction module is used to construct a merged image according to the public data set, the corresponding relationship between each simplified image and the target data block, and the corresponding relationship between each simplified image and the independent data.

[0035] According to a third aspect, an electronic device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the method for generating an installation package according to any one of the first aspects when running the computer program.

[0036] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to implement the method for generating an installation package as described in any one of the first aspects.

[0037] In a fifth aspect, a computer program product is provided, comprising a computer program or instructions, which, when executed by a processor, implements the method for generating an installation package as described in any one of the first aspects.

[0038] In summary, the method for generating an installation package provided by this application has the following beneficial technical effects:

[0039] In this solution, a common data set is constructed based on the shared data between multiple images to be merged, and the independent data of each image to be merged is determined. For any image to be merged, a streamlined image is constructed based on the target data blocks in the common data set and the independent data of the image to be merged. Because the data blocks in the common data set can be reused in each streamlined image, and the data volume of the streamlined image is less than or equal to the data volume of the corresponding image to be merged, the data volume is effectively reduced, and the storage resource usage is reduced. The merged image is constructed based on the common data set, the correspondence between each streamlined image and the target data block, and the correspondence between each streamlined image and the independent data, further integrating resources, eliminating duplicate data in the merged image, reducing the size of the merged image, and thus improving transmission efficiency.

[0040] In addition, the present application also provides an installation package generation device, equipment, medium and product, all of which have the above-mentioned beneficial technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0042] Figure 1 This is a flow chart of a method for generating an installation package provided in an embodiment of the present application;

[0043] Figure 2 This is a schematic diagram of an application of merging images provided in an embodiment of the present application;

[0044] Figure 3 This is a schematic diagram of a process for generating a public data set provided in an embodiment of the present application;

[0045] Figure 4 This is a schematic diagram of a process for mirroring provided in an embodiment of the present application;

[0046] Figure 5 This is a schematic diagram of the structure of a mirror abstraction hierarchical framework provided by an embodiment of the present application;

[0047] Figure 6 This is a schematic diagram of a merged image provided by an embodiment of the present application;

[0048] Figure 7 This is a simplified flowchart of an operating system provided by an embodiment of the present application;

[0049] Figure 8 This is a schematic diagram of a shared data identification process provided by an embodiment of the present application;

[0050] Figure 9 This is a schematic diagram of the relationship between a simplified image and a merged image provided by an embodiment of the present application;

[0051] Figure 10 This is a schematic diagram of the structure of a device for generating an installation package provided in an embodiment of the present application;

[0052] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed, but as long as they are within the scope of the present application, they are protected by patent law.

[0054] It should be noted that in the optional embodiments of the present application, the object information and other related data involved, when the embodiments in the present application are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the object, it needs to be obtained through the authorization and consent of the object, the authorization and consent of the relevant departments, and in compliance with the relevant laws, regulations and standards of the country and region. If personal information is involved in the embodiments, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject needs to be obtained. The embodiments also need to be implemented with the authorization and consent of the object.

[0055] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0056] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document, unless otherwise specified, generally indicates an "or" relationship between the related objects.

[0057] In order to better understand and illustrate the solutions of the embodiments of the present application, some technical terms involved in the embodiments of the present application are briefly explained below.

[0058] Image: A special file system that not only provides the programs, libraries, resources, configuration files, and other files required for the container runtime, but also contains some configuration parameters prepared for runtime (such as anonymous volumes, environment variables, users, etc.). Its content will not be changed after it is built.

[0059] Container: An application or group of applications that runs independently. A container is a running instance created from an image and can be started, started, stopped, and deleted. Each container is isolated and secure.

[0060] Tiered Storage: This is one of the core principles of image composition. Each image is composed of multiple layers, each representing a snapshot of a file system. Together, these layers form a complete image file system. Each image layer is read-only. When a container is running, a writable layer is added on top of the image layer for container write operations. Therefore, multiple containers can share the same read-only image layer while having their own writable layer, achieving a high degree of resource sharing and isolation. This design makes images reusable, allowing the same image layer to be shared by multiple images, saving storage space, reducing image transmission time, and improving image transmission efficiency.

[0061] A software installation package is a collection of self-decompressible files that contains all the files required to install the software. Running this installation package (executable file) releases all the files to your hard drive. An upgrade package is also a type of installation package.

[0062] Package: The process of compressing one or more files (folders) using compression software. The "packaging" operation can effectively reduce the size of the data.

[0063] Security Operations Platform: A security operations platform is an integrated technology framework designed to help organizations monitor, detect, and respond to cybersecurity threats. It integrates various security tools and data sources to provide real-time security situational awareness and incident response capabilities.

[0064] XDR (Extended Detection and Response): An extended detection and response platform that integrates SIEM log access, a security detection engine, a security operations module, and coordinated response. XDR is generally considered a mainstream product implementation for security operations platforms.

[0065] Large Language Model (LLM): A large language model (abbreviated as "LLM") is a natural language processing model based on deep learning technology. Trained on massive amounts of text data, it can understand and generate human language and perform various complex language tasks, such as text generation, question answering, and translation. LLMs typically use a Transformer architecture with billions or even hundreds of billions of parameters, capable of capturing the deep semantics and contextual relationships of language.

[0066] To better understand the solution provided by the embodiments of this application, the solution is described below with reference to a specific application scenario. In some embodiments, the installation package generation method can be applied to an installation package generation system. In some embodiments, the installation package generation system includes a first electronic device and a second electronic device, which can be directly or indirectly connected via wired or wireless communication. The first electronic device can be a terminal device or a server. The server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. The second electronic device can be a terminal device, including but not limited to mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. This embodiment of this application does not limit this. In one possible scenario, after receiving a software package request from the second electronic device, the first electronic device generates a merged image based on the installation package generation method to obtain the installation package and sends it to the second electronic device. It should be understood that the above is merely an example and is not limited to this embodiment.

[0067] An embodiment of the present application provides a method for generating an installation package, which can significantly reduce the size of the installation package in multiple mirroring situations. It effectively solves the shortcomings of current industry solutions in multiple mirroring situations, such as large installation package size, long installation package transmission / download time, and difficulty in installation and upgrading. Compared with current solutions in the industry, it has a better streamlining effect.

[0068] Specifically, the present invention provides a method for generating an installation package. Figure 1As shown, the method provided in the embodiment of the present application can be executed by an electronic device, and the method includes: S101-S103, wherein:

[0069] S101: construct a common data set based on the shared data among multiple images to be merged, and determine the independent data of each image to be merged.

[0070] In an embodiment of the present application, the software data package to be processed includes multiple images to be merged. Common data refers to the common data portion existing in multiple images to be merged. Common data does not require that all multiple images to be merged have the data. Instead, a certain classification strategy is set to determine that as long as a preset number of images to be merged contain the data at the same time, it is considered common data. For example, as long as there is data commonly contained in more than three images to be merged at the same time / simplified data of the commonly contained data, it is considered common data, and the preset number is at least greater than 1. It can be understood that the above is only an example and is not limited to this embodiment.

[0071] A common dataset is a collection of data shared by multiple images to be merged. This dataset includes at least one data type, such as operating system data. It can also include data blocks shared by other data types. The independent data of each image to be merged refers to data other than the shared data.

[0072] S102 : For any image to be merged, construct a simplified image corresponding to the image to be merged based on the target data blocks in the public data set and the independent data of the image to be merged.

[0073] The public data set includes multiple data blocks, which are used to be multiplexed into each thin image. The target data blocks correspond to the original data blocks in the image to be merged. The data volume of the thin image is less than or equal to the data volume of the corresponding image to be merged.

[0074] In an embodiment of the present application, each streamlined data is composed of an abstract sublayer, and the abstract sublayer of the streamlined image may include: an image layer corresponding to independent data and an image layer corresponding to the target data block corresponding to the image to be merged in the public data set.

[0075] S103: Construct a merged image according to the common data set, the corresponding relationship between each streamlined image and the target data block, and the corresponding relationship between each streamlined image and the independent data.

[0076] The merged image includes a common data set and independent data of each simplified image, as well as a corresponding relationship between each simplified image and a target data block, and a corresponding relationship between each simplified image and independent data.

[0077] The data of the merged image includes multiple abstract layers, that is, the public data set and the independent data correspond to their own abstract layers respectively. It can be understood that each abstract layer is composed of abstract sublayers of each streamlined image. In an embodiment of the present application, the storage of duplicate data can be reduced by constructing the image in layers, and the image construction process is decomposed into multiple abstract layers, each of which can be independently constructed, cached and reused, thereby improving construction efficiency and reducing storage space usage. In this step, the storage of duplicate data is reduced and the storage and construction efficiency of the image are optimized by constructing the merged image in layers. In an embodiment of the present application, based on the correspondence between each streamlined image and the target data block, and the correspondence between each streamlined image and the independent data, the merged image is split into multiple streamlined images. For example, see Figure 2 When the merged image includes: independent data 1, independent data 2, independent data 3, independent data 4, shared data a, shared data b, and shared data c, the corresponding relationship between each thin image and the target data block and the independent data includes: thin image 1 corresponds to: independent data 1, shared data a, thin image 2 corresponds to: independent data 2, shared data b, thin image 3 corresponds to: independent data 3, shared data a, shared data b, thin image 4 corresponds to: independent data 4, shared data a, shared data c, and thin image 1, thin image 2, thin image 3, and thin image 4 can be obtained.

[0078] It can be seen that in the embodiment of the present application, a common data set is constructed based on the shared data between multiple images to be merged, and the independent data of each image to be merged is determined; for any image to be merged, a streamlined image is constructed based on the target data blocks in the common data set and the independent data of the image to be merged. Since the data blocks in the common data set can be reused in each streamlined image, and the data volume of the streamlined image is less than or equal to the data volume of the corresponding image to be merged, the data volume is effectively reduced and the storage resource usage is reduced; the merged image is constructed based on the common data set, the corresponding relationship between each streamlined image and the target data block, and the corresponding relationship between each streamlined image and the independent data, further integrating resources, so that there is no duplicate data in the merged image, reducing the size of the merged image, and thus improving transmission efficiency.

[0079] In a possible implementation of the embodiment of the present application, the public data set includes: a first data set and a second data set. For details, see Figure 3 S101 constructs a public dataset based on the shared data among multiple images to be merged, including:

[0080] S1011 : Scan system environments of multiple images to be merged, and construct a first data set based on a common operating system among the multiple images to be merged.

[0081] The software data package includes all resources of the software, which may include resources corresponding to the operating system and other data in addition to the operating system. Specifically, by analyzing the operating system type, version, basic files required for running the business and other information in each image to be merged, the operating system of each image to be merged is obtained, and based on the shared operating system between multiple images to be merged, the first data set is obtained. The shared operating system may include merging, optimizing, and replacing all operating systems with an existing streamlined operating system. Compared with all the original operating systems, the data volume of the first data set is significantly reduced.

[0082] S1012: Scan data blocks other than the system environment of the multiple images to be merged, and construct a second data set based on the common data blocks among the multiple images to be merged.

[0083] Among them, by traversing the data except the system layer in multiple images to be merged, the original data information that can identify the common data is obtained; by extracting the common data, constructing the second data set, reducing the common layer data, and achieving the purpose of reducing the image volume.

[0084] In the embodiment of the present application, the public data set includes data sets of at least two data types, namely, a data set of an operating system type and a data set of a common data type.

[0085] As can be seen, scanning the system environments of multiple images to be merged and constructing a first dataset based on the shared operating systems across the multiple images to be merged accurately extracts the common operating system components across multiple images, avoiding the storage of the same operating system across multiple images and reducing data redundancy. Simultaneously, scanning the data blocks of the multiple images to be merged, excluding the system environments, and constructing a second dataset based on the shared data blocks across the multiple images to be merged further optimizes the non-system environment data and integrates duplicate data blocks excluding the system environment into the second dataset.

[0086] Furthermore, based on the fact that the public data set includes at least a first data set corresponding to the operating system and a second data set corresponding to the shared data block, after obtaining the first data set, the correspondence between each streamlined image and the target data block, and the correspondence between each streamlined image and the independent data, the image creation process can be entered. The specific process is as follows: Figure 4 , based on the abstract sub-layers of each streamlined image, compression is performed using a layered storage method to obtain a merged image.

[0087] The embodiment of the present application utilizes the characteristics of image layered storage to abstract the merged image into at least three layers. Taking three layers as an example, see Figure 5, the first data set corresponds to the system layer, the second data set corresponds to the public layer, and the independent data block corresponds to the business layer. Specifically, the merged image is abstracted into three levels, including: System layer: Contains the operating system, the basic environment for image operation, and configuration information. Public layer: Contains common data such as files, configurations, and other information in multiple images to be merged; the public layer can be one or more layers. If there are N images to be merged, the common data does not require all N images to be merged to have the data. Instead, a certain classification strategy is set to determine that as long as a preset number of images to be merged contain the data at the same time, it is regarded as common data. For example, as long as there are more than 3 images to be merged that contain the data at the same time, it is regarded as common data. Business layer: Contains other content in each image to be merged except the system layer and the public layer, that is, independent data, such as unique code, configuration, pictures, etc.

[0088] For example, the number of images to be merged is 5, and the data types include: operating system type, shared data block type, see Figure 6 The merged image includes Business 1, Business 2, Business 3, Business 4, and Business 5 of the business layer, Public 1, Public 2, and Public 3 of the public layer, and System 1, System 2, and System 3 of the system layer.

[0089] Specifically, the embodiment of the present application further elaborates on the first data set constructed based on the shared operating system among multiple images to be merged.

[0090] In one achievable method, shared (identical or substantially identical) operating systems can be identified and then merged to reduce the total number of different operating systems. S1011 scans the system environments of multiple images to be merged and constructs a first dataset based on the shared operating systems among the multiple images to be merged. This includes scanning the system environments of the multiple images to be merged and constructing the first dataset based on the target operating systems of the multiple images to be merged. The target operating systems of the multiple images to be merged are the deduplicated operating systems of the multiple images to be merged.

[0091] Specifically, the system environment of each image to be merged is scanned to identify the operating system of each image to be merged; duplicate operating systems in the operating systems of the multiple images to be merged are removed to obtain a common operating system, thereby constructing the first data set. Specifically, the operating systems of the multiple images to be merged are merged based on at least one of system files, operating system types, and operating system versions of the system environments of the multiple images to be merged, thereby removing duplicate operating systems in each category of operating systems and obtaining a common operating system.

[0092] There are many ways to determine duplicate operating systems. Specifically: Method 1, the similarity between the system files of each category of operating systems can be calculated. When the similarity is greater than the preset similarity threshold, it means that the two operating systems are similar. At this time, only one of the operating systems can be retained, or the two operating systems can be merged to remove duplicate files. The preset similarity threshold can be customized by the user, such as 80%, 85%, etc. Method 2, operating systems with the same operating system type or the same operating system version can be merged into one operating system. Method 3, the operating systems can be merged only when at least two of the following conditions are met: the similarity between the system files of the operating systems is greater than the preset similarity threshold, the operating system types of the operating systems are the same, and the operating system versions of the operating systems are the same. It can be understood that other methods can also be used to achieve the merging of operating systems, which are not limited here.

[0093] Furthermore, after scanning the system environments of multiple images to be merged and constructing a first data set based on the target operating systems of the multiple images to be merged, the target operating system can be optimized to further reduce the size of the operating system. The method can also include: streamlining the target operating system to obtain a streamlined target operating system, and the amount of data of the streamlined target operating system is smaller than that of the target operating system before streamlining.

[0094] In the embodiments of this application, the operating system is optimized through certain methods to reduce the size of the shared operating system. The present invention does not limit the method for optimizing the operating system. Specific optimization methods include, but are not limited to: replacing the target operating system with a streamlined version of the operating system; installing only necessary software; deleting unnecessary files; and cleaning up temporary and redundant files. As can be seen, in the embodiments of this application, the operating system can be further optimized after merging, reducing the size of the operating system, thereby further reducing the size of the software installation package.

[0095] For example, see Figure 7 After obtaining each image to be merged (original image), the system environment of the multiple images to be merged can be scanned to obtain operating system 1, operating system 2, operating system 3, and operating system 4, and then the operating system merging is performed to remove duplicate operating systems, and the operating systems are optimized / streamlined to obtain a final streamlined first data set including operating system A and operating system B.

[0096] It can be seen that in the embodiment of the present application, the system environments of multiple images to be merged are scanned, and a first data set is constructed based on the target operating systems (operating systems after deduplication processing) of the multiple images to be merged. By deduplicating the operating systems, the operating system parts existing in multiple images can be accurately extracted, avoiding the need to store a complete operating system in each image. Instead, only non-duplicate operating systems are stored, thereby reducing data redundancy and thus reducing the size of the installation package.

[0097] In one feasible manner, S1011 scans the system environments of multiple images to be merged, and constructs a first data set based on the common operating system between the multiple images to be merged, including: scanning the system environments of multiple images to be merged, obtaining the system type of the operating system of each image to be merged; according to the system type, reading the streamlined operating system corresponding to the system type from the storage module to construct the first data set.

[0098] Some operating systems have existing streamlined operating systems. The type of operating system can be determined based on the version number, operating system name and other information of the operating system of each image to be merged; based on the system type, the streamlined operating system corresponding to the system type is read from the storage module; if a streamlined operating system of a certain system type is read, the operating system in the image to be merged is replaced with the streamlined operating system to facilitate the construction of the first data set.

[0099] It can be seen that in the embodiment of the present application, the system environments of multiple images to be merged are scanned, the system type of the operating system of each image to be merged is obtained, and then the streamlined operating system corresponding to the system type is read from the storage module according to the system type to construct a first data set; the pre-stored streamlined operating system that has been optimized is utilized to further reduce the amount of data.

[0100] A possible implementation of the embodiment of the present application is shown in Figure 8 S1012 scans data blocks other than the system environment of the plurality of images to be merged, and constructs a second data set based on the common data blocks among the plurality of images to be merged, including: scanning data blocks other than the system environment of the plurality of images to be merged to determine duplicate data blocks; screening the duplicate data blocks using a preset rule to obtain the common data blocks among the plurality of images to be merged; and constructing the second data set based on the common data blocks among the plurality of images to be merged;

[0101] Among them, the preset rules include at least one of the following: from the duplicate data blocks, filtering out duplicate data blocks with a repetition count greater than a preset repetition count threshold as the common data blocks between the multiple mirrors to be merged; from the duplicate data blocks, filtering out duplicate data blocks with a data volume greater than a preset data volume threshold as the common data blocks between the multiple mirrors to be merged.

[0102] In the embodiments of the present application, a duplicate data block is considered a duplicate data block as long as it exists in at least two of the multiple images to be merged. Specific strategies for determining duplicate data blocks include, but are not limited to, calculating a unique identifier for a file using an algorithm (such as MD5, SHA256, etc., without limitation) to determine whether two data blocks are duplicates.

[0103] Then, the required shared data blocks are calculated using preset rules. For example, the following strategies can be used: Strategy 1: Count the number of repetitions of duplicate data blocks and select those with a repetition count greater than a preset threshold as shared data blocks. The preset threshold is user-configurable. Strategy 2: Add a file size limit and select duplicate data blocks with a data size greater than a preset threshold as shared data blocks between multiple images to be merged. The preset threshold is user-configurable, such as 10MB.

[0104] A list of common data blocks is obtained based on the data blocks other than the system environment of the multiple images to be merged as a second data set. Each duplicate data in the second data set can be regarded as a type of data.

[0105] It can be seen that in the embodiment of the present application, when constructing the second data set, data blocks other than the system environment of multiple images to be merged are scanned to determine duplicate data blocks; duplicate data blocks with a repetition count greater than a preset repetition count threshold are screened out from the duplicate data blocks, or duplicate data blocks with a data volume greater than a preset data volume threshold are screened out as common data blocks, and the common data blocks between the multiple images to be merged are obtained. This can accurately identify data blocks that truly have commonality, avoid mistaking some accidentally repeated or small-volume data blocks for common data blocks, and thus ensure the quality of the second data set.

[0106] In a possible implementation of the embodiment of the present application, the original data block of the image to be merged includes: a first data block and a second data block, wherein the first data block represents the operating system corresponding to the image to be merged,

[0107] For any image to be merged, a streamlined image corresponding to the image to be merged is constructed based on the target data blocks in the public data set and the independent data of the image to be merged, including:

[0108] For any image to be merged, construct a simplified image corresponding to the image to be merged based on the target shared operating system in the first data set, the shared data blocks in the second data set, and the independent data of the image to be merged;

[0109] The target shared operating system corresponds to the operating system in the image to be merged, and the shared data block corresponds to the second data block in the image to be merged.

[0110] In the embodiments of this application, Figure 9 As shown, the target shared operating system corresponds to an abstract sublayer, the shared data blocks correspond to an abstract sublayer, and the independent data corresponds to an abstract sublayer. When constructing a streamlined image, for any image to be merged, it is constructed based on the target shared operating system in the first data set, the shared data blocks in the second data set, and the independent data of the image to be merged. The target shared operating system corresponds to the operating system in the image to be merged, and the shared data blocks correspond to the second data blocks in the image to be merged. This construction method directly reuses the target shared operating system in the public data set for the operating system part, avoiding duplicate storage; for other data parts, the shared data blocks are reused while retaining the independent data, thereby constructing a streamlined image of the image to be merged, which not only ensures the normal operation of the image, but also minimizes the amount of data.

[0111] In a possible implementation of an embodiment of the present application, a common data set includes a first data set, or a common data set includes a first data set and a second data set, the first data set represents a common operating system between multiple images to be merged, and the second data set represents a common data block between multiple images to be merged; after constructing a merged image based on the common data set, the correspondence between each streamlined image and the target data block, and the correspondence between each streamlined image and the independent data, the method further includes: if the common data set only includes the first data set, obtaining an installation package based on the first data set and the second data set, so that when the installation package is started in the container, the second data set can be copied into the container in the form of external data; if the common data set includes the first data set and the second data set, the merged image is used as the installation package.

[0112] In an embodiment of the present application, when the public data set only includes the first data set, an installation package is obtained based on the first data set and the second data set, and it is stipulated that the second data set is copied into the container in the form of external data after the container is started, thereby reducing the volume of the merged image and improving the transmission efficiency and transmission success rate of the merged image; improving the flexibility of the merged image, supporting coupling with different second data sets, and being able to provide all data completely when the container is running, ensuring that the container can operate normally and be compatible with more business scenarios.

[0113] Based on any of the above embodiments, the present application proposes a solution for constructing a software installation package based on a layered method, which constructs an image by analyzing the common data to divide the image into multiple abstract layers. It should be noted that the present application does not limit the number of abstract layers (the example in this article is 3 layers: system layer, public layer, and business layer). The common data of the images to be merged (such as the operating system, common data blocks) are extracted, and then the streamlined images corresponding to each image to be merged are produced to obtain the merged image, that is, the streamlined installation package. The embodiment of the present application can use layered storage technology to solve the problems of large installation package size, long transmission (or downloading) time, and difficulty in installation and upgrading in the case of multiple images.

[0114] The following is an introduction to a device provided in an embodiment of the present application. The device described below and the method described above can be referenced to each other. The device of this embodiment is set in an electronic device. Figure 10 , Figure 10 This is a structural block diagram of an apparatus according to one embodiment of the present application, comprising: a determination module 210, for constructing a common data set based on the common data between a plurality of images to be merged, and determining the independent data of each image to be merged; a streamlined mirror construction module 220, for constructing, for any image to be merged, a streamlined mirror corresponding to the image to be merged according to the target data blocks in the common data set and the independent data of the image to be merged; wherein the common data set includes a plurality of data blocks, the data blocks are used to be multiplexed into each streamlined mirror, the target data blocks correspond to the original data blocks in the image to be merged, and the data volume of the streamlined mirror is less than or equal to the data volume of the corresponding image to be merged; a merged mirror construction module 230, for constructing a merged mirror according to the common data set, the correspondence between each streamlined mirror and the target data block, and the correspondence between each streamlined mirror and the independent data.

[0115] In a preferred example, the present application can be further configured as follows: the public data set includes: a first data set and a second data set, and the determination module 210 includes: a first data set construction unit for: scanning the system environments of multiple images to be merged, and constructing the first data set based on the common operating system between the multiple images to be merged; and a second data set construction unit for: scanning the data blocks other than the system environment of the multiple images to be merged, and constructing the second data set based on the common data blocks between the multiple images to be merged.

[0116] In a preferred example, the present application can be further configured as follows: the original data blocks of the image to be merged include: a first data block and a second data block, the first data block represents the operating system corresponding to the image to be merged, and the streamlined image construction module 220 includes: a streamlined image construction unit, which is used to construct a streamlined image corresponding to the image to be merged for any image to be merged based on the target common operating system in the first data set, the common data blocks in the second data set and the independent data of the image to be merged; the target common operating system corresponds to the operating system in the image to be merged, and the common data blocks correspond to the second data blocks in the image to be merged.

[0117] In a preferred example, the present application may be further configured as follows: the first data set construction unit is specifically configured to: scan the system environments of the multiple images to be merged, and construct the first data set based on the target operating systems of the multiple images to be merged, wherein the target operating systems of the multiple images to be merged are the deduplicated operating systems of the multiple images to be merged;

[0118] The first data set construction unit is specifically configured to: scan the system environments of multiple images to be merged to obtain the system type of the operating system of each image to be merged; and read the streamlined operating system corresponding to the system type from the storage module according to the system type to construct the first data set.

[0119] In a preferred embodiment, the present application may be further configured as follows: the second data set construction unit is specifically configured to: scan data blocks other than the system environment of the multiple images to be merged to determine duplicate data blocks; filter the duplicate data blocks using a preset rule to obtain common data blocks among the multiple images to be merged; and construct the second data set based on the common data blocks among the multiple images to be merged;

[0120] Among them, the preset rules include at least one of the following: from the duplicate data blocks, filtering out duplicate data blocks with a repetition count greater than a preset repetition count threshold as the common data blocks between the multiple mirrors to be merged; from the duplicate data blocks, filtering out duplicate data blocks with a data volume greater than a preset data volume threshold as the common data blocks between the multiple mirrors to be merged.

[0121] In a preferred example, the present application can be further configured as follows: the public data set includes a first data set, or the public data set includes a first data set and a second data set, the first data set represents a common operating system between multiple images to be merged, and the second data set represents a common data block between multiple images to be merged; the device also includes: an installation package generation module, which is used to obtain an installation package based on the first data set and the second data set if the public data set only includes the first data set, so that when the installation package is started in the container, the second data set can be copied into the container in the form of external data.

[0122] An electronic device is provided in an embodiment of the present application, such as Figure 11 As shown, Figure 11 The electronic device 300 shown includes: at least one processor 301 ( Figure 11 301 and memory 303. The processor 301 and memory 303 are connected, for example, via a bus 302. Optionally, the electronic device 300 may further include a transceiver 304. It should be noted that in practical applications, the number of transceivers 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of the present application.

[0123] Processor 301 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0124] Bus 302 may include a path for transmitting information between the above components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0125] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0126] The memory 303 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the above method embodiment.

[0127] Figure 11 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0128] An embodiment of the present application provides a computer-readable storage medium, which stores at least one program code. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content of the aforementioned method embodiment.

[0129] An embodiment of the present application provides a computer program product, including a computer program or instructions, which implements the corresponding contents of the aforementioned method embodiment when the computer program or instructions are executed by a processor.

[0130] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0131] The above are only some of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for generating an installation package, characterized in that: include: Based on the shared data among multiple images to be merged, a common data set is constructed, and the independent data of each image to be merged is determined; For any image to be merged, construct a simplified image corresponding to the image to be merged based on the target data blocks in the public data set and the independent data of the image to be merged; wherein the public data set includes multiple data blocks, the data blocks are used to be multiplexed into each simplified image, the target data blocks correspond to the original data blocks in the image to be merged, and the data volume of the simplified image is less than or equal to the data volume of the corresponding image to be merged; A merged image is constructed according to the public data set, the corresponding relationship between each simplified image and the target data block, and the corresponding relationship between each simplified image and the independent data.

2. The method for generating an installation package according to claim 1, wherein: The public data set includes: a first data set and a second data set. The public data set is constructed based on the shared data among the multiple images to be merged, including: Scanning system environments of multiple images to be merged, and constructing a first data set based on a common operating system among the multiple images to be merged; The data blocks other than the system environment of the multiple images to be merged are scanned, and a second data set is constructed based on the common data blocks among the multiple images to be merged.

3. The method for generating an installation package according to claim 2, wherein: The original data blocks of the image to be merged include: a first data block and a second data block, wherein the first data block represents the operating system corresponding to the image to be merged, The step of constructing a simplified image corresponding to any image to be merged based on the target data blocks in the public data set and the independent data of the image to be merged includes: For any image to be merged, construct a simplified image corresponding to the image to be merged based on the target shared operating system in the first data set, the shared data blocks in the second data set, and the independent data of the image to be merged; The target shared operating system corresponds to the operating system in the image to be merged, and the shared data block corresponds to the second data block in the image to be merged.

4. The method for generating an installation package according to claim 2, wherein: The step of scanning the system environments of the plurality of images to be merged and constructing a first data set based on a common operating system among the plurality of images to be merged includes: Scanning system environments of the multiple images to be merged, and constructing a first data set based on target operating systems of the multiple images to be merged, wherein the target operating systems of the multiple images to be merged are deduplicated operating systems of the multiple images to be merged; or, Scan the system environments of multiple images to be merged to obtain the system type of the operating system of each image to be merged; and read the simplified operating system corresponding to the system type from the storage module according to the system type to construct a first data set.

5. The method for generating an installation package according to claim 2, wherein: The step of scanning data blocks other than the system environment of the plurality of images to be merged and constructing a second data set based on the common data blocks among the plurality of images to be merged includes: Scanning data blocks other than system environments of a plurality of images to be merged, and determining duplicate data blocks; Using preset rules, duplicate data blocks are screened to obtain common data blocks among the multiple images to be merged; and a second data set is constructed based on the common data blocks among the multiple images to be merged; The preset rules include at least one of the following: Filtering out duplicate data blocks whose number of repetitions is greater than a preset repetition number threshold from the duplicate data blocks as shared data blocks between the multiple images to be merged; From the duplicate data blocks, duplicate data blocks with a data volume greater than a preset data volume threshold are screened out as common data blocks between the multiple mirrors to be merged.

6. The method for generating an installation package according to claim 1, wherein: The public data set includes a first data set, or the public data set includes a first data set and a second data set, the first data set represents a common operating system among the multiple images to be merged, and the second data set represents a common data block among the multiple images to be merged; After constructing the merged image according to the public data set, the correspondence between each streamlined image and the target data block, and the correspondence between each streamlined image and the independent data, the method further includes: If the public data set only includes the first data set, an installation package is obtained according to the first data set and the second data set, so that when the installation package is started in the container, the second data set can be copied into the container in the form of external data.

7. A device for generating an installation package, characterized in that: include: A determination module, configured to construct a common data set based on the shared data among the multiple images to be merged, and to determine the independent data of each image to be merged; a streamlined image construction module, configured to construct, for any image to be merged, a streamlined image corresponding to the image to be merged based on a target data block in the public data set and independent data of the image to be merged; wherein the public data set includes a plurality of data blocks, the data blocks being multiplexed into each streamlined image, the target data blocks corresponding to the original data blocks in the image to be merged, and the data volume of the streamlined image being less than or equal to the data volume of the corresponding image to be merged; The merged image construction module is used to construct a merged image according to the public data set, the corresponding relationship between each simplified image and the target data block, and the corresponding relationship between each simplified image and the independent data.

8. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the method for generating an installation package according to any one of claims 1 to 6 when running the computer program.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one program code, and the program code is loaded and executed by a processor to implement the method for generating an installation package according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises a computer program or an instruction, which, when executed by a processor, implements the method for generating an installation package according to any one of claims 1 to 6.