Application program updating method and container management platform

By using annotation information to determine the target resource data and its loading order in the container management platform, cross-version update of the application is solved, and the problem of high and low efficiency of full update costs caused by too many intermediate versions is solved, improving update efficiency and reducing costs.

CN120029640APending Publication Date: 2025-05-23HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410171818.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-11-21
Filing Date
2024-02-06
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

When the application version is updated, as the version increases, the number of intermediate versions is huge, resulting in high cost and low efficiency of full updates.

Method used

By determining the target resource data and its loading order based on the annotation information in the resource data of each version of the application, cross-version updates are achieved and full updates are avoided.

Benefits of technology

Reduces the cost of cross-version updates for applications, improves update efficiency, and reduces development workload and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029640A_ABST
    Figure CN120029640A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an application program updating method and a container management platform, and relates to the technical field of computers. The application program updating method is applied to a container management platform, an application program is deployed on a container managed by the container management platform, and the container management platform receives an updating instruction for updating the application program of a first version to a second version; determining at least one piece of target resource data and a loading sequence of the at least one piece of target resource data according to annotation information in the resource data under each of the first version, the second version and the at least one intermediate version; and based on the loading sequence of the at least one piece of target resource data and the at least one piece of target resource data, updating the resource data of the application program of the first version. According to the embodiment of the invention, the application program updating efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to a Chinese patent application with application number 202311558339.9 filed on November 21, 2023, and invention name “A cloud-native cross-version upgrade method and device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of computer technology, and in particular to an application updating method and a container management platform. Background Art

