Application program updating method, device, electronic device and storage medium

CN116594764BActive Publication Date: 2025-04-04QINGDAO ZHONGKE SHUGUANG TECH SERVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310440499.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2025-04-04
Estimated Expiration
2043-04-23

Smart Images

  • Figure CN116594764B_ABST
    Figure CN116594764B_ABST
Patent Text Reader

Abstract

The present invention discloses an application update method, device, electronic device and storage medium, and relates to the field of cluster technology. The method includes: creating a custom controller and allocating custom resources to the custom controller; monitoring the update status of the configuration dictionary according to the configuration relationship through the custom controller, and updating the configuration of the application when the update information of the configuration dictionary is monitored; and executing the container group update operation of the application according to the monitored configuration update information of the application by the management controller. The technical solution of the embodiment of the present invention monitors the update of the configuration dictionary and updates the configuration of the application through the custom controller, and does not require the application to have any active or passive detection function, and has good universal applicability and high configuration update efficiency. In addition, the present application only needs to set one or a limited number of custom controllers in the management node, which reduces the occupation of cluster resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cluster technology, and in particular to an application updating method, device, electronic device and storage medium. Background Art

[0002] As an open source system for managing containerized applications, Kubernetes (k8s) components are widely used in cluster application deployment, and configuration dictionaries are a common way to load configuration files for deployed applications in k8s components.

[0003] Although the configuration dictionary supports hot update function, most applications do not have the function of detecting configuration dictionary updates. Therefore, even if the configuration dictionary is changed, the application still cannot respond immediately. In order to solve the above problem, the existing technology usually starts the business container and the sidecar container at the same time when deploying the container group of the application, and the sidecar container obtains the configuration dictionary mapped to the business container.

[0004] However, after deploying the sidecar container, the application still needs to be able to receive signals and perform hot updates, but most business applications do not support this function. At the same time, the update of business applications depends on the update of the configuration files mounted to the application, and the update of the configuration files depends on the update of the corresponding configuration dictionary. When the configuration dictionary changes, the update of the configuration file does not take effect immediately, and there is a long waiting time, which often leads to update delays in the container group of business applications. Summary of the invention

[0005] The present invention provides an application updating method, device, electronic device and storage medium to solve the problem of untimely updating of configuration data of the application.

[0006] According to one aspect of the present invention, there is provided a method for updating an application program, comprising:

[0007] Creating a custom controller and allocating custom resources to the custom controller; wherein the custom resources are used to record the configuration relationship between the configuration dictionary and the application;

[0008] Monitoring the update status of the configuration dictionary according to the configuration relationship through the custom controller, and updating the configuration of the application when the update information of the configuration dictionary is monitored;

[0009] The management controller executes the container group update operation of the application according to the monitored configuration update information of the application.

[0010] After creating a custom controller and allocating custom resources to the custom controller, the method further includes: in response to obtaining a configuration relationship update request of the custom controller, updating the configuration relationship between the configuration dictionary recorded by the custom resource and the application program. Based on the configuration relationship update request, the monitoring object of the custom controller can be adjusted according to different monitoring requirements of the user, and the monitoring scope of the custom controller can be expanded.

[0011] The creation of a custom controller and allocation of custom resources to the custom controller specifically include: traversing each application in the cluster and obtaining the monitoring type of each application; wherein the monitoring type includes active monitoring application, passive monitoring application and non-monitoring application; if it is determined that the current application is an active monitoring application, the current application is not used as the monitoring object of the custom controller; if it is determined that the current application is a passive monitoring application or a non-monitoring application, the current application is used as the monitoring object of the custom controller. If the current application is an active monitoring application, its code logic itself has the configuration file detection function, and it does not need to be included in the monitoring scope of the custom controller, avoiding the occurrence of redundant detection; if the current application is a non-monitoring application, the application is used as a monitoring object to complete the configuration update of the application in time; if the current application is a passive monitoring application, the custom controller created in the management node can not only obtain the configuration dictionary update information in time through the k8s component service interface, and then complete the real-time update of the application configuration data, but also release multiple sidecar containers in the cluster, greatly saving cluster resources.

