A virtual machine service detection method, device, equipment and storage medium
By introducing a service middleware layer into the virtual machine to store and monitor service status data, the problem that traditional detection methods cannot detect service anomalies is solved, and comprehensive and reliable detection of virtual machine services is achieved.
Patent Information
- Application Number
- CN202411954695.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-12-27
AI Technical Summary
Traditional virtual machine detection methods cannot fully detect the normality of virtual machine services, resulting in the inability to provide external services when the virtual machine is normal but the service is abnormal, thus affecting user business.
By introducing a service middleware layer into the virtual machine, service status data of candidate and target virtual machines can be stored and periodically detected and anomaly handled, avoiding direct detection of virtual machine status.
This improves the comprehensiveness and reliability of virtual machine service detection, ensuring the normal operation of the service.
Smart Images

Figure CN119892912B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly to the field of cloud computing technology, specifically to a virtual machine service detection method, apparatus, device, and storage medium. Background Technology
[0002] For cloud cryptography service platforms, if the virtual cryptography machine applied for by a user malfunctions and cannot provide services, it will have a huge impact on the user's business. Therefore, timely determination of whether the virtual cryptography machine is functioning properly becomes a thorny issue.
[0003] The traditional approach is to add probes to the virtual machine to check its status. However, probes detect the virtual machine itself, not the programs providing services within it. This can lead to situations where the virtual machine is functioning normally, but the services are not. In such cases, the virtual machine cannot provide services to the outside world, which means that relying on probes cannot achieve comprehensive detection of virtual machine services. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for detecting virtual machine services, so as to improve the comprehensiveness and reliability of virtual machine service detection.
[0005] According to one aspect of this application, a virtual machine service detection method is provided, the method comprising:
[0006] Upon detecting that a candidate virtual machine has started and is running a candidate service, the candidate service status data of the candidate service is saved to a pre-configured service middleware layer.
[0007] If it is identified that a target virtual machine is allocated to the user from the candidate virtual machines, the current service status data of the target virtual machine is saved to the service middleware layer;
[0008] The current service in the service middleware layer is periodically checked, and if an anomaly is detected in the current service, the abnormal service is handled based on the service middleware layer.
[0009] According to another aspect of this application, a virtual machine service detection apparatus is provided, the apparatus comprising:
[0010] The first data storage module is used to save the candidate service status data of the candidate service to a pre-configured service middleware when the candidate virtual machine is detected to start and run the candidate service.
[0011] The second data storage module is used to save the current service status data of the target virtual machine to the service middleware layer when it is recognized that a target virtual machine is allocated to the user from the candidate virtual machines.
[0012] The service detection module is used to periodically detect the current service in the service intermediate layer, and when an anomaly is detected in the current service, to perform anomaly handling on the abnormal service based on the service intermediate layer.
[0013] According to another aspect of this application, an electronic device is provided, the electronic device comprising:
[0014] One or more processors;
[0015] Memory, used to store one or more programs;
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the virtual machine service detection methods provided in the embodiments of this application.
[0017] According to another aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements any of the virtual machine service detection methods provided in the embodiments of this application.
[0018] According to another aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the virtual machine service detection methods provided in the embodiments of this application.
[0019] This application addresses the following: When a candidate virtual machine is identified as starting and running a candidate service, the candidate service's status data is saved to a pre-configured service middleware layer. When a target virtual machine is identified as being allocated to a user from among the candidate virtual machines, the current service status data of the target virtual machine is saved to the service middleware layer. The current service in the service middleware layer is periodically monitored, and when an anomaly is detected in the current service, anomaly handling is performed based on the service middleware layer. This technical solution, with the service middleware layer at its core, eliminates the need for virtual machine-level monitoring; instead, it periodically monitors specific services, improving the comprehensiveness and reliability of virtual machine service monitoring. Attached Figure Description
[0020] Figure 1 This is a flowchart of a virtual machine service detection method provided according to Embodiment 1 of this application;
[0021] Figure 2 This is a flowchart of a virtual machine service detection method provided according to Embodiment 2 of this application;
[0022] Figure 3 This is a schematic diagram of a virtual machine service detection device according to Embodiment 3 of this application;
[0023] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the virtual machine service detection method of the embodiments of this application. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] Furthermore, it should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of candidate services and related data, as well as candidate service status data, involved in the technical solution of this application, all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0027] Example 1
[0028] Figure 1 This is a flowchart of a virtual machine service detection method according to Embodiment 1 of this application. This embodiment is applicable to the periodic detection and anomaly handling of virtual machines on a cloud cryptography service platform. It can be executed by a virtual machine service detection device, which can be implemented in hardware and / or software and can be configured in a computer device, such as a server. Figure 1 As shown, the method includes:
[0029] S110. When a candidate virtual machine is detected to be starting up and running a candidate service, the candidate service status data of the candidate service is saved to the pre-configured service middleware layer.
[0030] In this embodiment, a candidate virtual machine (VM) refers to a VM selected in the system to run a certain service or task; a candidate VM is a VM that is pending selection but not yet fully enabled. A candidate service refers to a service that can run on a candidate VM; these services are usually pending activation or pre-configured in the system and can be hosted and executed by the candidate VM under specific conditions. Candidate service status data refers to various information about the candidate service running on the candidate VM, such as the service's health status, operation logs, load status, performance data, configuration data, IP (Internet Protocol) address, port number, service name, etc. The service middleware layer refers to the intermediary layer used to store, manage, and exchange service status data; it is typically used to record information such as the running status and health status of VMs and services, maliciously track each service instance in the system, including information such as the service name, IP address, and port number, and provide query, monitoring, and fault tolerance functions to ensure that services can be recovered in a timely manner in case of failure; optionally, this service middleware layer specifically refers to the service registration and discovery middleware layer, which is an entity responsible for managing the registration and discovery of all services.
[0031] For example, when a candidate virtual machine is identified as starting and running a candidate service, candidate service status data is sent to the service middleware layer. This candidate service status data includes the service name, running IP address, and port, etc. The service middleware layer records the status of the candidate service based on the candidate service status data, so that other services can be found and invoked by name, IP address, and port.
[0032] S120. If it is recognized that a target virtual machine is allocated to the user from the candidate virtual machines, the current service status data of the target virtual machine is saved to the service middleware layer.
[0033] In this embodiment, the target virtual machine refers to the virtual machine that is ultimately assigned to a user (such as a specific application, user, or tenant) after the candidate virtual machine starts and runs the candidate service. Current service status data refers to various information about the service running on the target virtual machine, such as the service's health status, runtime logs, load status, performance data, configuration data, IP address, port number, and service name.
[0034] For example, after allocating a virtual machine to each user, the target virtual machine allocated to the user is registered to the service middleware layer, and the current service status data of the service in the target virtual machine is saved to the service middleware layer.
[0035] It should be noted that each user will be allocated a virtual machine and its relevant information (such as service name, IP address, port, etc.) will be registered with the service middleware layer. Each user's service belongs to a group; a group is a logical unit that groups multiple services of the same type together to provide services to the outside world.
[0036] S130. Periodically check the current service in the service middleware layer, and if an anomaly is detected in the current service, perform anomaly handling on the abnormal service based on the service middleware layer.
[0037] In this embodiment, the current service refers to the actual service running on the target virtual machine or other virtual machines. The system continuously monitors its status to ensure the healthy operation of the service. Periodic checks refer to periodically checking the status of services running in the system; this checking is usually automated and aims to detect service anomalies in a timely manner. Anomaly handling refers to the remedial or alternative measures taken when the system detects problems with services or virtual machines.
[0038] For example, the service status of all current services in the service middleware layer is checked periodically; if a certain service cannot be detected in the service middleware layer, it is determined that the service has crashed, that is, the current service has an abnormal situation; at this time, the abnormal service is handled based on the service middleware layer.
[0039] Optionally, based on a heartbeat mechanism, the current services in the service middleware layer are periodically checked; if a service in the service middleware layer cannot be detected within a preset time interval, the current service is considered to be abnormal; if all current services in the service middleware layer can be detected within a preset time interval, the current service is considered to be normal.
[0040] For example, every certain period of time, all currently registered services in the service middleware layer are checked, that is, the heartbeat mechanism is used to check whether the service is still running normally; if no heartbeat is received within a certain period of time, it is considered that the service has crashed, that is, the current service has encountered an abnormal situation.
[0041] In this embodiment, the heartbeat mechanism refers to a periodic detection method used to confirm whether system components (such as services, virtual machines, containers, etc.) are still in normal operation. In the heartbeat mechanism, the service periodically sends a "heartbeat signal" or "health report" to inform the monitoring system that it is still alive and working normally. If the monitoring system does not receive a heartbeat signal within a predetermined time, it considers that the service may have failed or crashed.
[0042] This application embodiment, upon identifying that a candidate virtual machine has started and is running a candidate service, saves the candidate service status data to a pre-configured service middleware layer; upon identifying that a target virtual machine has been allocated to a user from among the candidate virtual machines, saves the current service status data of the target virtual machine to the service middleware layer; periodically checks the current service in the service middleware layer, and, upon identifying an anomaly in the current service, performs anomaly handling based on the service middleware layer. This technical solution, with the service middleware layer as its core, eliminates the need for virtual machine-level detection, instead performing periodic monitoring of specific services, thereby improving the comprehensiveness and reliability of virtual machine service detection.
[0043] Example 2
[0044] Figure 2 This is a flowchart of a virtual machine service detection method according to Embodiment 2 of this application. Based on the technical solutions of the above embodiments, this embodiment refines "when an anomaly is detected in the current service, perform anomaly handling on the abnormal service based on the service intermediate layer" to "when the target service status data of the target service in the current service cannot be detected, determine the target service as an abnormal service, and determine the abnormal service name of the abnormal service; based on the service intermediate layer, perform anomaly handling on the abnormal service according to the abnormal service name." It should be noted that for parts not detailed in this embodiment, please refer to the relevant descriptions in other embodiments. For example... Figure 2 As shown, the method includes:
[0045] S210. When a candidate virtual machine is detected to be starting up and running a candidate service, the candidate service status data of the candidate service is saved to the pre-configured service middleware layer.
[0046] S220. If it is recognized that a target virtual machine is allocated to the user from the candidate virtual machines, the current service status data of the target virtual machine is saved to the service middleware layer.
[0047] S230. Perform periodic checks on the current service in the service middleware layer.
[0048] S240. If the target service status data of the target service in the current service cannot be detected, the target service is identified as an abnormal service, and the abnormal service name of the abnormal service is determined.
[0049] In this embodiment, the target service refers to the service that cannot be detected in the service intermediate layer. An abnormal service refers to a service that is identified as abnormal and requires handling. The abnormal service name is the identifier name of the service determined to be abnormal; each service typically has a unique name in the system, which allows for accurate location and handling of the service's abnormal situation.
[0050] S250. Based on the service middleware layer, perform exception handling on the abnormal service according to the abnormal service name.
[0051] Optionally, the service middleware tier includes a namespace and at least one user service group.
[0052] In this embodiment, a namespace is used to organize and isolate logical areas of services; it is typically a container with a unique identifier that helps manage the scope of services and prevents naming conflicts between different services; each service can belong to a specific namespace; the namespace in this application specifically refers to a pre-configured namespace for storing backup group information. A user service group refers to a logical area used to organize and isolate services allocated to users; a group is a logical unit that can place multiple services of the same type under the same group to provide services externally; it should be noted that each tenant's service belongs to a user service group.
[0053] Furthermore, the abnormal service group to which the abnormal service belongs is determined from at least one user service group; the abnormal service name is checked for consistency with the candidate service names in the abnormal service group to obtain the service name check result; and the abnormal service is handled according to the service name check result and the namespace.
[0054] In this embodiment, the abnormal service group refers to the user service group where the abnormal service resides. The candidate service name refers to the service name of other services in the abnormal service group besides the abnormal service. The service name verification result refers to the system's check result regarding whether the abnormal service name matches the candidate service name during consistency verification.
[0055] Furthermore, based on the service name verification result and the namespace, the exception handling for the abnormal service can be as follows: if the service name verification result is successful, then the service with the same name as the abnormal service in the abnormal service group will replace the abnormal service; if the service name verification result is unsuccessful, then the backup service in the namespace will replace the abnormal service.
[0056] In this embodiment, backup services refer to pre-configured alternative services that can replace faulty services in the event of a failure, ensuring high availability of the system. Backup services typically come from namespaces and have the same functions and characteristics.
[0057] For example, the system searches for other instances with the same service name within the abnormal service group. If a service instance with the same name is found, its IP address and port number are used directly to replace the original abnormal service instance. If no instance with the same abnormal service name is found, backup service information (such as other service instances or backup services) is obtained from the service middleware namespace. This backup service can be a healthy service instance that can temporarily replace the failed service instance. If no backup service is found in the service middleware namespace, a new virtual machine will be automatically started and registered as a new service instance in the service middleware.
[0058] In one optional implementation, if the service name verification result fails and there is no backup service in the namespace of the service middleware, a new virtual machine is added to the abnormal service group; the service status data of the abnormal service is obtained from the preset database and imported into the new virtual machine; if the service is detected that the new virtual machine has started and is running a service, the service status data of the new virtual machine is saved to the service middleware.
[0059] In this embodiment, a new virtual machine refers to a newly created virtual machine.
[0060] For example, when a service instance crashes, the service configuration and related data need to be migrated to a new virtual machine. This is done by exporting the configuration information and related business data of the failed service instance from a database or other persistent storage. This data includes the service's configuration files, database records, cache information, etc. The exported data and configuration information are then imported into the new virtual machine to ensure that the new virtual machine can support the original business and configuration. After the new virtual machine starts up and completes the data migration, it will restart using the original configuration information and re-register its information with the service middleware layer.
[0061] Understandably, by automatically reassigning virtual machines and importing the relevant data of standby virtual machines into new virtual machines, users can seamlessly replace virtual machines.
[0062] This application embodiment, upon identifying that a candidate virtual machine has started and is running a candidate service, saves the candidate service status data of the candidate service to a pre-configured service middleware layer; upon identifying that a target virtual machine has been allocated to a user from among the candidate virtual machines, saves the current service status data of the target virtual machine to the service middleware layer; periodically checks the current services in the service middleware layer; if the target service status data of the target service is not detected in the current services, the target service is identified as an abnormal service, and the abnormal service name is determined; based on the service middleware layer, abnormal service handling is performed according to the abnormal service name. The above technical solution, with the service middleware layer as its core, does not require detection of virtual machines but performs periodic monitoring of specific services, which can improve the comprehensiveness and reliability of virtual machine service detection.
[0063] Example 3
[0064] Figure 3 This is a schematic diagram of a virtual machine service detection device according to Embodiment 3 of this application. It is applicable to the periodic detection and anomaly handling of virtual machines on a cloud cryptography service platform. This virtual machine service detection device can be implemented in hardware and / or software and can be configured in a computer device, such as a server. Figure 3 As shown, the device includes:
[0065] The first data storage module 310 is used to save the candidate service status data of the candidate service to a pre-configured service middleware when the candidate virtual machine is detected to start and run the candidate service.
[0066] The second data storage module 320 is used to save the current service status data of the target virtual machine to the service middleware layer when it is recognized that the target virtual machine is allocated to the user from the candidate virtual machines.
[0067] The service detection module 330 is used to periodically detect the current service in the service middleware layer, and to perform exception handling on the abnormal service based on the service middleware layer when an anomaly is detected in the current service.
[0068] This application embodiment, upon identifying that a candidate virtual machine has started and is running a candidate service, saves the candidate service status data to a pre-configured service middleware layer; upon identifying that a target virtual machine has been allocated to a user from among the candidate virtual machines, saves the current service status data of the target virtual machine to the service middleware layer; periodically checks the current service in the service middleware layer, and, upon identifying an anomaly in the current service, performs anomaly handling based on the service middleware layer. This technical solution, with the service middleware layer as its core, eliminates the need for virtual machine-level detection, instead performing periodic monitoring of specific services, thereby improving the comprehensiveness and reliability of virtual machine service detection.
[0069] Optionally, the service detection module 330 includes:
[0070] The abnormal service determination unit is used to determine the target service as an abnormal service and determine the abnormal service name when the target service status data of the target service in the current service cannot be detected.
[0071] The exception handling unit is used to handle exceptions based on the service middleware and the name of the exception service.
[0072] Optionally, the service middleware layer includes a namespace and at least one user service group; correspondingly, the exception handling unit includes:
[0073] The service group determination subunit is used to determine the abnormal service group to which the abnormal service belongs from at least one user service group;
[0074] The service name verification subunit is used to verify the consistency of the abnormal service name with the candidate service names in the abnormal service group and obtain the service name verification result.
[0075] The exception handling subunit is used to handle exceptions for services based on the service name verification result and namespace.
[0076] Optional, exception handling subunit, specifically used for:
[0077] If the service name verification result is successful, the service with the same abnormal service name in the abnormal service group will replace the abnormal service.
[0078] If the service name verification fails, the alternate service in the namespace will replace the faulty service.
[0079] Optionally, the exception handling subunit is also specifically used for:
[0080] If the service name verification fails, and there is no backup service in the namespace, a new virtual machine will be added to the abnormal service group.
[0081] Retrieve service status data of abnormal services from the preset database and import the service status data of abnormal services into the new virtual machine;
[0082] Upon detecting that a new virtual machine has started and is running services, the service status data of the new virtual machine is saved to the service middleware layer.
[0083] The virtual machine service detection device provided in this application embodiment can execute the virtual machine service detection method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing each virtual machine service detection method.
[0084] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.
[0085] Example 4
[0086] Figure 4 This is a schematic diagram of the structure of an electronic device 410 implementing the virtual machine service detection method of this application embodiment. 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 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, 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 examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0087] like Figure 4 As shown, the electronic device 410 includes at least one processor 411 and a memory, such as a read-only memory (ROM) 412 or a random access memory (RAM) 413, communicatively connected to the at least one processor 411. The memory stores computer programs executable by the at least one processor. The processor 411 can perform various appropriate actions and processes based on the computer program stored in the ROM 412 or loaded from storage unit 418 into the RAM 413. The RAM 413 may also store various programs and data required for the operation of the electronic device 410. The processor 411, ROM 412, and RAM 413 are interconnected via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0088] Multiple components in electronic device 410 are connected to I / O interface 415, including: input unit 416, such as keyboard, mouse, etc.; output unit 417, such as various types of displays, speakers, etc.; storage unit 418, such as disk, optical disk, etc.; and communication unit 419, such as network card, modem, wireless transceiver, etc. Communication unit 419 allows electronic device 410 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0089] Processor 411 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 411 performs the various methods and processes described above, such as virtual machine service detection methods.
[0090] In some embodiments, the virtual machine service detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 410 via ROM 412 and / or communication unit 419. When the computer program is loaded into RAM 413 and executed by processor 411, one or more steps of the virtual machine service detection method described above may be performed. Alternatively, in other embodiments, processor 411 may be configured as the virtual machine service detection method by any other suitable means (e.g., by means of firmware).
[0091] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0092] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable virtual machine service detection device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on the machine, partially on the machine, or as a standalone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0093] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media 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 disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0094] 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 pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).
[0095] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0096] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. 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 cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0097] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0098] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. 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 principles of this application should be included within the scope of protection of this application.
Claims
1. A method for detecting virtual machine services, characterized in that, include: Upon detecting that a candidate virtual machine has started and is running a candidate service, the candidate service status data of the candidate service is saved to a pre-configured service middleware layer; wherein, the service middleware layer is an entity used to manage the registration and discovery of each service; the service middleware layer includes a namespace and at least one user service group; If it is identified that a target virtual machine is allocated to the user from the candidate virtual machines, the current service status data of the target virtual machine is saved to the service middleware layer; The current service in the service middleware layer is periodically checked, and if an anomaly is detected in the current service, the abnormal service is handled based on the service middleware layer. Specifically, when an anomaly is detected in the current service, anomaly handling is performed on the abnormal service based on the service middleware layer, including: If the target service status data of the target service in the current service cannot be detected, the target service is identified as an abnormal service, and the abnormal service name of the abnormal service is determined. Determine the abnormal service group to which the abnormal service belongs from the at least one user service group; The consistency of the abnormal service name with the candidate service names in the abnormal service group is verified to obtain the service name verification result. If the service name verification result is successful, then the abnormal service with the same abnormal service name in the abnormal service group will be replaced. If the service name verification result fails, the alternate service in the namespace will replace the abnormal service.
2. The method according to claim 1, characterized in that, The method further includes: If the service name verification result fails, and there is no backup service in the namespace, then a new virtual machine is added to the abnormal service group. The service status data of the abnormal service is obtained from the preset database and imported into the new virtual machine. Upon detecting that the new virtual machine has started and is running services, the service status data of the new virtual machine is saved to the service middleware layer.
3. A virtual machine service detection device, characterized in that, include: The first data storage module is used to save the candidate service status data of the candidate service to a pre-configured service middleware layer when the candidate virtual machine is detected to start and run the candidate service; wherein, the service middleware layer is an entity used to manage the registration and discovery of each service; the service middleware layer includes a namespace and at least one user service group; The second data storage module is used to save the current service status data of the target virtual machine to the service middleware layer when it is recognized that a target virtual machine is allocated to the user from the candidate virtual machines. The service detection module is used to periodically detect the current service in the service middleware layer, and when an anomaly is detected in the current service, to perform anomaly handling on the abnormal service based on the service middleware layer. The service detection module includes: An abnormal service determination unit is used to determine the target service as an abnormal service and determine the abnormal service name of the abnormal service when the target service status data of the target service in the current service cannot be detected. An exception service handling unit is used to perform exception handling on the exception service based on the service middleware and the exception service name. The exception service processing unit includes: A service group determination subunit is used to determine the abnormal service group to which the abnormal service belongs from the at least one user service group; The service name verification subunit is used to perform consistency verification between the abnormal service name and the candidate service names in the abnormal service group to obtain the service name verification result. An exception handling subunit is used to perform exception handling on the abnormal service based on the service name verification result and the namespace. Specifically, the exception handling subunit is used for: If the service name verification result is successful, then the abnormal service with the same abnormal service name in the abnormal service group will be replaced. If the service name verification result fails, the alternate service in the namespace will replace the abnormal service.
4. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the virtual machine service detection method as described in any one of claims 1-2.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the virtual machine service detection method as described in any one of claims 1-2.
6. A computer program product comprising a computer program that, when executed by a processor, implements the virtual machine service detection method according to any one of claims 1-2.
Citation Information
Patent Citations
High-availability BMC service operation implementation method, system and computer equipment
CN118069330A