[0003] Containers are used to provide an isolated computing environment for storing and accessing programs. They are virtualization devices similar to virtual machines, except that they are used to implement process-level resource isolation. Container management platforms, also known as container orchestration systems (such as Kubernetes, K8s), can deploy applications by loading application resource data (such as resource templates in K8s deployment packages (charts), making it easier to deploy and manage applications.

[0004] In the related art, when an application is updated, such as when the version is upgraded or rolled back, the container orchestration system can replace the resource data of the current version with the resource data of the updated version to obtain the updated resource data, and then load the updated resource data to update the current version of the application. For cross-version application updates, such as updates between versions V1 and V3, it is necessary to update the versions in order of old and new, that is, to update the entire version; upgrade version V1 to version V2, and then upgrade version V2 to version V3, so as to use the resource data of the intermediate version (such as version V2) to implement the data iteration between the current version and the updated version (such as the iteration of the data structure, the iteration of the functional interface, etc.), and avoid the update failure caused by the missing resource data of the intermediate version.

[0005] However, the number of application versions will continue to increase over time, and the large number of intermediate versions will make full updates very costly and inefficient. Summary of the invention

[0006] In order to solve the above technical problems, the present application provides an application update method and a container management platform. The application update method is applied to the container management platform, and through the annotation information in the resource data of each version of the application, the cross-version update of the application can be realized without performing a full update or developing an upgrade path corresponding to all versions, thereby improving the update efficiency of the application.

[0007] In a first aspect, an embodiment of the present application provides an application updating method, which is applied to a container management platform, and an application is deployed on a container managed by the container management platform. The method includes: receiving an update instruction to update a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version; determining at least one target resource data and a loading order of at least one target resource data based on annotation information in the resource data of each version of the first version, the second version, and the at least one intermediate version; wherein the annotation information is used to indicate a functional type of resource data in an update path from the first version to the second version; and updating the resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data.

[0008] In the embodiment of the present application, the annotation information is used to indicate the functional type of the resource data in the cross-version update path. Based on this, according to the annotation information in the resource data under each version in the cross-version update path, at least one target resource data that can realize the cross-version update and the loading order of at least one target resource data can be determined. On this basis, at least one target resource data is loaded based on the loading order, which can ensure that in the cross-version update of updating the first version of the application to the second version of the application, the loading order of the resource data conforms to the iteration logic corresponding to the update path, and the resource data is the target resource data required by the update path. In this way, the resource data used for intermediate version iteration and irrelevant to the cross-version update when the full update is directly performed is omitted, and the complexity of the update process is reduced, thereby greatly reducing the cost of the cross-version update of the application and improving the update efficiency. In addition, this solution realizes the cross-version update by reusing the resource data required for version iteration, without the need to develop all upgrade paths in each version, thereby reducing the development workload and the subsequent maintenance cost, improving the update efficiency of the application and reducing the update cost.

[0009] According to the first aspect, the function type includes one or more of a first type, a second type and a third type; the resource data of the first type is used to deploy an application of each version in a first version, a second version and at least one intermediate version; the resource data of the second type is used to initialize the second version of the application; the resource data of the third type is used to implement the iteration of data in the application from the first version to the second version.

[0010] In the embodiment of the present application, different function types are used to indicate the functions of different resource data in the update path from the first version to the second version, thereby ensuring that the update of the application can be applicable to more diverse iterative situations, reducing the update complexity of the application and improving the update efficiency.

[0011] According to the first aspect, or any implementation of the first aspect above, at least one target resource data and the loading order of at least one target resource data are determined according to the annotation information in the resource data under each version of the first version, the second version and at least one intermediate version, including: in the resource data under each version of the first version, the second version and at least one intermediate version, the resource data whose annotation information indicates the first type and whose corresponding version is the second version is determined as the target resource data, and the loading order of the target resource data is determined according to the resource data loading order specified by the container management platform; in the resource data under each version of the first version, the second version and at least one intermediate version, the resource data whose annotation information indicates the second type and whose corresponding version is applicable to the current deployment environment is determined as the target resource data, and the loading order of the target resource data is determined to be loaded before the resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application; in the resource data under each version of the first version, the second version and at least one intermediate version, the resource data whose annotation information indicates the third type is determined as the target resource data, and the loading order of all target resource data with the same name under the third type is determined according to the version order corresponding to the update indication.

[0012] In an embodiment of the present application, the loading order of the target resource is determined according to the functional type of the target resource data, ensuring that the loading order of the target resource data complies with the iterative logic of the update path, and reusing the resource data required for version iteration to achieve cross-version updates, while taking into account the accuracy and efficiency of cross-version updates of the application.

[0013] According to the first aspect, or any implementation of the first aspect above, after the resource data under each version of the first version, the second version and at least one intermediate version, the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment. Resource data is determined as target resource data, the method also includes: obtaining a sequence weight for each target resource data of the second type; and determining the loading order of each target resource data of the second type according to the sequence weight.

[0014] In the embodiment of the present application, for resource data whose function type is initialization, that is, the second type, the loading order can be further controlled by weight to implement different update paths corresponding to different loading orders of resource data, thereby reducing the implementation complexity of the diversified update process and further improving the update efficiency of the application.

[0015] According to the first aspect, or any implementation of the first aspect above, at least one target resource data and the loading order of at least one target resource data are determined according to the annotation information in the resource data in each version of the first version, the second version, and at least one intermediate version, including: resource data with empty annotation information and / or no functional type in the resource data in each version of the first version, the second version, and at least one intermediate version are determined as target resource data, and the loading order of the target resource data is determined according to the resource data loading order specified by the container management platform.

[0016] In the embodiment of the present application, the annotation information is empty and / or has no function type, indicating that the resource data is not restricted by the function type, that is, there is no special update logic, and the resource data can be directly loaded according to the loading order specified by the container management platform, that is, the default loading order. In this way, it can be applied to more diverse update paths, further improving the convenience of application updates.

[0017] According to the first aspect, or any implementation of the first aspect above, before updating the resource data of the first version of the application based on the loading order of at least one target resource data and at least one target resource data, the method also includes: if any target resource data of the at least one target resource data corresponds to multiple loading orders in the loading order of at least one target resource data, feedback is used to indicate a prompt information of an update error.

[0018] In the embodiment of the present application, by identifying the situation where a loop is included in the loading sequence of the target resource data, that is, the situation where a target resource is loaded repeatedly and reporting an error, update anomalies can be avoided.

[0019] According to the first aspect, or any implementation of the first aspect above, the container management platform is Kubernetes; before determining at least one target resource data and the loading order of at least one target resource data according to the annotation information in the resource data in each of the first version, the second version and at least one intermediate version, the method also includes: obtaining the deployment package in the Helm repository repository that is applicable to the first version, the second version and each of the at least one intermediate version of the current deployment environment; wherein the current deployment environment is the deployment environment of the first version of the application; reading the resource data in the obtained deployment package, and reading the annotation information in the resource data until the resource data in the obtained deployment package is traversed.

[0020] The embodiment of the present application, when applied to Kubernetes, obtains the deployment package under each of the first version, the second version, and at least one intermediate version applicable to the current deployment environment from the Helm repository through Helm, and reads the annotation information in the resource data until the resource data in the obtained deployment package is traversed, thereby improving the efficiency of application updates in the Kubernetes scenario

[0021] In a second aspect, an embodiment of the present application provides a container management platform, on which an application is deployed. The container managed by the container management platform includes: an indication receiving module, used to receive an update indication to update a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version; an annotation parsing module, used to determine at least one target resource data and a loading order of at least one target resource data according to annotation information in the resource data under each version of the first version, the second version and at least one intermediate version; wherein the annotation information is used to indicate a functional type of resource data in an update path from the first version to the second version; a resource update module, used to update the resource data of the first version of the application based on the loading order of at least one target resource data and at least one target resource data.

[0022] According to the second aspect, the functional type includes one or more of a first type, a second type, and a third type; the resource data of the first type is used to deploy an application of each of a first version, a second version, and at least one intermediate version;

[0023] The second type of resource data is used to initialize the second version of the application; the third type of resource data is used to implement the iteration of data from the first version to the second version of the application.

[0024] According to the second aspect, or any implementation of the second aspect above, the annotation parsing module is specifically used to: determine the resource data under each version of the first version, the second version and at least one intermediate version, in which the annotation information indicates the first type and the corresponding version is the second version as the target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform; determine the resource data under each version of the first version, the second version and at least one intermediate version, in which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, and determine the loading order of the target resource data to be loaded before resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application; determine the resource data under each version of the first version, the second version and at least one intermediate version, in which the annotation information indicates the third type as the target resource data, and determine the loading order of all target resource data with the same name under the third type according to the version order corresponding to the update indication.

[0025] According to the second aspect, or any implementation method of the second aspect above, the annotation parsing module is also used to: after determining the resource data in each version of the first version, the second version and at least one intermediate version, in which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, obtain the sequence weight of each target resource data of the second type; and determine the loading order of each target resource data of the second type according to the sequence weight.

[0026] According to the second aspect, or any implementation of the second aspect above, the annotation parsing module is specifically used to: determine the resource data with empty annotation information and / or no functional type in the resource data under each version of the first version, the second version and at least one intermediate version as target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform.

[0027] According to the second aspect, or any implementation of the second aspect above, the device also includes an information output module, which is used to: before the resource update module updates the resource data of the first version of the application based on the loading order of at least one target resource data and at least one target resource data, when any target resource data in the at least one target resource data corresponds to multiple loading orders in the loading order of at least one target resource data, feedback a prompt message indicating an update error.

[0028] According to the second aspect, or any implementation of the second aspect above, the container management platform is Kubernetes; the device also includes a data acquisition module, which is used to: before the annotation parsing module determines at least one target resource data and the loading order of at least one target resource data according to the annotation information in the resource data in each of the first version, the second version and at least one intermediate version, obtain the deployment package under each of the first version, the second version and at least one intermediate version applicable to the current deployment environment in the Helm repository repository; wherein the current deployment environment is the deployment environment of the first version of the application; read the resource data in the acquired deployment package, and read the annotation information in the resource data until the resource data in the acquired deployment package is traversed.

[0029] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.

[0030] In a third aspect, an embodiment of the present application provides a computing device cluster, comprising: at least one computing device, each computing device comprising a processor and a memory; the processor and the memory are connected; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes a method such as the first aspect and any one of the implementation methods of the first aspect.

[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising a computer program, the computer program comprising instructions for executing the method in the first aspect or any possible implementation of the first aspect, and when the computer program is run in a computing device cluster, the computing device cluster executes the method in the first aspect or any possible implementation of the first aspect.

[0032] In a fifth aspect, an embodiment of the present application provides a computer program, which includes instructions for executing the method in the first aspect or any possible implementation of the first aspect. When the computer program is run in a computing device cluster, the computing device cluster executes the method in the first aspect or any possible implementation of the first aspect.

[0033] In a sixth aspect, an embodiment of the present application provides a chip comprising one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of at least one computing device in a computing device cluster and send a signal to the processor, the signal comprising a computer instruction stored in the memory; when the processor executes the computer instruction, the at least one computing device executes the instructions of the method in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. 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 paying any creative labor.

[0035] Figure 1 This is a schematic diagram of the full update process under Kubernetes.

[0036] Figure 2 It is a schematic diagram of the structure of a computing cluster provided in an embodiment of the present application;

[0037] Figure 3 It is a structural block diagram of an application updating device provided in an embodiment of the present application;

[0038] Figure 4 This is one of the flowcharts of an application updating method provided in an embodiment of the present application;

[0039] Figure 5 This is one of the flowcharts of an application updating method provided in an embodiment of the present application;

[0040] Figure 6 is a schematic diagram of a target resource data determination process provided by an embodiment of the present application;

[0041] Figure 7 is an example diagram of the application of annotation information provided in an embodiment of the present application;

[0042] Figure 8 It is a schematic diagram of an application update process under Kubernetes provided by an embodiment of the present application;

[0043] Fig. 9 It is a structural block diagram of a container management platform provided in an embodiment of the present application;

[0044] Fig.10 is a structural block diagram of a computing device 100 provided in an embodiment of the present application;

[0045] Fig.11 This is one of the structural block diagrams of a computing device cluster provided in an embodiment of the present application;

[0046] Fig.12 This is one of the structural block diagrams of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0048] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0049] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.

