Method and device for managing instance identifier, storage medium and electronic equipment

By building an instance identifier management service based on Spring Boot in a container cloud environment, the problem of instance identifiers not being fixed due to Pod service migration is solved, and the unique identifier management and resource release of Pods are realized, improving the availability and health status monitoring of instance identifiers.

CN119003094APending Publication Date: 2024-11-22中国邮政储蓄银行股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411169293.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In a container cloud environment, Pod service migration can lead to the inability to permanently assign instance identifiers.

Method used

This service is built on Spring Boot and manages instance identifiers for Pods by detecting their status and heartbeat intervals. It ensures that each Pod has a unique identifier at startup and releases resources when it stops. It also uses heartbeat and socket detection technologies to monitor Pod connectivity and generate alerts to remind administrators to handle exceptions.

Benefits of technology

It enables unified management of instance identifiers for Pod services in a container cloud environment, ensuring that each Pod has a unique identifier at runtime and releases resources when stopped, thereby improving the availability of instance identifiers and enabling timely detection and handling of disconnection states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003094A_ABST
    Figure CN119003094A_ABST
Patent Text Reader

Abstract

The invention provides an instance identifier management method and device, a storage medium and electronic equipment. Comprising the steps that when it is detected that Pod is in a starting state, an instance identifier management service is called to query the number of instance identifiers, a first query result is generated, state updating is conducted on the instance identifiers according to the first query result, heartbeat time of the Pod is obtained according to the instance identifiers, and when it is determined that the heartbeat time is smaller than or equal to a time threshold value, the Pod is started. Determining that the Pod is in a normal connected state, and updating the heartbeat time to an instance identifier corresponding to the Pod; after it is determined that the Pod is in the normal connection state, under the condition that it is detected that the Pod is in the stop state, the instance identifier management service is called to query the number of instance identifiers corresponding to the Pod, a second query result is generated, and the instance identifiers are released according to the second query result. The problem that the instance identifier cannot be solidified due to Pod service drift in a container cloud environment is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of managing instance identification, and in particular, to a method, device, storage medium and electronic device for managing instance identification. Background Art

[0002] In a distributed microservice architecture, each project will have multiple independently deployed services. Each service needs to deploy multiple instances. These instances may be deployed on the same machine or on different machines. Each instance needs to have an instance identifier to mark the uniqueness of the instance. The instance identifier can be used to quickly locate the machine and instance in link tracking. Under the virtual machine, the instance identifier is configured in the bashrc of the operating system and used as an environment variable for applications. Each instance has an instance identifier, and once configured, it generally does not change. However, in the context of container cloud, multiple Pods will be deployed on a Node. When the Pod drifts, the instance identifier cannot be solidified for its use through bashrc. Summary of the invention

[0003] The main purpose of the present application is to provide a method, device, storage medium and electronic device for managing instance identification, so as to at least solve the problem that the instance identification cannot be solidified due to Pod service drift in a container cloud environment.