[0012] If it is determined that the current application is a passive monitoring application or an unmonitored application, the current application is used as the monitoring object of the custom controller, specifically including: if it is determined that the current application is a passive monitoring application, and the average passive monitoring time of the current application is greater than or equal to the average monitoring time of the custom controller, the current application is used as the monitoring object of the custom controller, and the original monitoring tool corresponding to the current application is released. If the average passive monitoring time is longer, the current application is used as the monitoring object of the custom controller to further improve the configuration update efficiency of the current application; if the average passive monitoring time is shorter, the current application is not used as the monitoring object of the custom controller to ensure that the current application maintains the original high configuration update efficiency; if the average passive monitoring time is equal to the average monitoring time, the current application can also be used as the monitoring object of the custom controller, thereby releasing the cluster resources occupied by the sidecar container while maintaining the configuration update efficiency unchanged.

[0013] After determining that the current application is an active monitoring application, it also includes: if it is determined that the average active monitoring time of the current application is greater than or equal to the first preset time, or the real-time level of the current application is greater than or equal to the first preset level, the current application is used as the monitoring object of the custom controller; if a monitoring request initiated by the current application is detected, the monitoring request initiated by the current application is not responded to. The real-time update requirements of the current application configuration data are met. The current application is not used as the monitoring object of the custom controller, including: if it is determined that the average active monitoring time of the current application is less than the first preset time, and the real-time level of the current application is less than the first preset level, the current application is not used as the monitoring object of the custom controller. The update operation of the configuration file can be performed based on the active detection function of the current application itself, which not only reduces the number of monitoring objects of the custom controller, but also avoids the occurrence of redundant detection.

[0014] The first preset time is greater than the average monitoring time of the custom controller. The first preset time is set to be greater than the average monitoring time, so that for applications with a shorter detection time, even if their detection time is slightly greater than the average monitoring time, they are not monitored by the custom controller, thereby avoiding the occurrence of redundant detection; and for applications with a longer detection time, they are monitored by the custom controller, thereby greatly improving the configuration data update efficiency of the current application.

[0015] The creation of a custom controller and allocation of custom resources to the custom controller include: creating multiple different custom controllers and allocating different custom resources to each of the custom controllers; wherein each of the custom controllers is matched with an application of a different monitoring type; the monitoring priorities of active monitoring applications, passive monitoring applications and non-monitoring applications are increased in sequence; if monitoring requests from multiple custom controllers are detected, the monitoring requests of each of the custom controllers are responded to in sequence according to the monitoring priorities of the monitoring types corresponding to each of the custom controllers. Different response priorities are set for different custom controllers according to the different monitoring types of different applications. When multiple monitoring requests are detected at the same time, it can ensure priority response to non-monitoring applications that do not have any update detection function, and can also ensure secondary response to passive monitoring applications that take a long time to respond, thereby ensuring the timely update of configuration data for all applications in the cluster to the greatest extent.

[0016] According to another aspect of the present invention, there is provided an application updating device, comprising:

[0017] A controller creation module, used to create a custom controller and allocate custom resources to the custom controller; wherein the custom resources are used to record the configuration relationship between the configuration dictionary and the application;

[0018] A configuration update execution module, used to monitor the update status of the configuration dictionary according to the configuration relationship through the custom controller, and perform configuration update on the application when the update information of the configuration dictionary is monitored;

[0019] The container group update execution module is used to execute the container group update operation of the application program according to the configuration update information of the application program monitored by the management controller.

[0020] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0021] at least one processor; and

[0022] a memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application program update method described in any embodiment of the present invention.

[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application update method described in any embodiment of the present invention when executed.

[0025] The technical solution of the embodiment of the present invention monitors the update of the configuration dictionary through the created custom controller, thereby completing the configuration update of the application, and then executes the container group update operation of the application based on the monitored configuration update information of the application through the management controller. Compared with setting the sidecar container in the container group, the present application uses the custom controller to monitor the update of the configuration dictionary and the configuration update of the application, which does not require the application to have any active or passive detection function, and has good universal applicability. At the same time, the configuration dictionary monitoring based on the custom controller improves the configuration update efficiency of the application. In addition, compared with the need to set up a sidecar container in each container group, the present application only needs to set up one or a limited number of custom controllers in the management node, which greatly reduces the occupancy of cluster resources.

[0026] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0028] Figure 1A is a flowchart of a method for updating an application program provided according to Embodiment 1 of the present invention;

[0029] Figure 1B is a schematic diagram of the structure of a management node provided according to Embodiment 1 of the present invention;

[0030] Figure 2 is a flow chart of a method for updating an application program provided according to Embodiment 2 of the present invention;

[0031] Figure 3 is a flowchart of a method for updating an application program provided according to Embodiment 3 of the present invention;