[0050] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0051] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0052] First, some terms and related technologies involved in this application are explained to facilitate understanding.

[0053] Application deployment: The process of providing applications to users, which usually includes steps such as configuring the environment, installing the application, and testing.

[0054] Container: An isolated computing environment for storing and accessing programs. It can carry the process corresponding to a task. It is a virtualization device similar to a virtual machine, except that containers are used to implement process-level resource isolation. Among them, a task can be a task used to support the operation of an application.

[0055] Kubernetes (K8s): An open source platform for managing containers, that is, an open source container orchestration system. K8s allows users to more easily deploy, expand and manage containerized applications, and implement load balancing, service discovery, and automatic elastic scaling in an automated way. In the past few years, K8s has become the de facto standard in the field of container orchestration and management, and has been increasingly widely used.

[0056] Helm: A software package management tool provided by Kubernetes, which is specifically responsible for managing the resources of applications deployed on containers managed by Kubernetes. Helm can be used to uniformly package, distribute, install, upgrade, and roll back applications deployed on containers managed by Kubernetes.

[0057] Deployment package (chart): A package used to deploy applications in Kubernetes. The templates directory in the deployment package stores application resource data such as resource templates. Resource templates can obtain valid files used to support application operation by rendering variables. The values.yaml in the deployment package is used to store the default values ​​of templates.

[0058] For example, Figure 1 This is a schematic diagram showing the full update process under Kubernetes. Figure 1 As shown, K8s manages applications based on Helm charts. Charts correspond to application versions and have a version concept. Charts contain resource data corresponding to applications, such as deployment resources and configuration information. Deployment resources are deployment objects (Deployment) and statefulsets (Statefulset) indicated by templates. For example Figure 1 The V1 version of the chart shown includes two applications to be deployed: resources App1 and App2; and two middlewares, MySQL and Memcached, in a stateful set (Statefulset).

[0059] As time goes by, the application has version updates (such as version upgrades and version rollbacks), and accordingly, the version of the application's resource data is iterated accordingly. The chart when the application is released is the release version, which contains all the resource data of the application. When upgrading the application based on the chart, Helm parses the upgraded version of the chart to obtain the target resource data, replaces the resource data source of the current version of the chart with the target resource data, and performs the necessary tasks (jobs). Figure 1 As shown, taking the version upgrade of the application as an example, version V1, version V2 and version V3, there may be the following upgrade paths: V1 upgrades to V2, V1 upgrades to V3, V2 upgrades to V3. For ease of understanding, each upgrade path is introduced below:

[0060] When upgrading an application from version V1 to version V2, the resource data contained in the directory templates of the chart of version V1 include: DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, StatefulsetOfMySQL.yaml, and StatefulsetOfMemcached.yaml. The resource data contained in the directory templates of the chart of version V2 include: DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, DeploymentOfApp3.yaml, StatefulsetOfMySQL.yaml, StatefulsetOfRedis.yaml, and JobOfDataMigration.yaml. On this basis, upgrading from V1 to V2 can be: splitting App2 in the chart package of version V1 into App2 and App3, uninstalling Redis and replacing it with Memcached, and completing the conversion of data in Memcached to data in Redis through development task 1 (Job1). Among them, development task 1 (Job1) is Memcached->Redis.

[0061] When upgrading the application from version V2 to version V3, the resource data contained in the directory templates of the chart of version V3 include: DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, DeploymentOfApp3.yaml, StatefulsetOfMySQL.yaml, StatefulsetOfElasticSearch.yaml, and JobOfDataMigration.yaml. Based on this, the upgrade from V2 to V3 can be: upgrading App1 and App3 in the resource data of version V2, replacing Redis with ElasticSearch, and completing the conversion of data in Redis to data in ElasticSearch through development task 2 (Job2). Among them, development task 2 (Job2) is Redis->ElasticSearch.

[0062] When upgrading an application from version V1 to version V3, if a differential update method similar to the upgrade from V1 to V2 and from V2 to V3 is used, that is, the differential (such as application and / or middleware) is determined only through the resource data in the chart of version V3 and the resource data in the chart of version V1, and the differential is updated (such as uninstalling, replacing and / or executing development tasks), the upgrade may fail due to the lack of some resource data of the intermediate version. For example, the upgrade from V1 to V2 requires the execution of development task 1 (Job1). The upgrade from V2 to V3 requires the execution of development task 2 (Job2). If V1 is upgraded to V3 in the differential update method, development task 1 (Job1) and development task 2 (Job2) are missing, resulting in upgrade failure.

[0063] To solve the above problems caused by the upgrade from V1 to V3, there are generally two solutions:

[0064] Solution 1: Upgrade in the order of the latest and oldest versions. In this way, version V1 is upgraded to version V2, and then from version V2 to version V3. Obviously, if there are many versions of the middleware, each upgrade will require a full upgrade, which will consume a lot of time and computing costs, resulting in high update costs and low efficiency.

[0065] Solution 2: Develop all upgrade paths in each version. For example, consider the upgrade paths for V1 and V2 in version V3. In other words, Figure 1Based on the above, an additional development task 3 (Job3) is added in the V3 version to achieve data migration from Memcached->ES. Obviously, with the increase in versions, this approach will lead to a huge development workload, failure to converge in the later stage, a significant increase in maintenance costs, excessively high update costs, and low efficiency.