[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for managing instance identifiers is provided, comprising: building an instance identifier management service based on spring boot; when it is detected that a Pod is in a startup state, calling the instance identifier management service according to the parameters of the Pod to query the number of instance identifiers corresponding to the Pod, generating a first query result, and updating the state of the instance identifier according to the first query result, so that one Pod in the startup state corresponds to one instance identifier, wherein the Pod is the smallest scheduling unit in a container orchestration system Kubernetes cluster, and the parameters of the Pod include the Pod IP; obtaining the heartbeat time of the Pod according to the instance identifier, and determining that the Pod is in a normal connectivity state when the heartbeat time is less than or equal to a time threshold, and updating the heartbeat time to the instance identifier corresponding to the Pod; after determining that the Pod is in the normal connectivity state, when it is detected that the Pod is in a stopped state, calling the instance identifier management service again according to the parameters of the Pod to query the number of instance identifiers corresponding to the Pod, generating a second query result, and releasing the instance identifier according to the second query result, so that the Pod in the stopped state does not have a corresponding instance identifier.

[0005] Optionally, after obtaining the heartbeat time of the Pod according to the instance identifier, the method also includes: when it is determined that the heartbeat time is greater than the time threshold, determining that the Pod is in a lost state; using socket detection technology to detect whether the Pod is connected to the instance identifier management service; when it is determined that the Pod is not connected to the instance identifier management service, obtaining and updating the number of detections for detecting whether the Pod is connected to the instance identifier management service; determining whether the number of detections is greater than a preset number of detections, and when it is determined that the number of detections is greater than the preset number of detections, generating an alarm message, wherein the alarm message is used to remind the Pod that the Pod is not connected to the instance identifier management service.

[0006] Optionally, the status of the instance identifier is updated according to the first query result, including: when it is determined that the number of instance identifiers corresponding to the Pod in the first query result is equal to 1, determining whether the usage bit status of the instance identifier is used; when it is determined that the usage bit status of the instance identifier is used, determining whether the release bit status of the instance identifier is released; when it is determined that the release bit status of the instance identifier is released, updating the release bit status to used.

[0007] Optionally, the status of the instance identifier is updated according to the first query result, including: when it is determined that the number of instance identifiers corresponding to the Pod in the first query result is 0, obtaining a preset number of instance identifier sets with unused usage bits from the database, selecting an instance identifier from the instance identifier set to correspond to the Pod, and updating the usage bit status of the instance identifier corresponding to the Pod to used; or, when it is determined that the number of instance identifiers corresponding to the Pod in the first query result is greater than or equal to 2, generating abnormal data information, wherein the abnormal data information is used to remind that manual processing is required.

[0008] Optionally, before obtaining the heartbeat time of the Pod according to the instance identifier, the method also includes: calling the instance identifier management service again to query the number of instance identifiers corresponding to the Pod according to the parameters of the Pod, and generating a third query result; when it is determined that the number of instance identifiers corresponding to the Pod in the third query result is equal to 1, using heartbeat detection technology to obtain the heartbeat time of the Pod, and updating the heartbeat time to the parameters of the instance identifier, wherein the parameters of the instance identifier include the heartbeat time; when it is determined that the number of instance identifiers corresponding to the Pod in the third query result is equal to 0, generating reminder information, wherein the reminder information is used to remind that the instance identifier corresponding to the Pod has not been queried; when it is determined that the number of instance identifiers corresponding to the Pod in the third query result is greater than or equal to 2, generating abnormal data information, wherein the abnormal data information is used to remind that manual processing is required.

[0009] Optionally, the instance identifier is released according to the second query result, including: when it is determined that the number of instance identifiers corresponding to the Pod in the second query result is equal to 1, determining whether the release time of the instance identifier corresponding to the Pod is greater than a preset time; when it is determined that the release time of the instance identifier corresponding to the Pod is greater than the preset time, releasing the instance identifier corresponding to the Pod.

[0010] Optionally, after generating the abnormal data information, the method further includes: after the manual processing, receiving the instance identifier uploaded after the manual processing; updating the usage bit status of the instance identifier to unused, and updating other parameters of the instance identifier to null, wherein the other parameters include Pod IP, heartbeat time, and release time.

[0011] According to another aspect of the present application, a device for managing instance identifiers is provided, comprising: a construction unit for constructing an instance identifier management service based on spring boot; a status update unit for, when detecting that a Pod is in a startup state, calling the instance identifier management service according to the parameters of the Pod to query the number of instance identifiers corresponding to the Pod, generating a first query result, and updating the status of the instance identifier according to the first query result, so that one Pod in the startup state corresponds to one instance identifier, wherein the Pod is the smallest scheduling unit in the container orchestration system Kubernetes cluster, and the parameters of the Pod include Pod ip; a heartbeat time updating unit, used to obtain the heartbeat time of the Pod according to the instance identifier, and when it is determined that the heartbeat time is less than or equal to the time threshold, determine that the Pod is in a normal connected state, and update the heartbeat time to the instance identifier corresponding to the Pod; a release processing unit, used to, after determining that the Pod is in the normal connected state, and when it is detected that the Pod is in a stopped state, call the instance identifier management service again according to the parameters of the Pod to query the number of the instance identifiers corresponding to the Pod, generate a second query result, and release the instance identifier according to the second query result, so that the Pod in the stopped state does not have the corresponding instance identifier.

[0012] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods for managing instance identification.

[0013] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of the management instance identification methods.

[0014] Applying the technical solution of the present application, an instance identification management service is constructed based on spring boot; when it is detected that the Pod is in the startup state, the instance identification management service is called according to the parameters of the Pod to query the number of instance identifications corresponding to the Pod, and a first query result is generated. The state of the instance identification is updated according to the first query result, so that a Pod in the startup state corresponds to an instance identification, wherein the Pod is the smallest scheduling unit in the container orchestration system Kubernetes cluster, and the parameters of the Pod include the Pod IP; the heartbeat time of the Pod is obtained according to the instance identification, and when it is determined that the heartbeat time is less than or equal to the time threshold, it is determined that the Pod is in a normal connected state, and the heartbeat time is updated to the instance identification corresponding to the Pod; after determining that the Pod is in a normal connected state, when it is detected that the Pod is in a stopped state, the instance identification management service is called again according to the parameters of the Pod to query the number of instance identifications corresponding to the Pod, and a second query result is generated. The instance identification is released according to the second query result, so that there is no corresponding instance identification for the Pod in the stopped state. Through the instance identification management service, all instance identifications are uniformly managed and resources are released. It can provide a unique instance identification for the Pod for use, and ensure that each running Pod service will have a unique instance identification at the same time. When the Pod stops, the instance identification resources will be released to improve the availability of the instance identification. When the Pod is in a disconnected state, the Pod service can be detected for health status through the scheduled heartbeat detection of the instance identification management service. When the detection threshold is reached, an alarm message is issued to remind the administrator that the instance identification is abnormal and needs manual processing. The instance identification management service solves the problem of Pod service drifting and unable to solidify the instance identification in the container cloud environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings constituting part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0016] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for managing instance identification provided in an embodiment of the present application is shown;

[0017] Figure 2 A schematic diagram of a process for managing instance identification provided according to an embodiment of the present application is shown;

[0018] Figure 3 A schematic diagram of a process for obtaining an instance identifier when a Pod is in the startup state according to an embodiment of the present application is shown;

[0019] Figure 4 A schematic diagram of a process for updating the heartbeat time of a Pod heartbeat detection provided in accordance with an embodiment of the present application is shown;

[0020] Figure 5 A schematic diagram of a process for determining whether a Pod is disconnected according to an embodiment of the present application is shown;

[0021] Figure 6 A schematic diagram of a process for releasing an instance identifier when a Pod is stopped according to an embodiment of the present application is shown;

[0022] Figure 7 A schematic diagram of a process of manually processing management instance identification according to an embodiment of the present application is shown;

[0023] Figure 8 A structural block diagram of a device for managing instance identification provided according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

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

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

[0027] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0028] Container: A container is a lightweight, executable, independent software package and an entity that runs an image.

[0029] Container Cloud: is a container management service based on Kubernetes that deploys, manages, and scales containerized applications on Container Cloud.

[0030] Master: The control node in the Kubernetes cluster, responsible for the management and scheduling of the entire cluster.

[0031] Node: A working node in a Kubernetes cluster that actually runs workloads. When a Node goes down, its workload will be automatically transferred to other Nodes by the Master.

[0032] Pod: The smallest unit created or deployed in Kubernetes. A Pod represents a process running on the cluster and encapsulates one or more closely related containers.

