Method, device, equipment, medium and product for updating status indication information
By uniformly managing application deployment information in the target database of the cloud computing platform and determining status indication information based on specific elements, the problems of fault location and multiple application management in the container orchestration platform are solved, and unified management of application status and rapid resolution of faults are achieved.
Patent Information
- Application Number
- CN202411347118.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-09-26
AI Technical Summary
In the field of cloud computing technology, in the container orchestration platform, technicians are unable to accurately locate and resolve faults, and different operators use different methods to represent application status, resulting in inconsistent structure and semantics of the status field, and it is impossible to manage multiple PaaS applications in a unified manner.
By uniformly managing application deployment information in the target database, and determining status indication information based on one or more elements in the identification information, container group labels, container group number and timestamps, ensuring that the structure and semantics of the status field are consistent.
It realizes unified management of multiple applications, simplifies management difficulty, and technicians can locate specific problems based on status indication information and solve problems in a timely manner.
Smart Images

Figure CN118860577B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and in particular to a method, device, equipment, medium and product for updating status indication information. Background Art
[0002] In the field of cloud computing technology, container orchestration platforms have greatly simplified the deployment, management and expansion of containerized applications. As one of the three-tier service models of cloud computing (IaaS, PaaS, SaaS), Platform as a Service (PaaS) provides an efficient and convenient application development, deployment and operation environment, allowing developers to focus on the implementation of business logic without having to pay attention to the complexity of the underlying infrastructure. Among them, the three-tier service models of cloud computing are Infrastructure as a Service (IaaS), PaaS and Software as a Service (SaaS).
[0003] In the current container orchestration platform, the related technology generally uses Operator to monitor the status of PaaS applications and update the status of PaaS applications to the user resource (Custom Resource, CR). Users can know the real-time status of PaaS applications by viewing the detailed information of CR. Among them, Operator is an automation tool designed specifically for Kubernetes environment. It realizes the automated management of specific applications or services by extending Kubernetes' Application Programming Interfaces (APIs) and control plane.
[0004] However, the status field in the CR in the related art only reflects the high-level status of the application (for example, whether it is running), which makes it difficult for technicians to accurately locate and solve faults. In addition, since different operators use different ways to represent the status of the application, the structure and semantics of the status field are inconsistent, making it impossible to uniformly manage multiple PaaS applications. For example, one operator may use status.phase to represent the status, while another operator may use status.state. Summary of the invention
[0005] In view of this, the present invention provides a method, apparatus, device, medium and product for updating status indication information to solve the problem that technicians are unable to accurately locate and solve faults.
[0006] In a first aspect, the present invention provides a method for updating status indication information, the method being applied to a cloud platform, the cloud platform storing a target database, the target database including deployment information of at least one application, the method comprising:
[0007] Obtaining a first monitoring instruction, wherein the first monitoring instruction includes first identification information of a first application;
[0008] Determine, in the target database, first deployment information of the first application according to the first identification information, wherein the first deployment information includes the first identification information, a first container group label, a first container group quantity, a first timestamp, and first status indication information;
[0009] Determine current second state indication information of the first application according to one or more elements of the first identification information, the first container group tag, the number of the first container groups, and the first timestamp;
[0010] determining whether the first status indication information and the second status indication information are the same;
[0011] When it is determined that the first status indication information and the second status indication information are different, the first status indication information in the first deployment information is updated to the second status indication information.
[0012] The method for updating status indication information provided by the present invention has the following advantages:
[0013] This solution manages the deployment information of cloud platform applications in a unified manner through the target database. Each time the status indication information is updated, the corresponding status indication information of the target database can be updated. In this way, regardless of the service type of the application, the status field used is the same, which can simplify the management of multiple applications. In addition, this solution determines the status indication information based on one or more elements in the identification information, container group label, container group number and timestamp, so that the status indication information can include relevant information of the container group. The technicians can locate the specific problem based on the status indication information and solve it in time.
[0014] In an optional implementation, determining the current second state indication information of the first application according to one or more elements of the first identification information, the first container group tag, the first container group quantity, and the first timestamp includes:
[0015] Determining, according to the first identification information, whether the cloud platform has deployed user resources corresponding to the first identification information;
[0016] When it is determined that the cloud platform has deployed the user resources corresponding to the first identification information, determining whether there is at least one container group corresponding to the first container group tag;
[0017] When it is determined that there is no container group corresponding to the first container group tag, the first preset state is determined as the second state indication information, wherein the first preset state is used to indicate that the cloud platform has completed the creation of the user resource corresponding to the first identification information, and has not started to create the container group corresponding to the first container group tag. Specifically, when the user resource has been created but no associated container group has been created, the cloud platform can mark the first application as a specific state (the first preset state). This state definition helps users and administrators clearly understand the deployment progress of the application.
[0018] In an optional implementation, when it is determined that there is at least one container group corresponding to the first container group tag, the method further includes:
[0019] determining whether the number of container groups corresponding to the first container group tag is equal to the first container group number;
[0020] When it is determined that the number of container groups corresponding to the first container group tag is less than the first number of container groups, a second preset state is determined as the second state indication information, wherein the second preset state is used to indicate that the first application is creating a container group corresponding to the first container group tag.
[0021] Specifically, when the user resources have been created and some associated container groups have been created, the cloud platform can mark the first application as a specific state (a second preset state). This state definition helps users and administrators clearly understand the deployment progress of the application.
[0022] In an optional implementation, when it is determined that the number of container groups corresponding to the first container group tag is equal to the first container group number, the method further includes:
[0023] Obtaining a timestamp recorded in each of the container groups and a status of each of the container groups;
[0024] Determine, according to the timestamp of the target container group and the first timestamp, whether the target container group is the latest container group, wherein the target container group is any one of the at least one container group;
[0025] When it is determined that all container groups in at least one of the container groups are the latest container groups, and the states of all container groups in at least one of the container groups are in the running state, a third preset state is determined as the second state indication information, wherein the third preset state is used to indicate that the first application has been deployed and can be used normally.
[0026] Specifically, when all associated container groups have been created or updated and all container groups have been successfully run, the cloud platform can mark the first application as a specific state (third preset state). This state definition helps users and administrators clearly understand the deployment progress of the application.
[0027] In an optional implementation, when it is determined that any container group in at least one of the container groups is not the latest container group, or when it is determined that the state of any container group in at least one of the container groups is not the running state, the method further includes:
[0028] A fourth preset state is determined as the second state indication information, wherein the fourth preset state is used to indicate that the first application is being deployed.
[0029] Specifically, when all associated container groups are not updated or all container groups cannot be successfully run, the cloud platform can mark the first application as a specific state (a fourth preset state). This state definition helps users and administrators clearly understand the deployment progress of the application.
[0030] In an optional implementation, before obtaining the first monitoring instruction, the method further includes:
[0031] receiving a creation instruction for the first application, wherein the creation instruction includes a first service type, a first container group label, and a number of the first container groups;
[0032] Generate the first identification information according to a pre-built identification generator, wherein the first identification information is a universal unique identification code;
[0033] Acquire the first moment of receiving the creation instruction, and use the first moment as the first timestamp;
[0034] generating the user resource according to the first service type, the first identification information, the first container group label, and the number of the first container groups;
[0035] A target annotation is added to the user resource, and the user resource with the target annotation is deployed on the cloud platform, wherein the target annotation is a key-value pair, the key in the key-value pair is a time field name, and the value in the key-value pair is the first timestamp.
[0036] Specifically, after receiving the creation instruction, a target annotation is added to the user resource so that the generated container group can carry timestamp information, which is convenient for subsequent determination of the version of the container group, that is, determining whether the container group is the latest container group.
[0037] In an optional implementation, after adding a target annotation to the user resource and deploying the user resource with the target annotation added to the cloud platform, the method further includes:
[0038] According to the user resource after adding the target annotation, container groups of the same number as the first container groups are created, wherein the container groups of the same number as the first container groups all include the first timestamp.
[0039] Specifically, by creating a container group according to the second user resource, the created container group may carry timestamp information, which facilitates subsequent determination of the version of the container group, that is, determining whether the container group is the latest container group.
[0040] In an optional implementation, when it is determined that the cloud platform has not deployed a user resource corresponding to the first identification information, the method further includes:
[0041] A fifth preset state is determined as the second state indication information, wherein the fifth preset state is used to indicate that the first application fails to be deployed.
[0042] Specifically, when the user resources are not deployed successfully, the cloud platform can mark the first application as a specific state (fifth preset state). This state definition helps users and administrators to clearly understand the deployment progress of the application.
[0043] In an optional embodiment, the method further includes:
[0044] When it is detected that the user resource is deployed successfully, the timing starts;
[0045] When the timing duration reaches a first preset duration and it is determined that the number of container groups corresponding to the first container group tag is less than the first number of container groups, or when the timing duration reaches a second preset duration and it is determined that at least one of the container groups has at least one container group that is not in a running state, the fifth preset state is determined as the second state indication information.
[0046] Specifically, when the user resources are not deployed successfully, the cloud platform can mark the first application as a specific state (fifth preset state). This state definition helps users and administrators to clearly understand the deployment progress of the application.
[0047] In an optional implementation, after acquiring the first moment of receiving the creation instruction and using the first moment as the first timestamp, the method further includes:
[0048] Generate the first deployment information according to the first service type, the first identification information, the first container group tag, the number of the first container groups, and the first timestamp;
[0049] The first deployment information is added to the target database.
[0050] Specifically, by creating a target database, the format of deployment information for applications of all service types can be unified. There is no need to use one Operator for each service type, and management of applications of different service types can be achieved, reducing the number of management tools and, in turn, reducing operation and maintenance costs.
[0051] In an optional embodiment, the method further includes:
[0052] receiving an update instruction for the first application;
[0053] According to the update instruction, the user resource after adding the target annotation is updated;
[0054] Acquire a second moment of receiving the update instruction, and use the second moment as a second timestamp;
[0055] Modify the first timestamp in the target annotation to the second timestamp, and modify the first timestamp in the first deployment information to the second timestamp;
[0056] According to the user resource after the timestamp is modified, at least one of the container groups is updated and restarted, so that the first timestamp in each of the container groups is updated to the second timestamp.
[0057] Specifically, when receiving an update instruction for the first application, the cloud platform updates the timestamp of the container group by updating the timestamp of the user resource, thereby facilitating the subsequent determination of whether the container group is the latest container group and more accurately determining the deployment status of the first application.
[0058] In an optional implementation, the first deployment information further includes error cause information;
[0059] When it is determined that the cloud platform has not deployed a user resource corresponding to the first identification information, the method further includes:
[0060] The error reason information of the first deployment information is modified to the user resource creation failure.
[0061] Specifically, in addition to the status indication information, the cloud platform can also fill in the error cause information in the deployment information, so that technical personnel can understand the detailed reasons and solve related problems in a timely manner.
[0062] In an optional implementation, the first deployment information further includes an error information field. When the timing duration reaches the preset duration and it is determined that the number of container groups corresponding to the first container group tag is less than the first number of container groups, or when the timing duration reaches the preset duration and it is determined that at least one of the container groups has at least one container group that is not in a running state, the method further includes:
[0063] The error reason information of the first deployment information is modified to container group deployment timeout.
[0064] Specifically, in addition to the status indication information, the cloud platform can also fill in the error cause information in the deployment information, so that technical personnel can understand the detailed reasons and solve related problems in a timely manner.
[0065] In an optional implementation, the first deployment information further includes an error information field, and when it is determined that all container groups in at least one of the container groups are the latest container groups and the states of all container groups in at least one of the container groups are in the running state, after determining the third preset state as the second state indication information, the method further includes:
[0066] When an error is detected in the operation of any container group in at least one of the container groups, the third preset state in the first deployment information is modified to a fifth preset state;
[0067] The error reason information of the first deployment information is modified to container group operation failure.
[0068] Specifically, in addition to the status indication information, the cloud platform can also fill in the error cause information in the deployment information, so that technical personnel can understand the detailed reasons and solve related problems in a timely manner.
[0069] In an optional implementation, the first monitoring instruction is periodically generated after receiving the creation instruction.
[0070] Specifically, during the process of creating the first application, the creation process can be monitored in real time, so that the technical personnel can understand the deployment status of the first application in a timely manner.
[0071] In an optional embodiment, the method further includes:
[0072] Receiving a status query instruction sent by a client, wherein the query instruction includes first identification information;
[0073] Acquire, in the target database, first deployment information corresponding to the first identification information according to the first identification information;
[0074] The latest target status indication information of the first application is extracted from the status field of the first deployment information and fed back to the client.
[0075] Specifically, by using the unique identification information (first identification information), the cloud platform can accurately locate the specific deployment record, thereby providing accurate status feedback to the client.
[0076] In a second aspect, the present invention provides a device for updating status indication information, the device is applied to a cloud platform, the cloud platform stores a target database, the target database includes deployment information of at least one application, the device includes:
[0077] An acquisition module, configured to acquire a first monitoring instruction, wherein the first monitoring instruction includes first identification information of a first application program;
[0078] a determination module, configured to determine, in the target database, first deployment information of the first application program according to the first identification information, wherein the first deployment information includes the first identification information, a first container group tag, a first container group quantity, a first timestamp, and first state indication information; determine, according to one or more elements of the first identification information, the first container group tag, the first container group quantity, and the first timestamp, current second state indication information of the first application program; and determine whether the first state indication information and the second state indication information are the same;
[0079] An updating module is used to update the first status indication information in the first deployment information to the second status indication information when it is determined that the first status indication information and the second status indication information are different.
[0080] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for updating status indication information of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0081] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for updating status indication information of the above-mentioned first aspect or any corresponding embodiment thereof.
[0082] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for updating status indication information of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0084] Figure 1 It is a schematic diagram of the architecture of a cloud platform according to the relevant technology;
[0085] Figure 2 is a schematic diagram of the architecture of a cloud platform according to an embodiment of the present invention;
[0086] Figure 3 is a flow chart of a method for updating status indication information according to an embodiment of the present invention;
[0087] Figure 4 is a flowchart of a method for creating an application according to an embodiment of the present invention;
[0088] Figure 5 is a schematic diagram of state changes of an application program according to the related art;
[0089] Figure 6 is a schematic diagram of state changes of an application according to an embodiment of the present invention;
[0090] Figure 7 This is a schematic diagram of state changes of a Kafka service type application according to an embodiment of the present invention;
[0091] Figure 8 is a structural block diagram of a device for updating status indication information according to an embodiment of the present invention;
[0092] Fig. 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0093] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0094] The following is an explanation of the professional terms involved in this plan.
[0095] Platform as a Service (PaaS) is a cloud computing service model in which users can obtain a complete computing platform through the Internet, including but not limited to operating systems, database management systems, middleware, development tools, runtime environments, application programming interfaces (APIs), and other services to support application development, testing, deployment, and management.
[0096] Pod: A combination of one or more containers.
[0097] Container: A lightweight, portable, standalone software package that contains all the elements needed to run an application. Containerization technology allows developers to package applications and their dependencies together, ensuring that applications can be developed in one environment and run in another environment.
[0098] Custom Resource Definition (CRD): A CRD is a Kubernetes resource object that allows users to define a new resource type. For example, a user resource object can include metadata such as the name, group name, version, and schema of the defined resource type.
[0099] Custom Resource (CR): A CR is a single instance of a new resource type defined by a CRD.
[0100] Operator: It is an automation tool designed specifically for the Kubernetes (K8s) environment. It implements automated management of specific applications or services by extending the K8s API and control plane.
[0101] Helm Chart: Usually contains a set of files and directories that describe the configuration information of K8s resources. Among them, values.yaml is a very important file, which contains the default configuration values of the Chart, which can be used by the Yaml files in the templates directory. Helm Chart is usually packaged into a tarball, which can facilitate the deployment, upgrade, rollback, and uninstallation of applications.
[0102] YAML: is a human-readable data serialization language. K8s supports using YAML format files to create resource objects.
[0103] Deployment: is an important resource object in K8s.
[0104] Service: is an important resource object in K8s.
[0105] Kafka: An open source stream processing platform, mainly used to build real-time data pipelines and stream applications. Kafka's Broker is a core component in the Kafka cluster, responsible for receiving, storing and distributing messages.
[0106] Zookeeper: It is a distributed coordination service that provides functions such as configuration management, synchronization services, and distributed locks for distributed systems. It can help Kafka achieve collaborative work and state consistency between nodes.
[0107] In related technologies, the architecture of the cloud platform can be as follows: Figure 1 As shown. The cloud platform may include a Kubernetes (K8s) cluster. In the process of deploying an application, the cloud platform may perform the following steps:
[0108] 1. Deploy Operator: Operator is a custom controller that defines and manages PaaS applications based on Kubernetes custom resources. Install the required Operator through Helm Chart or Kubernetes resource list (for example, YAML file).
[0109] 2. Create user resources.
[0110] 3. Operator processes user resources: Once a user resource is created, the Operator detects this event and starts processing it. The Operator performs corresponding operations based on the information defined in the user resource, for example, creating K8s resources such as Deployment, Service, and Container Group to deploy and manage PaaS applications.
[0111] 4. Lifecycle management: Operators monitor the lifecycle of PaaS applications and perform corresponding operations as needed. For example, when a PaaS application needs to be updated or expanded, Operators adjust K8s resources accordingly. Operators also monitor the status of PaaS applications and update the status of PaaS applications to user resources. Users can know the running status of PaaS applications at this time by viewing the detailed information of user resources.
[0112] The above-mentioned related technologies have the following disadvantages:
[0113] 1. Incomplete status information: The status field in the user resource only reflects the high-level status of the application (such as being created, running, failed, etc.), lacking a detailed description of the underlying details (such as the specific status of each Pod, resource usage, etc.). This incomplete information may make it difficult for technicians to accurately locate and solve problems.
[0114] 2. Operational complexity: Users need to parse and understand the complex status field structure in user resources, which may increase the learning and usage costs for users who are not familiar with K8s or specific operators.
[0115] 3. Insufficient fault tolerance: If the Operator fails or crashes, the user resource status field may not be updated in time, thus affecting the accuracy and real-time performance of status acquisition.
[0116] 4. Lack of a unified status representation standard: Different operators may use different ways to represent application status, resulting in inconsistent structure and semantics of status fields. For example, one operator may use status.phase to represent the status, while another operator may use status.state. Active and Running may both indicate that the PaaS application is running healthily in different operators. This inconsistency makes it impossible to uniformly parse and manage status information between multiple PaaS applications.
[0117] The embodiment of the present invention provides a cloud platform, such as Figure 2As shown, the cloud platform may include a management logic node, a storage logic node, and a working logic node. Among them, the management logic node may be deployed with a PaaS management tool, the storage logic node may store a target database, the target database may include the deployment information of at least one application, and the working logic node may be deployed with at least one application. Each logical node may include one or more physical nodes. For example, the working logic node may be a Kubernetes cluster including multiple servers. In some optional implementations, there may be multiple management logic nodes. When the main management logic node fails, the backup management logic node may be started to avoid the failure to update the application status in time, thereby ensuring the accuracy and real-time acquisition of the application status.
[0118] The embodiment of the present invention provides a method for updating status indication information, which indicates relevant information of a container group through the status indication information, so that a technician can timely understand the problem of an application through the status indication information and solve it in time, and at the same time, the difficulty of managing the application can be simplified.
[0119] According to an embodiment of the present invention, a method embodiment for updating status indication information is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0120] In this embodiment, a method for updating status indication information is provided, which can be specifically executed by a PaaS management tool installed on the management logic node in the above cloud platform. Figure 3 is a flow chart of a method for updating status indication information according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0121] Step S301, obtaining a first monitoring instruction.
[0122] The first monitoring instruction may include first identification information of the first application program, and the first identification information is a universally unique identifier (UUID).
[0123] Specifically, the cloud platform can be deployed with at least one application, and for each application, the PaaS management tool can periodically generate monitoring instructions corresponding to each application. Each time a monitoring instruction is obtained, the PaaS management tool can extract the identification information of the application from the monitoring instruction. Accordingly, in the current cycle, when the PaaS management tool obtains the first monitoring instruction, the first identification information of the first application can be extracted from the first monitoring instruction. Alternatively, the user can query the status of the first application on the client, and accordingly, the client can generate the first monitoring instruction according to the user's operation and send it to the cloud platform.
[0124] In some optional implementations, the first monitoring instruction may be periodically generated after receiving a creation instruction corresponding to the first application. In this way, the status of the first application may be monitored from the initial stage of the first application, and the life cycle of the first application may be monitored more comprehensively.
[0125] Step S302: Determine first deployment information of a first application in a target database according to the first identification information.
[0126] The data structure of the target database may include an identification information field, a container group tag field, a container group quantity field, an error cause information field, a time field, and a status indication information field. Accordingly, each piece of deployment information in the target database may include identification information, a container group tag, a container group quantity, error cause information, a timestamp, and status indication information. That is, the first deployment information may include first identification information, a first container group tag, a first container group quantity, a first timestamp, first error cause information, and first status indication information. The first status indication information may be status indication information determined in the previous cycle corresponding to the current cycle.
[0127] Specifically, the cloud platform can match the first deployment information corresponding to the first identification information in the target database according to the first identification information, that is, determine the first deployment information of the first application.
[0128] Step S303: Determine the current second state indication information of the first application according to one or more elements of the first identification information, the first container group tag, the first container group quantity and the first timestamp.
[0129] Specifically, the cloud platform may be pre-set with the following rules: First, user resources have been deployed ∩ no container group has been created = the first preset state. Second, the number of container groups has not reached the expected value = the second preset state. Third, the number of container groups has reached the expected value ∩ (any container group is not the latest ∪ any container group is not in full running state) = the fourth preset state. Fourth, the number of container groups has reached the expected value ∩ all container groups are the latest ∩ all container groups are in running state = the third preset state. Fifth, user resources have not been deployed ∪ container group creation failed ∪ container group deployment timed out ∪ container group operation failed = the fifth preset state.
[0130] Specifically, the above step S303 may include:
[0131] Step 1: Determine, based on the first identification information, whether the cloud platform has deployed user resources corresponding to the first identification information.
[0132] Step 2: When it is determined that the cloud platform has deployed the user resources corresponding to the first identification information, it is determined whether there is at least one container group corresponding to the first container group tag.
[0133] Step three: when it is determined that there is no container group corresponding to the first container group tag, the first preset state is determined as the second state indication information.
[0134] The first preset state is used to indicate that the cloud platform has completed the creation of the user resource corresponding to the first identification information, and has not started to create the container group corresponding to the first container group tag. For example, the name of the first preset state may be "initializing".
[0135] Step 4: when it is determined that there is at least one container group corresponding to the first container group tag, determine whether the number of container groups corresponding to the first container group tag is equal to the first container group number.
[0136] Step five: when it is determined that the number of container groups corresponding to the first container group tag is less than the first number of container groups, the second preset state is determined as the second state indication information.
[0137] The second preset state is used to indicate that the first application is creating a container group corresponding to the first container group tag. For example, the name of the second preset state may be "starting".
[0138] Step six: when it is determined that the number of container groups corresponding to the first container group tag is equal to the first number of container groups, obtain the timestamp recorded in each container group and the status of each container group.
[0139] Step seven: determine whether the target container group is the latest container group according to the timestamp of the target container group and the first timestamp.
[0140] The target container group is any container group in the at least one container group.
[0141] Specifically, the cloud platform may determine whether the timestamp of the target container group is consistent with the first timestamp, and if so, the target container group may be considered to be the latest container group. If not, the target container group may be considered not to be the latest container group.
[0142] Step eight: when it is determined that all container groups in the at least one container group are the latest container groups, and the states of all container groups in the at least one container group are in the running state, the third preset state is determined as the second state indication information.
[0143] The third preset state may be used to indicate that the first application has been created. For example, the name of the third preset state may be "available".
[0144] Step nine: when it is determined that any container group in the at least one container group is not the latest container group, or when it is determined that the state of any container group in the at least one container group is not the running state, the fourth preset state is determined as the second state indication information.
[0145] The fourth preset state is used to indicate that the first application is being deployed. For example, the name of the fourth preset state may be "waiting for readiness".
[0146] Step ten: when it is determined that the cloud platform has not deployed the user resources corresponding to the first identification information, the fifth preset state is determined as the second state indication information.
[0147] The fifth preset state is used to indicate that the deployment of the first application program fails.
[0148] In some optional implementations, the life cycle of an application may include multiple stages, specifically, the user resource deployment stage, the container group deployment stage, the container group operation stage, and the update stage. In different stages, the status indication information of the application may be determined according to the method corresponding to the stage. Accordingly, in step S303, the PaaS management tool may first obtain the target stage of the current first application, and obtain the target method corresponding to the target stage. According to the target method, one or more elements corresponding to the target method are selected from the first identification information, the first container group label, the first container group quantity, and the first timestamp to determine the second status indication information. Accordingly, the specific steps may be as follows:
[0149] When the target stage is the user resource deployment stage, the selected element may include the first identification information, and the PaaS management tool may determine whether the cloud platform has deployed the user resources corresponding to the first identification information based on the first identification information. When it is determined that the cloud platform has deployed the user resources corresponding to the first identification information, the first preset state is determined as the second state indication information, and the first application is marked to enter the container group deployment stage. Alternatively, when it is determined that the cloud platform has not deployed the user resources corresponding to the first identification information, the fifth preset state is determined as the second state indication information.
[0150] When the target stage is the container group deployment stage, the selected elements may include the first container group tag and the first container group number. The PaaS management tool may determine whether there is at least one container group corresponding to the first container group tag. When it is determined that there is no container group corresponding to the first container group tag, the first preset state is determined as the second state indication information. Alternatively, when it is determined that there is at least one container group corresponding to the first container group tag, it is determined whether the number of container groups corresponding to the first container group tag is equal to the number of first container groups. When it is determined that the number of container groups corresponding to the first container group tag is less than the number of first container groups, the second preset state is determined as the second state indication information. Alternatively, when it is determined that the number of container groups corresponding to the first container group tag is equal to the number of first container groups, the state of each container group corresponding to the first container group tag is obtained. When it is determined that the states of all container groups are in the running state, the third preset state is determined as the second state indication information, and the first application may be marked to enter the container group running stage. Alternatively, when it is determined that the state of any container group in at least one container group is not in the running state, the fourth preset state is determined as the second state indication information.
[0151] When the target stage is the container group running stage, the selected elements may include the first container group tag and the first container group quantity. The PaaS management tool may determine, based on the first container group tag, whether there are container groups with a number equal to the first container group quantity running normally. If not, the PaaS management tool may determine the fifth preset state as the second state indication information.
[0152] When the target stage is the update stage, the selected elements may include the first container group tag, the first container group number, and the first timestamp. The PaaS management tool may obtain the timestamp recorded in each container group corresponding to the first container group tag according to the first container group tag. Then, it may be determined whether the target container group is the latest container group according to the timestamp of the target container group and the first timestamp. When it is determined that any container group among all the container groups corresponding to the first container group tag is not the latest container group, the fourth preset state may be determined as the second state indication information. Alternatively, when it is determined that all the container groups (the first container group number container groups) corresponding to the first container group tag are the latest container groups, the states of all the container groups corresponding to the first container group tag may be obtained according to the first container group tag, and when it is determined that the states of all the container groups (the first container group number container groups) corresponding to the first container group tag are all in the running state, the third preset state may be determined as the second state indication information. Alternatively, when it is determined that any container group among the container groups corresponding to the first container group tag is not in the running state, the fourth preset state may be determined as the second state indication information.
[0153] In some optional implementations, when it is determined that the cloud platform has not deployed the user resources corresponding to the first identification information, the PaaS management tool may determine the user resource creation failure as the second error cause information.
[0154] In some optional implementations, after the first application is successfully deployed, the first application starts to run. During the operation of the first application, that is, during the operation of all container groups corresponding to the first container group tag, any container group may have an operation error due to the influence of cloud platform environmental factors. At this time, it is necessary to update the status of the first application in real time so that the technician can promptly know that there is a problem with the first application. Accordingly, when an operation error is detected with any container group in at least one container group, the third preset state in the first deployment information is modified to the fifth preset state. For example, the name of the fifth preset state can be "failure". Furthermore, the PaaS management tool can also determine the failure of the container group operation as the second error cause information, so that the technician can promptly understand that the cause of the error in the first application operation is the failure of the container group operation.
[0155] In some optional implementations, when the user resource deployment is monitored to be successful, the timing is started. When the timing duration reaches the first preset duration and it is determined that the number of container groups corresponding to the first container group tag is less than the first number of container groups, or when the timing duration reaches the second preset duration and it is determined that there is at least one container group that is not in operation in at least one container group, the fifth preset state is determined as the second state indication information. Furthermore, the PaaS management tool can also determine the container group deployment timeout as the second error cause information. Among them, the first preset duration can be the same as the second preset duration, or it can be different. For example, the first preset duration and the second preset duration can both be 30 minutes.
[0156] In some optional implementations, when the timing duration reaches a first preset duration and it is determined that the number of container groups corresponding to the first container group tag is less than the first number of container groups, a container group creation timeout may be determined as the second error cause information. When the timing duration reaches a second preset duration and it is determined that at least one container group in the at least one container group is not in a running state, a container group startup timeout may be determined as the second error cause information.
[0157] Step S304: determine whether the first status indication information and the second status indication information are the same.
[0158] Step S305: When it is determined that the first status indication information and the second status indication information are different, the first status indication information in the first deployment information is updated to the second status indication information.
[0159] Specifically, the PaaS management tool can determine whether the first status indication information and the second status indication information are the same. If yes, it is considered that the status of the first application in the current cycle is consistent with the status of the previous cycle, and no update is required, and the next cycle can be entered. If no, the first deployment information can be updated, that is, the first status indication information in the first deployment information is updated to the second status indication information.
[0160] In some optional implementations, when it is determined that the first status indication information and the second status indication information are different, the PaaS management tool may also update the first error cause information in the first deployment information to the second error cause information.
[0161] In some optional embodiments, when the first monitoring instruction is generated periodically, the user can query the status of the first application. The cloud platform can directly perform the query operation in the target database, and the query speed is relatively fast. Accordingly, the cloud platform can receive the status query instruction sent by the client, wherein the status query instruction includes the first identification information. Then, according to the first identification information, the first deployment information related to the first application is obtained in the target database, and the latest target status indication information of the first application is extracted from the status field of the first deployment information, and fed back to the client.
[0162] In some optional implementations, when the PaaS management tool determines that the target state indication information is one of the first preset state, the second preset state, the third preset state, and the fourth preset state, the target state indication information may be directly fed back. Alternatively, when the target state indication information is determined to be the fifth preset state, the target error indication information is extracted from the first deployment information, and the target state indication information and the target error indication information are fed back to the client.
[0163] The method for updating status indication information provided in this embodiment manages the deployment information of the cloud platform application program in a unified manner through the target database. Each time the status indication information is updated, the corresponding status indication information of the target database can be updated. In this way, regardless of the service type of the application, the status field used is the same, which can simplify the management of multiple applications. In addition, the scheme determines the status indication information based on one or more elements in the identification information, container group label, container group number and timestamp, so that the status indication information can include relevant information of the container group, and the technician can locate the specific problem based on the status indication information and solve it in time.
[0164] In this embodiment, a method for creating an application is provided, which can be executed by the above-mentioned PaaS management tool. Figure 4 is a flowchart of a method for creating an application according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0165] Step S401: receiving a creation instruction for a first application.
[0166] The creation instruction may include a first service type, a first container group label, and a first container group quantity. For example, the first service type may be one of Kafka, Zookeeper, Redis, and the like.
[0167] Specifically, the user may input the first service type, the first container group label, the first container group quantity and configuration information of the first application program on the client, and the client may generate a creation instruction for the first application program based on the information input by the user and send the instruction to the cloud platform. In this way, the cloud platform may receive the creation instruction for the first application program.
[0168] Step S402: Generate first identification information according to a pre-built identification generator.
[0169] The first identification information may be a UUID.
[0170] Specifically, after receiving the creation instruction, the cloud platform may first generate the first identification information according to a pre-built identification generator.
[0171] In some optional implementations, the cloud platform may generate a name for the first application program according to the first service type. For example, when the first service type is Kafka, the name of the generated first application program may be "mykafka".
[0172] Step S403, obtaining the first moment of receiving the creation instruction, and taking the first moment as the first timestamp.
[0173] Specifically, when the cloud platform receives the creation instruction, it can also record the first moment of receiving the creation instruction and determine the first moment as the first timestamp. In this way, the initial version information of the first application can be recorded to facilitate subsequent updates.
[0174] In some optional implementations, after step S403, the cloud platform may further generate first deployment information according to the first service type, the first identification information, the first container group tag, the first container group quantity and the first timestamp, and add the first deployment information to the target database.
[0175] Specifically, the cloud platform can generate the first deployment information by combining the first service type, the first identification information, the first container group label, the first container group quantity and the first timestamp according to the preset storage structure. Further, the cloud platform can fill each item of information in the first deployment information into the corresponding field in the target database.
[0176] Step S404: Generate user resources according to the first service type, the first identification information, the first container group tag, and the number of first container groups.
[0177] Step S405, adding a target annotation to the user resource, and deploying the user resource with the target annotation added on the cloud platform.
[0178] The target annotation may be a key-value pair, the key in the key-value pair may be a time field name, and the value in the key-value pair may be a first timestamp.
[0179] Step S406: Create container groups of the same number as the first container group according to the user resources after adding the target annotation.
[0180] The container groups having a number equal to that of the first container groups all include the first timestamp.
[0181] In some optional implementations, the user may input update information of the first application program on the client, and the client may generate an update instruction based on the information input by the user and send it to the cloud platform. In this way, the PaaS management tool may receive the update instruction for the first application program. Then, the user resource may be updated according to the update instruction (for example, when creating a user resource, the creation instruction may also include configuration parameter information, and accordingly, the update instruction may include update configuration parameter information, and accordingly, the PaaS management tool may update the configuration parameter information in the user resource according to the update instruction, or the update instruction may include the updated number of container groups, and accordingly, the PaaS management tool may update the number of first container groups in the user resource according to the update instruction, so that the number of updated container groups is consistent with the number of updated first container groups). At this time, the PaaS management tool may also obtain the second moment of receiving the update instruction, use the second moment as the second timestamp, modify the first timestamp in the target annotation to the second timestamp, and modify the first timestamp in the first deployment information to the second timestamp. Finally, the PaaS management tool can update and restart all container groups in at least one container group corresponding to the first container group tag according to the user resource after the timestamp is modified, so that the first timestamp in each container group is updated to the second timestamp.
[0182] The method for creating an application provided in this embodiment adds a target annotation to the user resource after receiving the creation instruction, so that the generated container group can carry timestamp information, which is convenient for the subsequent determination of the version of the container group, that is, whether the container group is the latest container group. In addition, when receiving the update instruction for the first application, the cloud platform updates the timestamp of the user resource to update the timestamp of the container group, which is convenient for the subsequent determination of whether the container group is the latest container group, and more accurately determines the deployment status of the first application.
[0183] like Figure 5As shown in the figure, in the related art, after the application is updated, each Pod corresponding to the application will be restarted in a rolling manner, and each Pod (i.e. mypaas-1, mypaas-2, mypaas-3 in the figure) will go through the process of stopping, rebuilding, and running in sequence. At this time, the status of this application will be monitored to switch back and forth between "waiting for readiness" and "available". This results in frequent updates of status indication information, which wastes resources.
[0184] In this solution, timestamps are used. During the rolling restart of the Pod, the application status is always "waiting for ready", which is the fourth preset state mentioned above. This can reduce the number of status indication information updates, thus avoiding the problem of frequent status indication information updates.
[0185] like Figure 6 As shown, the method for updating the status indication information is described below using the complete life cycle of the first application.
[0186] The user can first enter the service type, first container group label, first container group quantity, etc. of the first application on the client, and the client can generate the corresponding creation instruction and send it to the management logic node of the cloud platform. The PaaS management tool in the management logic node can parse the creation instruction, obtain the service type, first container group label, first container group quantity and other information of the first application, and perform corresponding operations based on this information. For details, please refer to the specific processing of steps S401 to S406 above. In this process, first, the first application will successively enter the user resource deployment stage, the container group deployment stage, and the container group operation stage. If everything goes well, the first application will successively experience the first preset state, the second preset state, the fourth preset state and the third preset state. If any stage operation fails, the first application will change to the fifth preset state.
[0187] like Figure 7 As shown, the above method of updating status indication information is described below with a specific example.
[0188] The user sends a request to create a Kafka application (i.e., a creation instruction) through the PaaS management tool. The PaaS management tool saves the basic information of the Kafka application to the target database. The identification information of the Kafka application is UUID, the name is mykafka, and the number of container groups is 6. The PaaS management tool creates 3 copies of Kafka-broker and 3 copies of Zookeeper based on the service type Kafka. The PaaS management tool determines the status of the application as "initializing". At the same time, it creates corresponding user resources, starts a polling thread, periodically monitors the status of the Kafka application, and sends a deployment request to the K8s cluster. The K8s cluster creates Kafka-related container groups based on user resources, including Broker, Zookeeper and other components. When monitoring that the user resources are deployed successfully, the application status is determined to be "starting". When monitoring that the various container groups of Kafka (such as Kafka-Broker and Zookeeper) have been created but not all have entered the running state, the PaaS management tool determines the status of the Kafka application as "waiting for readiness". When all related container groups are in a running state, the PaaS management tool determines the state of the Kafka application as "available". If an error or timeout occurs during the process of creating or starting a related container group, the PaaS management tool can determine the state of the Kafka application as "failed" and record the error cause information.
[0189] In the present embodiment, a device for updating status indication information is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated here. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0190] This embodiment provides a device for updating status indication information, such as Figure 8 As shown, including:
[0191] An acquisition module 801 is used to acquire a first monitoring instruction, wherein the first monitoring instruction includes first identification information of a first application program;
[0192] The determination module 802 is used to determine the first deployment information of the first application in the target database according to the first identification information, wherein the first deployment information includes the first identification information, the first container group label, the first container group quantity, the first timestamp and the first state indication information; determine the current second state indication information of the first application according to one or more elements of the first identification information, the first container group label, the first container group quantity and the first timestamp; determine whether the first state indication information and the second state indication information are the same;
[0193] The updating module 803 is configured to update the first status indication information in the first deployment information to the second status indication information when it is determined that the first status indication information and the second status indication information are different.
[0194] In some optional implementations, the determination module 802 is specifically configured to:
[0195] Determine, based on the first identification information, whether the cloud platform has deployed user resources corresponding to the first identification information;
[0196] When it is determined that the cloud platform has deployed the user resources corresponding to the first identification information, determining whether there is at least one container group corresponding to the first container group tag;
[0197] When it is determined that there is no container group corresponding to the first container group tag, the first preset state is determined as the second state indication information, wherein the first preset state is used to indicate that the cloud platform has completed the creation of the user resources corresponding to the first identification information and has not started to create the container group corresponding to the first container group tag.
[0198] In some optional implementations, the determination module 802 is specifically configured to:
[0199] When it is determined that there is at least one container group corresponding to the first container group tag, determining whether the number of container groups corresponding to the first container group tag is equal to the first container group number;
[0200] When it is determined that the number of container groups corresponding to the first container group tag is less than the first container group number, a second preset state is determined as second state indication information, wherein the second preset state is used to indicate that the first application is creating a container group corresponding to the first container group tag.
[0201] In some optional implementations, the determination module 802 is specifically configured to:
[0202] When it is determined that the number of container groups corresponding to the first container group tag is equal to the first number of container groups, obtaining a timestamp recorded in each container group and a state of each container group;
[0203] Determine, according to the timestamp of the target container group and the first timestamp, whether the target container group is the latest container group, wherein the target container group is any one of the at least one container group;
[0204] When it is determined that all container groups in at least one container group are the latest container groups, and the states of all container groups in at least one container group are in the running state, the third preset state is determined as the second state indication information, wherein the third preset state is used to indicate that the first application has been deployed and can be used normally.
[0205] In some optional implementations, the determination module 802 is specifically configured to:
[0206] When it is determined that any container group in the at least one container group is not the latest container group, or when it is determined that the state of any container group in the at least one container group is not the running state, a fourth preset state is determined as the second state indication information, wherein the fourth preset state is used to indicate that the first application is being deployed.
[0207] In some optional implementations, the apparatus further includes a receiving module 804, a generating module 805, and a deploying module 806;
[0208] The receiving module 804 is configured to receive a creation instruction for the first application, wherein the creation instruction includes a first service type, a first container group label, and a first container group quantity;
[0209] A generating module 805, configured to generate first identification information according to a pre-built identification generator, wherein the first identification information is a universal unique identification code;
[0210] The acquisition module 801 is further used to acquire the first moment of receiving the creation instruction and use the first moment as the first timestamp;
[0211] The generating module 805 is further used to generate user resources according to the first service type, the first identification information, the first container group label and the number of the first container groups;
[0212] The deployment module 806 is also used to add target annotations to user resources and deploy the user resources with added target annotations on the cloud platform, wherein the target annotation is a key-value pair, the key in the key-value pair is the time field name, and the value in the key-value pair is the first timestamp.
[0213] In some optional implementations, the apparatus further includes a creation module 807, configured to:
[0214] According to the user resource after adding the target annotation, container groups of the same number as the first container group are created, wherein the container groups of the same number as the first container group all include the first timestamp.
[0215] In some optional implementations, the determination module 802 is specifically configured to:
[0216] When it is determined that the cloud platform has not deployed the user resources corresponding to the first identification information, the fifth preset state is determined as the second state indication information, wherein the fifth preset state is used to indicate that the deployment of the first application program has failed.
[0217] In some optional implementations, the determination module 802 is specifically configured to:
[0218] When the user resource deployment is detected to be successful, the timing starts;
[0219] When the timing duration reaches the first preset duration and it is determined that the number of container groups corresponding to the first container group tag is less than the first number of container groups, or when the timing duration reaches the second preset duration and it is determined that at least one container group in the at least one container group is not in the running state, the fifth preset state is determined as the second state indication information.
[0220] In some optional embodiments, the apparatus further includes an adding module 808;
[0221] The generating module 805 is further configured to generate first deployment information according to the first service type, the first identification information, the first container group label, the first container group quantity and the first timestamp;
[0222] The adding module 808 is further configured to add the first deployment information to the target database.
[0223] In some optional implementations, the apparatus further includes a modification module 809;
[0224] The receiving module 804 is further configured to receive an update instruction for the first application program;
[0225] The updating module 803 is further used to update the user resource after adding the target annotation according to the updating instruction;
[0226] The acquisition module 801 is further used to acquire a second moment of receiving the update instruction, and use the second moment as a second timestamp;
[0227] The modification module 809 is further used to modify the first timestamp in the target annotation to the second timestamp, and modify the first timestamp in the first deployment information to the second timestamp;
[0228] The updating module 803 is further configured to update and restart at least one container group according to the user resource after the timestamp is modified, so that the first timestamp in each container group is updated to the second timestamp.
[0229] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0230] The device for updating the status indication information in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0231] The embodiment of the present invention also provides a computer device having the above Figure 8 The device for updating status indication information is shown.
[0232] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0233] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0234] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0235] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0236] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0237] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0238] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0239] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0240] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for updating status indication information, characterized in that: The method is applied to a cloud platform, the cloud platform stores a target database, the target database includes deployment information of at least one application program, and the method includes: Obtaining a first monitoring instruction, wherein the first monitoring instruction includes first identification information of a first application; Determine, in the target database, first deployment information of the first application according to the first identification information, wherein the first deployment information includes the first identification information, a first container group label, a first container group quantity, a first timestamp, and first status indication information; Determine current second state indication information of the first application according to one or more elements of the first identification information, the first container group tag, the number of the first container groups, and the first timestamp; The determining, according to one or more elements of the first identification information, the first container group tag, the first container group quantity, and the first timestamp, the current second state indication information of the first application includes: Determining, according to the first identification information, whether the cloud platform has deployed user resources corresponding to the first identification information; When it is determined that the cloud platform has deployed the user resources corresponding to the first identification information, determining whether there is at least one container group corresponding to the first container group tag; When it is determined that there is no container group corresponding to the first container group tag, determining a first preset state as the second state indication information, wherein the first preset state is used to indicate that the cloud platform has completed creating the user resources corresponding to the first identification information, and has not started to create the container group corresponding to the first container group tag; determining whether the first status indication information and the second status indication information are the same; When it is determined that the first status indication information and the second status indication information are different, the first status indication information in the first deployment information is updated to the second status indication information.
2. The method according to claim 1, characterized in that When it is determined that there is at least one container group corresponding to the first container group tag, the method further includes: determining whether the number of container groups corresponding to the first container group tag is equal to the first container group number; When it is determined that the number of container groups corresponding to the first container group tag is less than the first container group number, a second preset state is determined as the second state indication information, wherein the second preset state is used to indicate that the first application is creating a container group corresponding to the first container group tag.
3. The method according to claim 2, characterized in that When it is determined that the number of container groups corresponding to the first container group tag is equal to the first container group number, the method further includes: Obtaining a timestamp recorded in each of the container groups and a status of each of the container groups; Determine, according to the timestamp of the target container group and the first timestamp, whether the target container group is the latest container group, wherein the target container group is any one of the at least one container group; When it is determined that all container groups in at least one of the container groups are the latest container groups, and the states of all container groups in at least one of the container groups are in the running state, a third preset state is determined as the second state indication information, wherein the third preset state is used to indicate that the first application has been deployed and can be used normally.
4. The method according to claim 3, characterized in that When it is determined that any container group in at least one of the container groups is not the latest container group, or when it is determined that the state of any container group in at least one of the container groups is not the running state, the method further includes: A fourth preset state is determined as the second state indication information, wherein the fourth preset state is used to indicate that the first application is being deployed.
5. The method according to any one of claims 1 to 4, characterized in that: Before obtaining the first monitoring instruction, the method further includes: receiving a creation instruction for the first application, wherein the creation instruction includes a first service type, a first container group label, and a number of the first container groups; Generate the first identification information according to a pre-built identification generator, wherein the first identification information is a universal unique identification code; Acquire the first moment of receiving the creation instruction, and use the first moment as the first timestamp; generating the user resource according to the first service type, the first identification information, the first container group label, and the number of the first container groups; A target annotation is added to the user resource, and the user resource with the target annotation is deployed on the cloud platform, wherein the target annotation is a key-value pair, the key in the key-value pair is a time field name, and the value in the key-value pair is the first timestamp.
6. The method according to claim 5, characterized in that After adding the target annotation to the user resource and deploying the user resource with the target annotation added to the cloud platform, the method further includes: According to the user resource after adding the target annotation, container groups of the same number as the first container groups are created, wherein the container groups of the same number as the first container groups all include the first timestamp.
7. The method according to claim 6, characterized in that When it is determined that the cloud platform has not deployed a user resource corresponding to the first identification information, the method further includes: A fifth preset state is determined as the second state indication information, wherein the fifth preset state is used to indicate that the first application fails to be deployed.
8. The method according to claim 7, characterized in that The method further comprises: When it is detected that the user resource is deployed successfully, the timing starts; When the timing duration reaches a first preset duration and it is determined that the number of container groups corresponding to the first container group tag is less than the first number of container groups, or when the timing duration reaches a second preset duration and it is determined that at least one of the container groups has at least one container group that is not in a running state, the fifth preset state is determined as the second state indication information.
9. The method according to claim 5, characterized in that After obtaining the first moment of receiving the creation instruction and using the first moment as the first timestamp, the method further includes: Generate the first deployment information according to the first service type, the first identification information, the first container group tag, the number of the first container groups, and the first timestamp; The first deployment information is added to the target database.
10. The method according to claim 5, characterized in that The method further comprises: receiving an update instruction for the first application; According to the update instruction, the user resource after adding the target annotation is updated; Acquire a second moment of receiving the update instruction, and use the second moment as a second timestamp; Modify the first timestamp in the target annotation to the second timestamp, and modify the first timestamp in the first deployment information to the second timestamp; According to the user resource after the timestamp is modified, at least one of the container groups is updated and restarted, so that the first timestamp in each of the container groups is updated to the second timestamp.
11. A device for updating status indication information, characterized in that: The device is applied to a cloud platform, the cloud platform stores a target database, the target database includes deployment information of at least one application program, and the device includes: An acquisition module, configured to acquire a first monitoring instruction, wherein the first monitoring instruction includes first identification information of a first application program; a determination module, configured to determine, in the target database, first deployment information of the first application program according to the first identification information, wherein the first deployment information includes the first identification information, a first container group tag, a first container group quantity, a first timestamp, and a first state indication information; determine, according to the first identification information, the first container group tag, the first container group quantity, and one or more elements of the first timestamp, the current second state indication information of the first application program; and determine whether the first state indication information and the second state indication information are the same; wherein, determining, according to the first identification information, the first container group tag, the first container group quantity, and one or more elements of the first timestamp, the current second state indication information of the first application program comprises: determining, according to the first identification information, whether the cloud platform has deployed user resources corresponding to the first identification information; when it is determined that the cloud platform has deployed user resources corresponding to the first identification information, determining whether there is at least one container group corresponding to the first container group tag; when it is determined that there is no container group corresponding to the first container group tag, determining a first preset state as the second state indication information, wherein the first preset state is used to indicate that the cloud platform has completed the creation of the user resources corresponding to the first identification information and has not started to create a container group corresponding to the first container group tag; An updating module is used to update the first status indication information in the first deployment information to the second status indication information when it is determined that the first status indication information and the second status indication information are different.
12. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for updating status indication information according to any one of claims 1 to 10 by executing the computer instructions.
13. 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 computer to execute the method for updating status indication information according to any one of claims 1 to 10.
14. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the method for updating status indication information according to any one of claims 1 to 10.
Citation Information
Patent Citations
Application scheduling method and device, electronic equipment and computer readable medium
CN116795478A
Port distribution method and device of application container, equipment, medium and product
CN117827365A