[0066] The embodiment of the present application provides an application updating method to solve the above problems. In the method, the annotation information is used to indicate the functional type of resource data in the cross-version update path. Based on this, according to the annotation information in the resource data under each version in the cross-version update path, at least one target resource data that can realize the cross-version update and the loading order of at least one target resource data can be determined. On this basis, at least one target resource data is loaded based on the loading order, which can ensure that in the cross-version update of updating the first version of the application to the second version of the application, the loading order of the resource data conforms to the iteration logic corresponding to the update path, and the resource data is the target resource data required by the update path. In this way, the resource data used for intermediate version iteration and irrelevant to the cross-version update when the full update is directly performed is omitted, and the complexity of the update process is reduced, thereby greatly reducing the cost of the cross-version update of the application and improving the update efficiency. In addition, this solution realizes the cross-version update by reusing the resource data required for version iteration, without the need to develop all upgrade paths in each version, thereby reducing the development workload and the subsequent maintenance cost, improving the update efficiency of the application and reducing the update cost.

[0067] Before describing the technical solution of the embodiment of the present application, the operating platform of the application update method of the embodiment of the present application is first described in conjunction with the accompanying drawings. The application update method of the embodiment of the present application can be applied to a container management platform, which can run on single electronic devices, computing clusters and other devices. Among them, single electronic devices can be, for example, desktop computers, portable computers, servers, mobile terminals, wearable devices, etc. The computing cluster can be, for example, a cluster including multiple physical computing nodes, or it can be a cluster including multiple virtual computing nodes. Exemplarily, Figure 2 Schematic diagram of a computing cluster provided in an embodiment of the present application. Figure 2 As shown, the computing cluster 200 may include: a management node 201, multiple computing nodes 202, and a container management platform 203. The management node 201 and each computing node 202 run containers, and the container management platform 203 is used to manage containers on all nodes in the computing cluster 200.

[0068] In one example, each node in the computing cluster 200 is a physical computing node such as a computing device. In this case, the management node 201 may include: a processor 2011 and a memory 2012; the processor 2011 and the memory 2012 are connected; similarly, the computing node 202 may include a processor 2021 and a memory 2022; the processor 2021 and the memory 2022 are connected;

[0069] The processor (such as processor 2011 and / or processor 2021) of at least one computing node (such as management node 201 and one or more of computing node 202) is used to execute instructions stored in the memory (such as memory 2012 and / or memory 2022) of the at least one computing node, so that the computing cluster 200 implements the application update method provided in the embodiment of the present application.

[0070] It should be understood that Figure 2 The computing cluster shown is only one example of a computing cluster, and a computing cluster may have more or fewer components than shown, may combine two or more components, or may have a different configuration of components. Figure 2 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0071] For example, Figure 3 is a structural block diagram of an application updating device provided in an embodiment of the present application. Figure 3 As shown, the application updating device is applied to a container management platform, and an application is deployed on a container managed by the container management platform. The device includes:

[0072] The receiving module 301 is configured to receive an update instruction for updating a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version;

[0073] The parsing module 302 is used to determine at least one target resource data and a loading order of at least one target resource data according to annotation information in the resource data of each version of the first version, the second version and the at least one intermediate version; wherein the annotation information is used to indicate the function type of the resource data in the update path from the first version to the second version;

[0074] The updating module 303 is used to update the resource data of the first version of the application program based on the loading order of the at least one target resource data and the at least one target resource data.

[0075] It is understandable that the above Figure 3The application updating device shown in the specific application can be in the form of a plug-in, thread, process, entity module, etc., and the embodiment of the present application is not limited to this and can be set according to application requirements.

[0076] For ease of understanding, the following Figures 4 to 8 The application updating method provided in the embodiment of the present application is described in detail.

[0077] For example, Figure 4 This is one of the flow charts of an application updating method provided in the embodiment of the present application. Figure 4 As shown, the application updating method can be applied to a container management platform, and an application is deployed on a container managed by the container management platform. The method may include:

[0078] S401, receiving an update instruction to update a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version.

[0079] Specifically, the update instruction may indicate that the application is to be upgraded or rolled back. There is at least one intermediate version between the first version and the second version, that is, a cross-version update of the application is performed in response to the update instruction. Figure 1 As shown, version V1 is upgraded to version V3. The first version is version V1, the second version is version V3, and there is an intermediate version between the two, version V2. Assuming that the first version is version V1 and the second version is version V5, there are three intermediate versions, version V2, version V3, and version V4. Similarly, assuming that version V3 is rolled back to version V1, there is an intermediate version, version V2.

[0080] It is understandable that the versions in the embodiments of the present application are only examples. In specific applications, the versions can be in English, date, etc., and the embodiments of the present application do not limit this. In addition, version rollback is the reverse operation of version upgrade. The rollback method is similar to the upgrade method, except that the update path is different and the updated resource data is different. For the same parts, refer to the version upgrade process. For the convenience of description and understanding, the version upgrade is used as an example for explanation.

[0081] For example, Figure 5 This is one of the flow charts of an application updating method provided in the embodiment of the present application. Figure 5 As shown, the application update method may include:

[0082] S501, receiving a Helm upgrade command.

[0083] When the container management platform is K8s and the update instruction is to upgrade the version of the application, the update instruction may be a Helm upgrade command.

[0084] S402, determining at least one target resource data and the loading order of at least one target resource data according to annotation information in the resource data in each version of the first version, the second version and at least one intermediate version; wherein the annotation information is used to indicate the functional type of the resource data in the update path from the first version to the second version.

[0085] Exemplarily, the update path refers to the version iteration process experienced by the first version to the second version. Figure 1 For example, the update path from version V1 to version V3 is that version V1 is upgraded to version V2 through the execution of development task 1 and the splitting of APP2, and version V2 is upgraded to version V3 through the upgrade of APP2 and APP3 and development task 2. Among them, development task 1, the splitting of APP2, the upgrade of APP2 and APP3, and development task 2 are resource data. The function type of resource data in the update path is used to indicate the role achieved by the resource data in the iterative process indicated by the update path. See also Figure 1 , the functional types of resource data development tasks 1 and 2 are loaded in a certain order to implement data iteration (such as data structure iteration, functional interface iteration, etc.): by loading development tasks 1 and 2 in the iteration order, the conversion of data in Memcached to data in Redis, and the conversion of data in Redis to data in ElasticSearch can be realized in turn, thus achieving the conversion of data in Memcached to data in ElasticSearch. In this way, there is no need for additional development to solve the differences between Memcached and ElasticSearch, and the update of applications is more convenient and efficient.

[0086] It is understandable that the target resource data is the resource data whose loading order is restricted by the function type in the update path from the first version to the second version. If there is only one target resource data, the loading order is to directly load the target resource data.

[0087] In an optional implementation, the container management platform is Kubernetes;

[0088] Accordingly, before determining at least one target resource data and the loading order of at least one target resource data according to the annotation information in the resource data of each version of the first version, the second version, and the at least one intermediate version, the application updating method provided in the embodiment of the present application may further include:

[0089] Obtain the deployment package of each of the first version, the second version, and at least one intermediate version applicable to the current deployment environment in the Helm repository repository; wherein the current deployment environment is the deployment environment of the first version of the application;

[0090] The resource data in the acquired deployment package is read, and the annotation information in the resource data is read, until the resource data in the acquired deployment package is traversed.

[0091] by Figure 5 For example, after receiving the Helm upgrade command, K8s executes S502 to S508 to determine at least one target resource data and the loading order of at least one target resource data:

[0092] S502, pull the chart of the deployed version in the current environment and the target version of the chart, as well as all intermediate versions of the chart release packages between the two, from the Helm repository.

[0093] The chart of the deployed version in the current environment and the chart of the target version refer to the chart of the first version of the application and the chart of the second version of the application, respectively. The intermediate version chart release package refers to the intermediate version chart released between the first version and the second version. Helm repository is the repository of Helm, which can be used to store resource data of each version of the application.

[0094] S503, template specification verification, and value.yaml rendering is completed.

[0095] In specific applications, after K8s obtains the resource data used to update the application, it can perform standard verification on the resource data, such as template, and complete the value.yaml rendering, that is, the rendering parameters, if the verification passes, to obtain a valid template for subsequent loading.

[0096] S504, read the template in the chart package of each pulled version in turn, and read the templateAnnotations.

[0097] Among them, template Annotations are annotation information. Annotation information can be pre-added to the template in each version of the chart package. The timing of adding annotation information can be the development process of each version of the application, or it can be the maintenance process of each version of the application, etc., which is not limited in the embodiments of the present application.

[0098] S505, determine whether annotation information is included; if included, execute S506; if not included, execute S507;

[0099] S506, determine whether it is category 1. If it is category 1, determine the loading order according to category 1; if it is not category 1, determine whether it is category 2. If it is category 2, determine the loading order according to category 2; ... If it is not category 2, determine whether it is the remaining categories in turn until the last category: determine whether it is category n. If it is category n, determine the loading order according to category n; if it is not category n, execute S507.

[0100] Among them, category 1 to category n are exemplary descriptions of the functional types of resource data. For example, taking the container management platform K8s as an example, Figure 6 FIG. 1 is a schematic diagram of a target resource data determination process provided by an embodiment of the present application. Figure 6 As shown, the first version is V1 version, and the second version is Vn version. For the n versions of the V1 version char package to the Vn version chart, that is, all versions of the chart, each char contains several resource data such as template1-1 to template1-n in the V1 version char package. When processing these templates, K8s determines whether to load and the loading order for each template based on the annotation information, and obtains a reorganized chart arranged in the loading order. By loading the reorganized chart, a part of the templates in all versions of the chart, that is, the target resource data, will be loaded. For example, template1-1, template n-2, and template n-3 are loaded in sequence, and then template1-m to template nn are loaded in parallel, where template2-m is executed after template1-m in template1-m to template nn.

[0101] S507, using Helm's default loading order;

[0102] In an optional implementation, the determining of at least one target resource data and the loading order of at least one target resource data according to the annotation information in the resource data of each version of the first version, the second version, and the at least one intermediate version may specifically include:

[0103] In the resource data under each version of the first version, the second version and at least one intermediate version, the resource data with empty annotation information and / or no functional type is determined as the target resource data, and the loading order of the target resource data is determined according to the resource data loading order specified by the container management platform.

[0104] Exemplarily, the container management platform is K8s, that is, S507 is executed. The default loading order of Helm can be, for example: for resource data with different content types, that is, different resource types, determine the corresponding loading order according to the resource type, and for resource data of the same resource type, determine the loading order according to the first letter of the resource data name. Among them, the resource type can be, for example, interface service (APIService), deployment (Deployment), and development task (Job), etc., and the corresponding loading orders are "Deployment", "Job", "APIService" in sequence.

[0105] In the embodiments of the present application, the annotation information is empty and / or has no function type, indicating that the resource data is not restricted by the function type, that is, there is no special update logic, and the resource data can be directly loaded according to the loading order specified by the container management platform, that is, the default loading order. In this way, it can be applicable to more diverse update paths and further improve the convenience of application program updates.

[0106] S508, determine whether all templates have been traversed. If all templates have been traversed, execute S509. If not, execute S504.

[0107] The above Figure 5 The embodiments ensure that the annotation information in the resource data under each version of the first version, the second version, and at least one intermediate version is read by traversing, that is, the template Annotations in all templates, so as to avoid update exceptions caused by omissions.

[0108] In an alternative embodiment, the above function type may include one or more of a first type, a second type, and a third type;

[0109] The resource data of the first type is used to deploy the application programs of each version of the first version, the second version, and at least one intermediate version;

[0110] The resource data of the second type is used for the initialization of the application program of the second version;

[0111] The resource data of the third type is used to implement the iteration of the data in the application programs from the first version to the second version.

[0112] Exemplarily, the annotation information "stateless" can be used to indicate the first type, the annotation information "initialized" can be used to indicate the second type, and the annotation information "sequenced" can be used to indicate the third type. The embodiment of the present application does not limit the specific form of the annotation information used to indicate different functional types, and can be set according to application requirements. Taking the container management platform as K8s as an example, the annotation information can be added to the metadata of the resource data yaml file in the templates directory, such as classified-annotations:stateless / initialized / sequenced.

[0113] In the embodiment of the present application, different function types are used to indicate the functions of different resource data in the update path from the first version to the second version, thereby ensuring that the update of the application can be applicable to more diverse iterative situations, reducing the update complexity of the application and improving the update efficiency.

[0114] In an optional implementation, the determining of at least one target resource data and the loading order of at least one target resource data according to the annotation information in the resource data of each version of the first version, the second version, and the at least one intermediate version may specifically include:

[0115] Determine resource data in each of the first version, the second version, and at least one intermediate version, whose annotation information indicates the first type and whose corresponding version is the second version, as target resource data, and determine a loading order of the target resource data according to a resource data loading order specified by the container management platform;

[0116] Determine, in resource data of each of the first version, the second version, and at least one intermediate version, resource data whose annotation information indicates the second type and whose corresponding version is applicable to the current deployment environment as target resource data, and determine the loading order of the target resource data to be loaded before resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application;

[0117] In the resource data under each of the first version, the second version and at least one intermediate version, the resource data of the third type indicated by the annotation information is determined as the target resource data, and the loading order of all target resource data with the same name under the third type is determined according to the version order corresponding to the update indication.