[0033] Pod drift: Kubernetes has powerful replica control capabilities, which can ensure that a new Pod is automatically started from the remaining Nodes when any Pod hangs up.

[0034] Spring Boot: Spring Boot is a new framework provided by the Pivotal team, which is designed to simplify the initial construction and development process of new Spring applications. The framework uses a specific way to configure, so that developers no longer need to define boilerplate configurations.

[0035] Instance ID: In the process of enterprise application deployment monitoring, some unique IDs are often needed to locate problematic projects or project running instances more quickly. In the same system, each instance ID represents a running instance. Instance IDs can be used throughout the entire life cycle of the application to avoid ID explosion.

[0036] As introduced in the background technology, in the prior art, in a container cloud environment, the drift of Pod services leads to the inability to solidify instance identifiers. To solve the problem in the prior art that in a container cloud environment, the drift of Pod services leads to the inability to solidify instance identifiers, the embodiments of the present application provide a method, device, storage medium and electronic device for managing instance identifiers.

[0037] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0038] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for managing instance identification according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0039] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for managing instance identification in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0040] In this embodiment, a method for managing instance identification running on a mobile terminal, a computer terminal or a similar computing device 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.

[0041] Figure 2 is a flow chart of a method for managing instance identification according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0042] Step S201, building an instance identification management service based on spring boot;

[0043] Specifically, Spring Boot is an open source Java development framework based on the Spring framework that can help developers quickly build Spring-based applications. Spring Boot provides a series of out-of-the-box features and tools that allow developers to build, deploy, and run applications more easily. Spring Boot reduces the configuration work of developers through automated configuration and the principle of convention over configuration, allowing developers to focus more on the development of business logic. Spring Boot also provides an embedded container that can easily package the application into an executable JAR file and run it directly without external container support.

[0044] Among them, the instance identification management service exists in the form of a service, and the client can obtain related resources through http requests.

[0045] Step S202, when it is detected that the Pod is in the startup state, call the instance identifier management service according to the parameters of the Pod to query the number of instance identifiers corresponding to the Pod, generate a first query result, and update the state of the instance identifier according to the first query result, so that one Pod in the startup state corresponds to one instance identifier, wherein the Pod is the smallest scheduling unit in the container orchestration system Kubernetes cluster, and the parameters of the Pod include the Pod IP;

[0046] Specifically, when it is detected that the Pod is in the startup state, the number of instance identifiers corresponding to the Pod is queried to obtain the query result, and the instance identifier corresponding to the Pod and the status of the instance identifier are updated according to the query result, so that each running Pod service will have a unique instance identifier.

[0047] Step S203, obtaining the heartbeat time of the Pod according to the instance identifier, and when it is determined that the heartbeat time is less than or equal to the time threshold, determining that the Pod is in a normal connected state, and updating the heartbeat time to the instance identifier corresponding to the Pod;

[0048] Among them, the time threshold can be set to 200s, 300s, and 400s;

[0049] Specifically, when the Pod is running, the heartbeat time of the Pod is obtained in real time to ensure that the Pod remains connected to the instance identification management service.

[0050] Step S204, after determining that the Pod is in a normal connected state, if it is detected that the Pod is in a stopped state, the instance identifier management service is called again according to the parameters of the Pod to query the number of instance identifiers corresponding to the Pod, and a second query result is generated. The instance identifier is released according to the second query result, so that there is no corresponding instance identifier for the Pod in the stopped state.

[0051] Specifically, when a Pod stops, the resources of the instance ID corresponding to the Pod are released to improve the availability of the instance ID.

[0052] Through this embodiment, an instance identification management service is constructed based on spring boot; when it is detected that the Pod is in the startup state, the instance identification management service is called according to the parameters of the Pod to query the number of instance identifications corresponding to the Pod, and a first query result is generated. The state of the instance identification is updated according to the first query result, so that a Pod in the startup state corresponds to an instance identification, wherein the Pod is the smallest scheduling unit in the container orchestration system Kubernetes cluster, and the parameters of the Pod include the Pod IP; the heartbeat time of the Pod is obtained according to the instance identification, and when it is determined that the heartbeat time is less than or equal to the time threshold, it is determined that the Pod is in a normal connected state, and the heartbeat time is updated to the instance identification corresponding to the Pod; after determining that the Pod is in a normal connected state, when it is detected that the Pod is in a stopped state, the instance identification management service is called again according to the parameters of the Pod to query the number of instance identifications corresponding to the Pod, and a second query result is generated. The instance identification is released according to the second query result, so that there is no corresponding instance identification for the Pod in the stopped state. Through the instance identification management service, all instance identifications are uniformly managed and resources are released. A unique instance identification can be provided to the Pod for its use, and each running Pod service will have a unique instance identification at the same time. When the Pod stops, the instance identification resources will be released to improve the availability of the instance identification. The instance identification management service solves the problem of Pod service drift and the inability to solidify the instance identification in the container cloud environment.

[0053] During the specific implementation process, after obtaining the heartbeat time of the Pod according to the instance identifier, the method also includes: when it is determined that the heartbeat time is greater than the time threshold, determining that the Pod is in a lost state; using socket detection technology to detect whether the Pod is connected to the instance identifier management service; when it is determined that the Pod is not connected to the instance identifier management service, obtaining and updating the number of detections for detecting whether the Pod is connected to the instance identifier management service; determining whether the number of detections is greater than the preset number of detections, and generating an alarm message when it is determined that the number of detections is greater than the preset number of detections, wherein the alarm message is used to remind that the Pod is not connected to the instance identifier management service.

[0054] Among them, the preset detection times can be set to 3 times or 5 times.

