CN116594764A - Application program updating method and device, electronic equipment and storage medium - Google Patents

Application program updating method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116594764A
CN116594764A CN202310440499.7A CN202310440499A CN116594764A CN 116594764 A CN116594764 A CN 116594764A CN 202310440499 A CN202310440499 A CN 202310440499A CN 116594764 A CN116594764 A CN 116594764A
Authority
CN
China
Prior art keywords
application program
monitoring
custom
controller
configuration
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
CN202310440499.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.)
Qingdao Zhongke Shuguang Technology Service Co ltd
Original Assignee
Qingdao Zhongke Shuguang Technology Service 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 Qingdao Zhongke Shuguang Technology Service Co ltd filed Critical Qingdao Zhongke Shuguang Technology Service Co ltd
Priority to CN202310440499.7A priority Critical patent/CN116594764A/en
Publication of CN116594764A publication Critical patent/CN116594764A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/301Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is a virtual computing platform, e.g. logically partitioned systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses an updating method and device of an application program, electronic equipment and a storage medium, and relates to the technical field of clusters, wherein the method comprises the following steps: creating a custom controller and distributing custom resources for the custom controller; monitoring the update state of the configuration dictionary according to the configuration relation by a custom controller, and carrying out configuration update on the application program when the update information of the configuration dictionary is monitored; and executing the updating operation of the container group of the application program by the management controller according to the monitored configuration updating information of the application program. According to the technical scheme, the configuration dictionary is updated and monitored by the custom controller and the configuration of the application program is updated, the application program is not required to have any active or passive detection function, the universal applicability is good, the configuration updating efficiency is high, in addition, only one or a limited number of custom controllers are required to be arranged in the management node, and the occupation of cluster resources is reduced.

Description