[0118] For example, if the annotation information is stateless, which indicates the first type, K8s determines whether the version of the chart to which the currently processed template belongs is the version of the target chart. If it is the version of the target chart, the Helm default loading order is determined as the loading order of the currently processed template. If it is not the version of the target chart, the template is not loaded, and the next template is analyzed. The target chart is the deployment package of the third version of the application.

[0119] If the annotation information is initialized, which indicates the second type, K8s determines whether the version of the chart to which the currently processed template belongs is the version of the chart deployed in the environment where the first version of the application is deployed, that is, the version of the chart deployed in the current environment. If it is the version of the chart deployed in the current environment, this type of template is placed before other types of templates and executed in this execution order.

[0120] In an optional implementation, after determining as target resource data the resource data in each of the first version, the second version, and the at least one intermediate version, the annotation information indicating the second type and the corresponding version applicable to the current deployment environment, the application update method provided in the embodiment of the present application may further include:

[0121] Obtaining a sequence weight of each target resource data of the second type;

[0122] The loading order of each target resource data of the second type is determined according to the order weight.

[0123] Exemplarily, if the annotation information is initialized, that is, indicating the second type, K8s determines whether the version of the chart to which the currently processed template belongs is the version of the chart deployed in the environment where the first version of the application is deployed, that is, the version of the chart deployed in the current environment. If it is the version of the chart deployed in the current environment, it continues to read the sequence weight of the resource data, such as classified-annotations-weight, and assigns a sequence weight to the loading order of this class of templates, thereby determining the loading order of each template in this class of templates according to the sequence weight.

[0124] In the embodiment of the present application, for resource data whose function type is initialization, that is, the second type, the loading order can be further controlled by weight to implement different update paths corresponding to different loading orders of resource data, thereby reducing the implementation complexity of the diversified update process and further improving the update efficiency of the application.

[0125] Exemplarily, if the annotation information is sequenced, that is, it indicates the third type, K8s reads the version of the template of the third type and the same resource name, and parses the old and new order indicated by the version, and determines the loading order of the template according to the old and new order of the version consistent with the update order indicated by the update indication. For example, if the update order indicated by the update indication is to upgrade from version V1 to version V3, then the loading order of the resource data with the function type sequenced is from version V1 to version V3. In one example, the old and new order indicated by the version can be parsed by a regular expression (regex). In this way, it is easy to adapt to versions in various text forms. Among them, regular expressions, also known as regular expressions, Regular Expression, regex, regexp or RE), are a text pattern including ordinary characters (for example, letters between a and z) and special characters (called "metacharacters"), which is a concept in computer science. Regular expressions use a single string to describe and match a series of strings that match a certain syntactic rule, and can be used to determine text that conforms to a certain pattern (rule).

[0126] In an embodiment of the present application, the loading order of the target resource is determined according to the functional type of the target resource data, ensuring that the loading order of the target resource data complies with the iterative logic of the update path, and reusing the resource data required for version iteration to achieve cross-version updates, while taking into account the accuracy and efficiency of cross-version updates of the application.

[0127] For example, Figure 7 is an example diagram of the application of annotation information provided in the embodiment of the present application. Figure 7 As shown, taking the upgrade of the application from version V1 to version V3 as an example, through the application update method provided in the embodiment of the present application, there is no need to perform additional development work to solve the difference from Memcached to ElasticSearch. Add annotation information classified-annotations Annotations in the resource data JobOfDataMigration.yaml of version V2 and version V3. In this example, the job needs to be executed in order from old to new versions, so add annotation information classified-annotations:sequenced to the yaml file. Add annotation information classified-annotations:stateless to other yaml files of version V1, version V2 and version V3. The specific sequence determination process is as follows:

[0128] When K8s receives the Helm upgrade command, it pulls the chart packages of versions V1, V2, and V3 through the Helm provided in the embodiment of the present application, and then verifies, reads, and renders the templates in the three versions of the chart packages. In one example, the analysis can be performed in order of versions:

[0129] All templates in version V1 are marked with classified-annotations:stateless, but version V1 is not the target version, that is, not version V3, so all templates in version V1 are not processed;

[0130] The resource data JobOfDataMigration.yaml in version V2 is marked with classified-annotations:sequenced. When the annotation information is recognized, K8s looks for templates with the resource name JobOfDataMigration.yaml in other chart packages, and determines the execution order of resources with the same name based on version comparison. In one example, the sequenced resource data with a determined execution order can be marked as parsed at this time, so that these resource data do not need to be parsed repeatedly in the future, thereby further improving the update efficiency of the application. The remaining five yaml files of version V2 are marked with classified-annotations:stateless, but version V2 is not the target version, so the templates marked with stateless in version V2 are not processed;

[0131] The resource data JobOfDataMigration.yaml in version V3 is marked with classified-annotations:sequenced. When parsing the resource data of version V2, it is marked as resolved, or when parsing the resource data of version V2, the resource data with the annotation information of sequenced has been processed. In this case, JobOfDataMigration.yaml does not need to be processed. The remaining five yaml files of version V3 are marked with classified-annotations:stateless, and version V3 is the target version, then these five templates can be loaded in the default loading order of Helm.

[0132] In summary, Figure 7In the example, the resource data DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, DeploymentOfApp3.yaml, StatefulsetOfMySQL.yaml, and StatefulsetOfElasticSearch.yaml of version V3 are loaded in the default loading order of Helm, and the JobOfDataMigration.yaml in versions V2 and V3 are executed in the order from version V2 to version V3.

[0133] In addition, the Helm provided in the embodiment of the present application can also be called Enhanced Helm, and the name of the subject used to implement the application update method in the embodiment of the present application is not limited.

[0134] S403: Update resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data.

[0135] For example, Figure 5 As shown, after determining the loading order of each target resource data, you can perform the following steps:

[0136] S509: Update resource data according to the determined loading order.

