Health Detection Method, Device, Electronic Device and Storage Medium for Cloud Native Applications
By conducting health detection on cloud-native applications and determining the status of each container in their business link, the problem of health detection of cloud-native applications is solved and the smooth execution of the application is ensured.
Patent Information
- Application Number
- CN202211209857.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-09-30
AI Technical Summary
In the process of using cloud-native applications, how to effectively conduct health detection to ensure the smooth execution of each business is a key issue.
By determining multiple historical reference vectors and their service links corresponding to the target cloud native application, determining the current reference vector in response to a health detection request or processing instruction, comparing the comparison results of the current reference vector with the historical reference vector, determining the target service link, and obtaining the health detection results based on the health status of each target container.
This method can quickly determine the status of each container in the service link of cloud-native applications, ensure the healthy status of cloud-native applications, and provide a basis for the smooth execution of each service in cloud-native applications.
Smart Images

Figure CN115604149B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of health detection of cloud-native applications, and in particular, to a method, device, electronic device, and storage medium for health detection of cloud-native applications. Background Art
[0002] Cloud-native applications are applications with cloud computing genes, constructed with the concept of cloud computing and suitable for cloud computing environments. Cloud-native applications have the following characteristics: they can be accessed through the network, deployed and executed remotely, scalable and elastically scalable, shared, self-service on demand, highly available, remotely monitored, billed, and audited, standardized delivery and location-independent, etc. These characteristics make cloud-native applications more and more valued by people.
[0003] During the use of cloud-native applications, generally, cloud-native applications are directly deployed on cloud-native service platforms. How to perform health detection on cloud-native applications to ensure the smooth execution of various services in cloud-native applications is a key issue studied in the industry. Summary of the Invention
[0004] The embodiments of the present invention provide a method, device, electronic device, and storage medium for health detection of cloud-native applications to perform health detection on cloud-native applications and provide a basis for the smooth execution of various services in cloud-native applications.
[0005] According to one aspect of the embodiments of the present invention, a method for health detection of cloud-native applications is provided, including:
[0006] Determine a plurality of historical reference vectors corresponding to a target cloud-native application and service links corresponding to each of the historical reference vectors; each of the service links includes at least one container;
[0007] In response to a health detection request for the target cloud-native application and / or in response to a processing instruction for a target service of the target cloud-native application, determine a current reference vector corresponding to the target cloud-native application;
[0008] Determine comparison results between the current reference vector and each of the historical reference vectors, and determine a target service link corresponding to the current reference vector according to each of the comparison results;
[0009] Obtain a health detection result of the target cloud-native application according to the health status of each target container in the target service link.
[0010] According to another aspect of the embodiments of the present invention, a device for health detection of cloud-native applications is provided, including:
[0011] A historical reference vector determination module, configured to determine a plurality of historical reference vectors corresponding to a target cloud native application, and service links corresponding to each of the historical reference vectors; each of the service links includes at least one container;
[0012] A current reference vector determination module, configured to determine a current reference vector corresponding to the target cloud native application in response to a health detection request for the target cloud native application and / or in response to a processing instruction for a target service of the target cloud native application;
[0013] A target service link determination module, configured to determine comparison results between the current reference vector and each of the historical reference vectors, and determine a target service link corresponding to the current reference vector according to each of the comparison results;
[0014] A health detection result determination module, configured to obtain a health detection result of the target cloud native application according to the health status of each target container in the target service link.
[0015] According to another aspect of the embodiments of the present invention, there is provided an electronic device, the electronic device includes:
[0016] At least one processor; and
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the health detection method of the cloud native application according to any one of the embodiments of the present invention.
[0019] According to another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the health detection method of the cloud native application according to any one of the embodiments of the present invention when executed by a processor.
[0020] The technical solution of the embodiment of the present invention determines a plurality of historical benchmark vectors corresponding to a target cloud-native application and service links corresponding to each of the historical benchmark vectors; in response to a health detection request of the target cloud-native application and / or in response to a processing instruction for a target service of the target cloud-native application, determines a current benchmark vector corresponding to the target cloud-native application; determines comparison results between the current benchmark vector and each of the historical benchmark vectors, and determines a target service link corresponding to the current benchmark vector according to each of the comparison results; and obtains a health detection result of the target cloud-native application according to the health status of each target container in the target service link, can quickly determine the status of each container in the service link of the cloud-native application, can perform health detection on the cloud-native application, and provides a basis for the smooth execution of each service in the cloud-native application.
[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the embodiments of the present invention. Other features of the embodiments of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 is a flowchart of a method for health detection of a cloud-native application according to Embodiment 1 of the present invention;
[0024] Figure 2 is a flowchart of a method for health detection of a cloud-native application according to Embodiment 2 of the present invention;
[0025] Figure 3 is a flowchart of a method for health detection of a cloud-native application according to Embodiment 2 of the present invention
[0026] Figure 4 is a schematic structural diagram of a device for health detection of a cloud-native application according to Embodiment 3 of the present invention;
[0027] Figure 5 is a schematic structural diagram of an electronic device for implementing the method for health detection of a cloud-native application of the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] To enable those skilled in the art to better understand the solutions of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the scope of protection of the embodiments of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the embodiments of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 FIG. 10 is a flowchart of a method for health detection of a cloud-native application provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of health detection of different service links in a cloud-native application. The method can be executed by a health detection device of the cloud-native application. The health detection device of the cloud-native application can be implemented in the form of hardware and / or software, and the health detection device of the cloud-native application can be configured in an electronic device such as a computer, a server, or a tablet computer. Specifically, referring to Figure 1 , the method specifically includes the following steps:
[0032] Step 110: Determine a plurality of historical reference vectors corresponding to the target cloud-native application, and service links corresponding to each of the historical reference vectors; each of the service links includes at least one container.
[0033] Among them, the target cloud-native application can be any application, for example, face recognition, transfer confirmation, or information query, etc., which is not limited in this embodiment.
[0034] In an alternative implementation of this embodiment, multiple historical reference vectors corresponding to the target cloud native application may be determined before responding to the health detection request of the target cloud native application; optionally, in this embodiment, the assignment situations of various parameters used by the target cloud native application when processing services at historical moments may be determined, and then multiple historical reference vectors corresponding to the target cloud native application may be obtained according to the assignment situations of the various parameters; by way of example, if the target cloud native application is a face recognition application, the assignment situations (0 or 1) of different parameters in the application when the target cloud native application separately recognizes 20 different face images yesterday may be obtained respectively, and then historical reference vectors corresponding to the processing processes of each face image may be generated; among them, the parameters may be request parameters, header parameters, response parameters, etc., and no limitation is imposed on them in this embodiment.
[0035] In a specific implementation, after determining multiple historical reference vectors corresponding to the target cloud native application, the service links corresponding to the respective historical reference vectors may be further determined; optionally, the respective containers used by the target cloud native application when processing the services corresponding to each historical reference vector may be determined, and then the service links corresponding to the respective historical reference vectors may be obtained; by way of example, in the above example, the multiple containers used by the face recognition application when recognizing each face image may be determined respectively, and then the respective service links may be obtained according to the sequence of use of the respective containers; by way of example, if for the first face image, the face recognition application processes it successively through container A, container B, and container C, then the service link for the face recognition application to process the first face image is container A container B container C; if for the second face image, the face recognition application processes it successively through container A, container B, and container D, then the service link for the face recognition application to process the first face image is container A
[0036] container B container D.
[0037] It should be noted that the number of historical reference vectors and the service links corresponding to them involved in this embodiment is not fixed, and may be 20, 200, 2000, etc., and no limitation is imposed on them in this embodiment.
[0038] Step 120, in response to the health detection request of the target cloud native application and / or in response to the processing instruction for the target service of the target cloud native application, determine the current reference vector corresponding to the target cloud native application.
[0039] In an alternative implementation of this embodiment, when the electronic device receives a health detection request for a target cloud native application, a processing instruction for the target service of the target cloud native application, or both a health detection request for the target cloud native application and a processing instruction for the target service of the target cloud native application, it can further determine the current reference vector corresponding to the target cloud native application.
[0040] Optionally, in this embodiment, after the electronic device receives a health detection request for a target cloud native application, a processing instruction for the target service of the target cloud native application, or both a health detection request for the target cloud native application and a processing instruction for the target service of the target cloud native application, it can further determine the assignment of each parameter when the target cloud native application processes the target service at the current moment, and determine the current reference vector according to the assignment of each parameter. Exemplarily, if the assignments of each parameter when the target cloud native application processes the target service at the current moment are 1, 1, 0 respectively, then the current reference vector is [1, 1, 0].
[0041] Step 130: Determine the comparison results between the current reference vector and each of the historical reference vectors, and determine the target service link corresponding to the current reference vector according to each comparison result.
[0042] In an alternative implementation of this embodiment, after obtaining the current reference vector corresponding to the target cloud native application, it can further compare the current reference vector with each historical reference vector in sequence to determine the target historical reference vector that is most similar to the current reference vector.
[0043] Exemplarily, the similarity between the current reference vector and each historical reference vector can be calculated in sequence, and the target historical reference vector that is most similar to the current reference vector can be determined according to the similarity calculation result; or the current reference vector and each historical reference vector can be input into a pre-trained machine learning model respectively to obtain the target historical reference vector that is most similar to the current reference vector.
[0044] Furthermore, the service link corresponding to the target historical reference vector can be obtained, and the service link corresponding to the target historical reference vector can be determined as the target service link corresponding to the current reference vector.
[0045] Step 140: Obtain the health detection result of the target cloud native application according to the health status of each target container in the target service link.
[0046] In an alternative implementation of this embodiment, after obtaining the target service link corresponding to the current reference vector, the health status of each container in the target service link can be detected. For example, the health status of each container can be obtained from the cloud native service platform, or the health status of each container can be confirmed by sending corresponding message signals to each container respectively and based on the feedback signals.
[0047] Exemplarily, if the target service link includes three containers, namely container A, container B, and container C, the health status of these three containers can be obtained from the cloud native service platform respectively. If the cloud native service platform feedbacks that the status of all these three containers is healthy, it can be determined that the health status of the target service link is healthy; if the cloud native service platform feedbacks that one or more of these three containers have failures, it can be determined that the health status of the target service link is unhealthy.
[0048] The technical solution of this embodiment determines multiple historical reference vectors corresponding to the target cloud native application and the service links corresponding to each of the historical reference vectors; in response to the health detection request of the target cloud native application and / or in response to the processing instruction for the target service of the target cloud native application, determines the current reference vector corresponding to the target cloud native application; determines the comparison results between the current reference vector and each of the historical reference vectors respectively, and determines the target service link corresponding to the current reference vector according to each of the comparison results; and obtains the health detection result of the target cloud native application according to the health status of each target container in the target service link, which can quickly determine the status of each container in the service link of the cloud native application, perform health detection on the cloud native application, and provide a basis for the smooth execution of each service in the cloud native application.
[0049] Embodiment Two
[0050] Figure 2 FIG. is a flowchart of a method for health detection of a cloud native application provided according to Embodiment Two of the present invention. This embodiment further refines the above technical solutions, and the technical solutions in this embodiment can be combined with each optional solution in one or more of the above embodiments. As Figure 2 shown, the method for health detection of a cloud native application may include the following steps:
[0051] Step 210, determine at least one anchoring attribute parameter; determine the assignment of each anchoring attribute parameter when the target cloud native application processes the target service at different historical moments; and determine each historical reference vector according to the assignment of each anchoring attribute parameter.
[0052] Among them, the anchored attribute parameters are the parameters of the target cloud native application when performing corresponding services. For example, HTTP request parameter, Header, request entity, etc. In this embodiment, they are not limited.
[0053] In an alternative implementation of this embodiment, after determining at least one anchored attribute parameter, it is further possible to determine the assignment of each anchored attribute parameter when the target cloud native application processes the target service at different historical moments, and determine a plurality of historical reference vectors according to the assignment of each anchored attribute parameter.
[0054] Exemplarily, if the target cloud native application is an information query application, after determining each anchored attribute parameter of the information query application, it is possible to sequentially determine the assignment of each anchored attribute when the information query application processes different information query services at historical moments (such as 10 o'clock yesterday morning or 3 o'clock the day before yesterday afternoon, etc.); further, a plurality of historical reference vectors can be determined according to the assignment of each anchored attribute parameter. For example, if the assignment of each anchored attribute parameter at the historical moment of the first query service is 1, 1, 0, then the historical reference vector corresponding to the first query service is [1, 1, 0]; if the assignment of each anchored attribute parameter at the historical moment of the second query service is 1, 1, 1, then the historical reference vector corresponding to the second query service is [1, 1, 1].
[0055] Step 220: Obtain each container used by the target cloud native application when processing the target service at different historical moments; determine the service link corresponding to each historical reference vector according to the time information of each container used.
[0056] In an alternative implementation of this embodiment, it is also possible to obtain each container used by the target cloud native application when processing the target service at different historical moments, and further determine each service link corresponding to each historical reference vector according to the time information of each container used.
[0057] Exemplarily, in the above example, if the information query application uses three containers, namely container A, container B, and container C, when processing the first query service, and the order of use in time is container A, container B, and container C, then the service link corresponding to the historical reference vector of the first query service is container A container B container C.
[0058] Step 230: Determine the assignment of each anchored attribute parameter when the target cloud native application processes the target service at the current moment; determine the current reference vector according to the assignment of each anchored attribute parameter.
[0059] In an alternative implementation of this embodiment, when receiving a health detection request for a target cloud native application, a processing instruction for the target service of the target cloud native application, or when receiving both a health detection request for the target cloud native application and a processing instruction for the target service of the target cloud native application, it is possible to further determine the assignment of each anchored attribute parameter when the target cloud native application processes the target service at the current moment, and determine the current reference vector based on the assignment of each anchored attribute parameter.
[0060] Exemplarily, in the above example, if the assignments of each anchored attribute parameter for the target query service at the current moment are 1, 1, 1, then the current reference vector corresponding to the target query service is [1, 1, 1].
[0061] Step 240: Calculate the cosine similarity between the current reference vector and each of the historical reference vectors respectively; determine the target historical reference vector corresponding to the target cosine similarity, and determine the service link corresponding to the target historical reference vector as the target service link.
[0062] In an alternative implementation of this embodiment, after obtaining a plurality of historical reference vectors and the current reference vector, the cosine similarity between the current reference vector and each historical reference vector can be calculated respectively; further, the calculation results of each similarity can be sorted, the maximum similarity result can be determined as the target cosine similarity, and the target historical reference vector corresponding to the target cosine similarity can be determined; further, the service link corresponding to the target historical reference vector can be determined as the target service link.
[0063] Exemplarily, in the above example, the first historical reference vector is [1, 1, 0], and the service link corresponding to the first historical reference vector is Container A -> Container B -> Container C; the second historical reference vector is [1, 1, 1], and the service link corresponding to the second historical reference vector is Container A -> Container B -> Container D; the current reference vector is [1, 1, 1]; the calculated cosine similarity between the current reference vector [1, 1, 1] and the first historical reference vector [1, 1, 0] is 0.82; the cosine similarity between the current reference vector [1, 1, 1] and the second historical reference vector [1, 1, 1] is 1; it can be seen that 1 > 0.82, so it can be determined that the target service link corresponding to the current reference vector is Container A -> Container B -> Container D.
[0064] Step 250: Obtain the health status of each of the target containers from the cloud native service platform; generate a health detection result for the target cloud native application according to the health status of each of the target containers.
[0065] Among them, the target container can be any container in the target service link, and it is not limited in this embodiment.
[0066] In an alternative implementation of this embodiment, after determining the target service link, the health status of each of the target containers can be further obtained from the cloud native service platform; and a health detection result of the target cloud native application can be generated based on the health status of each of the target containers.
[0067] Exemplarily, in the above example, the target service link corresponding to the current reference vector is container A
[0068] For containers B and D, the health statuses of containers A, B, and D can be obtained from the cloud native service platform respectively; if the cloud native service platform feedbacks that the statuses of these three containers are all healthy, it can be determined that the health status of the target service link is healthy, that is, the health detection result of the target cloud native application is healthy; if the cloud native service platform feedbacks that one or more of these three containers have failures, it can be determined that the health status of the target service link is unhealthy, that is, the health detection result of the target cloud native application is unhealthy.
[0069] Step 260, if it is determined that the health status of the first target container among the target containers is unhealthy, then replace the first target container in the target service link to ensure the health of the target service link.
[0070] Wherein, the first target container can be any container in the target service link, and it is not limited in this embodiment. For example, container A, container B, or container D in the above example.
[0071] In this embodiment, if it is determined that the health status of the first target container in the target container is unhealthy, then replace the first target container in the target service link to ensure the health of the target service link.
[0072] Exemplarily, in this embodiment, if it is determined that the health status of container D is non-monitored, then container D can be replaced with other containers such as container C or container E, thereby ensuring the health of the target service link, and thus ensuring that the target cloud native application can process each service.
[0073] The solution of this embodiment can record the containers through which the traffic passes according to the link data in the link tracking; adopt the cosine similarity algorithm to perform similarity matching on the expected newly entered and newly entered traffic, and after obtaining the associated container list, judge whether the overall traffic path is healthy through the container health detection status provided by the cloud native service, so as to achieve the health detection of the full process call chain with fine granularity.
[0074] For a better understanding of the embodiments of the present invention, Figure 3 is a flowchart of a method for health detection of a cloud native application provided according to Embodiment 2 of the present invention. Refer to Figure 3, which mainly includes the following steps:
[0075] Step 310: Define the anchoring attributes of the specific service;
[0076] Step 320: Calculate the benchmark value of the specific service;
[0077] Step 330: The real-time service enters;
[0078] Step 340: Conduct a similarity comparison with the service benchmark value;
[0079] Step 350: Determine the health detection path;
[0080] Step 360: Determine whether the path is reachable;
[0081] If so, execute normally;
[0082] Otherwise, switch the traffic target.
[0083] In the solution of this embodiment, before the new traffic arrives or a new health detection is initiated, the link tracking system is extracted to analyze the anchoring data, so as to obtain the complete call chain benchmark data and the corresponding pod list. When the new traffic or a new health detection arrives, according to the previously defined and calculated and analyzed anchoring attributes, a similarity evaluation is performed with the call chain benchmark data. When the similarity requirement is met, the cloud native platform is requested to obtain the health detection status of the corresponding pod, achieving the goal of providing full-link call health detection.
[0084] Specifically, it may include the following steps:
[0085] (1) Define the anchoring attributes of the specific service, such as HTTP request parameter, Header, requestentity keywords.
[0086] (2) Calculate the benchmark value of the historical call data of the link tracking system according to the anchoring attributes and collect the relevant pod list.
[0087] (3) When the soft / hard load initiates a new health detection or new service traffic enters, calculate the similarity between the new traffic and the benchmark value using cosine similarity according to the anchoring attributes.
[0088] (4) When it is found that the similarity meets the requirements, obtain the health status of the corresponding pod from the cloud native platform.
[0089] (5) When it is found that the health status does not meet the requirements, switch the traffic target to the backup data center.
[0090] (6) When the pod health status meets the requirements, execute the full-process call.
[0091] The solution of this embodiment records the pods through which the traffic passes according to the link data in the link tracking; uses the cosine similarity algorithm to perform similarity matching on the expected newly entered and newly entered traffic, and after obtaining the list of associated pods, determines whether the overall traffic path is healthy through the pod health detection status provided by the cloud native service, achieving fine-grained health detection of the full process call chain.
[0092] Embodiment Three
[0093] Figure 4 It is a schematic structural diagram of a health detection device for a cloud native application provided according to Embodiment Three of the present invention. As Figure 4 shown, the device includes: a historical reference vector determination module 410, a current reference vector determination module 420, a target service link determination module 430, and a health detection result determination module 440.
[0094] The historical reference vector determination module 410 is used to determine a plurality of historical reference vectors corresponding to the target cloud native application, and service links corresponding to each of the historical reference vectors; each of the service links includes at least one container;
[0095] The current reference vector determination module 420 is used to determine a current reference vector corresponding to the target cloud native application in response to the health detection request for the target cloud native application and / or in response to a processing instruction for the target service of the target cloud native application;
[0096] The target service link determination module 430 is used to determine the comparison results of the current reference vector with each of the historical reference vectors, and determine a target service link corresponding to the current reference vector according to each of the comparison results;
[0097] The health detection result determination module 440 is used to obtain the health detection result of the target cloud native application according to the health status of each target container in the target service link.
[0098] In the solution of this embodiment, the historical reference vector determination module determines multiple historical reference vectors corresponding to the target cloud native application and the service links corresponding to the historical reference vectors; each of the service links includes at least one container; the current reference vector determination module determines, in response to a health detection request for the target cloud native application and / or in response to a processing instruction for a target service of the target cloud native application, a current reference vector corresponding to the target cloud native application; the target service link determination module determines the comparison results between the current reference vector and each of the historical reference vectors respectively, and determines a target service link corresponding to the current reference vector according to each of the comparison results; the health detection result determination module obtains a health detection result of the target cloud native application according to the health status of each target container in the target service link, and can quickly determine the status of each container in the service link of the cloud native application, providing a basis for the smooth execution of each service in the cloud native application.
[0099] In an alternative implementation manner of this embodiment, the historical reference vector determination module 410 is specifically configured to determine at least one anchoring attribute parameter;
[0100] Determine the assignment conditions of each of the anchoring attribute parameters when the target cloud native application processes the target service at different historical moments;
[0101] Determine each of the historical reference vectors according to the assignment conditions of each of the anchoring attribute parameters.
[0102] In an alternative implementation manner of this embodiment, the historical reference vector determination module 410 is further specifically configured to obtain each container used by the target cloud native application when processing the target service at different historical moments;
[0103] Determine the service links corresponding to each of the historical reference vectors according to the time information of each of the containers used.
[0104] In an alternative implementation manner of this embodiment, the current reference vector determination module 420 is specifically configured to determine the assignment conditions of each anchoring attribute parameter when the target cloud native application processes the target service at the current moment;
[0105] Determine the current reference vector according to the assignment conditions of each of the anchoring attribute parameters.
[0106] In an alternative implementation manner of this embodiment, the target service link determination module 420 is specifically configured to calculate the cosine similarity between the current reference vector and each of the historical reference vectors respectively;
[0107] Determine a target historical reference vector corresponding to a target cosine similarity, and determine the service link corresponding to the target historical reference vector as the target service link.
[0108] In an alternative implementation of this embodiment, the health detection result determination module 440 is specifically configured to obtain the health status of each of the target containers from the cloud native service platform;
[0109] Generate a health detection result of the target cloud native application according to the health status of each of the target containers.
[0110] In an alternative implementation of this embodiment, the health detection device for cloud native applications further includes: a replacement module for
[0111] If it is determined that the health status of the first target container among the target containers is unhealthy, replace the first target container in the target service link to ensure the health of the target service link.
[0112] The health detection device for cloud native applications provided by the embodiments of the present invention can execute the health detection method for cloud native applications provided by any embodiment of the embodiments of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0113] Embodiment 4
[0114] Figure 5 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the embodiments of the present invention described and / or claimed herein.
[0115] As Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0116] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0117] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the health detection method for cloud-native applications.
[0118] In some embodiments, the health detection method for cloud-native applications can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the health detection method for cloud-native applications described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the health detection method for cloud-native applications in any other appropriate manner (e.g., by means of firmware).
[0119] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0120] The computer programs for implementing the methods of the embodiments of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0121] In the context of the embodiments of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0123] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0124] The computing system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0125] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the embodiments of the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the embodiments of the present invention can be achieved, and no limitation is made herein.
[0126] The above specific embodiments do not constitute a limitation on the protection scope of the embodiments of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the embodiments of the present invention shall be included within the protection scope of the embodiments of the present invention.
Claims
1. A health detection method for cloud-native applications, characterized in that, Including: Determine a plurality of historical benchmark vectors corresponding to the target cloud-native application, and the service links corresponding to each of the historical benchmark vectors; each of the service links includes at least one container; In response to the health detection request of the target cloud-native application and / or in response to the processing instruction for the target service of the target cloud-native application, determine the current benchmark vector corresponding to the target cloud-native application; Determine the comparison results between the current benchmark vector and each of the historical benchmark vectors respectively, and determine the target service link corresponding to the current benchmark vector according to each of the comparison results; the target service link is the service link corresponding to the target historical benchmark vector that is most similar to the current benchmark vector; Obtain the health detection result of the target cloud-native application according to the health status of each target container in the target service link; The determining a plurality of historical benchmark vectors corresponding to the target cloud-native application, and the service links corresponding to each of the historical benchmark vectors, includes: Determine at least one anchoring attribute parameter; the anchoring attribute parameter is the parameter of the target cloud-native application when performing the corresponding service; Determine the assignment situation of each of the anchoring attribute parameters when the target cloud-native application processes the target service at different historical moments; Determine each of the historical benchmark vectors according to the assignment situation of each of the anchoring attribute parameters.
2. The method according to claim 1, characterized in that The determining a plurality of historical benchmark vectors corresponding to the target cloud-native application, and the service links corresponding to each of the historical benchmark vectors, further includes: Obtain each container used by the target cloud-native application when processing the target service at different historical moments; Determine the service link corresponding to each of the historical benchmark vectors according to the time information of each container used.
3. The method according to claim 1, wherein The determining the current benchmark vector corresponding to the target cloud-native application includes: Determine the assignment situation of each of the anchoring attribute parameters when the target cloud-native application processes the target service at the current moment; Determine the current benchmark vector according to the assignment situation of each of the anchoring attribute parameters.
4. The method according to claim 1, wherein The determining the comparison results between the current benchmark vector and each of the historical benchmark vectors respectively, and determining the target service link corresponding to the current benchmark vector according to each of the comparison results, includes: Calculate the cosine similarity between the current benchmark vector and each of the historical benchmark vectors respectively; Determine the target historical benchmark vector corresponding to the target cosine similarity, and determine the service link corresponding to the target historical benchmark vector as the target service link.
5. The method according to claim 1, characterized in that, The obtaining the health detection result of the target cloud-native application according to the health status of each target container in the target service link includes: Obtain the health status of each of the target containers from the cloud-native service platform; Generate the health detection result of the target cloud-native application according to the health status of each of the target containers.
6. The method according to claim 1, wherein After obtaining the health detection result of the target cloud-native application according to the health status of each target container in the target service link, it further includes: If it is determined that the health status of the first target container among each of the target containers is unhealthy, replace the first target container in the target service link to ensure the health of the target service link.
7. A health detection device for cloud-native applications, characterized in that, Including: A historical benchmark vector determination module, configured to determine a plurality of historical benchmark vectors corresponding to a target cloud native application, and service links corresponding to each of the historical benchmark vectors; each of the service links includes at least one container; A current benchmark vector determination module, configured to determine a current benchmark vector corresponding to the target cloud native application in response to a health detection request for the target cloud native application and / or in response to a processing instruction for a target service of the target cloud native application; A target service link determination module, configured to determine comparison results between the current benchmark vector and each of the historical benchmark vectors, and determine a target service link corresponding to the current benchmark vector according to each of the comparison results; the target service link is the service link corresponding to the target historical benchmark vector that is most similar to the current benchmark vector; A health detection result determination module, configured to obtain a health detection result of the target cloud native application according to the health status of each target container in the target service link; The historical benchmark vector determination module is specifically configured to determine at least one anchoring attribute parameter; the anchoring attribute parameter is a parameter of the target cloud native application when performing corresponding services; Determine the assignment situation of each of the anchoring attribute parameters when the target cloud native application processes the target service at different historical moments; Determine each of the historical benchmark vectors according to the assignment situation of each of the anchoring attribute parameters.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the health detection method of the cloud native application according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to implement the health detection method of the cloud native application according to any one of claims 1-6 when executed.
Citation Information
Patent Citations
Cloud native application testing method and device, equipment and storage medium
CN114064475A
Service architecture maintenance method and device, equipment, storage medium and program product
CN115048134A