Application program updating method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of cluster technologies, and in particular, to an application program updating method, an application program updating device, an electronic device, and a storage medium.
Background
Kubernetes (i.e., k8 s) component is widely used in application deployment of clusters as an open source system for managing containerized applications, and the configuration dictionary is a common configuration file loading manner for applications deployed in k8s components.
Although the configuration dictionary supports the hot update function, most application programs do not have the function of detecting the update of the configuration dictionary, so even if the configuration dictionary is changed, the application programs still cannot respond immediately; in order to solve the above-mentioned problems, a service container and a sidecar container are started simultaneously when a container group of an application program is deployed, and a configuration dictionary mapped into the service container is acquired by the sidecar container.
However, after the sidecar container is deployed, it is still required that the application program can receive the signal and perform the hot update, but most business applications do not support the function, and at the same time, the update of the business application depends on the update of the configuration file mounted to the application, and the update of the configuration file depends on the update of the configuration dictionary corresponding to the configuration file; when the configuration dictionary changes, the update of the configuration file is not immediately effective, and long waiting time exists, thus often causing update delay of the container group of the business application.
Disclosure of Invention
The invention provides an updating method and device of an application program, electronic equipment and a storage medium, and aims to solve the problem that configuration data of the application program is not updated timely.
According to an aspect of the present invention, there is provided an update method of an application program, including:
creating a custom controller and distributing custom resources for the custom controller; the custom resource is used for recording the configuration relation between the configuration dictionary and the application program;
monitoring the updating state of the configuration dictionary according to the configuration relation by the custom controller, and carrying out configuration updating on the application program when the updating information of the configuration dictionary is monitored;
and executing the updating operation of the container group of the application program by the management controller according to the monitored configuration updating information of the application program.
After creating the custom controller and allocating custom resources for the custom controller, the method further comprises: and in response to the acquired configuration relation updating request of the custom controller, updating the configuration relation between the configuration dictionary of the custom resource record and the application program. Therefore, based on the configuration relation updating request, the monitoring object of the custom controller can be adjusted according to different monitoring requirements of users, and the monitoring range of the custom controller is expanded.
The creating a custom controller and distributing custom resources for the custom controller specifically comprises: traversing each application program in the cluster, and acquiring the monitoring type of each application program; wherein the monitoring type comprises an active monitoring application, a passive monitoring application and a non-monitoring application; if the current application program is determined to be the active monitoring application, the current application program is not used as a monitoring object of the custom controller; and if the current application program is determined to be the passive monitoring application or the non-monitoring application, taking the current application program as a monitoring object of the self-defined controller. If the current application program is active monitoring application, the code logic of the current application program has the detection function of the configuration file, and the current application program does not need to be brought into the monitoring range of the custom controller, so that the occurrence of redundant detection is avoided; if the current application program is a non-monitoring application, taking the application program as a monitoring object, and timely finishing configuration updating of the application program; if the current application program is a passive monitoring application, the custom controller created in the management node can not only acquire the configuration dictionary updating information in time through the k8s component service interface, and further complete the real-time updating of the configuration data of the application program, but also release a plurality of side car containers in the cluster, so that the cluster resource is greatly saved.
If it is determined that the current application program is a passive monitoring application or a non-monitoring application, taking the current application program as a monitoring object of the custom controller specifically includes: if the current application program is determined to be the passive monitoring application, and the average passive monitoring time of the current application program is greater than or equal to the average monitoring time of the custom controller, taking the current application program as a monitoring object of the custom controller, and releasing an original monitoring tool corresponding to the current application program. If the average passive monitoring time is longer, the current application program is used as a monitoring object of the custom controller, so that the configuration updating efficiency of the current application program is further improved; if the average passive monitoring time is shorter, the current application program is not used as a monitoring object of the custom controller, so that the current application program is ensured to keep the original higher configuration updating efficiency; if the average passive monitoring time is equal to the average monitoring time, the current application program can be used as a monitoring object of the custom controller, so that cluster resources occupied by the side car container are released on the premise of keeping the configuration updating efficiency unchanged.
After determining that the current application program is an active monitoring application, the method further comprises: if the average active monitoring time of the current application program is determined to be greater than or equal to a first preset time or the real-time grade of the current application program is determined to be greater than or equal to a first preset grade, the current application program is taken as a monitoring object of the self-defined controller; and if the monitoring request initiated by the current application program is detected, not responding to the monitoring request initiated by the current application program. The real-time updating requirement of the current application program configuration data is met. The step of taking the current application program not as the monitoring object of the custom controller comprises the following steps: if the average active monitoring time of the current application program is less than the first preset time and the real-time level of the current application program is less than the first preset level, the current application program is not used as a monitoring object of the custom controller. The update operation of the configuration file is performed based on the active detection function of the current application program, so that the number of monitoring objects of the custom controller is reduced, and the occurrence of redundant detection is avoided.
The first preset time is longer than the average monitoring time of the custom controller. The first preset time is set to be longer than the average monitoring time, so that for an application program with shorter time consumption, even if the detection time consumption is slightly longer than the average monitoring time, the application program is not used as a monitoring object of the custom controller, and redundant detection is avoided; for the application program with longer time consumption, the application program is used as a monitoring object of the custom controller, so that the configuration data updating efficiency of the current application program is greatly improved.
The creating a custom controller and allocating custom resources for the custom controller includes: creating a plurality of different custom controllers and allocating different custom resources to each of the custom controllers; each self-defined controller is matched with application programs of different monitoring types respectively; the monitoring priority of the active monitoring application, the passive monitoring application and the non-monitoring application is sequentially increased; if monitoring requests of a plurality of custom controllers are detected, the monitoring requests of the custom controllers are responded in sequence according to the monitoring priorities of the monitoring types respectively corresponding to the custom controllers. According to different monitoring types of different application programs, different response priorities are set for different custom controllers, when a plurality of monitoring requests are detected at the same time, priority response of non-monitoring applications without any update detection function can be ensured, secondary response of passive monitoring applications with long response time can be ensured, and timely update of configuration data of all application programs in a cluster is ensured to the greatest extent.
According to another aspect of the present invention, there is provided an update apparatus of an application program, including:
the controller creation module is used for creating a custom controller and distributing custom resources for the custom controller; the custom resource is used for recording the configuration relation between the configuration dictionary and the application program;
the configuration updating execution module is used for monitoring the updating state of the configuration dictionary according to the configuration relation through the self-defined controller, and carrying out configuration updating on the application program when the updating information of the configuration dictionary is monitored;
and the container group updating execution module is used for executing the container group updating operation of the application program according to the monitored configuration updating information of the application program through the management controller.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of updating an application program according to any one of the embodiments of the present invention.
According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute an update method of an application program according to any embodiment of the present application.
According to the technical scheme, the configuration dictionary is monitored and updated through the established custom controller, the configuration updating of the application program is further completed, and then the management controller is used for executing the updating operation of the container group of the application program based on the monitored configuration updating information of the application program.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1A is a flowchart of an application program update method according to a first embodiment of the present invention;
FIG. 1B is a schematic diagram of a management node according to a first embodiment of the present invention;
FIG. 2 is a flowchart of an update method of an application program according to a second embodiment of the present invention;
FIG. 3 is a flowchart of an update method of an application program according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an updating device for an application program according to a fourth embodiment of the present invention;
Fig. 5 is a schematic structural diagram of an electronic device implementing an application program updating method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1A is a flowchart of an application program updating method according to an embodiment of the present invention, where the method may be applicable to updating configuration data of an application program deployed in a k8s component, and the method may be performed by an application program updating device, where the application program updating device may be implemented in hardware and/or software, and the application program updating device is configured in a management node in a cluster, typically, a management server in a server cluster, where the cluster includes at least one management node and at least one working node. As shown in fig. 1A, the method includes:
s101, creating a custom controller and distributing custom resources for the custom controller; the custom resource is used for recording the configuration relation between the configuration dictionary and the application program.
The custom controller can be created based on a controller creation request sent by a user, taking fig. 1B as an example, when a management node obtains the controller creation request sent by the user through a service interface (i.e. kube-apis erver) of a k8s component, the custom controller is created in the management node, and the custom controller is different from a native controller in a management controller (i.e. controller-manager) in the k8s component and is used for monitoring the change of a user-defined resource; the custom resource is an extensible resource with k8s components opened for users or specific functions, and in the embodiment of the invention, the custom resource comprises a storage resource in a data storage module (namely an ETCD module); wherein the ETCD module is a functional module in the k8s component for persistent storage of data.
The application program in the embodiment of the invention is an application deployed in the cluster through a k8s component, and the application may be deployed in one or more electronic devices in the cluster; the configuration dictionary is a resource name in the k8s component that stores configuration data in the form of key-value pairs; the configuration dictionary is used for injecting configuration data into the container group where the application program is located; the data stored in the configuration dictionary object may be referenced by a volume of the configuration dictionary type and used by a containerized application running in the container group; the configuration dictionary is matched with the application programs one by one, and the same application programs in different electronic devices correspond to the same configuration dictionary; wherein, the container group is the minimum dispatch unit in the k8s component, one application program corresponds to one container group, and one container can comprise a plurality of containers, and the containers in the same container group share a network stack and a file system.
When a management node acquires a controller creation request sent by a user, if the controller creation request does not comprise the configuration relation between a configuration dictionary and an application program, only a custom resource is allocated to the custom controller, and no information is recorded in the custom resource temporarily; if the controller creation request already comprises the configuration relation between the configuration dictionary and the application program, after the custom resource is allocated to the custom controller, the corresponding configuration relation can be recorded through the custom resource; the configuration relation reflects which application programs are deployed in the monitoring cluster by the custom controller and a configuration dictionary matched with the application programs.
Optionally, in an embodiment of the present invention, after creating a custom controller and allocating custom resources to the custom controller, the method further includes: and in response to the acquired configuration relation updating request of the custom controller, updating the configuration relation between the configuration dictionary of the custom resource record and the application program. The monitoring object of each custom controller can be set up based on the configuration relation included in the creation request when created, and can be modified by the configuration relation update request sent by the user later, so that the monitoring object of the custom controller can be adjusted according to different monitoring requirements of the user based on the configuration relation update request, and the monitoring range of the custom controller is expanded.
S102, monitoring the updating state of the configuration dictionary according to the configuration relation through the custom controller, and carrying out configuration updating on the application program when the updating information of the configuration dictionary is monitored.
When the management node acquires a configuration dictionary updating request, comparing the configuration dictionary information acquired this time with the previous version of the configuration dictionary in the data storage module through the service interface, and storing updating contents in the data storage module when determining that updating exists; the custom controller updates and monitors one or more configuration dictionaries appointed in the data storage module through the service interface according to the configuration relation recorded in the custom resource; when the custom controller detects that a certain configuration dictionary is updated, the configuration data of the corresponding application program is updated according to the configuration relation monitoring, namely, the configuration data is injected into the application program through the configuration dictionary.
S103, executing the updating operation of the container group of the application program through the management controller according to the monitored configuration updating information of the application program.
When the management controller monitors the update of the configuration data of the application program through the service interface, each container in the container group where the application program is located is restarted in sequence, so that at least one container in each electronic device where the application program is located is ensured to be in an operating state, complete external service is ensured to be provided, and after each container is restarted, the update operation is completed.
Optionally, in an embodiment of the present invention, the creating a custom controller and allocating custom resources to the custom controller specifically includes: traversing each application program in the cluster, and acquiring the monitoring type of each application program; wherein the monitoring type comprises an active monitoring application, a passive monitoring application and a non-monitoring application; if the current application program is determined to be the active monitoring application, the current application program is not used as a monitoring object of the custom controller; and if the current application program is determined to be the passive monitoring application or the non-monitoring application, taking the current application program as a monitoring object of the self-defined controller.
Specifically, the custom controller can also be built by the management node, for example, when the cluster deployment is started for the first time, the management node manages configuration update monitoring of each application program in the cluster by setting the custom controller; firstly, the management node traverses all application programs in the cluster, including the application programs installed in the management node and the working node, and judges whether the current application program is used as a monitoring object according to different monitoring types of the application programs; the application program is provided with an active monitoring function for updating the configuration file; the passive monitoring application, namely the application program does not have an active monitoring function, but passively acquires a configuration file updating signal based on monitoring tools (namely original monitoring tools) such as a side car container; the application program has neither an active monitoring function nor a passive monitoring function.
If the current application program is active monitoring application, the code logic of the current application program has the detection function of the configuration file, and the current application program does not need to be brought into the monitoring range of the custom controller, so that the occurrence of redundant detection is avoided; if the current application program is a non-monitoring application, taking the application program as a monitoring object, and timely finishing configuration updating of the application program; if the current application program is a passive monitoring application, the update efficiency of the sidecar container on which the application program depends is low, serious update delay exists, and for the application program, one sidecar container needs to be started in each container group, so that cluster resources are wasted greatly, for example, 10 pieces of electronic equipment are included in the cluster, each piece of electronic equipment deploys the application program A, one sidecar container needs to be started in the container group of the application program A of each piece of electronic equipment, obviously, a plurality of sidecar containers in the cluster occupy a large amount of cluster resources, and a custom controller created in a management node can acquire configuration dictionary update information in time through a k8s component service interface, so that real-time update of configuration data of the application program is completed, and meanwhile, a plurality of sidecar containers in the cluster are released, so that cluster resources are saved greatly.
Optionally, in the embodiment of the present invention, if it is determined that the current application program is a passive monitoring application or a non-monitoring application, the taking the current application program as the monitoring object of the custom controller specifically includes: if the current application program is determined to be the passive monitoring application, acquiring the average passive monitoring time of the current application program; and if the average passive monitoring time of the current application program is greater than or equal to the average monitoring time of the custom controller, taking the current application program as a monitoring object of the custom controller, and releasing an original monitoring tool corresponding to the current application program.
Specifically, the side car container monitors the checksum of the configuration file corresponding to the configuration dictionary, if the checksum changes, the configuration dictionary is indicated to be updated, and then a signal is sent to the service container, and the service application executes thermal update based on the signal; passive monitoring time, which is the time from the execution of the checksum to the sending of the update signal by the sidecar container, is long (usually takes more than 10 seconds); the average passive monitoring time is the average value of each passive monitoring time of the current application program in different electronic equipment; the average monitoring time is the average monitoring time of the user-defined controller on each monitoring object.
If the average passive monitoring time is longer, namely longer than the average monitoring time, the current application program is used as a monitoring object of the custom controller, so that the configuration updating efficiency of the current application program is further improved; if the average passive monitoring time is shorter, namely smaller than the average monitoring time, the current application program is not used as a monitoring object of the custom controller, so that the current application program is ensured to keep the original higher configuration updating efficiency; in particular, if the average passive monitoring time is equal to the average monitoring time, the current application program can be used as a monitoring object of the custom controller, so that cluster resources occupied by the sidecar container are released on the premise of keeping the configuration updating efficiency unchanged.
Optionally, in an embodiment of the present invention, the creating a custom controller and allocating custom resources to the custom controller includes: creating a plurality of different custom controllers; each self-defined controller is matched with application programs of different monitoring types respectively; the monitoring priorities of the active monitoring application, the passive monitoring application and the non-monitoring application are sequentially increased; responding to the monitoring requests of a plurality of custom controllers, and sequentially responding to the monitoring requests of the custom controllers according to the monitoring priorities of the monitoring types respectively corresponding to the custom controllers.
Specifically, in order to improve the monitoring efficiency of the custom controllers, different custom controllers may be set for different electronic devices in the cluster, where each custom controller is responsible for monitoring an application program in one or more electronic devices; different custom controllers can be set for different types of application programs according to different application types, and each custom controller is responsible for monitoring one or more types of application programs; in addition, different custom controllers can be set for application programs of different monitoring types according to different monitoring types; for example, different custom controllers are respectively set for an active monitoring application, a passive monitoring application and a non-monitoring application; because the custom controllers all need to update the monitoring configuration dictionary through the service interface of the k8s component, when monitoring requests of a plurality of custom controllers are detected, the monitoring requests sent by the custom controllers corresponding to the non-monitoring application are preferentially responded according to the monitoring priorities of the monitoring types respectively corresponding to the custom controllers, so that the preferential response of the application programs without any active or passive detection function is ensured.
The passive monitoring application is in response of the secondary priority in order to improve the configuration updating efficiency of the passive monitoring application because the response of the depending side car container is too long; the active monitoring application has a self-checking function, and the updating time is shorter than that of the passive monitoring application, so that even if the updating of the configuration data can not be completed in time through the self-defining controller, the configuration updating can be completed through the self-checking function, and the time consumption is relatively shorter; therefore, different response priorities are set for different custom controllers according to different monitoring types of different application programs, when a plurality of monitoring requests are detected at the same time, priority response of non-monitoring applications without any updating detection function can be ensured, secondary response of passive monitoring applications with long response time can be ensured, and timely updating of configuration data of all application programs in a cluster is ensured to the greatest extent.
According to the technical scheme, the configuration dictionary is monitored and updated through the established custom controller, the configuration updating of the application program is further completed, and then the management controller is used for executing the updating operation of the container group of the application program based on the monitored configuration updating information of the application program.
Example two
Fig. 2 is a flowchart of an application program updating method according to a second embodiment of the present invention, where the relationship between the present embodiment and the above embodiment is that an active monitoring application is selectively added to a monitoring object of a custom controller. As shown in fig. 2, the method includes:
s201, creating a custom controller and distributing custom resources for the custom controller; the custom resource is used for recording the configuration relation between the configuration dictionary and the application program.
S202, traversing each application program in the cluster, and acquiring the monitoring type of each application program; wherein the monitoring types include active monitoring applications, passive monitoring applications, and non-monitoring applications.
And S203, if the current application program is determined to be the active monitoring application, and the average active monitoring time of the current application program is greater than the first preset time, or the real-time level of the current application program is greater than the first preset level, taking the current application program as a monitoring object of the self-defined controller.
If the real-time level of the current application program is smaller than or equal to a first preset level, the current application program has lower requirement on real-time, and the current application program is not required to be used as a monitoring object of the custom controller at the moment, and the updating operation of the configuration file is executed based on the active detection function of the current application program, so that the number of the monitoring objects of the custom controller is reduced, and the occurrence of redundant detection is avoided; if the real-time level of the current application program is greater than the first preset level, the current application program has higher requirement on real-time, the active detection function of the current application program is limited by the code logic of the current application program, and the high-efficiency update detection operation cannot be executed, and at the moment, the current application program is used as a monitoring object of the custom controller so as to meet the real-time update requirement of the configuration data of the current application program.
The active monitoring time is the time required by the code logic of the application program itself to detect the update of the configuration file; the average active monitoring time is the average value of all the actively monitored times of the current application program in different electronic devices; if the average active monitoring time of the current application program is smaller than the first preset time, the detection time of the current application program is short, and the current application program is not required to be used as a monitoring object of the custom controller at the same time; if the average active monitoring time of the current application program is greater than or equal to the first preset time, the detection time of the current application program is longer, and the current application program is used as a monitoring object of the custom controller at the moment, so that the configuration data updating efficiency of the current application program is improved.
Optionally, in an embodiment of the present invention, the first preset time is greater than an average monitoring time of the custom controller. The first preset time may be set to be greater than the average monitoring time of the custom controller, for example, the first preset time is set to be an integer multiple of the average monitoring time, and a value of the integer multiple is greater than 1; this is because even if the active monitoring application is brought into the monitoring range of the custom controller, the monitoring logic of the application program itself still performs self-checking operation, thereby generating redundant detection; therefore, the first preset time is set to be longer than the average monitoring time, and even if the detection time of the application program with shorter time consumption is slightly longer than the average monitoring time, the application program is not used as a monitoring object of the custom controller, so that redundant detection is avoided; for the application program with longer time consumption, the application program is used as a monitoring object of the custom controller, so that the configuration data updating efficiency of the current application program is greatly improved.
S204, if the monitoring request initiated by the current application program is detected, the monitoring request initiated by the current application program is not responded.
After the active monitoring program is added into the custom controller, since the update monitoring of the application is already performed by the custom controller and the monitoring time of the custom controller is shorter than the self-checking time of the application program, the self-checking function of the application program is actually a redundant detection, and the monitoring request sent by the active monitoring application is not responded any more.
S205, monitoring the updating state of the configuration dictionary according to the configuration relation by the custom controller, and carrying out configuration updating on the application program when the updating information of the configuration dictionary is monitored.
S206, executing the updating operation of the container group of the application program according to the monitored configuration updating information of the application program through the management controller.
According to the technical scheme provided by the embodiment of the invention, after the current application program is determined to be the active monitoring application, if the average active monitoring time of the current application program is longer than the first preset time or the real-time level of the current application program is longer than the first preset level, the current application program is used as a monitoring object of the custom controller, so that the real-time updating requirement of the configuration data of the current application program is met; if the average active monitoring time of the current application program is less than or equal to the first preset time or the real-time level of the current application program is less than or equal to the first preset level, the current application program is not used as a monitoring object of the custom controller, and the updating operation of the configuration file is executed based on the active detection function of the current application program, so that the number of the monitoring objects of the custom controller is reduced, and the occurrence of redundant detection is avoided.
Example III
Fig. 3 is a flowchart of an application program updating method according to a third embodiment of the present invention, where in the embodiment of the present invention, different monitoring policies are executed by different monitoring types of application programs. As shown in fig. 3, the method includes:
s301, creating a custom controller and distributing custom resources for the custom controller; the custom resource is used for recording the configuration relation between the configuration dictionary and the application program; s302 is performed.
S302, traversing each application program in the cluster, and acquiring the monitoring type of each application program; wherein the monitoring types include active monitoring applications, passive monitoring applications, and non-monitoring applications. If the current application program is the active monitoring application, executing S303; if the current application program is a passive monitoring application, executing S304; if the current application is a non-monitoring application, S305 is executed.
S303, judging whether the average active monitoring time of the current application program is greater than or equal to a first preset time and whether the real-time level of the current application program is greater than or equal to a first preset level; if yes, executing S305; if not, S306 is performed.
S304, judging whether the average passive monitoring time of the current application program is more than or equal to the average monitoring time of the custom controller; if yes, executing S305; if not, S306 is performed.
S305, using the current application program as a monitoring object of the custom controller; s307 is performed.
S306, the current application program is not used as a monitoring object of the custom controller; s307 is performed.
S307, monitoring the updating state of the configuration dictionary according to the configuration relation by the custom controller, and carrying out configuration updating on the application program when the updating information of the configuration dictionary is monitored; s307 is performed.
And S308, executing the updating operation of the container group of the application program through the management controller according to the monitored configuration updating information of the application program.
According to the technical scheme, if the current application program is the passive monitoring application and the average passive monitoring time is long, the current application program is used as a monitoring object of the custom controller, so that the configuration updating efficiency of the current application program is further improved; if the current application program is a passive monitoring application and the average passive monitoring time is shorter, the current application program is not used as a monitoring object of the custom controller, so that the current application program is ensured to keep the original higher configuration updating efficiency; if the current application program is active monitoring application, and the average active monitoring time is longer or the real-time performance level is higher, the current application program is used as a monitoring object of the custom controller, so that the real-time updating requirement of the configuration data of the current application program is met; if the current application program is active monitoring application, the average active monitoring time is shorter and the real-time level is lower, the current application program is not used as a monitoring object of the self-defined controller, and the updating operation of the configuration file is executed based on the active detection function of the current application program, so that the number of the monitoring objects of the self-defined controller is reduced, and the occurrence of redundant detection is avoided.
Example IV
Fig. 4 is a block diagram of an apparatus for updating an application program according to a fourth embodiment of the present application, where the apparatus specifically includes:
a controller creation module 401, configured to create a custom controller and allocate custom resources for the custom controller; the custom resource is used for recording the configuration relation between the configuration dictionary and the application program;
a configuration update execution module 402, configured to monitor, by the custom controller, an update state of the configuration dictionary according to the configuration relationship, and perform configuration update on the application program when update information of the configuration dictionary is monitored;
and the container group update execution module 403 is configured to execute, by using the management controller, a container group update operation of the application program according to the monitored configuration update information of the application program.
According to the technical scheme, the configuration dictionary is monitored and updated through the established custom controller, the configuration updating of the application program is further completed, and then the management controller is used for executing the updating operation of the container group of the application program based on the monitored configuration updating information of the application program.
Optionally, the application updating device further includes:
and the configuration relation update request acquisition module is used for updating the configuration relation between the configuration dictionary of the custom resource record and the application program in response to the acquired configuration relation update request of the custom controller.
Optionally, the controller creating module 401 is specifically configured to traverse each application program in the cluster, and obtain a monitoring type of each application program; wherein the monitoring type comprises an active monitoring application, a passive monitoring application and a non-monitoring application; if the current application program is determined to be the active monitoring application, the current application program is not used as a monitoring object of the custom controller; and if the current application program is determined to be the passive monitoring application or the non-monitoring application, taking the current application program as a monitoring object of the self-defined controller.
Optionally, the controller creating module 401 is specifically further configured to, if it is determined that the current application program is a passive monitoring application and the average passive monitoring time of the current application program is greater than or equal to the average monitoring time of the custom controller, take the current application program as a monitoring object of the custom controller, and release an original monitoring tool corresponding to the current application program.
Optionally, the controller creation module 401 is specifically further configured to, if it is determined that the average active monitoring time of the current application program is greater than or equal to a first preset time, or the real-time level of the current application program is greater than or equal to a first preset level, use the current application program as a monitoring object of the custom controller; if the monitoring request initiated by the current application program is detected, not responding to the monitoring request initiated by the current application program; if the average active monitoring time of the current application program is less than the first preset time and the real-time level of the current application program is less than the first preset level, the current application program is not used as a monitoring object of the custom controller.
Optionally, the first preset time is greater than an average monitoring time of the custom controller.
Optionally, the controller creation module 401 is specifically further configured to create a plurality of different custom controllers and allocate different custom resources to each of the custom controllers; each self-defined controller is matched with application programs of different monitoring types respectively; the monitoring priority of the active monitoring application, the passive monitoring application and the non-monitoring application is sequentially increased; if monitoring requests of a plurality of custom controllers are detected, the monitoring requests of the custom controllers are responded in sequence according to the monitoring priorities of the monitoring types respectively corresponding to the custom controllers.
The device can execute the application program updating method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method. Technical details not described in detail in this embodiment may refer to the method for updating an application program provided in any embodiment of the present invention.
Example five
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may 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 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various 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, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, for example, the update method of the application program.
In some embodiments, the method of updating an application program may be implemented as a computer program tangibly embodied on 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 onto the heterogeneous hardware accelerator via the ROM and/or the 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 perform the update method of the application program in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can 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 a trackball) through which a user can provide input to the heterogeneous hardware accelerator. Other kinds of devices may also be used to provide for interaction with a user; for example, 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, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for updating an application program, comprising:
creating a custom controller and distributing custom resources for the custom controller; the custom resource is used for recording the configuration relation between the configuration dictionary and the application program;
monitoring the updating state of the configuration dictionary according to the configuration relation by the custom controller, and carrying out configuration updating on the application program when the updating information of the configuration dictionary is monitored;
And executing the updating operation of the container group of the application program by the management controller according to the monitored configuration updating information of the application program.
2. The method of claim 1, further comprising, after creating a custom controller and assigning custom resources to the custom controller:
and in response to the acquired configuration relation updating request of the custom controller, updating the configuration relation between the configuration dictionary of the custom resource record and the application program.
3. The method according to claim 1, wherein creating a custom controller and assigning custom resources to the custom controller comprises:
traversing each application program in the cluster, and acquiring the monitoring type of each application program; wherein the monitoring type comprises an active monitoring application, a passive monitoring application and a non-monitoring application;
if the current application program is determined to be the active monitoring application, the current application program is not used as a monitoring object of the custom controller;
and if the current application program is determined to be the passive monitoring application or the non-monitoring application, taking the current application program as a monitoring object of the self-defined controller.
4. The method according to claim 3, wherein if the current application program is determined to be a passive monitoring application or a non-monitoring application, the method further comprises:
if the current application program is determined to be the passive monitoring application, and the average passive monitoring time of the current application program is greater than or equal to the average monitoring time of the custom controller, taking the current application program as a monitoring object of the custom controller, and releasing an original monitoring tool corresponding to the current application program.
5. The method of claim 3, further comprising, after determining that the current application program is an active monitoring application:
if the average active monitoring time of the current application program is determined to be greater than or equal to a first preset time or the real-time grade of the current application program is determined to be greater than or equal to a first preset grade, the current application program is taken as a monitoring object of the self-defined controller;
if the monitoring request initiated by the current application program is detected, not responding to the monitoring request initiated by the current application program;
the step of taking the current application program not as the monitoring object of the custom controller comprises the following steps:
If the average active monitoring time of the current application program is less than the first preset time and the real-time level of the current application program is less than the first preset level, the current application program is not used as a monitoring object of the custom controller.
6. The method of claim 5, wherein the first preset time is greater than an average monitoring time of the custom controller.
7. The method of claim 1, wherein creating and assigning custom resources to a custom controller comprises:
creating a plurality of different custom controllers and allocating different custom resources to each of the custom controllers; each self-defined controller is matched with application programs of different monitoring types respectively; the monitoring priority of the active monitoring application, the passive monitoring application and the non-monitoring application is sequentially increased;
if monitoring requests of a plurality of custom controllers are detected, the monitoring requests of the custom controllers are responded in sequence according to the monitoring priorities of the monitoring types respectively corresponding to the custom controllers.
8. An application program updating apparatus, comprising:
The controller creation module is used for creating a custom controller and distributing custom resources for the custom controller; the custom resource is used for recording the configuration relation between the configuration dictionary and the application program;
the configuration updating execution module is used for monitoring the updating state of the configuration dictionary according to the configuration relation through the self-defined controller, and carrying out configuration updating on the application program when the updating information of the configuration dictionary is monitored;
and the container group updating execution module is used for executing the container group updating operation of the application program according to the monitored configuration updating information of the application program through the management controller.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of updating an application of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the method of updating an application of any of claims 1-7 when executed.
CN202310440499.7A 2023-04-23 2023-04-23 Application program updating method and device, electronic equipment and storage medium Pending CN116594764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310440499.7A CN116594764A (en) 2023-04-23 2023-04-23 Application program updating method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310440499.7A CN116594764A (en) 2023-04-23 2023-04-23 Application program updating method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116594764A true CN116594764A (en) 2023-08-15