[0137] Specifically, the container management platform loads the target resource data in sequence according to the loading order of the target resource data, and can use the target resource data (such as version V3's resource data DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, DeploymentOfApp3.yaml, StatefulsetOfMySQL.yaml and StatefulsetOfElasticSearch.yaml) to replace the resource data of the first version of the application, and / or execute the target resource data (such as JobOfDataMigration.yaml in versions V2 and V3), iterate the resource data of the first version of the application, and thus update the first version of the application to the second version of the application.

[0138] In an optional implementation, before loading at least one target resource data to update the first version of the application based on the loading order of at least one target resource data, the application updating method provided in the embodiment of the present application may further include:

[0139] If any target resource data in the at least one target resource data corresponds to multiple loading orders in the loading order of the at least one target resource data, prompt information for indicating an update error is fed back.

[0140] Exemplarily, if any target resource data in at least one target resource data corresponds to multiple loading orders in the loading order of at least one target resource data, it indicates that the determined loading order contains a loop, and continuing to update at this time will cause an update exception, so an error may be reported. It is understandable that if each target resource data in at least one target resource data corresponds to one loading order in the loading order of at least one target resource data, that is, the determined loading order does not contain a loop, then the above S403 may be executed.

[0141] In the embodiment of the present application, by identifying the situation where a loop is included in the loading sequence of the target resource data, that is, the situation where a target resource is loaded repeatedly and reporting an error, update anomalies can be avoided.

[0142] For ease of understanding, the following Figure 8 The application program update method provided in each embodiment of the present application is integrated and described. For example, Figure 8 Schematic diagram of the application update process under Kubernetes provided by the embodiment of the present application. Figure 8 As shown, the application update method provided in the embodiment of the present application can be applied to a computing cluster managed by a container management platform. When the container management platform is K8s, the application can be deployed on the computing cluster by adding a deployment package with annotation information (HelmChart With Classified Annotations). By rendering the file values.yaml in the deployment package, the file rendering parameters under the resource data temples directory in the Chart can be obtained to obtain valid resource data for updating the application. The application update process can include the following steps 1 to 8:

[0143] 1. The user executes Helm upgrade foo xxxx;

[0144] 2. The Helm Library API is called;

[0145] 3. Pull the current version chart deployed in the environment to the target version chart of this update and all release version charts between the two from the Helm repository;

[0146] 4. Verify and process / read / render the templates in foo's Helm chart;

[0147] 5. Read templates Annotations. If classified-annotations exist, determine the function type and sort according to the annotations; otherwise, sort according to step 6;

[0148] 6. Sort by resource type, and finally sort by resource name in ascending order;

[0149] 7. Load Resources to Kubernetes in the determined order;

[0150] 8. Exit the client.

[0151] Above Figure 8 Embodiment and above Figure 4 The steps with the same functions in the embodiment and the optional embodiment are similar, the difference is that the description is different, and the same parts are not repeated here, and can be referred to Figure 4 Description of the embodiments and optional embodiments. Among them, the user executes helm upgrade foo xxxx, that is, the user issues an update instruction Helm upgrade (such as updating xxxx) for the application (such as foo) to K8s through Helm. After Helm verifies the template specification and completes the values.yaml rendering, it will perform the upgrade in order according to the resource type. Verification refers to the specification verification of the template in each chart. The client refers to a client that can issue update instructions for the application, such as a Helm client.

[0152] The present application also provides a container management platform. Fig. 9 is a structural block diagram of a container management platform provided in an embodiment of the present application. Fig. 9 As shown, an application is deployed on the container managed by the container management platform, and the container management platform includes:

[0153] An instruction receiving module, configured to receive an update instruction for updating a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version;

[0154] An annotation parsing module, used to determine at least one target resource data and a loading order of at least one target resource data according to annotation information in the resource data in each of the first version, the second version and the at least one intermediate version; wherein the annotation information is used to indicate a function type of the resource data in the update path from the first version to the second version;

[0155] The resource update module is used to update the resource data of the first version of the application program based on the loading order of at least one target resource data and at least one target resource data.

[0156] Among them, the indication receiving module, the annotation parsing module and the resource updating module can all be implemented by software, or can be implemented by hardware. Exemplarily, the following takes the indication receiving module as an example to introduce the implementation of the indication receiving module. Similarly, the implementation of the annotation parsing module and the resource updating module can refer to the implementation of the indication receiving module.

[0157] As an example of a software functional unit, the module indicates that the receiving module may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the indicating receiving module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.

[0158] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0159] As an example of a hardware functional unit, the indication receiving module may include at least one computing device, such as a server, etc. Alternatively, the indication receiving module may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0160] The multiple computing devices included in the indication receiving module can be distributed in the same region or in different regions. The multiple computing devices included in the indication receiving module can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the indication receiving module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0161] It should be noted that, in other embodiments, the indication receiving module can be used to execute any step in the application update method, the annotation parsing module can be used to execute any step in the application update method, and the resource update module can be used to execute any step in the application update method. The steps that the indication receiving module, the annotation parsing module, and the resource update module are responsible for implementing can be specified as needed. The full functions of the container management platform are realized by respectively implementing different steps in the application update method through the indication receiving module, the annotation parsing module, and the resource update module.

[0162] The present application also provides a computing device 100. Exemplarily, Fig.10 1 is a block diagram of a computing device 100 provided in an embodiment of the present application. Fig.10 As shown, the computing device 100 includes: a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate with each other through the bus 102. The computing device 100 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 100.

[0163] The bus 102 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 The bus 104 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 104 may include a path for transmitting information between various components of the computing device 100 (eg, the memory 106, the processor 104, and the communication interface 108).

[0164] The processor 104 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0165] The memory 106 may include a volatile memory, such as a random access memory (RAM). The processor 104 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0166] The memory 106 stores executable program codes, and the processor 104 executes the executable program codes to respectively implement the functions of the aforementioned indication receiving module, annotation parsing module, and resource updating module, thereby implementing the application updating method. That is, the memory 106 stores instructions for executing the application updating method.

[0167] The communication interface 103 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.

[0168] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0169] For example, Fig.11 This is one of the structural block diagrams of a computing device cluster provided in an embodiment of the present application. Fig.11 As shown, the computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the application program update method.

[0170] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the application updating method. In other words, the combination of one or more computing devices 100 may jointly execute instructions for executing the application updating method.

[0171] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster may store different instructions, which are respectively used to execute part of the functions of the container management platform. That is, the instructions stored in the memory 106 in different computing devices 100 may implement the functions of one or more modules among the instruction receiving module, the annotation parsing module and the resource updating module.

[0172] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. For example, Fig.12 This is one of the structural block diagrams of a computing device cluster provided in an embodiment of the present application. Fig.12 As shown, in a possible implementation, two computing devices 100A and 100B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 106 in the computing device 100A stores instructions for executing the functions of the indication receiving module. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the annotation parsing module and the resource updating module.

[0173] Fig.12 The connection method between the computing device clusters shown can be based on the consideration that the application update method provided in this application requires a large amount of resource data reading and parsing, as well as resource data sorting and other processing, so it is considered that the functions implemented by the annotation parsing module and the resource update module are handed over to the computing device 100B for execution.

[0174] It should be understood that Fig.12 The functions of the computing device 100A shown in FIG. 1 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.