[0055] When the method determines that the heartbeat time is greater than the set 300s, the Pod is considered to be disconnected and detects whether the Pod is connected to the instance identification management service. If the detection is not connected, it determines whether the number of detections between the Pod and the instance identification management service is greater than 3 times. If it is less than or equal to 3 times, the detection number is updated and the next detection is waited; if it is greater than 3 times, an alarm message is generated to remind that the Pod is not connected to the instance identification management service, and the detection number is updated and the next detection is waited. When it is determined that the Pod is connected to the instance identification management service, the heartbeat time is updated to the instance identification corresponding to the Pod.

[0056] Specifically, the status of the instance identifier is updated according to the first query result, including: when it is determined that the number of instance identifiers corresponding to the Pod in the first query result is equal to 1, determining whether the usage bit status of the instance identifier is used; when it is determined that the usage bit status of the instance identifier is used, determining whether the release bit status of the instance identifier is released, and when it is determined that the release bit status of the instance identifier is released, updating the release bit status to used.

[0057] This method, when the Pod is in the startup state and the number of instance identifiers corresponding to the Pod is equal to 1, determines whether the usage bit state of the instance identifier is used. If the usage bit state of the instance identifier is unused, the usage bit state is updated to used. If it is determined that the usage bit state of the instance identifier is used, it is determined whether the Pod corresponding to the instance identifier is in the process of releasing resources. If it is determined that the Pod is in the process of releasing resources, it is considered that the acquisition of the instance identifier has failed and waits for the next acquisition. If it is determined that the Pod is in the process of releasing resources, the release state of the instance identifier is updated to used.

[0058] More specifically, updating the status of the instance identifier according to the first query result includes:

[0059] When it is determined that the number of instance identifiers corresponding to the Pod in the first query result is 0, obtain a preset number of instance identifier sets with usage bit states of unused from the database, select an instance identifier from the instance identifier set to correspond to the Pod, and update the usage bit state of the instance identifier corresponding to the Pod to used; or, when it is determined that the number of instance identifiers corresponding to the Pod in the first query result is greater than or equal to 2, generate abnormal data information, wherein the abnormal data information is used to remind that manual processing is required.

[0060] Among them, the preset number can be selected as 100, and the instance identifier set whose usage bit state is unused indicates that these 100 instance identifiers are not used;

[0061] This method, when the Pod is in the startup state, finds that the number of instance identifiers corresponding to the Pod is 0, and needs to randomly select an unused instance identifier to correspond to the Pod, and update the usage bit state of the instance identifier to used, and update the Pod IP of the Pod to the instance identifier, so that the Pod corresponds to the instance identifier; when the Pod is in the startup state, if the number of instance identifiers corresponding to the Pod is found to be at least 2, abnormal data information is generated to remind that redundant instance identifiers need to be manually processed.

[0062] Furthermore, before obtaining the heartbeat time of the Pod according to the instance identifier, the method also includes: calling the instance identifier management service again to query the number of instance identifiers corresponding to the Pod according to the parameters of the Pod, and generating a third query result; when it is determined that the number of instance identifiers corresponding to the Pod in the third query result is equal to 1, using heartbeat detection technology to obtain the heartbeat time of the Pod, and updating the heartbeat time to the parameters of the instance identifier, wherein the parameters of the instance identifier include the heartbeat time; when it is determined that the number of instance identifiers corresponding to the Pod in the third query result is equal to 0, generating reminder information, wherein the reminder information is used to remind that the instance identifier corresponding to the Pod has not been queried; when it is determined that the number of instance identifiers corresponding to the Pod in the third query result is greater than or equal to 2, generating abnormal data information, wherein the abnormal data information is used to remind that manual processing is required.

[0063] This method needs to query the number of instance identifiers corresponding to the Pod before the heartbeat detection to ensure that the number of instance identifiers corresponding to the Pod is 1, so that each running Pod service will have a unique instance identifier; when it is determined that the number of instance identifiers corresponding to the Pod is equal to 0, a reminder message is generated, and the instance resource data that is not matched and needs to be released is returned; when it is determined that the number of instance identifiers corresponding to the Pod is greater than or equal to 2, abnormal data information is generated, and the reminder needs to be processed manually.

[0064] Among them, the client will periodically detect the application, and after the detection, call the heartbeat maintenance interface of the instance identification management service to update the heartbeat time; the instance identification service provides a timed scanning detection capability to detect the application service corresponding to the instance identification with a heartbeat timeout. When the application does not respond, it will record the number of disconnections and the detection time. When there is still no response after multiple rounds of detection, an alarm operation will be triggered to remind the administrator that the application instance is unresponsive and requires manual intervention. The instance identification service provides a manual operation and maintenance port. After the administrator confirms that the application service has been offline, this port can be used to manually release the instance identification resource.

[0065] Furthermore, the instance identifier is released according to the second query result, including: when it is determined that the number of instance identifiers corresponding to the Pod in the second query result is equal to 1, determining whether the release time of the instance identifier corresponding to the Pod is greater than the preset time; when it is determined that the release time of the instance identifier corresponding to the Pod is greater than the preset time, releasing the instance identifier corresponding to the Pod.

[0066] Among them, the preset time can be set to 1 minute;

[0067] When it is determined that the release time of the instance identifier corresponding to the Pod is greater than 1 minute, the method releases the instance identifier corresponding to the Pod; when it is determined that the release time of the instance identifier corresponding to the Pod is less than or equal to 1 minute, the release bit state of the instance identifier is updated to releasing, the release time of the instance identifier is the current time, and the method returns to resource processing, waiting for the next release.

[0068] Specifically, after generating the abnormal data information, the method also includes: after manual processing, receiving the instance identifier uploaded after the manual processing; updating the usage bit status of the instance identifier to unused, and updating other parameters of the instance identifier to null, wherein the other parameters include Pod IP, heartbeat time, and release time.