Family

ID=87610706

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310440499.7A Pending CN116594764A (en) 2023-04-23 2023-04-23 Application program updating method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116594764A (en)

Similar Documents

Publication Publication Date Title
CN105429776B (en) Method and system for managing functions of virtual network
CN112559182B (en) Resource allocation method, device, equipment and storage medium
US20230020324A1 (en) Task Processing Method and Device, and Electronic Device
CN112650576A (en) Resource scheduling method, device, equipment, storage medium and computer program product
CN114936173B (en) Read-write method, device, equipment and storage medium of eMMC device
CN112905314A (en) Asynchronous processing method and device, electronic equipment, storage medium and road side equipment
CN115658311A (en) Resource scheduling method, device, equipment and medium
CN115580645A (en) Service switching method and device, electronic equipment and storage medium
CN113608765A (en) Data processing method, device, equipment and storage medium
CN117725115A (en) Database sequence processing method, device, equipment and storage medium
CN116248689A (en) Capacity expansion method, device, equipment and medium for cloud native application
CN116126916A (en) Data query method, device and equipment based on intelligent network card
CN113032092B (en) Distributed computing method, device and platform
CN116594764A (en) Application program updating method and device, electronic equipment and storage medium
CN114691781A (en) Data synchronization method, system, device, equipment and medium
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN114924806B (en) Dynamic synchronization method, device, equipment and medium for configuration information
CN117009000A (en) Component, method, device, apparatus and medium for operating open source buddha system
CN115454660A (en) Task management method and device, electronic equipment and storage medium
CN117632492A (en) Resource management method and device, storage medium and electronic equipment
CN118152096A (en) Task allocation method, device, equipment and storage medium
CN118132232A (en) Method, apparatus, device, storage medium and program product for executing offline tasks
CN115913954A (en) Cluster management information interaction method, device, equipment and storage medium
CN117762600A (en) Method for executing task, related device and computer program product
CN115907779A (en) Transaction proposal verification method, device, server and storage medium

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