[0032] Figure 4 is a schematic diagram of the structure of an application updating device provided according to a fourth embodiment of the present invention;

[0033] Figure 5 The present invention is a schematic diagram of the structure of an electronic device for implementing the method for updating an application program according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0036] Embodiment 1

[0037] Figure 1A This is a flowchart of an application update method provided in the first embodiment of the present invention. This embodiment can be applied to update the configuration data of an application deployed in a k8s component. The method can be executed by an application update device. The application update device can be implemented in the form of hardware and / or software. The application update device is configured in a management node in a cluster. Typically, it can be configured in a management server in a server cluster. The cluster includes at least one management node and at least one working node. Figure 1A As shown, the method includes:

[0038] S101. Create a custom controller and allocate custom resources to the custom controller; wherein the custom resources are used to record the configuration relationship between a configuration dictionary and an application.

[0039] Custom controllers can be created based on controller creation requests issued by users, with Figure 1B For example, when the management node obtains a controller creation request issued by a user through the service interface of the k8s component (i.e., kube-APIserver), a custom controller is created in the management node. The above-mentioned custom controller is different from the native controller in the management controller (i.e., controller-manager) in the k8s component, and is used to monitor changes in user-defined resources; custom resources are extensible resources open to users or specific functions by the k8s component. The custom resources in the embodiment of the present invention include storage resources in the data storage module (i.e., ETCD module); wherein the ETCD module is a functional module in the k8s component for persistent storage of data.

[0040] The application in the embodiment of the present invention is an application deployed in a cluster through a k8s component, and the application may be deployed in one or more electronic devices in the cluster; a configuration dictionary is a resource name in a k8s component, which stores configuration data in the form of a key-value pair; the configuration dictionary is used to inject configuration data into the container group where the application is located; the data stored in the configuration dictionary object can be referenced by a volume of the configuration dictionary type and used by the containerized application running in the container group; the configuration dictionary matches the application one by one, and the same application in different electronic devices corresponds to the same configuration dictionary; wherein the container group is the smallest scheduling unit in the k8s component, one application corresponds to one container group, one container can include multiple containers, and containers in the same container group share a network stack and a file system.

[0041] When the management node receives a controller creation request from a user, if the controller creation request does not include the configuration relationship between the configuration dictionary and the application, only custom resources are allocated to the custom controller, and no information is temporarily recorded in the custom resources; if the controller creation request already includes the configuration relationship between the configuration dictionary and the application, after custom resources are allocated to the custom controller, the corresponding configuration relationship can be recorded in the custom resources; wherein the configuration relationship reflects which applications deployed in the cluster are monitored by the custom controller, and the configuration dictionary that matches the application.

[0042] Optionally, in an embodiment of the present invention, after creating a custom controller and allocating custom resources to the custom controller, it also includes: in response to obtaining a configuration relationship update request of the custom controller, updating the configuration relationship between the configuration dictionary recorded in the custom resource and the application. The monitoring object of each custom controller can not only be set up based on the configuration relationship included in the creation request when it is created, but can also be modified through a configuration relationship update request subsequently issued by the user, thereby adjusting the monitoring object of the custom controller based on the configuration relationship update request according to the different monitoring needs of the user and expanding the monitoring scope of the custom controller.

[0043] S102: Monitor the update status of the configuration dictionary according to the configuration relationship through the custom controller, and update the configuration of the application when the update information of the configuration dictionary is monitored.

[0044] When the management node obtains a configuration dictionary update request, it compares the configuration dictionary information obtained this time with the previous version of the configuration dictionary in the data storage module through the above-mentioned service interface, and when it is determined that there is an update, it stores the updated content in the data storage module; the custom controller monitors the update of one or more configuration dictionaries specified in the data storage module through the service interface according to the configuration relationship recorded in the custom resource; when the custom controller detects that there is an update to one of the above-mentioned configuration dictionaries, it also updates the configuration data of the corresponding application according to the configuration relationship monitoring, that is, injects the configuration data into the application through the configuration dictionary.

[0045] S103: Execute a container group update operation of the application program according to the monitored configuration update information of the application program through the management controller.

[0046] When the management controller detects that the configuration data of the above-mentioned application is updated through the service interface, it restarts each container in the container group where the application is located in turn to ensure that at least one container is kept running in each electronic device where the application is located, ensuring that complete external services are provided. After each container is restarted, the update operation is completed.