[0069] The method updates the usage status of the instance identifier uploaded after manual processing to unused, and updates the Podip, heartbeat time, and release time to null, thereby obtaining an unused instance identifier and improving the availability of the instance identifier.

[0070] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for managing instance identification of the present application will be described in detail below in conjunction with specific embodiments.

[0071] In a distributed microservice architecture, each project will have multiple independently deployed services, and each service needs to deploy multiple instances. These instances may be deployed on the same machine or on different machines. Each instance needs to have an instance identifier to mark the uniqueness of the instance, and the instance identifier can be used to quickly locate the machine and instance in link tracking. Under the virtual machine, the instance identifier is configured in the bashrc of the operating system and used as an environment variable for applications. Each instance has an instance identifier, and once configured, it generally does not change. However, in the context of container cloud, multiple Pods will be deployed on a Node. When the Pod drifts, the instance identifier cannot be solidified for its use by means of bashrc. Therefore, this embodiment provides an instance identifier management service based on springboot, which interacts with the Pod when it starts and stops, and manages the instance identifier. Through the instance identification management service, all instance identifications are uniformly managed and resources are released. It can provide a unique instance identification for the Pod for use, and ensure that each running Pod service will have a unique instance identification at the same time. When the Pod stops, the instance identification resources will be released to improve the availability of the instance identification. When the Pod is in a disconnected state, the Pod service can be detected for health status through the scheduled heartbeat detection of the instance identification management service. When the detection threshold is reached, an alarm message is issued to remind the administrator that the instance identification is abnormal and needs manual processing. The instance identification management service solves the problem of Pod service drifting and unable to solidify the instance identification in the container cloud environment.

[0072] This embodiment relates to a specific method for managing instance identifiers, which specifically includes the following contents:

[0073] like Figure 3As shown, when the Pod is detected to be in the startup state, the instance identifier is queried by requesting the uploaded Pod IP; when the number of instance identifiers corresponding to the Pod is 0, it is necessary to randomly select an unused instance identifier from 100 unused instance identifiers to correspond to the Pod, and update the usage bit state of the instance identifier to used, and update the Pod IP of the Pod to the instance identifier, so that the Pod corresponds to the instance identifier; when the number of instance identifiers corresponding to the Pod is at least 2, abnormal data information is generated to remind that the redundant instance identifiers need to be manually processed. When the number of instance identifiers corresponding to the Pod is 1, it is determined whether the usage bit state of the instance identifier is used. When the usage bit state of the instance identifier is unused, the usage bit state is updated to used; when it is determined that the usage bit state of the instance identifier is used, it is determined whether the Pod corresponding to the instance identifier is in the process of releasing resources. When it is determined that the Pod is in the process of releasing resources, it is considered that the acquisition of the instance identifier this time has failed, and waits for the next acquisition. When it is determined that the Pod is in the process of releasing resources, the release state of the instance identifier is updated to used.

[0074] like Figure 4 As shown, when the server receives the heartbeat detection request sent by the client, the number of instance identifiers is queried through the Pod IP. When it is determined that the number of instance identifiers corresponding to the Pod is equal to 1, the heartbeat detection technology is used to obtain the heartbeat time of the Pod, and the heartbeat time is updated to the parameters of the instance identifier, wherein the parameters of the instance identifier include the heartbeat time; when it is determined that the number of instance identifiers corresponding to the Pod is equal to 0, a reminder message is generated, wherein the reminder message is used to remind that the instance identifier corresponding to the Pod has not been queried; when it is determined that the number of instance identifiers corresponding to the Pod is greater than or equal to 2, abnormal data information is generated, wherein the abnormal data information is used to remind that manual processing is required. Through heartbeat detection, it is detected whether the service that obtains the resource is running normally, and the heartbeat detection time is updated to detect and control the current running status of the service.

[0075] like Figure 5As shown in the figure, the scheduled scanning task is turned on, and all Pods in the library table with abnormal heartbeats (no response for more than 300 seconds) and in use are scanned. By querying the Pod IP, the socket detection is performed to determine the connectivity between the Pod and the instance identification service. If it is determined that the Pod is not connected to the instance identification service, it is determined whether the number of detections between the Pod and the instance identification management service is greater than 3 times. If it is less than or equal to 3 times, the detection number is updated and the next detection is waited for; if it is greater than 3 times, an alarm message is generated to remind that the Pod is not connected to the instance identification management service, and the detection number is updated and the next detection is waited for. If it is determined that the Pod is connected to the instance identification management service, the heartbeat time is updated to the instance identification corresponding to the Pod. Through scheduled scanning, abnormal resource data (such as: data of unreleased instance identification resources due to service downtime, and requests that are unreachable due to instantaneous network anomalies) are scanned and detected. If the service is normal, the heartbeat detection time is updated. If the service is abnormal, multiple detections are performed. If it is still not connected after multiple detections, an alarm is triggered to notify the operation and maintenance personnel to intervene manually.

[0076] like Figure 6 As shown, after determining that the Pod is in a normal connected state, if the Pod is detected to be in a stopped state, the instance identifier management service is called again according to the parameters of the Pod to query the number of instance identifiers corresponding to the Pod. If it is determined that the number of instance identifiers corresponding to the Pod is equal to 1, it is determined whether the release time of the instance identifier corresponding to the Pod is greater than 1 minute; if it is determined that the release time of the instance identifier corresponding to the Pod is greater than 1 minute, the instance identifier corresponding to the Pod is released; if it is determined that the release time of the instance identifier corresponding to the Pod is less than or equal to 1 minute, the release bit state of the instance identifier is updated to be released, and the release time of the instance identifier is the current time, and the resource processing is returned to wait for the next release. If it is determined that the number of instance identifiers corresponding to the Pod is equal to 0, the instance identifier that does not match the one that needs to be released is returned; if it is determined that the number of instance identifiers corresponding to the Pod is greater than or equal to 2, abnormal data information is generated to remind that manual processing is required.

