CN111158737B - Incremental upgrading method and related equipment - Google Patents

Incremental upgrading method and related equipment Download PDF

Info

Publication number
CN111158737B
CN111158737B CN201911402504.5A CN201911402504A CN111158737B CN 111158737 B CN111158737 B CN 111158737B CN 201911402504 A CN201911402504 A CN 201911402504A CN 111158737 B CN111158737 B CN 111158737B
Authority
CN
China
Prior art keywords
image
version
mirror
module
package
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911402504.5A
Other languages
Chinese (zh)
Other versions
CN111158737A (en
Inventor
钟斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201911402504.5A priority Critical patent/CN111158737B/en
Publication of CN111158737A publication Critical patent/CN111158737A/en
Application granted granted Critical
Publication of CN111158737B publication Critical patent/CN111158737B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses an incremental upgrading method and related equipment, which are applied to a server, wherein the server comprises a construction container and a deployment container, and the deployment container comprises a mirror image reconstruction scheduling module, a mirror image reconstruction module, a mirror image deployment module and a first basic mirror image library. Wherein the method comprises the following steps: the mirror image reconstruction scheduling module acquires a delta upgrade package from the construction container; the image reconstruction module reconstructs a target image version package according to the delta upgrade package and the first basic image library; and the mirror image deployment module updates the mirror image file according to the target mirror image version package. Therefore, through the technical scheme provided by the application, incremental upgrading of the image file in the containerized architecture can be realized.

Description

Incremental upgrading method and related equipment
Technical Field
The application relates to the technical field of containers, in particular to an incremental upgrading method and related equipment.
Background
Containerization is the process of publishing and deploying applications in a mobile, predictable way, by wrapping components and their dependencies, into a standard, isolated, lightweight environment called a Container (LXC). The container may be a reduced version of the Linux operating system and the image is software loaded into the container, and when the functionality of the container needs to be enhanced, the corresponding image in the container needs to be updated. The image requires that all dependencies in the version be packed in the image, whereas during incremental upgrades of the version only the part of the version upgrade that is changed in this time is expected to be published in the upgrade package. Thus, LXCs currently do not support incremental upgrades of images.
Disclosure of Invention
The embodiment of the application provides an incremental upgrading method and related equipment, which can realize incremental upgrading of image files in a containerized architecture.
In a first aspect, an embodiment of the present application provides an incremental upgrade method, applied to a server, where the server includes a construction container and a deployment container, and the deployment container includes a mirror image reconstruction scheduling module, a mirror image reconstruction module, a mirror image deployment module, and a first base mirror image library, and the method includes:
the mirror image reconstruction scheduling module acquires a delta upgrade package from the construction container;
the image reconstruction module reconstructs a target image version package according to the delta upgrade package and the first basic image library;
and the mirror image deployment module updates the mirror image file according to the target mirror image version package.
In a second aspect, an embodiment of the present application provides an incremental upgrade apparatus, which is applied to a server, where the server includes a construction container and a deployment container, and the deployment container includes a mirror image reconstruction scheduling module, a mirror image reconstruction module, a mirror image deployment module, and a first base mirror image library, and the apparatus includes a processing unit, where the processing unit is configured to:
controlling the mirror image reconstruction scheduling module to acquire a delta upgrade package from the construction container;
The image reconstruction module is controlled to reconstruct a target image version package according to the difference upgrade package and the first basic image library;
and controlling the mirror image deployment module to update the mirror image file according to the target mirror image version package.
In a third aspect, embodiments of the present application provide a server comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the first aspect of embodiments of the present application.
In a fourth aspect, embodiments of the present application provide a computer storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to perform some or all of the steps as described in the first aspect of the embodiments of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
It can be seen that the technical scheme provided by the application is applied to a server comprising a construction container and a deployment container, wherein the deployment container comprises a mirror image reconstruction scheduling module, a mirror image reconstruction module, a mirror image deployment module and a first basic mirror image library, and the mirror image reconstruction scheduling module acquires a difference upgrade package from the construction container; the image reconstruction module reconstructs a target image version package according to the difference upgrade package and the first basic image library; and the mirror image deployment module updates the mirror image file according to the target mirror image version package. After a complete image to be upgraded is constructed in a construction container, a delta upgrade package to be issued for incremental upgrade is issued to a deployment container, namely, a file of a current version upgrade change part is issued to the deployment container, an image reconstruction scheduling module in the deployment container acquires the delta upgrade package, an image reconstruction module in the deployment container reconstructs according to the delta upgrade package and a first basic image library to obtain a complete image (namely a target image version package), and an image deployment module in the deployment container updates an image file according to the complete image obtained by reconstruction, so that incremental upgrade of the image file in a containerized architecture is realized.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic structural view of a container system provided in an embodiment of the present application;
FIG. 2A is a flow chart of an incremental upgrade method according to an embodiment of the present disclosure;
FIG. 2B is a schematic diagram of a version transition map storage structure according to an embodiment of the present application;
FIG. 2C is a schematic diagram of a delta upgrade package according to an embodiment of the present application;
FIG. 3 is a flow chart of another incremental upgrade method according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a server according to an embodiment of the present application;
fig. 5 is a functional unit composition block diagram of an incremental upgrade apparatus according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a container system according to an embodiment of the present application. As shown in fig. 1, the container system comprises two major parts, namely a construction container and a deployment container.
The container may also be referred to as an environment, so that the construction container is also referred to as a construction environment, i.e. an environment in which the delta upgrade package is constructed; the deployment container is also called a deployment environment, i.e., an environment in which delta upgrade packages deploy applications. In the embodiment of the application, the delta upgrade package is generated in a construction environment and distributed to a deployment environment to install and deploy the application.
The base mirror image library is a base part of incremental upgrade construction and application, and in the construction process of the mirror image file, the base mirror image is an important parameter, and can store different versions of mirror images as the base mirror image. In incremental upgrade, the base image can be built or reconstructed each time without completely restarting, and can be realized by adding part of files from one base image in an incremental way. In the embodiment of the application, two basic mirror image libraries are provided, and a second basic mirror image in a container is constructed and used for constructing a differential upgrade package; the first base image in the deployment container is used for reconstructing the actually deployed version image based on the delta upgrade package.
Wherein the build vessel comprises: the system comprises an image difference constructing and scheduling module, a difference file generating module, an image pre-constructing and checking information generating module and a second basic image library. In addition, the mirror image difference constructing and scheduling module, the difference file generating module, the mirror image pre-constructing and checking information generating module and the second basic mirror image library may perform data interaction, and the data interaction direction shown in fig. 1 is only schematic, but may also be other, which is not limited in particular in this application.
The mirror image difference quantity construction and scheduling module can be used for acquiring a basic version number of incremental upgrade and a version number to be upgraded; the delta file generating module is instructed to acquire an image file list of the version image corresponding to the basic version number from the second basic image library according to the basic image version number, or acquire an image file list of the version image corresponding to the version number to be upgraded from the second basic image library according to the version number to be upgraded; and instructing the image pre-construction and verification information generation module to construct a complete image of the version to be upgraded by the version number to be upgraded.
The delta file generation module can be used for generating a delta file according to the base version image and the complete image of the version to be upgraded, packaging the delta file, and packaging the base version number and the delta file list.
The image pre-construction and verification information generation module can be used for constructing a complete image of a version to be upgraded and generating image verification information of incremental upgrade.
Wherein the deployment container comprises: the system comprises a mirror image deployment scheduling module, a mirror image reconstruction scheduling module, a mirror image verification module and a first basic mirror image library. In addition, the image deployment scheduling module, the image reconstruction scheduling module, the image verification module and the first basic image library may perform data interaction, and the data interaction direction shown in fig. 1 is only schematic, but may also be other, which is not limited in particular in this application.
The image reconstruction scheduling module can be used for obtaining a delta upgrade package of incremental upgrade from a construction container.
The image reconstruction module can be used for reconstructing a complete image of a version to which the image reconstruction module needs to be upgraded.
The image checking module can be used for checking whether the reconstructed complete image of the version to be upgraded is correct.
The image deployment module can be used for updating the image file according to the reconstructed complete image of the version to be upgraded.
It can be seen that the container system provided by the embodiment of the application can be used for publishing the image files in the container, namely an incremental publishing mechanism of the image, and solves the loading and running problems of the incremental files in the target environment in the image publishing process. By solving the problems, smaller mirror image volume and smaller storage requirement can be obtained, and when version distribution is carried out, smaller network bandwidth requirement and shorter transmission time are obtained.
Referring to fig. 2A, fig. 2A is a flow chart of an incremental upgrade method according to an embodiment of the present application. As shown in fig. 2A, the method is applied to a server, the server includes the container system shown in fig. 1, the container system includes a build container and a deployment container, the deployment container includes a mirror reconstruction scheduling module, a mirror reconstruction module, a mirror deployment module, and a first base mirror library, the method includes:
S201, the mirror image reconstruction scheduling module acquires a delta upgrade package from the construction container.
When incremental upgrade of the image is needed, a complete image package of the version to be upgraded is built in the building container, then the complete image package of the version to be upgraded is compared with a current image package (basic image version package) of the deployment container to obtain the differential upgrade package, the differential upgrade package is released into the deployment environment, and the differential upgrade package can be obtained by the image reconstruction scheduling module.
S202, the image reconstruction module reconstructs a target image version package according to the delta upgrade package and the first basic image library.
It should be noted that, the first base image library stores a current image package (base image version package) of the deployment container, and the image reconstruction module may acquire the current image package (base image version package) from the first base image library, and then reconstruct, according to the delta upgrade package and the base image version package, a complete image package (target image version package) of a version to be upgraded.
S203, the mirror image deployment module updates the mirror image file according to the target mirror image version package.
It can be understood that after the image reconstruction module reconstructs the complete image packet of the version to be upgraded, the image deployment module can update the base image in the deployment container, so that incremental upgrade is successful.
It can be seen that the incremental upgrade method provided by the embodiment of the application is applied to a server comprising a construction container and a deployment container, wherein the deployment container comprises a mirror image reconstruction scheduling module, a mirror image reconstruction module, a mirror image deployment module and a first basic mirror image library, and the mirror image reconstruction scheduling module acquires a delta upgrade package from the construction container; the image reconstruction module reconstructs a target image version package according to the difference upgrade package and the first basic image library; and the mirror image deployment module updates the mirror image file according to the target mirror image version package. It can be seen that, by the incremental upgrade method provided by the embodiment of the present application, after a complete image to be upgraded is constructed in a construction container, a delta upgrade package to be issued for incremental upgrade is issued to a deployment container, that is, a file of a current version upgrade change part is issued to the deployment container, an image reconstruction scheduling module in the deployment container obtains the delta upgrade package, an image reconstruction module in the deployment container reconstructs according to the delta upgrade package and a first base image library to obtain a complete image, and an image deployment module in the deployment container updates an image file according to the complete image obtained by reconstruction, thereby implementing incremental upgrade of an image file in a containerized architecture.
In one possible example, the image reconstruction module reconstructs the target image version package from the delta upgrade package and the first base image library, including: the image reconstruction module acquires a basic image version number and a delta file list from the delta upgrade package; the image reconstruction module generates a construction script according to the basic image version number and the difference file list; and the image reconstruction module reconstructs the target image version package according to the construction script.
It can be understood that the image reconstruction module obtains the base image version number from the delta upgrade package, determines from which base image version the upgrade needs to be started, that is, determines which base image version package is obtained from the first base image library for updating.
The script is an extension of batch file, is a program stored in pure text, and is generally a combination of a series of determined control computer operation actions. Therefore, after the image reconstruction module generates the construction script, the complete image package (target image version package) of the version to be upgraded can be reconstructed by executing the construction script.
In this example, the base image version number and the delta file list for starting the upgrade are obtained from the delta upgrade package for incremental upgrade, so that a construction script is generated, and the image reconstruction module executes the construction script to reconstruct the target image version package, so that the process is simple, and the complete image package of the version to be upgraded can be quickly reconstructed.
In one possible example, the image reconstruction module reconstructs the target image version package according to the build script, including: the mirror image reconstruction module acquires a difference file from the difference upgrade package; the image reconstruction module acquires an image file of a version corresponding to the basic image version number from the first basic image library according to the construction script; and the image reconstruction module reconstructs the target image version package according to the delta file and the image file of the version corresponding to the basic image version number.
In this example, the delta file is obtained from the delta upgrade package of the incremental upgrade, the image file of the base image version package is obtained from the first base image library, and then the target image version package can be reconstructed by using the image file of the base image version package and the delta file, so that the process is simple, and the complete image package of the version to be upgraded can be quickly reconstructed.
In one possible example, the deployment container includes a mirror verification module, and before the mirror deployment module updates the mirror file according to the target mirror version package, the method further includes: the mirror image checking module acquires mirror image checking information from the delta upgrade package; the mirror image verification module verifies the target mirror image version package according to the mirror image verification information; and if the verification is passed, the mirror image verification module stores the target mirror image version package into the first basic mirror image library.
The mirror verification information includes information such as a Message Digest Algorithm value (MD 5), a file size, and the like.
The image verification module stores the target image version package into the first basic image library, and simultaneously records related version number information and differential path information of the target image version package, wherein the differential path information refers to which basic image version package the target image version package is updated from.
In this example, the verification information is obtained from the delta upgrade package of the incremental upgrade, the obtained complete image package is verified, and the image file is updated after verification, so that the success rate and the accuracy of the incremental upgrade can be ensured while the incremental upgrade of the image file in the containerized architecture is realized.
In one possible example, the construction container includes a delta construction scheduling module, a delta file generating module, and a second base mirror library, the construction container pre-constructs the target mirror version package, and the method further includes: the difference construction scheduling module acquires the basic mirror image version number and acquires a first mirror image file list of the target mirror image version package; the delta file generation module acquires a second image file list of a version corresponding to the basic image version number from the second basic image library according to the basic image version number; the difference file generation module traverses the first image file list and the second image file list to obtain the difference file list; and the delta file generation module copies the image file from the target image version package according to the delta file list to obtain the delta file.
In this example, a target image version package is pre-built in a building container, a delta building scheduling module designates a base image version number of incremental upgrade and a first image file list of the target image version package, then a delta file generating module obtains a second image file list of an image corresponding to the base image version number in a base image library of the building container, compares the first image file list with the second image file list to determine a delta file list, and copies a delta file corresponding to the delta file list from the target image version package, thereby being beneficial to accurately determining the delta file for incremental upgrade.
In one possible example, the build container further includes a mirror pre-construction and verification information generation module, the method further comprising: and the image pre-construction and verification information generation module generates image verification information according to the target image version package.
The mirror image verification information comprises information such as a message digest algorithm value (MD 5), a file size and the like.
In this example, the image verification information is generated according to the target image version package, and the image verification information is issued to the deployment container together, so that after the deployment container reconstructs the target image version package, the target image version package is verified, which is beneficial to ensuring that the reconstruction is successful.
In one possible example, the build container includes a delta build schedule module, a delta file generation module, a second base mirror library, and a mirror pre-build and verification information generation module, the method further comprising: the image pre-construction and inspection information generation module constructs the target image version package; the difference construction scheduling module acquires the basic mirror image version number and acquires a first mirror image file list of the target mirror image version package; the delta file generation module acquires a second image file list of a version corresponding to the basic image version number from the second basic image library according to the basic image version number; the difference file generation module traverses the first image file list and the second image file list to obtain the difference file list; and the delta file generation module copies the image file from the target image version package according to the delta file list to obtain the delta file.
In this example, when incremental upgrade is required, the image pre-construction and inspection information generation module in the construction container constructs the target image version package, the delta construction scheduling module designates the base image version number of the incremental upgrade and the first image file list of the target image version package, then the delta file generation module obtains the second image file list of the image corresponding to the base image version number in the base image library of the construction container, compares the first image file list and the second image file list to determine the delta file list, and copies the delta file corresponding to the delta file list from the target image version package, thereby being beneficial to accurately determining the delta file for incremental upgrade.
In one possible example, the method further comprises: the differential file generation module performs packaging processing on the differential file to obtain a differential data packet; the difference file generation module packages the basic mirror image version number and the difference file list to obtain a mirror image reconstruction information packet; and the delta construction scheduling module packages the delta data packet, the mirror image reconstruction information packet and the mirror image verification information to obtain the delta upgrade packet.
In this example, all the files required for incremental upgrade are packaged and distributed into the deployment container, and version distribution is performed after packaging, so that the method can adapt to smaller network bandwidth requirements and shorter transmission time.
Referring to fig. 2B, fig. 2B is a schematic diagram of a version transition map storage structure according to an embodiment of the present application. As shown in fig. 2B, the version transition map storage structure of the first base mirror image library is a tree map, nodes in the tree map are version numbers of version packages, each node is associated with and stores a mirror image file and a mirror image file list of a corresponding version package, wherein a top node is the version number of an original mirror image version package; each branch in the tree diagram represents an incremental upgrade path of a primary version, and each branch is associated with and stores a delta file from an incremental upgrade of a version package corresponding to the current node to a version package corresponding to any next-level node.
For example, the version 1 node is a top node, which is the initial original image version package, and the version 1 node associates all image files storing the initial image version package with a file list of all the image files; the version 2 node is an intermediate node which is a mirror image version package of the second version, and the version 2 node associates all mirror image files storing the mirror image version package of the second version with a file list of all the mirror image files; the branch between the version node 1 and the version node 2 is delta files 1-2, which are incremental paths for version upgrade, representing that version 1 is upgraded to version 2, and the associated image files which are needed to be added for version 1 to version 2 are stored.
In this example, the version transition map storage structure of the base mirror image library is designed into a tree map, so that mirrors are closely organized, and the implementation of incremental publishing of the mirrors is facilitated.
Referring to fig. 2C, fig. 2C is a schematic structural diagram of a delta upgrade package according to an embodiment of the present application. As shown in fig. 2C, the delta data packet, the mirror image reconstruction information packet and the mirror image verification information in the delta upgrade packet are connected in series, all delta files in the delta data packet are connected in parallel, and the base mirror image version number in the mirror image reconstruction information packet is connected in parallel with the delta file list.
For example, suppose that an upgrade from version 1 to version 2 is performed, the delta packet stores delta files between version 1 and version 2, i.e., files that exist in version 2 but do not exist in version 1; the mirror image reconstruction information packet is a list of delta files between the version 1 and the version 2 and a version number mark of the version 1; the mirror check information is the size of version 2, message digest algorithm value (MD 5).
In this example, all the files required for incremental upgrade are packaged and distributed into the deployment container, and version distribution is performed after packaging, so that the method can adapt to smaller network bandwidth requirements and shorter transmission time.
Referring to fig. 3, fig. 3 is a schematic flow chart of another incremental upgrade method according to the embodiment of the present application, consistent with the embodiment shown in fig. 2A. As shown in fig. 3, the method is applied to a server, the server includes the container system shown in fig. 1, the container system includes a build container and a deployment container, the deployment container includes a mirror reconstruction scheduling module, a mirror reconstruction module, a mirror deployment module, and a first base mirror library, the method includes:
s301, the mirror image reconstruction scheduling module acquires a delta upgrade package from the construction container.
S302, the image reconstruction module acquires a basic image version number and a delta file list from the delta upgrade package.
S303, the image reconstruction module generates a construction script according to the basic image version number and the difference file list.
S304, the image reconstruction module reconstructs the target image version package according to the construction script.
S305, the mirror image checking module acquires mirror image checking information from the delta upgrade package.
S306, the mirror image verification module verifies the target mirror image version package according to the mirror image verification information.
S307, if the verification is passed, the mirror image verification module stores the target mirror image version package into the first basic mirror image library.
S308, the mirror image deployment module updates the mirror image file according to the target mirror image version package.
It can be seen that, in the incremental upgrade method provided in the embodiment of the present application, after a complete image to be upgraded is constructed in a construction container, a delta upgrade package to be issued for incremental upgrade is issued to a deployment container, that is, a file of a current version upgrade change part is issued to the deployment container; a mirror image reconstruction scheduling module in the deployment container acquires the delta upgrade package; a mirror image reconstruction module in the deployment container acquires a basic mirror image version number and the difference file list from the difference upgrade package, then generates a construction script, and then obtains a complete mirror image according to the component script reconstruction; the image verification module in the deployment container acquires verification information from the delta upgrade package, and verifies the obtained complete image; after verification is passed, the mirror image deployment module in the deployment container updates the mirror image file according to the complete mirror image obtained by reconstruction, so that the success rate and the accuracy of incremental updating are ensured while the incremental updating of the mirror image file in the containerized architecture is realized.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a server 400 according to an embodiment of the present application, consistent with the embodiments shown in fig. 2A and 3. As shown in fig. 4, the server 400 includes an application processor 410, a memory 420, a communication interface 430, and one or more programs 421, wherein the one or more programs 421 are stored in the memory 420 and configured to be executed by the application processor 410, and the one or more programs 421 include instructions for performing any of the steps of the method embodiments described above. In addition, the server comprises a construction container and a deployment container, wherein the deployment container comprises a mirror image reconstruction scheduling module, a mirror image reconstruction module, a mirror image deployment module and a first basic mirror image library.
In one possible example, the instructions in the program 421 are for performing the following operations: the mirror image reconstruction scheduling module acquires a delta upgrade package from the construction container; the image reconstruction module reconstructs a target image version package according to the delta upgrade package and the first basic image library; and the mirror image deployment module updates the mirror image file according to the target mirror image version package.
It can be seen that, the server provided in the embodiment of the present application includes a construction container and a deployment container, where the deployment container includes a mirror image reconstruction scheduling module, a mirror image reconstruction module, a mirror image deployment module, and a first base mirror image library, and the mirror image reconstruction scheduling module obtains a delta upgrade package from the construction container; the image reconstruction module reconstructs a target image version package according to the difference upgrade package and the first basic image library; and the mirror image deployment module updates the mirror image file according to the target mirror image version package. It can be seen that, through the server provided in the embodiment of the present application, after a complete image to be upgraded is constructed in a construction container, a delta upgrade package to be issued for incremental upgrade is issued to a deployment container, that is, a file of a current version upgrade change portion is issued to the deployment container, an image reconstruction scheduling module in the deployment container obtains the delta upgrade package, an image reconstruction module in the deployment container reconstructs according to the delta upgrade package and a first base image library to obtain a complete image, and an image deployment module in the deployment container updates an image file according to the complete image obtained by reconstruction, thereby implementing incremental upgrade of an image file in a containerized architecture.
In one possible example, in terms of the image reconstruction module reconstructing the target image version package from the delta upgrade package and the first base image library, the instructions in the program 421 are specifically configured to: the image reconstruction module acquires a basic image version number and a delta file list from the delta upgrade package; the image reconstruction module generates a construction script according to the basic image version number and the difference file list; and the image reconstruction module reconstructs the target image version package according to the construction script.
In one possible example, in terms of the image reconstruction module reconstructing the target image version package according to the build script, the instructions in the program 421 are specifically configured to: the mirror image reconstruction module acquires a difference file from the difference upgrade package; the image reconstruction module acquires an image file of a version corresponding to the basic image version number from the first basic image library according to the construction script; and the image reconstruction module reconstructs the target image version package according to the delta file and the image file of the version corresponding to the basic image version number.
In one possible example, the deployment container includes a mirror verification module, and before the mirror deployment module updates the mirror file according to the target mirror version package, the instructions in the program 421 are further configured to: the mirror image checking module acquires mirror image checking information from the delta upgrade package; the mirror image verification module verifies the target mirror image version package according to the mirror image verification information; and if the verification is passed, the mirror image verification module stores the target mirror image version package into the first basic mirror image library.
In one possible example, the construction container includes a delta construction scheduling module, a delta file generating module, and a second base image library, the construction container pre-constructs the target image version package, and the instructions in the program 421 are further configured to: the difference construction scheduling module acquires the basic mirror image version number and acquires a first mirror image file list of the target mirror image version package; the delta file generation module acquires a second image file list of a version corresponding to the basic image version number from the second basic image library according to the basic image version number; the difference file generation module traverses the first image file list and the second image file list to obtain the difference file list; and the delta file generation module copies the image file from the target image version package according to the delta file list to obtain the delta file.
In one possible example, the build container further includes a mirror pre-configuration and verification information generation module, and the instructions in the program 421 are further configured to: and the image pre-construction and verification information generation module generates image verification information according to the target image version package.
In one possible example, the instructions in the program 421 are further for performing the following: the differential file generation module performs packaging processing on the differential file to obtain a differential data packet; the difference file generation module packages the basic mirror image version number and the difference file list to obtain a mirror image reconstruction information packet; and the delta construction scheduling module packages the delta data packet, the mirror image reconstruction information packet and the mirror image verification information to obtain the delta upgrade packet.
In one possible example, the delta data packet, the mirror reconfiguration packet, and the mirror verification information in the delta upgrade packet are connected in series, all delta files in the delta data packet are connected in parallel, and the base mirror version number and the list of delta files in the mirror reconfiguration packet are connected in parallel.
In one possible example, the version transition map storage structure of the first base mirror image library is a tree map, nodes in the tree map are version numbers of version packages, each node is associated with and stores a mirror image file and a mirror image file list of a corresponding version package, and a top node is the version number of the original mirror image version package; each branch in the tree diagram represents an incremental upgrade path of a primary version, and each branch is associated with and stores a delta file from an incremental upgrade of a version package corresponding to the current node to a version package corresponding to any next-level node.
It should be noted that, the specific implementation process of this embodiment may refer to the specific implementation process described in the foregoing method embodiment, which is not described herein.
The foregoing description of the embodiments of the present application has been presented primarily in terms of a method-side implementation. It will be appreciated that the server, in order to implement the above-described functions, includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various steps described in connection with the embodiments provided herein may be implemented as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application may divide the functional units of the server according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
Referring to fig. 5, fig. 5 is a block diagram illustrating functional units of an incremental upgrade apparatus 500 according to an embodiment of the present application. As shown in fig. 5, the incremental upgrade apparatus 500 is applied to a server, where the server includes a construction container and a deployment container, where the deployment container includes a mirror reconstruction scheduling module, a mirror reconstruction module, a mirror deployment module, and a first base mirror library, and the incremental upgrade apparatus 500 includes a processing unit 501 and a communication unit 502, where the processing unit 501 is configured to perform any step in the foregoing method embodiments, and when performing data transmission such as sending, the communication unit 502 is selectively invoked to complete a corresponding operation. The following is a detailed description.
In one possible example, the processing unit 501 is configured to: controlling the mirror image reconstruction scheduling module to acquire a delta upgrade package from the construction container; the image reconstruction module is controlled to reconstruct a target image version package according to the difference upgrade package and the first basic image library; and controlling the mirror image deployment module to update the mirror image file according to the target mirror image version package.
It can be seen that the incremental upgrade device provided by the embodiment of the application is applied to a server comprising a construction container and a deployment container, wherein the deployment container comprises a mirror image reconstruction scheduling module, a mirror image reconstruction module, a mirror image deployment module and a first basic mirror image library, and the mirror image reconstruction scheduling module acquires a delta upgrade packet from the construction container; the image reconstruction module reconstructs a target image version package according to the difference upgrade package and the first basic image library; and the mirror image deployment module updates the mirror image file according to the target mirror image version package. It can be seen that, by the incremental upgrade device provided by the embodiment of the present application, after a complete image to be upgraded is constructed in a construction container, a delta upgrade package to be issued for incremental upgrade is issued to a deployment container, that is, a file of a current version upgrade change part is issued to the deployment container, an image reconstruction scheduling module in the deployment container obtains the delta upgrade package, an image reconstruction module in the deployment container reconstructs according to the delta upgrade package and a first base image library to obtain a complete image, and an image deployment module in the deployment container updates an image file according to the complete image obtained by reconstruction, thereby implementing incremental upgrade of an image file in a containerized architecture.
In one possible example, in terms of the image reconstruction module reconstructing the target image version package according to the delta upgrade package and the first base image library, the processing unit 501 is specifically configured to: controlling the image reconstruction module to acquire a basic image version number and a difference file list from the difference upgrade package; the mirror image reconstruction module is controlled to generate a construction script according to the basic mirror image version number and the difference file list; and controlling the mirror image reconstruction module to reconstruct the target mirror image version package according to the construction script.
In one possible example, in terms of the image reconstruction module reconstructing the target image version package according to the build script, the processing unit 501 is specifically configured to: controlling the mirror image reconstruction module to acquire a difference file from the difference upgrade package; the image reconstruction module is controlled to acquire an image file of a version corresponding to the basic image version number from the first basic image library according to the construction script; and controlling the image reconstruction module to reconstruct the target image version package according to the delta file and the image file of the version corresponding to the basic image version number.
In one possible example, the deployment container includes a mirror verification module, and before the mirror deployment module updates the mirror file according to the target mirror version package, the processing unit 501 is further configured to: controlling the mirror image checking module to acquire mirror image checking information from the delta upgrade package; controlling the mirror image verification module to verify the target mirror image version package according to the mirror image verification information; and if the verification is passed, controlling the mirror image verification module to store the target mirror image version package into the first basic mirror image library.
In one possible example, the construction container includes a delta construction scheduling module, a delta file generating module, and a second base mirror library, the construction container pre-constructs the target mirror version package, and the processing unit 501 is further configured to: controlling the difference quantity construction scheduling module to acquire the basic mirror image version number and acquire a first mirror image file list of the target mirror image version package; controlling the delta file generation module to acquire a second image file list of a version corresponding to the basic image version number from the second basic image library according to the basic image version number; the difference file generation module is controlled to traverse the first image file list and the second image file list to obtain the difference file list; and controlling the delta file generation module to copy the image file from the target image version package according to the delta file list to obtain the delta file.
In one possible example, the build container further includes a mirror pre-construction and verification information generation module, and the processing unit 501 is further configured to: and controlling the image pre-construction and verification information generation module to generate image verification information according to the target image version package.
In one possible example, the processing unit 501 is further configured to: controlling the differential file generation module to carry out packaging processing on the differential file to obtain a differential data packet; controlling the difference file generation module to carry out packaging processing on the basic mirror image version number and the difference file list to obtain a mirror image reconstruction information packet; and controlling the differential construction scheduling module to carry out packaging processing on the differential data packet, the mirror image reconstruction information packet and the mirror image verification information to obtain the differential upgrading packet.
In one possible example, the delta data packet, the mirror reconfiguration packet, and the mirror verification information in the delta upgrade packet are connected in series, all delta files in the delta data packet are connected in parallel, and the base mirror version number and the list of delta files in the mirror reconfiguration packet are connected in parallel.
In one possible example, the version transition map storage structure of the first base mirror image library is a tree map, nodes in the tree map are version numbers of version packages, each node is associated with and stores a mirror image file and a mirror image file list of a corresponding version package, and a top node is the version number of the original mirror image version package; each branch in the tree diagram represents an incremental upgrade path of a primary version, and each branch is associated with and stores a delta file from an incremental upgrade of a version package corresponding to the current node to a version package corresponding to any next-level node.
The incremental upgrade apparatus 500 may further include a storage unit 503 for storing program codes and data of the electronic device. The processing unit 501 may be a processor, the communication unit 502 may be a touch display screen or a transceiver, and the storage unit 503 may be a memory.
It can be understood that, since the method embodiment and the apparatus embodiment are in different presentation forms of the same technical concept, the content of the method embodiment portion in the present application should be adapted to the apparatus embodiment portion synchronously, which is not described herein.
The embodiment of the application also provides a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, where the computer program causes a computer to execute part or all of the steps of any one of the methods described in the embodiments of the method, where the computer includes a server.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any one of the methods described in the method embodiments above. The computer program product may be a software installation package, said computer comprising a server.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present application. And the aforementioned memory includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing has outlined rather broadly the more detailed description of embodiments of the present application, wherein specific examples are provided herein to illustrate the principles and embodiments of the present application, the above examples being provided solely to assist in the understanding of the methods of the present application and the core ideas thereof; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (8)

1. An incremental upgrade method, applied to a server, wherein the server includes a build container and a deployment container, the deployment container includes a mirror reconstruction scheduling module, a mirror reconstruction module, a mirror deployment module, and a first base mirror library, the method includes:
The mirror image reconstruction scheduling module acquires a delta upgrade package from the construction container;
the image reconstruction module reconstructs a target image version package according to the delta upgrade package and the first basic image library, and comprises the following steps: the image reconstruction module acquires a basic image version number and a delta file list from the delta upgrade package; the image reconstruction module generates a construction script according to the basic image version number and the difference file list; the image reconstruction module reconstructs the target image version package according to the construction script;
the mirror image deployment module updates a mirror image file according to the target mirror image version package;
the version transition map storage structure of the first basic mirror image library is a tree map, nodes in the tree map are version numbers of version packages, each node is associated with and stores mirror image files and mirror image file lists of the corresponding version packages, and the top node is the version number of the original mirror image version package; each branch in the tree diagram represents an incremental upgrade path of a primary version, and each branch is associated with and stores a delta file from an incremental upgrade of a version package corresponding to a current node to a version package corresponding to any next node.
2. The method of claim 1, wherein the image reconstruction module reconstructing the target image version package from the build script comprises:
the mirror image reconstruction module acquires a difference file from the difference upgrade package;
the image reconstruction module acquires an image file of a version corresponding to the basic image version number from the first basic image library according to the construction script;
and the image reconstruction module reconstructs the target image version package according to the delta file and the image file of the version corresponding to the basic image version number.
3. The method of claim 1, wherein the deployment container comprises a mirror verification module, the method further comprising, prior to the mirror deployment module updating the mirror file according to the target mirror version package:
the mirror image checking module acquires mirror image checking information from the delta upgrade package;
the mirror image verification module verifies the target mirror image version package according to the mirror image verification information;
and if the verification is passed, the mirror image verification module stores the target mirror image version package into the first basic mirror image library.
4. The method of claim 1, wherein the build container includes a delta build schedule module, a delta file generation module, a second base image library, the build container pre-building the target image version package, the method further comprising:
The difference construction scheduling module acquires a basic mirror image version number and a first mirror image file list of the target mirror image version package;
the delta file generation module acquires a second image file list of a version corresponding to the basic image version number from the second basic image library according to the basic image version number;
the difference file generation module traverses the first image file list and the second image file list to obtain the difference file list;
and the delta file generation module copies the image file from the target image version package according to the delta file list to obtain the delta file.
5. The method of claim 4, wherein the build container further comprises a mirror pre-build and verification information generation module, the method further comprising:
and the image pre-construction and verification information generation module generates image verification information according to the target image version package.
6. The method of claim 5, wherein the method further comprises:
the differential file generation module performs packaging processing on the differential file to obtain a differential data packet;
The difference file generation module packages the basic mirror image version number and the difference file list to obtain a mirror image reconstruction information packet;
and the delta construction scheduling module packages the delta data packet, the mirror image reconstruction information packet and the mirror image verification information to obtain the delta upgrade packet.
7. The method of any of claims 1-6, wherein the delta data packet, the mirror reconfiguration packet, and the mirror verification information in the delta upgrade package are in series, all delta files in the delta data packet are in parallel, and the base mirror version number in the mirror reconfiguration packet is in parallel with the delta file list.
8. An incremental upgrade apparatus, applied to a server, where the server includes a build container and a deployment container, where the deployment container includes a mirror reconfiguration scheduling module, a mirror reconfiguration module, a mirror deployment module, and a first base mirror library, and the apparatus includes a processing unit configured to:
controlling the mirror image reconstruction scheduling module to acquire a delta upgrade package from the construction container;
and controlling the image reconstruction module to reconstruct a target image version package according to the delta upgrade package and the first base image library, including: the image reconstruction module acquires a basic image version number and a delta file list from the delta upgrade package; the image reconstruction module generates a construction script according to the basic image version number and the difference file list; the image reconstruction module reconstructs the target image version package according to the construction script;
The mirror image deployment module is controlled to update the mirror image file according to the target mirror image version package;
the version transition map storage structure of the first basic mirror image library is a tree map, nodes in the tree map are version numbers of version packages, each node is associated with and stores mirror image files and mirror image file lists of the corresponding version packages, and the top node is the version number of the original mirror image version package; each branch in the tree diagram represents an incremental upgrade path of a primary version, and each branch is associated with and stores a delta file from an incremental upgrade of a version package corresponding to a current node to a version package corresponding to any next node.
CN201911402504.5A 2019-12-30 2019-12-30 Incremental upgrading method and related equipment Active CN111158737B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911402504.5A CN111158737B (en) 2019-12-30 2019-12-30 Incremental upgrading method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911402504.5A CN111158737B (en) 2019-12-30 2019-12-30 Incremental upgrading method and related equipment

Publications (2)

Publication Number Publication Date
CN111158737A CN111158737A (en) 2020-05-15
CN111158737B true CN111158737B (en) 2024-01-05

Family

ID=70559412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911402504.5A Active CN111158737B (en) 2019-12-30 2019-12-30 Incremental upgrading method and related equipment

Country Status (1)

Country Link
CN (1) CN111158737B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966388A (en) * 2020-07-10 2020-11-20 福建升腾资讯有限公司 Space-saving mirror image version update management method, device, equipment and medium
CN112612489B (en) * 2020-12-16 2024-03-12 北京梆梆安全科技有限公司 Method and device for constructing upgrade package of software and electronic equipment
CN112905223B (en) * 2021-04-09 2024-03-19 竞技世界(北京)网络技术有限公司 Upgrade package generation method, device and equipment
CN113157288A (en) * 2021-04-30 2021-07-23 中国银行股份有限公司 File deployment method and device based on self-searching path
CN113342378B (en) * 2021-06-25 2022-08-02 浪潮通用软件有限公司 Mirror image generation method, device and medium based on file system update
CN113590168B (en) * 2021-07-29 2024-03-01 百度在线网络技术(北京)有限公司 Method, device, equipment, medium and program product for upgrading embedded equipment
CN113626046B (en) * 2021-08-26 2024-06-18 广州文远知行科技有限公司 Container mirror image updating method, device, storage medium and computer equipment
CN113656049B (en) * 2021-08-30 2023-12-29 浪潮商用机器有限公司 Operating system deployment method and device, electronic equipment and storage medium
CN116501363A (en) * 2023-06-29 2023-07-28 杭州美创科技股份有限公司 Method and device for rapidly upgrading software offline, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105373410A (en) * 2015-12-22 2016-03-02 京信通信技术(广州)有限公司 Differential upgrading method and device for base station software
CN106201625A (en) * 2016-07-19 2016-12-07 乐视控股(北京)有限公司 A kind of software version updating method, updating device and electronic equipment thereof
WO2016192197A1 (en) * 2015-06-02 2016-12-08 中兴通讯股份有限公司 Software upgrade method, apparatus and system of terminal, and computer storage medium
CN106528224A (en) * 2016-11-03 2017-03-22 腾讯科技(深圳)有限公司 Content updating method and system for Docker container, and server
CN110413379A (en) * 2019-07-31 2019-11-05 中国工商银行股份有限公司 Information processing method and its device, system, electronic equipment and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016192197A1 (en) * 2015-06-02 2016-12-08 中兴通讯股份有限公司 Software upgrade method, apparatus and system of terminal, and computer storage medium
CN105373410A (en) * 2015-12-22 2016-03-02 京信通信技术(广州)有限公司 Differential upgrading method and device for base station software
CN106201625A (en) * 2016-07-19 2016-12-07 乐视控股(北京)有限公司 A kind of software version updating method, updating device and electronic equipment thereof
CN106528224A (en) * 2016-11-03 2017-03-22 腾讯科技(深圳)有限公司 Content updating method and system for Docker container, and server
CN110413379A (en) * 2019-07-31 2019-11-05 中国工商银行股份有限公司 Information processing method and its device, system, electronic equipment and medium

Also Published As

Publication number Publication date
CN111158737A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN111158737B (en) Incremental upgrading method and related equipment
US11797283B2 (en) Application program development and deployment method and apparatus, and computer-readable medium
US20170085419A1 (en) System and method for deploying an application
WO2016177061A1 (en) Upgrade method and apparatus using over-the-air download technology
CN109002320B (en) Updating method, system, electronic device and storage medium for software development kit
CN103530156A (en) Method and device for dynamically loading and calling program
CN105893094A (en) Achieving method and device for application program plug-in
CN105867973A (en) Loading method and system for so file in application program
CN109753300B (en) Algorithm upgrading method, calculation task sending method and related device
CN111309336A (en) Distributed application deployment method and device
CN110716786A (en) Page display method, system and storage medium
US11023220B2 (en) Firmware update with integrated smart sequence and action engine
CN110716729A (en) Automobile online upgrading method, system and equipment and readable storage medium
McComas Increasing flight software reuse with OpenSatKit
CN106254440A (en) The upgrade method of a kind of AP and device
US11799724B2 (en) Internet-of-things model-based virtual internet-of-things device generation method and apparatus
CN112925715A (en) Application debugging method and device of mobile terminal
CN110286936A (en) Hot restorative procedure, device, electronic equipment and storage medium
CN106325924B (en) A kind of electronic program guides heat update system and method
CN117667118A (en) Algorithm model deployment method and device, electronic equipment and storage medium
CN113031986B (en) Feature comparison algorithm dynamic loading method, device, terminal and medium
CN114327667B (en) Dynamic resource loading method and system
CN114064085A (en) Method, device, terminal and storage medium for dual-system linkage upgrading
CN114640687A (en) Software upgrading method and device, storage medium and electronic equipment
US20140325270A1 (en) Method and a device for managing an application referenced by a device

Legal Events

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