[0047] Optionally, in an embodiment of the present invention, creating a custom controller and allocating custom resources to the custom controller specifically includes: traversing each application in the cluster and obtaining the monitoring type of each application; wherein the monitoring types include active monitoring applications, passive monitoring applications, and non-monitoring applications; if it is determined that the current application is an active monitoring application, the current application is not used as a monitoring object of the custom controller; if it is determined that the current application is a passive monitoring application or a non-monitoring application, the current application is used as a monitoring object of the custom controller.

[0048] Specifically, a custom controller can also be created by the management node itself. For example, when the cluster is deployed and started for the first time, the management node manages the configuration update monitoring of each application in the cluster by setting a custom controller. First, the management node traverses all applications in the cluster, including applications installed on the management node and the working nodes, and determines whether to use the current application as a monitoring object based on the monitoring type of the application. Among them, actively monitor applications, that is, the application itself has the ability to actively monitor configuration file updates; passively monitor applications, that is, the application itself does not have an active monitoring function, but passively obtains configuration file update signals based on monitoring tools such as sidecar containers (i.e., original monitoring tools); there is no monitoring application, that is, the application itself has neither active monitoring nor passive monitoring functions.

[0049] If the current application is an active monitoring application, its code logic itself has the function of detecting configuration files, and it does not need to be included in the monitoring scope of the custom controller, avoiding the occurrence of redundant detection; if the current application is an unmonitored application, the application will be used as the monitoring object to complete the configuration update of the application in time; if the current application is a passive monitoring application, the sidecar container on which the application depends has low update efficiency and serious update delays. For this application, a sidecar container needs to be started in each container group, which greatly wastes cluster resources. For example, the cluster includes a total of 10 electronic devices, each of which is deployed with application A. A sidecar container needs to be started in the container group of application A of each electronic device. Obviously, multiple sidecar containers in the cluster occupy a large amount of cluster resources. The custom controller created in the management node can not only obtain the configuration dictionary update information in time through the k8s component service interface, and then complete the real-time update of the application's configuration data, but also release multiple sidecar containers in the cluster, greatly saving cluster resources.

[0050] Optionally, in an embodiment of the present invention, if it is determined that the current application is a passive monitoring application or a non-monitoring application, the current application is used as the monitoring object of the custom controller, specifically including: if it is determined that the current application is a passive monitoring application, obtaining the average passive monitoring time of the current application; if it is determined that the average passive monitoring time of the current application is greater than or equal to the average monitoring time of the custom controller, the current application is used as the monitoring object of the custom controller, and the original monitoring tool corresponding to the current application is released.

[0051] Specifically, the sidecar container monitors the checksum of the configuration file corresponding to the configuration dictionary. If the checksum changes, it indicates that the configuration dictionary has been updated, and then sends a signal to the business container. The business application performs hot updates based on the above signal; the passive monitoring time is the time from the sidecar container executing the checksum to sending the update signal. The above process takes a long time to complete (usually more than 10 seconds); the average passive monitoring time is the average of the passive monitoring times of the current application in different electronic devices; the average monitoring time is the average monitoring time of the custom controller for each monitored object.

[0052] If the average passive monitoring time is longer, that is, greater than the average monitoring time, the current application will be used as the monitoring object of the custom controller to further improve the configuration update efficiency of the current application; if the average passive monitoring time is shorter, that is, less than the average monitoring time, the current application will not be used as the monitoring object of the custom controller to ensure that the current application maintains its original high configuration update efficiency; in particular, if the average passive monitoring time is equal to the average monitoring time, the current application can also be used as the monitoring object of the custom controller, thereby releasing the cluster resources occupied by the sidecar container while maintaining the configuration update efficiency unchanged.

[0053] Optionally, in an embodiment of the present invention, creating a custom controller and allocating custom resources to the custom controller includes: creating multiple different custom controllers; wherein each of the custom controllers is matched with an application of a different monitoring type; the monitoring priorities of the active monitoring application, the passive monitoring application and the non-monitoring application are increased in sequence; in response to obtaining monitoring requests from multiple custom controllers, responding to the monitoring requests of each of the custom controllers in sequence according to the monitoring priority of the monitoring type corresponding to each of the custom controllers.