[0077] like Figure 7 As shown, the resource release information passed in by manual processing is received, and the instance identifier to be released is queried through the primary key in the Pod. When it is determined that the query result is 0, the instance identifier that is not matched to be released is returned; when it is determined that the query result is greater than 0, the usage status bit of the instance identifier is updated to unused, and the Pod IP, heartbeat time, release time and other information in the instance identifier parameters are updated to empty. After the update is successful, the processing result is returned.

[0078] The instance identification management service of this embodiment exists in the form of a service, and can uniformly manage all instance identifications used. The client can obtain related resources through http requests, such as instance resource acquisition, release, heartbeat detection, scheduled scanning, manual processing, etc.; the instance acquisition of the instance identification management service is designed with an algorithm at the design level: for example, 100 unused instance identifications are obtained and one of the 100 data is randomly obtained for update, so as to improve the execution efficiency and reduce the collision rate of instance identification acquisition (two requests simultaneously obtain the same data for update, one update is successful, and the other update fails. If the update fails, it is necessary to wait for the next update). When acquiring the instance identification, the request for update failure due to the collision update will not immediately return the error to the client, but through self-loop (10 times, each time with an interval of 1s), the resource acquisition is performed again, reducing the interaction frequency between the client and the server, and improving the success rate of instance identification acquisition. When the number of self-loops is exhausted and the instance identification is still not obtained, the acquisition failure is returned and the next client trigger request is waited. Through the instance identification management service, all instance identifications are uniformly managed and resources are released. A unique instance identification can be provided to the Pod for its use, and each running Pod service will have a unique instance identification at the same time. When the Pod stops, the instance identification resources will be released to improve the availability of the instance identification. The instance identification management service solves the problem of Pod service drift and the inability to solidify the instance identification in the container cloud environment.

[0079] The embodiment of the present application also provides a device for managing instance identification. It should be noted that the device for managing instance identification of the embodiment of the present application can be used to execute the method for managing instance identification provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for 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.

[0080] The following is an introduction to the device for managing instance identification provided in an embodiment of the present application.

[0081] Figure 8 Schematic diagram of a device for managing instance identifiers according to an embodiment of the present application. Figure 8 As shown, the device includes: a construction unit 81, a state updating unit 82, a heartbeat time updating unit 83 and a release processing unit 84.

[0082] A construction unit 81 is used to construct an instance identification management service based on spring boot;

[0083] Among them, the instance identification management service exists in the form of a service, and the client can obtain related resources through http requests.

[0084] The state updating unit 82 is used to call the instance identification management service to query the number of instance identifications corresponding to the Pod according to the parameters of the Pod when detecting that the Pod is in the startup state, generate a first query result, and update the state of the instance identification according to the first query result, so that one Pod in the startup state corresponds to one instance identification, wherein the Pod is the smallest scheduling unit in the container orchestration system Kubernetes cluster, and the parameters of the Pod include the Pod IP;

[0085] Specifically, when it is detected that the Pod is in the startup state, the number of instance identifiers corresponding to the Pod is queried to obtain the query result, and the instance identifier corresponding to the Pod and the status of the instance identifier are updated according to the query result, so that each running Pod service will have a unique instance identifier.

[0086] The heartbeat time updating unit 83 is used to obtain the heartbeat time of the Pod according to the instance identifier, and when it is determined that the heartbeat time is less than or equal to the time threshold, it is determined that the Pod is in a normal connected state, and the heartbeat time is updated to the instance identifier corresponding to the Pod;

[0087] Among them, the time threshold can be set to 200s, 300s, and 400s;

[0088] Specifically, when the Pod is running, the heartbeat time of the Pod is obtained in real time to ensure that the Pod remains connected to the instance identification management service.

[0089] The release processing unit 84 is used to call the instance identifier management service again according to the parameters of the Pod to query the number of instance identifiers corresponding to the Pod after determining that the Pod is in a normal connected state and when detecting that the Pod is in a stopped state, generate a second query result, and release the instance identifier according to the second query result, so that there is no corresponding instance identifier for the Pod in the stopped state.

[0090] Specifically, when a Pod stops, the resources of the instance ID corresponding to the Pod are released to improve the availability of the instance ID.

[0091] In this embodiment, a construction unit is used to build an instance identification management service based on spring boot; a state update unit is used to call the instance identification management service according to the parameters of the Pod to query the number of instance identifications corresponding to the Pod when it is detected that the Pod is in the startup state, generate a first query result, and update the state of the instance identification according to the first query result, so that a Pod in the startup state corresponds to an instance identification, wherein the Pod is the smallest scheduling unit in the container orchestration system Kubernetes cluster, and the parameters of the Pod include the Pod IP; a heartbeat time update unit is used to obtain the heartbeat time of the Pod according to the instance identification, and when it is determined that the heartbeat time is less than or equal to the time threshold, it is determined that the Pod is in a normal connected state, and the heartbeat time is updated to the instance identification corresponding to the Pod; a release processing unit is used to call the instance identification management service again according to the parameters of the Pod to query the number of instance identifications corresponding to the Pod after determining that the Pod is in the normal connected state, when it is detected that the Pod is in the stopped state, generate a second query result, and release the instance identification according to the second query result, so that there is no corresponding instance identification for the Pod in the stopped state. Through the instance identification management service, all instance identifications are uniformly managed and resources are released. A unique instance identification can be provided to the Pod for its use, and each running Pod service will have a unique instance identification at the same time. When the Pod stops, the instance identification resources will be released to improve the availability of the instance identification. The instance identification management service solves the problem of Pod service drift and the inability to solidify the instance identification in the container cloud environment.