[0175] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes an application update method or an application update method.

[0176] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by the computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the application update method, or instruct the computing device to execute the application update method.

[0177] Among them, the computing device, computing device cluster, computer storage medium or computer program product provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0178] Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above content is within the scope of the present application.

[0179] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for updating an application, characterized in that: Applied to a container management platform, where an application is deployed on a container managed by the container management platform, the method includes: Receiving an update instruction to update a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version; Determine at least one target resource data and a loading order of the at least one target resource data according to annotation information in the resource data of each of the first version, the second version and the at least one intermediate version; wherein the annotation information is used to indicate a function type of the resource data in the update path from the first version to the second version; The resource data of the first version of the application is updated based on the loading order of the at least one target resource data and the at least one target resource data.

2. The method according to claim 1, characterized in that The functional type includes one or more of a first type, a second type and a third type; The resource data of the first type is used to deploy the application of each version of the first version, the second version and the at least one intermediate version; The second type of resource data is used to initialize the second version of the application program; The third type of resource data is used to implement iteration of data from the first version to the second version of the application.

3. The method according to claim 2, characterized in that The step of determining at least one target resource data and a loading order of the at least one target resource data according to the annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version includes: Determine, in the resource data of each of the first version, the second version, and the at least one intermediate version, the resource data whose annotation information indicates the first type and whose corresponding version is the second version as the target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform; Determine, in the resource data of each of the first version, the second version and the at least one intermediate version, the resource data of which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, and determine the loading order of the target resource data to be loaded before the resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application; In the resource data under each of the first version, the second version and the at least one intermediate version, the resource data of the third type indicated by the annotation information is determined as the target resource data, and the loading order of all target resource data with the same name under the third type is determined according to the version order corresponding to the update indication.

4. The method according to claim 3, characterized in that After determining, in the resource data of each of the first version, the second version and the at least one intermediate version, the resource data whose annotation information indicates the second type and whose corresponding version is applicable to the current deployment environment as the target resource data, the method further includes: Obtaining a sequence weight of each target resource data of the second type; The loading order of each target resource data of the second type is determined according to the order weight.

5. The method according to claim 3 or 4, characterized in that: The step of determining at least one target resource data and a loading order of the at least one target resource data according to the annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version includes: In the resource data under each version of the first version, the second version and the at least one intermediate version, the resource data with empty annotation information and / or no functional type is determined as the target resource data, and the loading order of the target resource data is determined according to the resource data loading order specified by the container management platform.

6. The method according to any one of claims 1 to 5, characterized in that Before updating the resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data, the method further includes: If any one of the at least one target resource data corresponds to a plurality of loading orders in the loading order of the at least one target resource data, prompt information indicating an update error is fed back.

7. The method according to any one of claims 1 to 6, characterized in that The container management platform is Kubernetes; Before determining at least one target resource data and a loading order of the at least one target resource data according to annotation information in the resource data of each of the first version, the second version and the at least one intermediate version, the method further includes: Obtaining the deployment packages of each of the first version, the second version, and the at least one intermediate version applicable to the current deployment environment from the Helm repository; wherein the current deployment environment is the deployment environment of the first version of the application; The resource data in the acquired deployment package is read, and the annotation information in the resource data is read, until the resource data in the acquired deployment package is traversed.

8. A container management platform, characterized in that: An application is deployed on a container managed by the container management platform, and the container management platform includes: An instruction receiving module, configured to receive an update instruction for updating a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version; An annotation parsing module, used to determine at least one target resource data and a loading order of the at least one target resource data according to annotation information in the resource data of each of the first version, the second version and the at least one intermediate version; wherein the annotation information is used to indicate a function type of the resource data in the update path from the first version to the second version; The resource update module is used to update the resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data.

9. The container management platform according to claim 8, characterized in that: The functional type includes one or more of a first type, a second type and a third type; The resource data of the first type is used to deploy the application of each version of the first version, the second version and the at least one intermediate version; The second type of resource data is used to initialize the second version of the application program; The third type of resource data is used to implement iteration of data from the first version to the second version of the application.

10. The container management platform according to claim 9, characterized in that: The annotation parsing module is specifically used for: Determine, in the resource data of each of the first version, the second version, and the at least one intermediate version, the resource data whose annotation information indicates the first type and whose corresponding version is the second version as the target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform; Determine, in the resource data of each of the first version, the second version and the at least one intermediate version, the resource data of which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, and determine the loading order of the target resource data to be loaded before the resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application; In the resource data under each of the first version, the second version and the at least one intermediate version, the resource data of the third type indicated by the annotation information is determined as the target resource data, and the loading order of all target resource data with the same name under the third type is determined according to the version order corresponding to the update indication.

11. The container management platform according to claim 10, characterized in that: The annotation parsing module is also used for: After determining, in the resource data of each of the first version, the second version and the at least one intermediate version, the resource data of which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, obtaining the sequence weight of each target resource data of the second type; The loading order of each target resource data of the second type is determined according to the order weight.

12. The container management platform according to claim 10 or 11, characterized in that: The annotation parsing module is specifically used for: In the resource data under each version of the first version, the second version and the at least one intermediate version, the resource data with empty annotation information and / or no functional type is determined as the target resource data, and the loading order of the target resource data is determined according to the resource data loading order specified by the container management platform.

13. The container management platform according to any one of claims 8 to 12, characterized in that: The container management platform also includes an information output module, which is used to: Before the resource update module updates the resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data, if any target resource data among the at least one target resource data corresponds to multiple loading orders in the loading order of the at least one target resource data, prompt information for indicating an update error is fed back.

14. The container management platform according to any one of claims 8 to 13, characterized in that: The container management platform is Kubernetes; The container management platform further includes a data acquisition module, which is used to: Before the annotation parsing module determines at least one target resource data and the loading order of the at least one target resource data according to the annotation information in the resource data of each of the first version, the second version and the at least one intermediate version, the deployment package of each of the first version, the second version and the at least one intermediate version applicable to the current deployment environment is obtained from the Helm repository repository; wherein the current deployment environment is the deployment environment of the first version of the application program; The resource data in the acquired deployment package is read, and the annotation information in the resource data is read, until the resource data in the acquired deployment package is traversed.

15. A computing device cluster, characterized in that: include: at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: The method comprises a computer program, wherein when the computer program is executed in a computing device cluster, the computing device cluster is caused to execute the method according to any one of claims 1 to 7.

17. A computer program product, characterized in that The method comprises a computer program, which, when executed in a computing device cluster, enables the computing device cluster to execute the method according to any one of claims 1 to 7.