[0054] Specifically, in order to improve the monitoring efficiency of the custom controller, different custom controllers can be set for different electronic devices in the cluster, and each custom controller is responsible for monitoring applications in one or more electronic devices; different custom controllers can also be set for different types of applications according to different application types, and each custom controller is responsible for monitoring one or more types of applications; in addition, different custom controllers can be set for applications of different monitoring types according to different monitoring types; for example, different custom controllers are set for active monitoring applications, passive monitoring applications, and non-monitoring applications respectively; because custom controllers all need to monitor the update of the configuration dictionary through the service interface of the k8s component, therefore, when monitoring requests from multiple custom controllers are detected, the monitoring requests issued by the custom controllers corresponding to the non-monitoring applications are responded to first according to the monitoring priority of the monitoring types corresponding to each custom controller, so as to ensure priority response to applications that do not have any active or passive detection functions.

[0055] As for passive monitoring applications, since the response time of the sidecar container they rely on is too long, in order to improve the configuration update efficiency of passive monitoring applications, passive monitoring applications are given secondary priority. As for active monitoring applications, since they have their own self-checking function and the update time is shorter than that of passive monitoring applications, even if the configuration data update cannot be completed in time through the custom controller, the configuration update can be completed through its self-checking function, and the time taken is relatively short. Therefore, according to the different monitoring types of different applications, different response priorities are set for different custom controllers. When multiple monitoring requests are detected at the same time, it can ensure priority response to non-monitoring applications that do not have any update detection function, and can also ensure secondary response to passive monitoring applications that take a long time to respond, thereby ensuring the timely update of configuration data of all applications in the cluster to the greatest extent.

[0056] The technical solution of the embodiment of the present invention monitors the update of the configuration dictionary through the created custom controller, thereby completing the configuration update of the application, and then executes the container group update operation of the application based on the monitored configuration update information of the application through the management controller. Compared with setting the sidecar container in the container group, the present application uses the custom controller to monitor the update of the configuration dictionary and the configuration update of the application, which does not require the application to have any active or passive detection function, and has good universal applicability. At the same time, the configuration dictionary monitoring based on the custom controller improves the configuration update efficiency of the application. In addition, compared with the need to set up a sidecar container in each container group, the present application only needs to set up one or a limited number of custom controllers in the management node, which greatly reduces the occupancy of cluster resources.

[0057] Embodiment 2

[0058] Figure 2 This is a flow chart of a method for updating an application provided in the second embodiment of the present invention. The relationship between this embodiment and the above embodiment is that the active monitoring application is selectively added to the monitoring object of the custom controller. Figure 2 As shown, the method includes:

[0059] S201. Create a custom controller and allocate custom resources to the custom controller; wherein the custom resources are used to record the configuration relationship between the configuration dictionary and the application.

[0060] S202, traverse each application in the cluster and obtain the monitoring type of each application; wherein the monitoring type includes an active monitoring application, a passive monitoring application, and a non-monitoring application.

[0061] S203: If it is determined that the current application is an active monitoring application, and the average active monitoring time of the current application is greater than the first preset time, or the real-time level of the current application is greater than the first preset level, the current application is used as a monitoring object of the custom controller.

[0062] If the real-time level of the current application is less than or equal to the first preset level, it indicates that the current application has a low requirement for real-time performance. In this case, there is no need to use the current application as a monitoring object for the custom controller. The configuration file update operation can be performed based on the active detection function of the current application itself. This not only reduces the number of monitoring objects of the custom controller, but also avoids the occurrence of redundant detection. If the real-time level of the current application is greater than the first preset level, it indicates that the current application has a high requirement for real-time performance, and its own active detection function is limited by its own code logic and cannot perform efficient update detection operations. In this case, the current application is used as a monitoring object for the custom controller to meet the real-time update requirements of the current application configuration data.

[0063] The active monitoring time is the time required for the application's own code logic to detect the configuration file update; the average active monitoring time is the average of the active monitoring times of the current application in different electronic devices; if the average active monitoring time of the current application is less than the first preset time, it indicates that the detection time of the current application is relatively short, and at this time there is no need to use the current application as a monitoring object for the custom controller; if the average active monitoring time of the current application is greater than or equal to the first preset time, it indicates that the detection time of the current application is relatively long, and at this time the current application is used as a monitoring object for the custom controller to improve the configuration data update efficiency of the current application.