[0092] As an optional solution, the device also includes a first determination unit, a detection unit, a first acquisition unit and an alarm information generation unit; the first determination unit is used to determine that the Pod is in a lost state after obtaining the heartbeat time of the Pod according to the instance identifier and determining that the heartbeat time is greater than a time threshold; the detection unit is used to use socket detection technology to detect whether the Pod is connected to the instance identifier management service; the first acquisition unit is used to obtain and update the number of detections for detecting whether the Pod is connected to the instance identifier management service when it is determined that the Pod is not connected to the instance identifier management service; the alarm information generation unit is used to determine whether the number of detections is greater than a preset number of detections, and generate an alarm message when it is determined that the number of detections is greater than the preset number of detections, wherein the alarm message is used to remind that the Pod is not connected to the instance identifier management service.

[0093] Among them, the preset detection times can be set to 3 times or 5 times.

[0094] An optional solution, the status update unit includes a first determination module and a second determination module; the first determination module is used to determine whether the usage bit state of the instance identifier is used when it is determined that the number of instance identifiers corresponding to the Pod in the first query result is equal to 1; the second determination module is used to determine whether the release bit state of the instance identifier is released when it is determined that the usage bit state of the instance identifier is used, and when it is determined that the release bit state of the instance identifier is released, update the release bit state to used.

[0095] Specifically, when the Pod is in the startup state and the number of instance identifiers corresponding to the Pod is equal to 1, determine whether the usage bit status of the instance identifier is used. If the usage bit status of the instance identifier is unused, update the usage bit status to used; when it is determined that the usage bit status of the instance identifier is used, determine whether the Pod corresponding to the instance identifier is in the process of releasing resources. If it is determined that the Pod is in the process of releasing resources, it is considered that the acquisition of the instance identifier has failed, and wait for the next acquisition. If it is determined that the Pod is in the process of releasing resources, update the release status of the instance identifier to used.

[0096] An optional scheme, the status update unit also includes an update module and a third determination module; the update module is used to obtain a preset number of instance identifier sets with unused usage bits from the database when it is determined that the number of instance identifiers corresponding to the Pod in the first query result is 0, select an instance identifier from the instance identifier set to correspond to the Pod, and update the usage bit status of the instance identifier corresponding to the Pod to used; the third determination module is used to generate abnormal data information when it is determined that the number of instance identifiers corresponding to the Pod in the first query result is greater than or equal to 2, wherein the abnormal data information is used to remind that manual processing is required.

[0097] The preset number may be 100, and the instance identifier set whose usage bit status is unused indicates that these 100 instance identifiers are not used.

[0098] An optional solution, the device also includes a calling unit, a second acquisition unit, a second determination unit and a third determination unit; the calling unit is used to call the instance identifier management service again to query the number of instance identifiers corresponding to the Pod according to the parameters of the Pod before obtaining the heartbeat time of the Pod according to the instance identifier, and generate a third query result; the second acquisition unit is used to obtain the heartbeat time of the Pod by using the heartbeat detection technology when determining that the number of instance identifiers corresponding to the Pod in the third query result is equal to 1, and update the heartbeat time to the parameters of the instance identifier, wherein the parameters of the instance identifier include the heartbeat time; the second determination unit is used to generate reminder information when determining that the number of instance identifiers corresponding to the Pod in the third query result is equal to 0, wherein the reminder information is used to remind that the instance identifier corresponding to the Pod has not been queried; the third determination unit is used to generate abnormal data information when determining that the number of instance identifiers corresponding to the Pod in the third query result is greater than or equal to 2, wherein the abnormal data information is used to remind that manual processing is required.

[0099] Specifically, before the heartbeat detection, it is necessary to query the number of instance identifiers corresponding to the Pod to ensure that the number of instance identifiers corresponding to the Pod is 1, so that each running Pod service will have a unique instance identifier; when it is determined that the number of instance identifiers corresponding to the Pod is equal to 0, a reminder message is generated, and the instance resource data that is not matched and needs to be released is returned; when it is determined that the number of instance identifiers corresponding to the Pod is greater than or equal to 2, abnormal data information is generated, and the reminder needs to be processed manually.

[0100] An optional scheme, the release processing unit includes a fourth determination module and a fifth determination module; the fourth determination module is used to determine whether the release time of the instance identifier corresponding to the Pod is greater than the preset time when it is determined that the number of instance identifiers corresponding to the Pod in the second query result is equal to 1; the fifth determination module is used to release the instance identifier corresponding to the Pod when it is determined that the release time of the instance identifier corresponding to the Pod is greater than the preset time.

[0101] Specifically, when it is determined that the release time of the instance identifier corresponding to the Pod is greater than 1 minute, the instance identifier corresponding to the Pod is released; when it is determined that the release time of the instance identifier corresponding to the Pod is less than or equal to 1 minute, the release bit status of the instance identifier is updated to releasing, the release time of the instance identifier is the current time, and the process returns to resource processing, waiting for the next release.

[0102] An optional solution, the device also includes a receiving unit and an updating unit; the receiving unit is used to receive the instance identifier uploaded after manual processing after the abnormal data information is generated; the updating unit is used to update the usage bit status of the instance identifier to unused, and update other parameters of the instance identifier to null, wherein the other parameters include Pod IP, heartbeat time, and release time.

[0103] Specifically, the usage status of the instance identifier uploaded after manual processing is updated to unused, and the Podip, heartbeat time, and release time are updated to empty, so as to obtain an unused instance identifier and improve the availability of the instance identifier.

[0104] The device for managing instance identification includes a processor and a memory, and the construction unit, state update unit, heartbeat time update unit and release processing unit are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.

[0105] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set to solve the problem of being unable to solidify instance identification due to Pod service drift in the container cloud environment by adjusting kernel parameters.

[0106] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0107] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for managing instance identification.

[0108] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for managing instance identification is executed when the program is running.

