CN117806676A - Automatic configuration-based application upgrading method, device and equipment - Google Patents

Automatic configuration-based application upgrading method, device and equipment Download PDF

Info

Publication number
CN117806676A
CN117806676A CN202311760000.7A CN202311760000A CN117806676A CN 117806676 A CN117806676 A CN 117806676A CN 202311760000 A CN202311760000 A CN 202311760000A CN 117806676 A CN117806676 A CN 117806676A
Authority
CN
China
Prior art keywords
key
configuration file
parameter configuration
merging
value corresponding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311760000.7A
Other languages
Chinese (zh)
Inventor
黄虹
鲍立焕
高伟
周明伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202311760000.7A priority Critical patent/CN117806676A/en
Publication of CN117806676A publication Critical patent/CN117806676A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses an application upgrading method, device and equipment based on automatic configuration, wherein the method comprises the following steps: acquiring a merging strategy file from a first version upgrading packet, and executing a first merging operation on a first parameter configuration file in the first version upgrading packet and a designated key in a second parameter configuration file in a second version upgrading packet according to a target merging strategy configured for the designated key in the merging strategy file to obtain a first merging result, wherein the first version upgrading packet is used for updating the second version upgrading packet; according to the default merging strategy, performing a second merging operation on keys except the designated key in the first parameter configuration file and the second parameter configuration file to obtain a second merging result; and finishing the application upgrading based on the first merging result and the second merging result. The method and the device automatically complete the combination of the configuration items of the new version and the old version based on the preset combination strategy in the upgrade package when the upgrade is applied, and improve the application upgrade efficiency.

Description