[0064] Optionally, in an embodiment of the present invention, the first preset time is greater than the average monitoring time of the custom controller. The first preset time can be set to be greater than the average monitoring time of the custom controller, for example, the first preset time is set to an integer multiple of the average monitoring time, and the value of the integer multiple is greater than 1; this is because even if the active monitoring application is included in the monitoring range of the custom controller, the monitoring logic of the application itself will still perform a self-check operation, thereby generating redundant detection; therefore, the first preset time is set to be greater than the average monitoring time, so that for applications that take a shorter time, even if their detection time is slightly greater than the average monitoring time, they are not used as monitoring objects of the custom controller, avoiding the occurrence of redundant detection; and for applications that take a longer time, they are used as monitoring objects of the custom controller, thereby greatly improving the configuration data update efficiency of the current application.

[0065] S204: If a monitoring request initiated by the current application is detected, do not respond to the monitoring request initiated by the current application.

[0066] After adding the active monitoring program to the custom controller, since the update monitoring of the application is performed by the custom controller and the monitoring time of the custom controller is shorter than the self-check time of the application, the self-check function of the application is actually a redundant detection and no longer responds to the monitoring request issued by the active monitoring application.

[0067] S205: Monitor the update status of the configuration dictionary according to the configuration relationship through the custom controller, and update the configuration of the application when the update information of the configuration dictionary is monitored.

[0068] S206: Execute a container group update operation of the application program according to the monitored configuration update information of the application program through the management controller.

[0069] The technical solution of the embodiment of the present invention is that after determining that the current application is an active monitoring application, if the average active monitoring time of the current application is greater than a first preset time, or the real-time level of the current application is greater than the first preset level, the current application is used as the monitoring object of the custom controller, thereby meeting the real-time update requirements of the current application configuration data; if the average active monitoring time of the current application is less than or equal to the first preset time, or the real-time level of the current application is less than or equal to the first preset level, the current application is not used as the monitoring object of the custom controller, and the configuration file update operation is performed based on the active detection function of the current application itself, which not only reduces the number of monitoring objects of the custom controller, but also avoids the occurrence of redundant detection.

[0070] Embodiment 3

[0071] Figure 3 This is a flow chart of a method for updating an application provided in Embodiment 3 of the present invention. In this embodiment of the present invention, applications of different monitoring types execute different monitoring strategies. Figure 3 As shown, the method includes:

[0072] S301, create a custom controller and allocate custom resources to the custom controller; wherein the custom resources are used to record the configuration relationship between the configuration dictionary and the application; execute S302.

[0073] S302, traverse each application in the cluster and obtain the monitoring type of each application; wherein the monitoring type includes active monitoring application, passive monitoring application and non-monitoring application. If the current application is an active monitoring application, execute S303; if the current application is a passive monitoring application, execute S304; if the current application is a non-monitoring application, execute S305.

[0074] S303, determine whether the average active monitoring time of the current application is greater than or equal to the first preset time, and whether the real-time level of the current application is greater than or equal to the first preset level; if so, execute S305; if not, execute S306.

[0075] S304, determine whether the average passive monitoring time of the current application is greater than or equal to the average monitoring time of the custom controller; if so, execute S305; if not, execute S306.

[0076] S305. The current application is used as a monitoring object of the custom controller; and S307 is executed.

[0077] S306. The current application is not used as a monitoring object of the custom controller; and S307 is executed.

[0078] S307 . Monitor the update status of the configuration dictionary according to the configuration relationship through the custom controller, and update the configuration of the application when the update information of the configuration dictionary is monitored; execute S307 .

[0079] S308: Execute a container group update operation of the application program according to the monitored configuration update information of the application program through the management controller.

[0080] According to the technical solution of the embodiment of the present invention, if the current application is a passive monitoring application and the average passive monitoring time is long, the current application is used as the monitoring object of the custom controller to further improve the configuration update efficiency of the current application; if the current application is a passive monitoring application and the average passive monitoring time is short, the current application is not used as the monitoring object of the custom controller to ensure that the current application maintains its original high configuration update efficiency; if the current application is an active monitoring application and the average active monitoring time is long or the real-time level is high, the current application is used as the monitoring object of the custom controller to meet the real-time update requirements of the current application configuration data; if the current application is an active monitoring application and the average active monitoring time is short and the real-time level is low, the current application is not used as the monitoring object of the custom controller, and the configuration file update operation is performed based on the active detection function of the current application itself, which not only reduces the number of monitoring objects of the custom controller, but also avoids the occurrence of redundant detection.

[0081] Embodiment 4

[0082] Figure 4 : is a structural block diagram of an application updating device provided by Embodiment 4 of the present invention, and the device specifically comprises:

[0083] The controller creation module 401 is used to create a custom controller and allocate custom resources to the custom controller; wherein the custom resources are used to record the configuration relationship between the configuration dictionary and the application program;

[0084] A configuration update execution module 402, configured to monitor the update status of the configuration dictionary according to the configuration relationship through the custom controller, and perform configuration update on the application when the update information of the configuration dictionary is monitored;

[0085] The container group update execution module 403 is used to execute the container group update operation of the application program according to the configuration update information of the application program monitored by the management controller.

[0086] The technical solution of the embodiment of the present invention monitors the update of the configuration dictionary through the created custom controller, thereby completing the configuration update of the application, and then executes the container group update operation of the application based on the monitored configuration update information of the application through the management controller. Compared with setting the sidecar container in the container group, the present application uses the custom controller to monitor the update of the configuration dictionary and the configuration update of the application, which does not require the application to have any active or passive detection function, and has good universal applicability. At the same time, the configuration dictionary monitoring based on the custom controller improves the configuration update efficiency of the application. In addition, compared with the need to set up a sidecar container in each container group, the present application only needs to set up one or a limited number of custom controllers in the management node, which greatly reduces the occupancy of cluster resources.

[0087] Optionally, the application updating device further includes:

[0088] The configuration relationship update request acquisition module is used to update the configuration relationship between the configuration dictionary of the custom resource record and the application program in response to obtaining the configuration relationship update request of the custom controller.

[0089] Optionally, the controller creation module 401 is specifically used to traverse each application in the cluster and obtain the monitoring type of each application; wherein the monitoring type includes an active monitoring application, a passive monitoring application, and an unmonitored application; if it is determined that the current application is an active monitoring application, the current application is not used as a monitoring object of the custom controller; if it is determined that the current application is a passive monitoring application or an unmonitored application, the current application is used as a monitoring object of the custom controller.

[0090] Optionally, the controller creation module 401 is also specifically used to use the current application as the monitoring object of the custom controller and release the original monitoring tool corresponding to the current application if it is determined that the current application is a passive monitoring application and the average passive monitoring time of the current application is greater than or equal to the average monitoring time of the custom controller.

[0091] Optionally, the controller creation module 401 is further specifically used to use the current application as a monitoring object of the custom controller if it is determined that the average active monitoring time of the current application is greater than or equal to a first preset time, or the real-time level of the current application is greater than or equal to the first preset level; if a monitoring request initiated by the current application is detected, not respond to the monitoring request initiated by the current application; if it is determined that the average active monitoring time of the current application is less than the first preset time, and the real-time level of the current application is less than the first preset level, not using the current application as a monitoring object of the custom controller.

[0092] Optionally, the first preset time is greater than an average monitoring time of the custom controller.

[0093] Optionally, the controller creation module 401 is further used to create multiple different custom controllers and allocate different custom resources to each of the custom controllers; wherein each of the custom controllers is matched with an application program of a different monitoring type; the monitoring priorities of active monitoring applications, passive monitoring applications and non-monitoring applications increase in sequence; if monitoring requests from multiple custom controllers are detected, the monitoring requests of each of the custom controllers are responded to in sequence according to the monitoring priorities of the monitoring types corresponding to each of the custom controllers.

[0094] The above device can execute the application update method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the application update method provided by any embodiment of the present invention.

[0095] Embodiment 5

[0096] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0097] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0098] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0099] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an application update method.

[0100] In some embodiments, the update method of the application program may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on a heterogeneous hardware accelerator via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps of the update method of the application program described above may be performed. Alternatively, in other embodiments, the processor may be configured to execute the update method of the application program by any other appropriate means (e.g., by means of firmware).