[0109] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the method for managing instance identification is implemented.

[0110] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0111] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program of initializing the method of at least managing the instance identification.

[0112] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0113] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0114] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0115] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0117] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0118] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0119] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0120] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0121] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for managing instance identification, characterized in that: include: Build instance identity management service based on spring boot; When it is detected that a Pod is in a startup state, the instance identifier management service is called according to the parameters of the Pod to query the number of instance identifiers corresponding to the Pod, and a first query result is generated. The state of the instance identifier is updated according to the first query result, so that one Pod in the startup state corresponds to one instance identifier, wherein the Pod is the smallest scheduling unit in a container orchestration system Kubernetes cluster, and the parameters of the Pod include the Pod IP; Obtain the heartbeat time of the Pod according to the instance identifier, and if it is determined that the heartbeat time is less than or equal to the time threshold, determine that the Pod is in a normal connected state, and update the heartbeat time to the instance identifier corresponding to the Pod; After determining that the Pod is in the normal connectivity state, when detecting that the Pod is in the stopped state, the instance identifier management service is called again according to the parameters of the Pod to query the number of the instance identifiers corresponding to the Pod, and a second query result is generated. The instance identifier is released according to the second query result, so that there is no corresponding instance identifier for the Pod in the stopped state.

2. The method according to claim 1, characterized in that After obtaining the heartbeat time of the Pod according to the instance identifier, the method further includes: When it is determined that the heartbeat time is greater than the time threshold, it is determined that the Pod is in a disconnected state; Using socket detection technology to detect whether the Pod is connected to the instance identification management service; When it is determined that the Pod is not connected to the instance identification management service, obtaining and updating the number of detections for detecting whether the Pod is connected to the instance identification management service; Determine whether the number of detections is greater than a preset number of detections, and generate an alarm message if it is determined that the number of detections is greater than the preset number of detections, wherein the alarm message is used to remind that the Pod is not connected to the instance identification management service.

3. The method according to claim 1, characterized in that Updating the status of the instance identifier according to the first query result includes: When it is determined that the number of instance identifiers corresponding to the Pod in the first query result is equal to 1, determining whether a usage bit state of the instance identifier is used; When it is determined that the use bit state of the instance identifier is used, it is determined whether the release bit state of the instance identifier is released; when it is determined that the release bit state of the instance identifier is released, the release bit state is updated to used.

4. The method according to claim 1, characterized in that: Updating the status of the instance identifier according to the first query result includes: When it is determined that the number of instance identifiers corresponding to the Pod in the first query result is 0, a set of instance identifiers with a preset number of usage bits in an unused state is obtained from a database, an instance identifier is selected from the set of instance identifiers to correspond to the Pod, and the usage bit state of the instance identifier corresponding to the Pod is updated to used; or, When it is determined that the number of the instance identifiers corresponding to the Pod in the first query result is greater than or equal to 2, abnormal data information is generated, wherein the abnormal data information is used to remind that manual processing is required.

5. The method according to claim 1, characterized in that Before obtaining the heartbeat time of the Pod according to the instance identifier, the method further includes: Calling the instance identifier management service again to query the number of instance identifiers corresponding to the Pod according to the parameters of the Pod, and generating a third query result; When it is determined that the number of instance identifiers corresponding to the Pod in the third query result is equal to 1, a heartbeat detection technology is used to obtain the heartbeat time of the Pod, and the heartbeat time is updated to the parameters of the instance identifier, wherein the parameters of the instance identifier include the heartbeat time; In the case where it is determined that the number of the instance identifiers corresponding to the Pod in the third query result is equal to 0, generating reminder information, wherein the reminder information is used to remind that the instance identifier corresponding to the Pod has not been queried; When it is determined that the number of the instance identifiers corresponding to the Pod in the third query result is greater than or equal to 2, abnormal data information is generated, wherein the abnormal data information is used to remind that manual processing is required.

6. The method according to claim 1, characterized in that The releasing process of the instance identifier according to the second query result includes: In a case where it is determined that the number of the instance identifiers corresponding to the Pod in the second query result is equal to 1, determining whether a release time of the instance identifier corresponding to the Pod is greater than a preset time; When it is determined that the release time of the instance identifier corresponding to the Pod is greater than the preset time, release processing is performed on the instance identifier corresponding to the Pod.

7. The method according to claim 4 or 5, characterized in that: After generating the abnormal data information, the method further includes: After the manual processing, receiving an instance identifier uploaded after the manual processing; Update the usage bit status of the instance identifier to unused, and update other parameters of the instance identifier to null, wherein the other parameters include Pod IP, heartbeat time, and release time.

8. A device for managing instance identification, characterized in that: include: Construction unit, used to build instance identity management service based on spring boot; A state updating unit is used for, when detecting that a Pod is in a startup state, calling the instance identification management service according to the parameters of the Pod to query the number of instance identifications corresponding to the Pod, generating a first query result, and updating the state of the instance identification according to the first query result, so that one Pod in the startup state corresponds to one instance identification, wherein the Pod is the smallest scheduling unit in a container orchestration system Kubernetes cluster, and the parameters of the Pod include the Pod IP; A heartbeat time updating unit, configured to obtain the heartbeat time of the Pod according to the instance identifier, and when it is determined that the heartbeat time is less than or equal to a time threshold, determine that the Pod is in a normal connected state, and update the heartbeat time to the instance identifier corresponding to the Pod; A release processing unit is used to, after determining that the Pod is in the normal connectivity state, call the instance identifier management service again according to the parameters of the Pod to query the number of the instance identifiers corresponding to the Pod when detecting that the Pod is in the stopped state, generate a second query result, and release the instance identifier according to the second query result, so that the Pod in the stopped state does not have the corresponding instance identifier.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for managing instance identification according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing the management instance identification described in any one of claims 1 to 7.