Application service affinity hidden danger determination method and device, electronic device, and storage medium
By determining the deployment method and related parameters of the target application service, the affinity risk level under virtual machine and container deployment is automatically determined, which solves the problem of unintelligent determination of target application service risks in existing technologies, realizes early detection and warning, reduces business interruptions, and improves user experience.
Patent Information
- Application Number
- CN202411287155.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-09-13
AI Technical Summary
In the existing technology, the identification of affinity risks of target application services is not intelligent and is usually discovered only after a business failure. There is a lack of early warning mechanism, resulting in business interruption and low user perception.
By obtaining the deployment method of the target application service, based on the number of cluster nodes deployed with a single virtual machine, the number of virtual machines associated with a single physical machine, the number of cluster nodes deployed with a single container, the number of containers deployed on a single platform, and the number of platforms deployed on a single host, the affinity risk level under different deployment methods is determined, achieving automatic early judgment and visual analysis.
It improves the accuracy of affinity risk levels, detects potential problems in virtual machine and container deployments in advance, reduces business interruptions, improves user perception, provides visual analysis tools for operation and maintenance work, and improves business continuity.
Smart Images

Figure CN119383108B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method, device, electronic device and storage medium for determining affinity risks of an application service. Background Art
[0002] Operators' service fault detection and handling have undergone a long development process. Currently, while quickly detecting faults, operators also rely on the existing network management system service architecture for analysis and processing. Early detection of high availability risks of target application services can reduce service failures and improve user awareness.
[0003] The affinity risks of existing target application services are usually discovered only after a service failure occurs. It can be seen that the determination of the affinity risks of existing target application services is not intelligent. Summary of the Invention
[0004] The present invention provides a method, device, electronic device and storage medium for determining affinity risks of application services, which are used to solve the defect of the existing technology that the determination of affinity risks of target application services is not intelligent, and realize automatic and advance acquisition of affinity risks of target application services.
[0005] The present invention provides a method for determining affinity risks of an application service, comprising: when the number of cluster nodes of a target application service is greater than 1, obtaining a deployment mode of the target application service; if the deployment mode is virtual machine deployment, determining an affinity risk level of the target application service based on the number of cluster nodes of a single virtual machine deployment corresponding to the target application service and / or the number of virtual machines associated with a single physical machine corresponding to the target application service; if the deployment mode is container deployment, determining an affinity risk level based on the number of cluster nodes of a single container deployment corresponding to the target application service, the number of containers deployed on a single platform corresponding to the target application service, and / or the number of platforms deployed on a single host corresponding to the target application service.
[0006] According to the method for determining affinity risks of application services provided by the present invention, the affinity risk level of the target application service is determined based on the number of nodes in the single virtual machine deployment cluster corresponding to the target application service and / or the number of virtual machines associated with a single physical machine corresponding to the target application service, including: when the number of nodes in the single virtual machine deployment cluster is greater than 1, determining the affinity risk level as a first-level affinity risk; when the number of nodes in the single virtual machine deployment cluster is equal to 1 and the number of virtual machines associated with a single physical machine is greater than 1, determining the affinity risk level as a second-level affinity risk. The affinity risk levels represent the order of deployment risks of the target application service, with the first-level affinity risk being greater than the second-level affinity risk.
[0007] According to the affinity risk determination method for application services provided by the present invention, the affinity risk level is determined based on the number of single-container deployment cluster nodes corresponding to the target application service, the number of single-platform deployment containers corresponding to the target application service, and / or the number of single-host deployment platforms corresponding to the target application service, including: when the number of single-container deployment cluster nodes is greater than 1, determining the affinity risk level as a level 1 affinity risk; when the number of single-container deployment cluster nodes is equal to 1, determining the affinity risk level based on the number of single-platform deployment containers and / or the number of single-host deployment platforms.
[0008] According to the method for determining affinity risks of application services provided by the present invention, the affinity risk level is determined based on the number of containers deployed on a single platform and / or the number of platforms deployed on a single host, including: when the number of containers deployed on a single platform is greater than 1, the affinity risk level is determined to be a second-level affinity risk; when the number of containers deployed on a single platform is equal to 1 and the number of platforms deployed on a single host is greater than 1, the affinity risk level is determined to be a third-level affinity risk. The affinity risk levels represent the presence of deployment risks in target application services in the following order: first-level affinity risks are greater than second-level affinity risks, and second-level affinity risks are greater than third-level affinity risks.
[0009] According to the method for determining affinity risks of application services provided by the present invention, the number of cluster nodes deployed on a single virtual machine is determined based on the following steps: obtaining a service deployment server list, the service deployment server list includes virtual machines and cluster nodes deployed on each virtual machine; and obtaining the number of cluster nodes deployed on a single virtual machine based on the service deployment server list.
[0010] According to the method for determining affinity risks of application services provided by the present invention, the number of cluster nodes deployed in a single container is determined based on the following steps: obtaining a service deployment container list, the service deployment container list including containers and cluster nodes deployed on each container; and obtaining the number of cluster nodes deployed in a single container based on the service deployment container list.
[0011] According to the method for determining affinity risks of application services provided by the present invention, the number of containers deployed on a single platform is determined based on the following steps: obtaining a list of platforms to which the containers belong, the list of platforms to which the containers belong includes the containers and the platform to which each container belongs; and obtaining the number of containers deployed on a single platform based on the list of platforms to which the containers belong.
[0012] The application further provides an application service affinity hidden danger determination device, comprising: a deployment mode determination module, configured to acquire a deployment mode of a target application service when the number of cluster nodes of the target application service is greater than 1; a first affinity hidden danger level determination module, configured to determine an affinity hidden danger level of the target application service based on the number of single virtual machine deployment cluster nodes corresponding to the target application service and / or the number of single physical machine associated virtual machines corresponding to the target application service if the deployment mode is virtual machine deployment; and a second affinity hidden danger level determination module, configured to determine the affinity hidden danger level based on the number of single container deployment cluster nodes corresponding to the target application service, the number of single platform deployment containers corresponding to the target application service and / or the number of single host deployment platforms corresponding to the target application service if the deployment mode is container deployment.
[0013] The application further provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above application service affinity hidden danger determination methods when executing the computer program.
[0014] The application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement any of the above application service affinity hidden danger determination methods.
[0015] The application provides an application service affinity hidden danger determination method, device, electronic device and storage medium, which realizes different affinity hidden danger level determinations through different deployment modes, improves the accuracy of determining the affinity hidden danger level, determines the affinity hidden danger level according to the number of single virtual machine deployment cluster nodes and / or the number of single physical machine associated virtual machines, realizes automatic early determination of the affinity hidden danger level in the case of virtual machine deployment, is conducive to early discovery of the affinity hidden danger in the case of virtual machine deployment, reduces the failure of the application service and improves user perception. The affinity hidden danger level is determined through the number of single container deployment cluster nodes, the number of single platform deployment containers and / or the number of single host deployment platforms, which realizes automatic early determination of the affinity hidden danger level in the case of container deployment, is conducive to early discovery of the affinity hidden danger in the case of container deployment, reduces the failure of the application service and improves user perception. The application can effectively solve the business interruption problem caused by non-standard application service deployment, provides a visual analysis tool for operation and maintenance work, can analyze application service deployment hidden dangers in advance and thus improve business continuity. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 This is one of the flow charts of the method for determining affinity risks of application services provided by the present invention.
[0018] Figure 2 It is a structural diagram of the virtual machine deployment provided by the present invention.
[0019] Figure 3 It is a structural diagram of the container deployment provided by the present invention.
[0020] Figure 4 This is the second flow chart of the method for determining affinity risks of application services provided by the present invention.
[0021] Figure 5 It is a structural diagram of the device for determining affinity hazards of application services provided by the present invention.
[0022] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0024] The following combination Figures 1-6 The present invention describes a method, device, and electronic device for determining affinity risks of application services.
[0025] Figure 1 This is one of the flow charts of the method for determining affinity risks of application services provided by the present invention, such as Figure 1 As shown, the method for determining affinity risks of application services includes steps S100 to S300, and the details of each step are as follows.
[0026] S100: When the number of cluster nodes of the target application service is greater than 1, obtain the deployment mode of the target application service.
[0027] Application services refer to computing resources and supporting systems that provide specific functions, applications, or services within information technology and computing environments. Application services are typically provided as network services, allowing users or other systems to access and use these functions. Target application services are those with a cluster node count of greater than one. Application service affinity refers to the relative relationships and scheduling strategies between application services within a computing environment, particularly in clustered or virtualized environments.
[0028] The deployment script of the target application service is obtained through the resource data of the target application service to obtain the number of cluster nodes of the target application service.
[0029] If the number of cluster nodes for the target application service is greater than 1, it indicates that the target application service is running in a distributed manner. In this case, the target application service may have affinity risks, such as those related to resource contention, network latency, data consistency, load balancing, fault recovery, configuration management, and scheduling policies. If the number of cluster nodes for the target application service is equal to 1, it indicates that there are no affinity risks for the target application service. Exit the affinity risk analysis for the target application service.
[0030] When the number of cluster nodes of the target application service is greater than 1, the deployment mode of the target application service is obtained according to the resource data of the target application service. The deployment mode of the target application service of the present invention includes a traditional deployment mode and a container deployment mode.
[0031] like Figure 2 As shown, traditional deployment involves virtual machine deployment, using virtualization technology to create and manage virtual machines and install target application services (or application services) on these virtual machines. Each virtual machine has its own operating system and resources, and different target application services are isolated from each other. Virtual machines are deployed on physical machines, such as real hardware servers.
[0032] like Figure 3 As shown in the figure, container deployment packages the target application service and its dependencies into a container, providing an isolated environment for the target application service. Containerization enables the target application service to run consistently in any environment, simplifying deployment and scaling.
[0033] Match the deployment mode of the target application service, and analyze the affinity risk level of the target application service based on the deployment mode of the target application service.
[0034] S200: If the deployment mode is virtual machine deployment, determine the affinity risk level of the target application service based on the number of nodes in the single virtual machine deployment cluster corresponding to the target application service and / or the number of virtual machines associated with a single physical machine corresponding to the target application service.
[0035] The number of cluster nodes deployed on a single virtual machine is determined based on the following steps: obtaining a service deployment server list, which includes virtual machines and cluster nodes deployed on each virtual machine; and obtaining the number of cluster nodes deployed on a single virtual machine based on the service deployment server list.
[0036] like Figure 4 As shown, when the number of cluster nodes for the target application service is greater than one and the target application service is deployed in a virtual machine, a service deployment server list is obtained. The service deployment server list includes the virtual machines and the number of all cluster nodes deployed on each virtual machine (including the cluster nodes for the target application service and cluster nodes for other application services). Using this service deployment server list, the number of cluster nodes for the target application service deployed in a single virtual machine can be obtained.
[0037] The present invention records the number of cluster nodes deployed on each virtual machine through a service deployment server list, thereby achieving comprehensive recording of virtual machine information and facilitating improved efficiency in obtaining the number of cluster nodes deployed on a single virtual machine.
[0038] Determine whether the target application service has affinity risks and the level of such risks based on the number of nodes in the single-VM deployment cluster. If the target application service is determined to have no affinity risks based on the number of nodes in the single-VM deployment cluster, obtain the list of physical machines to which the virtual machine belongs. This list contains the mapping between virtual machines and physical machines. Based on this list, obtain the number of virtual machines associated with the target application service. Determine whether the target application service has affinity risks and the level of such risks based on the number of virtual machines associated with the single physical machine.
[0039] S300: If the deployment mode is container deployment, the affinity risk level is determined based on the number of single-container deployment cluster nodes corresponding to the target application service, the number of single-platform deployment containers corresponding to the target application service, and / or the number of single-host deployment platforms corresponding to the target application service.
[0040] The number of cluster nodes deployed in a single container is determined based on the following steps: obtaining a service deployment container list, which includes containers and cluster nodes deployed on each container; and obtaining the number of cluster nodes deployed in a single container based on the service deployment container list.
[0041] If the target application service has more than one cluster node and is deployed in container mode, obtain the service deployment container list. The service deployment container list includes mappings between containers and cluster nodes (including the target application service's cluster node and cluster nodes of other application services). Get the number of cluster nodes for a single container deployment based on the service deployment container list.
[0042] The present invention records the mapping relationship between containers and cluster node numbers according to the service deployment container list, thereby achieving comprehensive recording of container information and facilitating improved efficiency in obtaining the number of cluster nodes deployed by a single container.
[0043] Determine whether the target application service has affinity risks and the level of such risks based on the number of nodes in the single-container deployment cluster. If the target application service is determined to have no affinity risks based on the number of nodes in the single-container deployment cluster, obtain the number of containers deployed on a single platform corresponding to the target application service. Determine whether the target application service has affinity risks and the level of such risks based on the number of containers deployed on a single platform.
[0044] The number of containers deployed on a single platform is determined based on the following steps: obtaining a list of platforms to which the containers belong, where the list includes the containers and the platform to which each container belongs; and obtaining the number of containers deployed on a single platform based on the list of platforms to which the containers belong.
[0045] The present invention records the mapping relationship between containers and platforms according to the platform list to which the containers belong, thereby improving the comprehensiveness of the container information recording and facilitating improving the accuracy of obtaining the number of containers deployed on a single platform.
[0046] If the target application service is determined to have no affinity risks based on the number of nodes in the single-container deployment cluster and the number of containers deployed on a single platform, obtain the number of platforms deployed on a single host for the target application service. Obtain the host list to which the platform belongs. The host list records the mapping between platforms and hosts. Based on the host list to which the platform belongs, obtain the number of platforms deployed on a single host. Based on the number of platforms deployed on a single host, determine whether the target application service has affinity risks and the level of the affinity risk.
[0047] The method for determining affinity hidden dangers of application services provided by the present invention realizes different affinity hidden danger level determinations through different deployment methods, thereby improving the accuracy of determining affinity hidden danger levels. The affinity hidden danger level is determined according to the number of cluster nodes deployed by a single virtual machine and / or the number of virtual machines associated with a single physical machine, thereby realizing automatic early determination of affinity hidden danger levels in the case of virtual machine deployment, which is conducive to early discovery of affinity hidden dangers under virtual machine deployment, reducing application service failures, and improving user perception. The affinity hidden danger level is determined by the number of cluster nodes deployed by a single container, the number of containers deployed by a single platform, and / or the number of platforms deployed by a single host, thereby realizing automatic early determination of affinity hidden danger levels in the case of container deployment, which is conducive to early discovery of affinity hidden dangers under container deployment, reducing application service failures, and improving user perception. The present invention can effectively solve the problem of business interruption caused by irregular application service deployment, provide a visual analysis tool for operation and maintenance work, and can analyze application service deployment hidden dangers in advance, thereby improving business continuity.
[0048] This invention, based on the operator's resource topology and the current state of application services within existing operator network management systems, links isolated faulty systems with resource systems, thereby developing an intelligent analysis method for application service affinity hazards. Furthermore, based on the characteristics of the network management system, resource system, and network, it proposes automated handling of high-availability hazards in application services. To avoid repetitive and tedious business process modeling, this invention reorganizes all analysis processes to provide a common business process.
[0049] Based on the above embodiment, the affinity risk level of the target application service is determined based on the number of single virtual machine deployment cluster nodes corresponding to the target application service and / or the number of virtual machines associated with a single physical machine corresponding to the target application service, including steps S210 to S220, and each step is specifically as follows.
[0050] S210: When the number of nodes in the single virtual machine deployment cluster is greater than 1, determine that the affinity risk level is a level one affinity risk.
[0051] S210: When the number of nodes in a single virtual machine deployment cluster is equal to 1 and the number of virtual machines associated with a single physical machine is greater than 1, the affinity risk level is determined to be a level 2 affinity risk. The affinity risk level represents the presence of deployment risks in the target application service, with level 1 affinity risk being greater than level 2 affinity risk.
[0052] like Figure 4 As shown, when the number of cluster nodes deployed in a single virtual machine is greater than 1, it indicates that the target application service has a high availability risk, and the target application service is determined to be a first-level affinity risk, indicating that the target application service has the highest affinity risk.
[0053] For a target application service deployed in a virtual machine, if the number of nodes in a single virtual machine deployment cluster is equal to 1 and the number of virtual machines associated with a single physical machine is greater than 1, this indicates that the target application service may have a high availability vulnerability. The affinity vulnerability level for this target application service is determined to be level 2, indicating that this target application service may have an affinity vulnerability. The higher the affinity vulnerability level, the lower the likelihood of the application service having an affinity vulnerability. For example, the likelihood of affinity vulnerabilities is ranked from highest to lowest: level 1 > level 2 > level 3.
[0054] When the number of nodes in a single virtual machine deployment cluster is equal to 1 and the number of virtual machines associated with a single physical machine is equal to 1, it indicates that there is no risk for the target application service, and the risk analysis for the target application service is exited (exit analysis).
[0055] The present invention determines the affinity risk level based on the number of cluster nodes deployed in a single virtual machine and / or the number of virtual machines associated with a single physical machine, thereby realizing automatic early determination of the affinity risk level in the case of virtual machine deployment, which is conducive to early discovery of affinity risks in virtual machine deployment, reduces application service failures, and improves user perception.
[0056] Based on the above embodiment, the affinity risk level is determined based on the number of single-container deployment cluster nodes corresponding to the target application service, the number of single-platform deployment containers corresponding to the target application service, and / or the number of single-host deployment platforms corresponding to the target application service, including steps S310 to S320, and each step is specifically as follows.
[0057] S310: When the number of nodes in the single-container deployment cluster is greater than 1, determine that the affinity risk level is a level 1 affinity risk.
[0058] S320: When the number of nodes in the single-container deployment cluster is equal to 1, determine the affinity risk level based on the number of containers deployed on a single platform and / or the number of platforms deployed on a single host.
[0059] The affinity risk level is determined based on the number of containers deployed on a single platform and / or the number of platforms deployed on a single host. Specifically, when the number of containers deployed on a single platform is greater than 1, the affinity risk level is determined to be a level 2 affinity risk; when the number of containers deployed on a single platform is equal to 1 and the number of platforms deployed on a single host is greater than 1, the affinity risk level is determined to be a level 3 affinity risk. The order of the affinity risk levels representing the presence of deployment risks in the target application services is: level 1 affinity risk is greater than level 2 affinity risk, and level 2 affinity risk is greater than level 3 affinity risk.
[0060] For a target application service deployed in a container, if the number of nodes in a single container deployment cluster is greater than 1, it indicates that the target application service has a high availability risk and is determined to have a first-level affinity risk.
[0061] If the number of nodes in a single-container deployment cluster is equal to 1 and the number of containers deployed on a single platform is greater than 1, it indicates that the target application service may have high availability risks. The affinity risk level of the target application service is determined to be a level 2 affinity risk.
[0062] If the number of cluster nodes deployed in a single container is equal to 1, the number of containers deployed on a single platform is equal to 1, and the number of platforms deployed on a single host is greater than 1, it indicates that the target application service may be at risk, but the impact of the risk is small. The affinity risk level of the target application service is determined to be level 3 affinity risk.
[0063] If the number of cluster nodes deployed with a single container is equal to 1, the number of containers deployed with a single platform is equal to 1, and the number of platforms deployed with a single host is equal to 1, it indicates that there is no risk for the target application service, and the risk analysis for the target application service is exited.
[0064] The application determines the affinity risk level by the single-container deployment cluster node number, the single-platform deployment container number and / or the single-host deployment platform number, realizes the automatic early determination of the affinity risk level in the container deployment case, is beneficial to early discovery of the affinity risk in the container deployment, reduces the application service failure and improves the user perception.
[0065] The application service affinity risk determination device provided by the application is described below, and the application service affinity risk determination device described below can be correspondingly referred to the application service affinity risk determination method described above.
[0066] As shown in the figure, an application service affinity risk determination device comprises: a deployment mode determination module 501 configured to acquire a deployment mode of a target application service when the cluster node number of the target application service is greater than 1. Figure 5
[0067] A first affinity risk level determination module 502 is configured to determine the affinity risk level of the target application service based on the single-virtual-machine deployment cluster node number corresponding to the target application service and / or the number of virtual machines associated with a single physical machine corresponding to the target application service if the deployment mode is virtual machine deployment.
[0068] A second affinity risk level determination module 503 is configured to determine the affinity risk level based on the single-container deployment cluster node number corresponding to the target application service, the single-platform deployment container number corresponding to the target application service and / or the single-host deployment platform number corresponding to the target application service if the deployment mode is container deployment.
[0069] The application service affinity risk determination device provided by the application realizes different affinity risk level determinations through different deployment modes, improves the accuracy of determining the affinity risk level, determines the affinity risk level based on the single-virtual-machine deployment cluster node number and / or the number of virtual machines associated with a single physical machine, realizes the automatic early determination of the affinity risk level in the virtual machine deployment case, is beneficial to early discovery of the affinity risk in the virtual machine deployment, reduces the application service failure, improves the user perception, determines the affinity risk level based on the single-container deployment cluster node number, the single-platform deployment container number and / or the single-host deployment platform number, realizes the automatic early determination of the affinity risk level in the container deployment case, is beneficial to early discovery of the affinity risk in the container deployment, reduces the application service failure, improves the user perception. The application can effectively solve the business interruption problem caused by the non-standard application service deployment, provides a visual analysis tool for the operation and maintenance work, can analyze the application service deployment risk in advance and further improve the business continuity.
[0070] In one embodiment, the first affinity risk level determination module 502 is used to: when the number of cluster nodes deployed in a single virtual machine is greater than 1, determine the affinity risk level as a first-level affinity risk; when the number of cluster nodes deployed in a single virtual machine is equal to 1 and the number of virtual machines associated with a single physical machine is greater than 1, determine the affinity risk level as a second-level affinity risk. The order of the deployment risk of the target application service represented by the affinity risk level is that the first-level affinity risk is greater than the second-level affinity risk.
[0071] In one embodiment, the second affinity risk level determination module 503 is used to: when the number of nodes in a single-container deployment cluster is greater than 1, determine the affinity risk level as a level 1 affinity risk; when the number of nodes in a single-container deployment cluster is equal to 1, determine the affinity risk level based on the number of containers deployed on a single platform and / or the number of platforms deployed on a single host.
[0072] In one embodiment, the second affinity risk level determination module 503 is used to: when the number of containers deployed on a single platform is greater than 1, determine the affinity risk level as a second-level affinity risk; when the number of containers deployed on a single platform is equal to 1 and the number of platforms deployed on a single host is greater than 1, determine the affinity risk level as a third-level affinity risk. The affinity risk levels represent the presence of deployment risks in target application services in the following order: first-level affinity risks are greater than second-level affinity risks, and second-level affinity risks are greater than third-level affinity risks.
[0073] In one embodiment, the first affinity risk level determination module 502 is further configured to: obtain a service deployment server list, the service deployment server list including virtual machines and cluster nodes deployed on each virtual machine; and obtain the number of cluster nodes deployed on a single virtual machine based on the service deployment server list.
[0074] In one embodiment, the second affinity risk level determination module 503 is further configured to: obtain a service deployment container list, the service deployment container list including containers and cluster nodes deployed on each container; and obtain the number of cluster nodes deployed on a single container based on the service deployment container list.
[0075] In one embodiment, the second affinity risk level determination module 503 is further configured to: obtain a container platform list, the container platform list including the container and the platform to which each container belongs; and obtain the number of containers deployed on a single platform based on the container platform list.
[0076] Figure 6 An example of a physical structure diagram of an electronic device is shown below. Figure 6As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630, and a communications bus 640, wherein the processor 610, the communications interface 620, and the memory 630 communicate with each other via the communications bus 640. The processor 610 may invoke logic instructions in the memory 630 to execute a method for determining affinity risks for an application service. The method includes: when the number of cluster nodes of a target application service is greater than one, obtaining a deployment mode of the target application service; if the deployment mode is virtual machine deployment, determining an affinity risk level for the target application service based on the number of cluster nodes for a single virtual machine deployment corresponding to the target application service and / or the number of virtual machines associated with a single physical machine corresponding to the target application service; if the deployment mode is container deployment, determining an affinity risk level based on the number of cluster nodes for a single container deployment corresponding to the target application service, the number of containers for a single platform deployment corresponding to the target application service, and / or the number of platforms for a single host deployment corresponding to the target application service.
[0077] Furthermore, the logic instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0078] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for determining affinity risks of application services provided by the above-mentioned methods, the method comprising: when the number of cluster nodes of the target application service is greater than 1, obtaining the deployment mode of the target application service; if the deployment mode is virtual machine deployment, determining the affinity risk level of the target application service based on the number of cluster nodes of a single virtual machine deployment corresponding to the target application service and / or the number of virtual machines associated with a single physical machine corresponding to the target application service; if the deployment mode is container deployment, determining the affinity risk level based on the number of cluster nodes of a single container deployment corresponding to the target application service, the number of containers deployed on a single platform corresponding to the target application service and / or the number of platforms deployed on a single host corresponding to the target application service.
[0079] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0080] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for determining affinity risks of application services, characterized in that: include: When the number of cluster nodes of the target application service is greater than 1, obtaining the deployment mode of the target application service; If the deployment mode is virtual machine deployment, determining the affinity risk level of the target application service based on the number of nodes in the single virtual machine deployment cluster corresponding to the target application service and the number of virtual machines associated with a single physical machine corresponding to the target application service; If the deployment mode is container deployment, the affinity risk level is determined based on the number of single-container deployment cluster nodes corresponding to the target application service, the number of single-platform deployment containers corresponding to the target application service, and the number of single-host deployment platforms corresponding to the target application service.
2. The method for determining affinity risks of application services according to claim 1, characterized in that: The determining the affinity risk level of the target application service based on the number of nodes in the single virtual machine deployment cluster corresponding to the target application service and the number of virtual machines associated with a single physical machine corresponding to the target application service includes: When the number of nodes in the single virtual machine deployment cluster is greater than 1, determining the affinity risk level to be a level one affinity risk; When the number of nodes in the single virtual machine deployment cluster is equal to 1 and the number of virtual machines associated with the single physical machine is greater than 1, the affinity risk level is determined to be a second-level affinity risk, and the order of the deployment risks of the target application service represented by the affinity risk level is that the first-level affinity risk is greater than the second-level affinity risk.
3. The method for determining affinity risks of application services according to claim 1, characterized in that: The determining the affinity risk level based on the number of single-container deployment cluster nodes corresponding to the target application service, the number of single-platform deployment containers corresponding to the target application service, and the number of single-host deployment platforms corresponding to the target application service includes: When the number of nodes in the single-container deployment cluster is greater than 1, determining the affinity risk level to be a level one affinity risk; When the number of nodes in the single-container deployment cluster is equal to 1, the affinity risk level is determined based on the number of containers deployed on a single platform and the number of platforms deployed on a single host.
4. The method for determining affinity risks of application services according to claim 3, characterized in that: The determining the affinity risk level based on the number of containers deployed on a single platform and the number of platforms deployed on a single host includes: When the number of containers deployed on the single platform is greater than 1, determining the affinity risk level as a level 2 affinity risk; When the number of containers deployed on a single platform is equal to 1 and the number of platforms deployed on a single host is greater than 1, the affinity risk level is determined to be a level three affinity risk. The order of the deployment risks of the target application service represented by the affinity risk levels is that the level one affinity risk is greater than the level two affinity risk, and the level two affinity risk is greater than the level three affinity risk.
5. The method for determining affinity risks of application services according to claim 1, characterized in that: The number of nodes in the single virtual machine deployment cluster is determined based on the following steps: Obtain a service deployment server list, the service deployment server list including virtual machines and cluster nodes deployed on each of the virtual machines; the service deployment server list refers to a server list deployed by the target application service; The number of nodes in the single virtual machine deployment cluster is obtained based on the service deployment server list.
6. The method for determining affinity risks of application services according to claim 1, characterized in that: The number of nodes in the single container deployment cluster is determined based on the following steps: Obtain a service deployment container list, the service deployment container list including containers and cluster nodes deployed on each container, the service deployment container list refers to a list of containers deployed by the target application service; The number of nodes in the single container deployment cluster is obtained based on the service deployment container list.
7. The method for determining affinity risks of application services according to claim 1, characterized in that: The number of containers deployed on a single platform is determined based on the following steps: Obtain a list of platforms to which the containers belong, the list of platforms to which the containers belong including the containers and the platforms to which each container belongs, the list of platforms to which the target application service is deployed; The number of containers deployed on the single platform is obtained based on the platform list to which the container belongs.
8. A device for determining affinity risks of application services, characterized in that: include: A deployment mode determination module, configured to obtain a deployment mode of the target application service when the number of cluster nodes of the target application service is greater than 1; a first affinity risk level determination module configured to determine, if the deployment mode is virtual machine deployment, the affinity risk level of the target application service based on the number of nodes in the single virtual machine deployment cluster corresponding to the target application service and the number of virtual machines associated with a single physical machine corresponding to the target application service; The second affinity risk level determination module is used to determine the affinity risk level based on the number of single-container deployment cluster nodes corresponding to the target application service, the number of single-platform deployment containers corresponding to the target application service, and the number of single-host deployment platforms corresponding to the target application service if the deployment mode is container deployment.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for determining affinity risks of the application service according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining affinity risks of an application service according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Virtual network function (VNF) migration method, management and orchestration (MANO), and VNF system
CN106506201A
Cloud server anti-affinity processing method, device, storage medium and system
CN117834635A