Automatic configuration-based application upgrading method, device and equipment
Technical Field
The application belongs to the technical field of computers, and particularly relates to an application upgrading method, device and equipment based on automatic configuration.
Background
Kubernetes (abbreviated as k8 s) is an open-source container cluster management system for managing containerized applications on multiple hosts in a cloud platform, where yaml files are used to define various resource objects. Helm is an application package management tool based on k8s, and yaml file sets can be conveniently packaged into Chart and deployed to k8s. After application information described in Chart is deployed by Helm, an application instance in a container form can be generated in k8s.
Applications can be deployed and upgraded on the cluster quickly through the Chart package product, wherein key value pairs in a parameter configuration file (values. Yaml file) of Chart generally describe key value pairs needing frequent modification, and the key value pairs comprise configuration item keys and configuration value values, such as resource size, mirror image information and the like, so that in the upgrading process, new version configuration items and current version configuration items need to be combined. However, in the prior art, when the application is upgraded, on-site operation and maintenance personnel are required to perform manual intervention, configuration items before and after the upgrade are checked by manual comparison, necessary modification and configuration are performed manually, and then the new version configuration item and the current version configuration item of the application to be upgraded are combined to obtain a combination result so as to upgrade the application.
On the one hand, when more configuration items or more Chart packages to be deployed are provided, the method of manually modifying and configuring is performed in a manual mode, so that the application upgrading efficiency is lower. On the other hand, for a cross-version upgrade application, for example, an application upgrade from v1 version to v3 version, but a certain configuration item only exists in the Chart package of v2 version, the following problems need to be faced: (1) How the historical version of the Chart package is maintained and available to the background service. (2) The configuration item merging method for cross-version upgrading needs to meet the requirements of multiple version upgrades.
Disclosure of Invention
The application upgrading method, device and equipment based on automatic configuration are used for automatically completing configuration item combination of new and old versions of parameter configuration files based on a combination strategy preset in an upgrading package when the application is upgraded, and application upgrading efficiency is improved.
In a first aspect, the present application provides an application upgrade method based on an automation configuration, the method including:
acquiring a merging strategy file from a first version upgrade package, and executing a first merging operation on a designated key according to a target merging strategy configured for the designated key in the merging strategy file to obtain a first merging result; wherein the specified key comprises a key unique to a first parameter configuration file in the first version upgrade package relative to a second parameter configuration file in a second version upgrade package, or comprises a key unique to the second parameter configuration file relative to the first parameter configuration file, or comprises a key common to the first parameter configuration file and the second parameter configuration file; the first version upgrade package is used for updating the second version upgrade package;
According to a default merging strategy, performing a second merging operation on keys except the designated key in the first parameter configuration file and the second parameter configuration file to obtain a second merging result;
and finishing application upgrading based on the first merging result and the second merging result.
In a possible implementation manner, the merging strategy file includes at least one of the following merging strategies:
selecting a value corresponding to a key in the first parameter configuration file as the value corresponding to the designated key in the first merging result;
selecting a value corresponding to the key in the second parameter configuration file as the value corresponding to the designated key in the first merging result;
when the specified key further includes a key in the specified parameter configuration file, the merge policy file further includes the following merge policies:
selecting a value corresponding to the key in the designated parameter configuration file as the value corresponding to the designated key in the first merging result; the specified parameter configuration file is obtained from a specified version upgrade package, and the version of the specified version upgrade package is a version between the version corresponding to the first version upgrade package and the version corresponding to the second version upgrade package.
In one possible implementation, when the specified key includes a key that is common to the first parameter profile and the second parameter profile, the performing a first merging operation on the specified key includes:
when the target merging strategy is to select a value corresponding to a key in the first parameter configuration file as a value corresponding to the specified key in the first merging result, selecting a value corresponding to the specified key in the first parameter configuration file as a value corresponding to the specified key in the first merging result; or alternatively
When the target merging strategy is to select the value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result, selecting the value corresponding to the specified key in the second parameter configuration file as the value corresponding to the specified key in the first merging result.
In a possible implementation manner, when the specified key includes a key unique to the first parameter configuration file relative to the second parameter configuration file or includes a key unique to the second parameter configuration file relative to the first parameter configuration file, the performing a first merging operation on the specified key includes:
When the target merging strategy is to select a value corresponding to a key in the first parameter configuration file as a value corresponding to the specified key in the first merging result, reserving the value corresponding to the specified key in the first parameter configuration file as the value corresponding to the specified key in the first merging result;
when the target merging strategy is to select the value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result, reserving the value corresponding to the specified key in the second parameter configuration file as the value corresponding to the specified key in the first merging result.
In a possible implementation manner, when the specified key includes a key in the specified parameter configuration file, the performing a first merging operation on the specified key includes:
and reserving the value corresponding to the specified key in the specified parameter configuration file as the value corresponding to the specified key in the first merging result.
In a second aspect, the present application provides an application upgrade apparatus based on automated configuration, the apparatus comprising:
the first merging module is used for acquiring a merging strategy file from the first version upgrade package, and executing a first merging operation on the designated key according to a target merging strategy configured for the designated key in the merging strategy file to obtain a first merging result; wherein the specified key comprises a key unique to a first parameter configuration file in the first version upgrade package relative to a second parameter configuration file in a second version upgrade package, or comprises a key unique to the second parameter configuration file relative to the first parameter configuration file, or comprises a key common to the first parameter configuration file and the second parameter configuration file; the first version upgrade package is used for updating the second version upgrade package;
The second merging module is used for executing a second merging operation on the keys except the designated key in the first parameter configuration file and the second parameter configuration file according to a default merging strategy to obtain a second merging result;
and the upgrading module is used for finishing application upgrading based on the first merging result and the second merging result.
In a possible implementation manner, the merging strategy file includes at least one of the following merging strategies:
selecting a value corresponding to a key in the first parameter configuration file as the value corresponding to the designated key in the first merging result;
selecting a value corresponding to the key in the second parameter configuration file as the value corresponding to the designated key in the first merging result;
when the specified key further includes a key in the specified parameter configuration file, the merge policy file further includes the following merge policies:
selecting a value corresponding to the key in the designated parameter configuration file as the value corresponding to the designated key in the first merging result; the specified parameter configuration file is obtained from a specified version upgrade package, and the version of the specified version upgrade package is a version between the version corresponding to the first version upgrade package and the version corresponding to the second version upgrade package.
In a possible implementation manner, when the specified key includes a key that is common to the first parameter configuration file and the second parameter configuration file, the first merging module is specifically configured to:
when the target merging strategy is to select a value corresponding to a key in the first parameter configuration file as a value corresponding to the specified key in the first merging result, selecting a value corresponding to the specified key in the first parameter configuration file as a value corresponding to the specified key in the first merging result; or alternatively
When the target merging strategy is to select the value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result, selecting the value corresponding to the specified key in the second parameter configuration file as the value corresponding to the specified key in the first merging result.
In a possible implementation manner, when the specified key includes a key unique to the first parameter configuration file relative to the second parameter configuration file, or includes a key unique to the second parameter configuration file relative to the first parameter configuration file, the first merging module is specifically configured to:
When the target merging strategy is to select a value corresponding to a key in the first parameter configuration file as a value corresponding to the specified key in the first merging result, reserving the value corresponding to the specified key in the first parameter configuration file as the value corresponding to the specified key in the first merging result;
when the target merging strategy is to select the value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result, reserving the value corresponding to the specified key in the second parameter configuration file as the value corresponding to the specified key in the first merging result.
In a possible implementation manner, when the specified key includes a key in the specified parameter configuration file, the first merging module is specifically configured to:
and reserving the value corresponding to the specified key in the specified parameter configuration file as the value corresponding to the specified key in the first merging result.
In a third aspect, embodiments of the present application provide an electronic device comprising at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the automated configuration-based application upgrade method as provided in any one of the first aspects of the present application.
In a fourth aspect, embodiments of the present application further provide a computer readable storage medium, which when executed by a processor of a terminal device, enables the terminal device to perform an application upgrade method based on an automated configuration as provided in any one of the first aspects of the present application.
The technical scheme provided by the embodiment of the application at least brings the following beneficial effects:
when the application is upgraded from the old version to the new version, the appointed keys in the two version parameter configuration files are merged according to the merging strategy in the merging strategy file in the new version upgrading package, and other keys except the appointed keys in the two version parameter configuration files are merged according to the default merging strategy, so that the automatic merging of the parameter configuration files of the new version and the old version is realized, and the upgrading efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, and it is obvious that the drawings that are described below are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an application upgrading method based on automatic configuration according to an embodiment of the present application;
FIG. 2 is a logic diagram of an application upgrade based on an automated configuration according to an embodiment of the present application;
fig. 3 is a schematic diagram of an application upgrading device based on an automatic configuration according to an embodiment of the present application;
fig. 4 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Wherein the described embodiments are some, but not all embodiments of the present application, and the specific methods of operation in the method embodiments may also be applied to the apparatus embodiments or the system embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be noted that "a plurality of" is understood as "at least two" in the description of the present application. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. A is connected with B, and can be represented as follows: both cases of direct connection of A and B and connection of A and B through C. In addition, in the description of the present application, the words "first," "second," and the like are used merely for distinguishing between the descriptions and not be construed as indicating or implying a relative importance or order.
For a better understanding of the embodiments of the present application, the following description first explains the terms of art related to the embodiments of the present application.
(1) Kubernetes (abbreviated as k8 s) is an open-source container cluster management system for managing containerized applications on multiple hosts in a cloud platform, where yaml files are used to define various resource objects in k8s.
(2) Helm is an application package management tool based on k8s, and yaml file sets can be conveniently packaged into Chart and deployed to k8s. After application information described in Chart is deployed by Helm, an application instance in a container form can be generated in k8s.
Applications can be deployed and upgraded on the cluster quickly through the Chart package product, wherein key value pairs in a parameter configuration file (values. Yaml file) of Chart generally describe key value pairs needing frequent modification, and the key value pairs comprise configuration item keys and configuration value values, such as resource size, mirror image information and the like, so that in the upgrading process, new version configuration items and current version configuration items need to be combined.
However, in the prior art, when an application is upgraded, on-site operation and maintenance personnel are required to perform manual intervention, configuration items before and after upgrading are checked through manual comparison, necessary modification and configuration are performed manually, and then the new version configuration item and the current version configuration item of the application to be upgraded are combined to obtain a combination result so as to upgrade the application.
On the one hand, when more configuration items or more Chart packages to be deployed are provided, the method of manually modifying and configuring is performed in a manual mode, so that the application upgrading efficiency is lower. On the other hand, for a cross-version upgrade application, for example, an application upgrade from v1 version to v3 version, but a certain configuration item only exists in the Chart package of v2 version, the following problems need to be faced: (1) How the historical version of the Chart package is maintained and available to the background service. (2) The configuration item merging method for cross-version upgrading needs to meet the requirements of multiple version upgrades.
In view of the above problems, the application upgrading method, device and equipment based on automatic configuration are provided, and when an application is upgraded from an old version to a new version, specified keys in two version parameter configuration files are combined according to a combination strategy in a combination strategy file in a new version upgrading packet, other keys except the specified keys in the two version parameter configuration files are combined according to a default combination strategy, so that the automatic combination of the parameter configuration files of the two new and old versions is realized, and the application upgrading efficiency is improved.
Embodiments of the present disclosure are described in further detail below with reference to the accompanying drawings.
As shown in fig. 1, a flowchart of an application upgrading method based on an automatic configuration is provided in an embodiment of the present application, where the flowchart may be executed by an application upgrading device based on the automatic configuration, and the device may be implemented by software and/or hardware. As shown in fig. 1, the flow includes the following steps S101 to S103.
In step S101, a merging policy file is obtained from a first version upgrade package, and a first merging operation is performed on a designated key according to a target merging policy configured for the designated key in the merging policy file, so as to obtain a first merging result;
wherein the designating key includes: a key unique to a first parameter configuration file in the first version upgrade package relative to a second parameter configuration file in the second version upgrade package, or a key unique to the second parameter configuration file relative to the first parameter configuration file, or a key common to the first parameter configuration file and the second parameter configuration file; the first version upgrade package is used for updating the second version upgrade package.
Optionally, the merge policy set may be stored in a file (such as a merge. Schema. Json file), or may be stored in a list, where a merge policy for a specified key is configured in the merge policy set, and each merge policy may include a name of the specified key, a specific merge policy description content, an additional function, and other parameters, so as to perform a required merge operation when the merge policy set is called.
Optionally, the merging policy file includes at least one of the following merging policies:
the first merging strategy is to select the value corresponding to the key in the first parameter configuration file as the value corresponding to the appointed key in the first merging result;
and selecting a value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result by using a second merging strategy.
The first merging policy may specify which keys may be selected from the values corresponding to the keys in the first parameter configuration file; the second merging policy may specify which keys may be selected from the values corresponding to the keys in the second parameter configuration file.
As a possible implementation, when the designated key includes a key shared by the first parameter configuration file and the second parameter configuration file, performing a first merging operation on the designated key includes:
when the target merging strategy is a first merging strategy, selecting a value corresponding to the designated key in a first parameter configuration file as the value corresponding to the designated key in the first merging result; or alternatively
When the target merging strategy is a second merging strategy, selecting a value corresponding to the designated key in the second parameter configuration file as the value corresponding to the designated key in the first merging result.
As a possible implementation, when the designated key includes a key unique to the first parameter configuration file relative to the second parameter configuration file, or includes a key unique to the second parameter configuration file relative to the first parameter configuration file, performing a first merging operation on the designated key includes:
when the target merging strategy is a first merging strategy, reserving a value corresponding to the designated key in a first parameter configuration file as the value corresponding to the designated key in the first merging result;
when the target merging strategy is the second merging strategy, reserving a value corresponding to the appointed key in a second parameter configuration file as the value corresponding to the appointed key in the first merging result.
Taking the first merge strategy as an example:
assume that for application container1 to be upgraded, a first parameter configuration file obtained when configuration items are combined is: { "image": "a", "b": [ { "key1": "test1" }, { "key2": "test2" } ]; the second parameter configuration file is: { "image": "1" };
designating a key "image" to use a first merge policy (which may be an overlay policy), that is, the "image" needs to be configured to select a value corresponding to the "image" in the first parameter configuration file as the value corresponding to the "image" in the merge result; the merge policy (mergerstrategy) may be configured in the merge policy file to { "containers": { "containers 1": { "image": { "mergerstrategy": "overlay" } } } } } }, so that the output merge result is: { "image": "a", "b": [ { "key1": "test1" }, { "key2": "test2" } ] }.
In some embodiments, when the application is upgraded from the current version, the application may be upgraded across versions or not, that is, there may be other upgraded versions or no other upgraded versions between the upgraded version of the first version upgrade package and the upgraded version of the second version upgrade package.
In one or more embodiments, when the specified key further includes a key in a specified parameter configuration file, the merge policy file further includes the following merge policies:
and selecting a value corresponding to the key in the specified parameter configuration file as a value corresponding to the specified key in the first merging result.
As a possible implementation, when the designated key includes a key in the designated parameter configuration file, performing a first merging operation on the designated key includes:
and reserving the value corresponding to the specified key in the specified parameter configuration file as the value corresponding to the specified key in the first merging result.
The specified parameter configuration file is obtained from a specified version upgrade package, and the version of the specified version upgrade package is a version between the version corresponding to the first version upgrade package and the version corresponding to the second version upgrade package.
For example, if the upgrade version of the first version upgrade package is v5 and the upgrade version of the second version upgrade package is v2, the application needs to be upgraded from the currently-located version v2 to be upgraded to the v5 version, i.e. the cross-version upgrade.
However, when the third parameter configuration file corresponding to the middle v3 version is newly added with a configuration item "add_3" relative to the v2 version, and only the configuration item "add_3" exists in the third parameter configuration file corresponding to the v3 version, the update of the key value pair related to the configuration item "add_3" is not configured in the first parameter configuration file of the latest v5 version.
Therefore, the "add_3" and the corresponding key value need to be obtained from the third parameter configuration file corresponding to the v3 version, and added to the merging result of the second parameter configuration file and the first parameter configuration file, so as to complete cross-version upgrade, and similarly, if the configuration item "del_4" is deleted in the v4 version, the configuration item "del_4" needs to be deleted in the merging result of the second parameter configuration file and the first parameter configuration file, where the merging policy configured in the merging policy file may include a cross-version policy (may be a cross version policy) as follows: { "crossVersion": { "locations" [ { "add_3": "v3" }, { "del_4": "v4" } ] }.
According to the configuration, when cross-version upgrading is performed, a v3 upgrading packet of a v3 version is obtained, a third parameter configuration file is obtained from the v3 upgrading packet to obtain an add_3 and a corresponding key value, and the add_3 and the corresponding key value are added into a merging result of the second parameter configuration file and the first parameter configuration file; and the same principle as the description of the del-4, returning a null value, and deleting the configuration item del-4 in the combination result of the second parameter configuration file and the first parameter configuration file.
In step S102, according to a default merging policy, performing a second merging operation on keys except the designated key in the first parameter configuration file and the second parameter configuration file, to obtain a second merging result;
in some embodiments, the first parameter profile comprises N first keys, the second parameter profile comprises M second keys, and both N and M are integers greater than 0;
the keys other than the designated key may be keys shared by the N first keys and the M second keys, may be keys unique to the M second keys from among the N first keys, or may be keys unique to the N first keys from among the M second keys.
In some embodiments, the default merging policy may be selecting a value corresponding to a key in the first parameter configuration file when a key other than the specified key is a key shared by the first parameter configuration file and the second parameter configuration file; when the key except the specified key is a key unique to the first parameter configuration file relative to the second parameter configuration file or a key unique to the second parameter configuration file relative to the first parameter configuration file, reserving a key value pair corresponding to the key except the specified key; namely, the common key of the N first keys and the M second keys is selected, the value in the N first keys is taken, and the rest non-common keys are taken as a union set, so that a second merging result is obtained.
In some embodiments, the default merging policy may also be selecting a value corresponding to a key in the second parameter configuration file when a key other than the specified key is a key shared by the first parameter configuration file and the second parameter configuration file; when the key except the specified key is a key unique to the first parameter configuration file relative to the second parameter configuration file or a key unique to the second parameter configuration file relative to the first parameter configuration file, reserving a key value pair corresponding to the key except the specified key; namely, the common key of the N first keys and the M second keys is selected, the value in the M second keys is taken, and the rest non-common keys are taken as a union set, so that a second merging result is obtained.
In some embodiments, the default merging policy may be other merging policies configured according to actual situations and requirements, which is not limited herein.
In step S103, the application upgrade is completed based on the first merging result and the second merging result.
And after the first merging result is obtained and the second merging result is obtained based on the default merging policy, the application upgrading can be completed based on the first merging result and the second merging result.
In the embodiment of the application, when the application is upgraded from the old version to the new version, the designated keys in the two version parameter configuration files are merged according to the merging policies in the merging policy files in the new version upgrading package, and other keys which are not designated by the merging policies in the two version parameter configuration files except the designated keys are merged according to the default merging policies, so that compared with the prior art, the automatic merging of the two new and old version parameter configuration files is realized, the application upgrading efficiency is improved, meanwhile, for cross-version upgrading, the designated keys also comprise the designated keys in the other intermediate version parameter configuration files, and the cross-upgrading is realized only by one-time upgrading, so that the upgrading cost and the consumption of computer resources are reduced.
Based on the method shown in fig. 1, fig. 2 is a logic schematic diagram of an application upgrade based on an automation configuration according to an embodiment of the present application. As shown in fig. 2, according to a target merging strategy configured for a designated key in a merging strategy file obtained from a first version upgrade package, performing a first merging operation on the designated key to obtain a first merging result, wherein the designated key may include a key unique to a first parameter configuration file in the first version upgrade package relative to a second parameter configuration file in the second version upgrade package, or include a key unique to the second parameter configuration file relative to the first parameter configuration file, or include a key common to the first parameter configuration file and the second parameter configuration file, or include a key in a parameter configuration file in a designated intermediate version upgrade package; according to a default merging strategy, performing a second merging operation on keys except the designated key in the first parameter configuration file and the second parameter configuration file to obtain a second merging result; and finishing application upgrading based on the first merging result and the second merging result.
Based on the same inventive concept, the embodiment of the present application further provides an application upgrading device based on automatic configuration, as shown in fig. 3, where the device includes:
the first merging module 301 is configured to obtain a merging policy file from the first version upgrade package, and execute a first merging operation on a specified key according to a target merging policy configured for the specified key in the merging policy file, so as to obtain a first merging result;
wherein the specified key comprises a key unique to a first parameter configuration file in the first version upgrade package relative to a second parameter configuration file in a second version upgrade package, or comprises a key unique to the second parameter configuration file relative to the first parameter configuration file, or comprises a key common to the first parameter configuration file and the second parameter configuration file; the first version upgrade package is used for updating the second version upgrade package;
a second merging module 302, configured to execute a second merging operation on the keys except the designated key in the first parameter configuration file and the second parameter configuration file according to a default merging policy, so as to obtain a second merging result;
and the upgrading module 303 is configured to complete application upgrading based on the first merging result and the second merging result.
As a possible implementation manner, the merging strategy file includes at least one of the following merging strategies:
selecting a value corresponding to a key in the first parameter configuration file as the value corresponding to the designated key in the first merging result;
selecting a value corresponding to the key in the second parameter configuration file as the value corresponding to the designated key in the first merging result;
when the specified key further includes a key in the specified parameter configuration file, the merge policy file further includes the following merge policies:
selecting a value corresponding to the key in the designated parameter configuration file as the value corresponding to the designated key in the first merging result; the specified parameter configuration file is obtained from a specified version upgrade package, and the version of the specified version upgrade package is a version between the version corresponding to the first version upgrade package and the version corresponding to the second version upgrade package.
As a possible implementation manner, when the specified key includes a key that is common to the first parameter configuration file and the second parameter configuration file, the first merging module 301 is specifically configured to:
when the target merging strategy is to select a value corresponding to a key in the first parameter configuration file as a value corresponding to the specified key in the first merging result, selecting a value corresponding to the specified key in the first parameter configuration file as a value corresponding to the specified key in the first merging result; or alternatively
When the target merging strategy is to select the value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result, selecting the value corresponding to the specified key in the second parameter configuration file as the value corresponding to the specified key in the first merging result.
As a possible implementation manner, when the specified key includes a key unique to the first parameter configuration file relative to the second parameter configuration file, or includes a key unique to the second parameter configuration file relative to the first parameter configuration file, the first merging module 301 is specifically configured to:
when the target merging strategy is to select a value corresponding to a key in the first parameter configuration file as a value corresponding to the specified key in the first merging result, reserving the value corresponding to the specified key in the first parameter configuration file as the value corresponding to the specified key in the first merging result;
when the target merging strategy is to select the value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result, reserving the value corresponding to the specified key in the second parameter configuration file as the value corresponding to the specified key in the first merging result.
As a possible implementation manner, when the specified key includes a key in the specified parameter configuration file, the first merging module 301 is specifically configured to:
and reserving the value corresponding to the specified key in the specified parameter configuration file as the value corresponding to the specified key in the first merging result.
It should be noted that, the above device provided in the embodiment of the present application can implement all the method steps in the embodiment of the method and achieve the same technical effects, and the details of the same parts and the advantages as those of the embodiment of the method in the embodiment are not described here.
Based on the same inventive concept, the present application also provides an electronic device 400, as shown in fig. 4, comprising at least one processor 402; and a memory 401 communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the automated configuration-based application upgrade method described above.
The memory 401 is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory 401 may be a volatile memory (RAM) such as a random-access memory (RAM); the memory may also be a nonvolatile memory (non-volatile memory), such as a flash memory (flash memory), a Hard Disk Drive (HDD) or a Solid State Drive (SSD); but may be any one or a combination of any of the above volatile and nonvolatile memories.
The processor 402 may be a central processing unit (central processing unit, CPU for short), a network processor (network processor, NP for short), or a combination of CPU and NP. But also a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD for short), a field-programmable gate array (field-programmable gate array, FPGA for short), general-purpose array logic (generic array logic, GAL for short), or any combination thereof.
Based on the same inventive concept, the embodiments of the present application provide a computer program medium storing a computer program for causing a computer to execute the above-described application upgrade method based on an automated configuration.
The storage medium may be a non-transitory computer readable storage medium, which may be, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
The foregoing has described in detail the technical solutions provided herein, and specific examples have been used to illustrate the principles and embodiments of the present application, where the above examples are only used to help understand the methods and core ideas of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It should be understood that embodiments of the present application may be provided as methods, systems, or computer program products as would be understood by one of skill in the art of computer program instructions. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the application may take the form of one or more computer-usable storage media having computer-usable program code embodied therein (for each and every flow and/or block of the flowchart and/or block diagram, or a combination of flows and/or blocks of the flowchart and/or block diagram, the computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow(s) and/or block diagram block(s).
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (10)

1. An application upgrading method based on automatic configuration, which is characterized by comprising the following steps:
acquiring a merging strategy file from a first version upgrade package, and executing a first merging operation on a designated key according to a target merging strategy configured for the designated key in the merging strategy file to obtain a first merging result; wherein the specified key comprises a key unique to a first parameter configuration file in the first version upgrade package relative to a second parameter configuration file in a second version upgrade package, or comprises a key unique to the second parameter configuration file relative to the first parameter configuration file, or comprises a key common to the first parameter configuration file and the second parameter configuration file; the first version upgrade package is used for updating the second version upgrade package;
according to a default merging strategy, performing a second merging operation on keys except the designated key in the first parameter configuration file and the second parameter configuration file to obtain a second merging result;
and finishing application upgrading based on the first merging result and the second merging result.
2. The method of claim 1, wherein the merge policy file includes at least one of the following merge policies:
Selecting a value corresponding to a key in the first parameter configuration file as the value corresponding to the designated key in the first merging result;
selecting a value corresponding to the key in the second parameter configuration file as the value corresponding to the designated key in the first merging result;
when the specified key further includes a key in the specified parameter configuration file, the merge policy file further includes the following merge policies:
selecting a value corresponding to the key in the designated parameter configuration file as the value corresponding to the designated key in the first merging result; the specified parameter configuration file is obtained from a specified version upgrade package, and the version of the specified version upgrade package is a version between the version corresponding to the first version upgrade package and the version corresponding to the second version upgrade package.
3. The method of claim 2, wherein when the designated key comprises a key common to the first parameter profile and the second parameter profile, the performing a first merge operation on the designated key comprises:
when the target merging strategy is to select a value corresponding to a key in the first parameter configuration file as a value corresponding to the specified key in the first merging result, selecting a value corresponding to the specified key in the first parameter configuration file as a value corresponding to the specified key in the first merging result; or alternatively
When the target merging strategy is to select the value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result, selecting the value corresponding to the specified key in the second parameter configuration file as the value corresponding to the specified key in the first merging result.
4. The method of claim 2, wherein the designated key comprises a key that is unique to the first parameter profile relative to the second parameter profile, or comprises a key that is unique to the second parameter profile relative to the first parameter profile, the performing a first merge operation on the designated key comprising:
when the target merging strategy is to select a value corresponding to a key in the first parameter configuration file as a value corresponding to the specified key in the first merging result, reserving the value corresponding to the specified key in the first parameter configuration file as the value corresponding to the specified key in the first merging result;
when the target merging strategy is to select the value corresponding to the key in the second parameter configuration file as the value corresponding to the specified key in the first merging result, reserving the value corresponding to the specified key in the second parameter configuration file as the value corresponding to the specified key in the first merging result.
5. The method of claim 2, wherein when the specified key comprises a key in the specified parameter configuration file, the performing a first merge operation on the specified key comprises:
and reserving the value corresponding to the specified key in the specified parameter configuration file as the value corresponding to the specified key in the first merging result.
6. An application upgrade apparatus based on automated configuration, comprising:
the first merging module is used for acquiring a merging strategy file from the first version upgrade package, and executing a first merging operation on the designated key according to a target merging strategy configured for the designated key in the merging strategy file to obtain a first merging result; wherein the specified key comprises a key unique to a first parameter configuration file in the first version upgrade package relative to a second parameter configuration file in a second version upgrade package, or comprises a key unique to the second parameter configuration file relative to the first parameter configuration file, or comprises a key common to the first parameter configuration file and the second parameter configuration file; the first version upgrade package is used for updating the second version upgrade package;
The second merging module is used for executing a second merging operation on the keys except the designated key in the first parameter configuration file and the second parameter configuration file according to a default merging strategy to obtain a second merging result;
and the upgrading module is used for finishing application upgrading based on the first merging result and the second merging result.
7. The apparatus of claim 6, wherein the merge policy file includes at least one of the following merge policies:
selecting a value corresponding to a key in the first parameter configuration file as the value corresponding to the designated key in the first merging result;
selecting a value corresponding to the key in the second parameter configuration file as the value corresponding to the designated key in the first merging result;
when the specified key further includes a key in the specified parameter configuration file, the merge policy file further includes the following merge policies:
selecting a value corresponding to the key in the designated parameter configuration file as the value corresponding to the designated key in the first merging result; the specified parameter configuration file is obtained from a specified version upgrade package, and the version of the specified version upgrade package is a version between the version corresponding to the first version upgrade package and the version corresponding to the second version upgrade package.
8. The apparatus of claim 7, wherein when the specified key comprises a key in the specified parameter configuration file, the first merge module performs a first merge operation on the specified key comprising:
and reserving the designated key and the value corresponding to the designated key in the designated parameter configuration file as the value corresponding to the designated key in the first merging result.
9. An electronic device comprising at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
10. A computer readable storage medium storing computer instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1-5.
CN202311760000.7A 2023-12-19 2023-12-19 Automatic configuration-based application upgrading method, device and equipment Pending CN117806676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311760000.7A CN117806676A (en) 2023-12-19 2023-12-19 Automatic configuration-based application upgrading method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311760000.7A CN117806676A (en) 2023-12-19 2023-12-19 Automatic configuration-based application upgrading method, device and equipment

Publications (1)

Publication Number Publication Date
CN117806676A true CN117806676A (en) 2024-04-02

Family

ID=90426764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311760000.7A Pending CN117806676A (en) 2023-12-19 2023-12-19 Automatic configuration-based application upgrading method, device and equipment

Country Status (1)

Country Link
CN (1) CN117806676A (en)

Similar Documents

Publication Publication Date Title
CN108566290B (en) Service configuration management method, system, storage medium and server
US9904525B2 (en) Managing reusable artifacts using placeholders
AU2013273685B2 (en) Enterprise migration planning information repository
US10412195B2 (en) Risk-aware service management stack transformation during workload migration
CN110162334B (en) Code management method, device and storage medium
CN111782339A (en) Container creation method and device, electronic equipment and storage medium
CN105159718A (en) Firmware updating method and device
EP2778962A1 (en) Silo-aware databases
US9223813B2 (en) Versioning for configurations of reusable artifacts
US10909487B2 (en) Workflow customization
CN107256167B (en) Upgrade control method and upgrade control equipment applied to application system migration
CN112395339A (en) Method and device for checking data access between systems, computer equipment and storage medium
CN117806676A (en) Automatic configuration-based application upgrading method, device and equipment
US20220229689A1 (en) Virtualization platform control device, virtualization platform control method, and virtualization platform control program
CN110784353A (en) Network element equipment configuration data migration method and device
CN113535206B (en) Multi-version code upgrading method and system
US20220078228A1 (en) Infrastructure imports for an information technology platform
CN112671567B (en) 5G core network topology discovery method and device based on service interface
CN112418796B (en) Sub-process task node activation method and device, electronic equipment and storage medium
CN114553859A (en) BMC configuration management method and device, electronic equipment and storage medium
CN113867778A (en) Method and device for generating mirror image file, electronic equipment and storage medium
CN111950232B (en) Method and device for automatically switching number segments
US11977926B1 (en) Deployment of pod cohorts
CN115188190B (en) Updating method and device of traffic data processing mode and vehicle-road cooperative system
CN113129049B (en) File configuration method and system for model training and application

Legal Events

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