[0101] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0102] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0103] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0104] To provide interaction with a user, the systems and techniques described herein may be implemented on a heterogeneous hardware accelerator having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) through which a user can provide input to the heterogeneous hardware accelerator. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0105] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0106] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0107] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0108] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for updating an application, characterized in that: include: Creating a custom controller and allocating custom resources to the custom controller; wherein the custom resources are used to record the configuration relationship between the configuration dictionary and the application; Monitoring the update status of the configuration dictionary according to the configuration relationship through the custom controller, and updating the configuration of the application when the update information of the configuration dictionary is monitored; Executing a container group update operation of the application program according to the monitored configuration update information of the application program through the management controller; The step of creating a custom controller and allocating custom resources to the custom controller specifically includes: Traversing each application in the cluster and obtaining a monitoring type of each application; wherein the monitoring type includes an active monitoring application, a passive monitoring application, and an unmonitored application; If it is determined that the current application is an active monitoring application, the current application is not used as a monitoring object of the custom controller; If it is determined that the current application is a passive monitoring application or a non-monitoring application, the current application is used as a monitoring object of the custom controller; If it is determined that the current application is a passive monitoring application or a non-monitoring application, the current application is used as a monitoring object of the custom controller, specifically including: If it is determined that the current application is a passive monitoring application, and the average passive monitoring time of the current application is greater than or equal to the average monitoring time of the custom controller, the current application is used as the monitoring object of the custom controller, and the original monitoring tool corresponding to the current application is released; Among them, the active monitoring application, that is, the application itself has the active monitoring function of the configuration file update; the passive monitoring application, that is, the application itself does not have the active monitoring function, but passively obtains the configuration file update signal based on the sidecar container; the non-monitoring application, that is, the application itself has neither the active monitoring function nor the passive monitoring function; The average passive monitoring time is the average of the passive monitoring times of the current application in different electronic devices; the average monitoring time is the average monitoring time of each monitoring object by the custom controller.

2. The method according to claim 1, characterized in that After creating a custom controller and assigning custom resources to the custom controller, also include: In response to obtaining the configuration relationship update request of the custom controller, the configuration relationship between the configuration dictionary of the custom resource record and the application is updated.

3. The method according to claim 1, characterized in that After determining that the current application is an active monitoring application, it also includes: If it is determined that the average active monitoring time of the current application is greater than or equal to the first preset time, or the real-time level of the current application is greater than or equal to the first preset level, the current application is used as a monitoring object of the custom controller; If a monitoring request initiated by the current application is detected, not responding to the monitoring request initiated by the current application; The step of not using the current application as a monitoring object of the custom controller includes: If it is determined that the average active monitoring time of the current application is less than the first preset time, and the real-time level of the current application is less than the first preset level, the current application is not used as a monitoring object of the custom controller; The average active monitoring time is the average of each active monitoring time of the current application in different electronic devices.

4. The method according to claim 3, characterized in that The first preset time is greater than an average monitoring time of the custom controller.

5. The method according to claim 1, characterized in that The step of creating a custom controller and allocating custom resources to the custom controller includes: Creating a plurality of different custom controllers and allocating different custom resources to each of the custom controllers; wherein each of the custom controllers is matched with an application program of a different monitoring type; the monitoring priorities of active monitoring applications, passive monitoring applications and non-monitoring applications are increased in sequence; If monitoring requests from multiple custom controllers are detected, the monitoring requests from each custom controller are responded to in turn according to the monitoring priorities of the monitoring types corresponding to each custom controller.

6. An application updating device, characterized in that: include: A controller creation module, used to create a custom controller and allocate custom resources to the custom controller; wherein the custom resources are used to record the configuration relationship between the configuration dictionary and the application; A configuration update execution module, used to monitor the update status of the configuration dictionary according to the configuration relationship through the custom controller, and perform configuration update on the application when the update information of the configuration dictionary is monitored; A container group update execution module, used to execute a container group update operation of the application program according to the configuration update information of the application program monitored by the management controller; The controller creation module is specifically used to traverse each application in the cluster and obtain the monitoring type of each application; wherein the monitoring type includes an active monitoring application, a passive monitoring application, and an unmonitored application; if it is determined that the current application is an active monitoring application, the current application is not used as a monitoring object of the custom controller; if it is determined that the current application is a passive monitoring application or an unmonitored application, the current application is used as a monitoring object of the custom controller; The controller creation module is further specifically used to, if it is determined that the current application is a passive monitoring application and the average passive monitoring time of the current application is greater than or equal to the average monitoring time of the custom controller, use the current application as a monitoring object of the custom controller and release the original monitoring tool corresponding to the current application; Among them, the active monitoring application, that is, the application itself has the active monitoring function of the configuration file update; the passive monitoring application, that is, the application itself does not have the active monitoring function, but passively obtains the configuration file update signal based on the sidecar container; the non-monitoring application, that is, the application itself has neither the active monitoring function nor the passive monitoring function; The average passive monitoring time is the average of the passive monitoring times of the current application in different electronic devices; the average monitoring time is the average monitoring time of each monitoring object by the custom controller.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application updating method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application updating method according to any one of claims 1 to 5 when executed.

Citation Information

Patent Citations

  • Parameter updating method and device compatible with cloud native application

    CN113687854A