Virtual machine service detection method and device, equipment and storage medium

By using the service intermediate layer to save and detect the status data of virtual machine services in virtual machine service detection, the problem that traditional methods cannot fully detect virtual machine services is solved, and more efficient and reliable virtual machine service detection is achieved.

CN119892912AActive Publication Date: 2025-04-25BEIJING PASSWORD CLOUD CORE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411954695.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

Traditional methods cannot fully detect the status of virtual machine services, which may lead to normal virtual machine but abnormal service, and relying on probes to achieve comprehensive detection of virtual machine services.

Method used

When the candidate virtual machine is identified, the status data of the candidate service is saved to the service intermediate layer, and when the target virtual machine is allocated, its current service status data is saved to the service intermediate layer, and the current service in the service intermediate layer is periodically detected and exception processing is performed.

Benefits of technology

It improves the comprehensiveness and reliability of virtual machine service detection. There is no need to detect virtual machines, but periodically monitor specific services to ensure the normal operation of virtual machine services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892912A_ABST
    Figure CN119892912A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual machine service detection method and device, equipment and a storage medium, and relates to the technical field of cloud computing. The method comprises the steps of storing candidate service state data of a candidate service to a pre-configured service intermediate layer under the condition that a candidate virtual machine is identified to start and operate the candidate service; storing current service state data of a target virtual machine to a service intermediate layer under the condition of identifying that the target virtual machine is allocated to the user from the candidate virtual machines; and performing periodic detection on the current service in the service intermediate layer, and performing exception handling on the exceptional service based on the service intermediate layer when the current service is identified to be exceptional. According to the technical scheme, the service middle layer is taken as a core, the virtual machine does not need to be detected, the specific service is periodically monitored, and the comprehensiveness and reliability of virtual machine service detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, in particular to the field of cloud computing technology, and specifically to a virtual machine service detection method, device, equipment and storage medium. Background Art

[0002] For the cloud cryptographic service platform, if the virtual cryptographic machine applied for by the user has problems and cannot provide services, it will have a huge impact on the user's business, so timely judging whether the virtual cryptographic machine is normal becomes a tricky problem.

[0003] The traditional way is to add a probe inside the virtual machine to check the status of the virtual machine, but the probe detects the virtual machine, not the program that provides services inside the virtual machine. The virtual machine may be normal, but the service may not be normal. At this time, the virtual machine cannot provide services normally to the outside world, which makes it impossible to achieve comprehensive detection of virtual machine services by relying on probes. Summary of the invention

[0004] The present application provides a virtual machine service detection method, apparatus, device and storage medium to improve the comprehensiveness and reliability of virtual machine service detection.

[0005] According to one aspect of the present application, a virtual machine service detection method is provided, the method comprising:

[0006] When it is identified that the candidate virtual machine is started and the candidate service is running, the candidate service state data of the candidate service is saved to a pre-configured service middle layer;

[0007] When it is identified that a target virtual machine is allocated to a user from the candidate virtual machines, the current service state data of the target virtual machine is saved to the service intermediate layer;

[0008] The current service in the service middle layer is periodically detected, and when an abnormality is identified in the current service, an abnormality handling is performed on the abnormal service based on the service middle layer.

[0009] According to another aspect of the present application, a virtual machine service detection device is provided, the device comprising:

[0010] A first data saving module is used to save the candidate service state data of the candidate service to a pre-configured service middle layer when it is identified that the candidate virtual machine starts and runs the candidate service;

[0011] A second data saving module is used to save the current service state data of the target virtual machine to the service intermediate layer when identifying that the target virtual machine is allocated to the user from the candidate virtual machines;

[0012] The service detection module is used to perform periodic detection on the current service in the service middle layer, and when an abnormality is identified in the current service, perform abnormal processing on the abnormal service based on the service middle layer.

[0013] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0014] one or more processors;

[0015] A memory for storing 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 one of the virtual machine service detection methods provided in the embodiments of the present application.

[0017] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, any one of the virtual machine service detection methods provided in the embodiments of the present application is implemented.

[0018] According to another aspect of the present application, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the virtual machine service detection methods provided in the embodiments of the present application.

[0019] This application saves the candidate service status data of the candidate service to the pre-configured service middle layer when it is identified that the candidate virtual machine starts and runs the candidate service; saves the current service status data of the target virtual machine to the service middle layer when it is identified that the target virtual machine is allocated to the user from the candidate virtual machine; performs periodic detection on the current service in the service middle layer, and performs exception handling on the abnormal service based on the service middle layer when it is identified that the current service is abnormal. The above technical solution takes the service middle layer as the core, does not need to detect the virtual machine, but performs periodic monitoring on the specific service, which can improve the comprehensiveness and reliability of virtual machine service detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flow chart of a virtual machine service detection method provided according to Embodiment 1 of the present application;

[0021] Figure 2 It is a flow chart of a virtual machine service detection method provided according to Embodiment 2 of the present application;

[0022] Figure 3 It is a structural diagram of a virtual machine service detection device provided according to Embodiment 3 of the present application;

[0023] Figure 4 It is a structural diagram of an electronic device that implements the virtual machine service detection method of an embodiment of the present application. DETAILED DESCRIPTION

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

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

[0026] In addition, it should be noted that in the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as candidate services and candidate service status data are in compliance with the relevant laws and regulations and do not violate public order and good morals.

[0027] Embodiment 1

[0028] Figure 1 This is a flowchart of a virtual machine service detection method provided in accordance with the first embodiment of the present application. This embodiment is applicable to the situation where periodic detection and exception handling are performed on virtual machines of a cloud cryptographic service platform. It can be performed by a virtual machine service detection device. The virtual machine service detection device can be implemented in the form of hardware and / or software. The virtual machine service detection device can be configured in a computer device, such as a server. Figure 1 As shown, the method includes:

[0029] S110 . When it is identified that the candidate virtual machine starts and runs the candidate service, save the candidate service state data of the candidate service to a pre-configured service middle layer.

[0030] In this embodiment, a candidate virtual machine refers to a virtual machine selected in the system to run a certain service or task; a candidate virtual machine is a virtual machine that is to be selected and has not yet been fully enabled. A candidate service refers to a service that can be run on a candidate virtual machine; these services are usually to be enabled, or are pre-set in the system, and can be carried and executed by a candidate virtual machine under specific conditions. Candidate service status data refers to various types of information of a candidate service running on a candidate virtual machine, such as the health status, operation log, load status, performance data, configuration data, IP (Internet Protocol) address, port number, service name, etc. of the service. A service middle layer refers to an intermediary layer for storing, managing and exchanging service status data; it is usually used to record information such as the operation status and health status of virtual machines and services, maliciously track each service instance in the system, including information such as the name, IP address, port number, etc. of the service, and provide query, monitoring and fault tolerance functions to ensure that the service can be restored in time when a failure occurs; optionally, the service middle layer specifically refers to a service registration and discovery middle layer, which is an entity responsible for managing the registration and discovery of all services.

[0031] Exemplarily, when a candidate virtual machine is identified to start and run a candidate service, candidate service status data is sent to the service middle layer, where the candidate service status data includes the name of the service, the IP address and port on which it runs, etc.; the service middle layer records the status of the candidate service based on the candidate service status data, so that other services can search and call it by name, IP and port.

[0032] S120: When it is identified that a target virtual machine is to be allocated to a user from the candidate virtual machines, the current service state data of the target virtual machine is saved to the service middle layer.

[0033] In this embodiment, the target virtual machine refers to the virtual machine that is finally allocated to the user (such as a specific application, user or tenant) after the candidate virtual machine starts and runs the candidate service. The current service status data refers to various types of information of the service running on the target virtual machine, such as the health status of the service, operation log, load status, performance data, configuration data, IP address, port number, service name, etc.

[0034] Exemplarily, after a virtual machine is allocated to each user, the target virtual machine allocated to the user is registered with the service middle layer, and the current service state data of the service in the target virtual machine is saved to the service middle layer.

[0035] It should be noted that each user will be assigned a virtual machine and register its related information (such as service name, IP address, port, etc.) with the service middle layer. Each user's service belongs to a group; a group is a logical unit that puts multiple services of the same type into the same group to provide external services.

[0036] S130: Periodically check the current service in the service middle layer, and when an abnormality is identified in the current service, perform abnormal processing on the abnormal service based on the service middle layer.

[0037] In this embodiment, the current service refers to the actual service running on the target virtual machine or other virtual machines, and the system will continuously monitor its status to ensure the healthy operation of the service. Periodic detection refers to regular status checks on services running in the system; this detection is usually automated and aims to detect service anomalies in a timely manner. Exception handling refers to the repair or replacement measures taken when the system detects a problem with a service or virtual machine.

[0038] Exemplarily, the service status of all current services in the service middle layer is periodically detected; if a certain service in the current services cannot be detected in the service middle layer, it is determined that the service has crashed, that is, the current service has an abnormal situation; at this time, based on the service middle layer, the abnormal service is handled abnormally.

[0039] Optionally, based on the heartbeat mechanism, the current service in the service middle layer is periodically checked; if a service in the service middle layer cannot be detected within a preset time interval, it is determined that the current service has an abnormality; if all current services in the service middle layer can be detected within the preset time interval, it is determined that there is no abnormality in the current service.

[0040] Exemplarily, at regular intervals, all currently registered services in the service middle layer are checked, that is, a 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, an abnormality has occurred in the current service.

[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 is considered that the service may have a fault or crash.

[0042] The embodiment of the present application saves the candidate service status data of the candidate service to the pre-configured service middle layer when it is identified that the candidate virtual machine starts and runs the candidate service; saves the current service status data of the target virtual machine to the service middle layer when it is identified that the target virtual machine is allocated to the user from the candidate virtual machine; performs periodic detection on the current service in the service middle layer, and performs exception handling on the abnormal service based on the service middle layer when it is identified that the current service is abnormal. The above technical solution takes the service middle layer as the core, does not need to detect the virtual machine, but performs periodic monitoring on the specific service, which can improve the comprehensiveness and reliability of virtual machine service detection.

[0043] Embodiment 2

[0044] Figure 2 This is a flowchart of a virtual machine service detection method provided in accordance with the second embodiment of the present application. Based on the technical solutions of the above embodiments, this embodiment refines "when an abnormality is identified in the current service, based on the service middle layer, the abnormal service is handled abnormally" into "when the target service status data of the target service in the current service cannot be detected, the target service is determined as an abnormal service, and the abnormal service name of the abnormal service is determined; based on the service middle layer, the abnormal service is handled abnormally according to the abnormal service name". It should be noted that for the parts not described in detail in the embodiments of the present application, please refer to the relevant statements of other embodiments. Figure 2 As shown, the method includes:

[0045] S210: When it is identified that the candidate virtual machine starts and runs the candidate service, save the candidate service state data of the candidate service to a pre-configured service middle layer.

[0046] S220: When it is identified that a target virtual machine is to be allocated to a user from the candidate virtual machines, the current service state data of the target virtual machine is saved to the service middle layer.

[0047] S230: Periodically check the current service in the service middle layer.

[0048] S240: When the target service status data of the target service in the current service cannot be detected, the target service is determined as an abnormal service, and an 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 middle layer. The abnormal service refers to the service that is determined to be abnormal and needs to be processed. The abnormal service name refers to the identification name of the service that is determined to be abnormal; each service usually has a unique name in the system, and the abnormal situation of the service can be accurately located and processed through this name.

[0050] S250. Based on the service middle layer, perform exception processing on the abnormal service according to the abnormal service name.

[0051] Optionally, the service middle layer includes a namespace and at least one user service group.

[0052] In this embodiment, the namespace is used to organize and isolate the logical areas of the service; it is usually a container with a unique identifier that helps manage the scope of the service and prevent naming conflicts between different services; each service can belong to a certain namespace; the namespace of this application specifically refers to a pre-set namespace that stores backup group information. The user service group refers to the logical area used to organize and isolate the services allocated to the user; the group is a logical unit, and multiple services of the same type can be placed in the same group to provide services to the outside world; 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 a service name verification result; and the abnormal service is handled abnormally according to the service name verification result and the namespace.

[0054] In this embodiment, the abnormal service group refers to the user service group where the abnormal service is located. The candidate service name refers to the service name of other services in the abnormal service group except the abnormal service. The service name verification result refers to the system's check result of whether the abnormal service name matches the candidate service name when performing consistency verification.

[0055] Furthermore, according to the service name verification result and the namespace, the abnormal service can be handled abnormally. If the service name verification result is passed, the abnormal service is replaced by the service with the same name as the abnormal service in the abnormal service group; if the service name verification result is failed, the abnormal service is replaced by the backup service in the namespace.

[0056] In this embodiment, the backup service refers to a pre-configured alternative service, which can replace the abnormal service when a failure occurs to ensure high availability of the system; the backup service usually comes from the namespace and has the same functions and characteristics.

[0057] Exemplarily, a search is performed within the abnormal service group to determine whether there are other instances with the same service name; if a service instance with the same name is found, the IP address and port number of the instance are directly used 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 namespace of the service middle layer; the backup service can be a service instance in a healthy state, which can temporarily replace the downed service instance; if a backup service is not found in the namespace of the service middle layer, a new virtual machine will be automatically started and registered as a new service instance to the service middle layer.

[0058] In an optional implementation, when the service name verification result fails, if there is no backup service in the namespace of the service middle layer, a new virtual machine is added to the abnormal service group; the service status data of the abnormal service is obtained from a preset database, and the service status data of the abnormal service is imported into the new virtual machine; when it is recognized that the new virtual machine is started and running the service, the service status data of the new virtual machine is saved to the service middle layer.

[0059] In this embodiment, the new virtual machine refers to a newly created virtual machine.

[0060] For example, when a service instance goes down, the service configuration and related data need to be migrated to a new virtual machine; the configuration information and related business data of the abnormal service instance are exported from a database or other persistent storage, including service configuration files, database records, cache information, etc.; the exported data and configuration information are imported into the new virtual machine to ensure that the new virtual machine can carry the original business and configuration; when the new virtual machine is started and the data migration is completed, it will restart using the original configuration information and re-register its own information with the service middle layer.

[0061] It is understandable that by automatically reallocating virtual machines and importing relevant data of the standby virtual machines into the new virtual machines, virtual machine replacement without user perception can be achieved.

[0062] The embodiment of the present application saves the candidate service status data of the candidate service to a pre-configured service middle layer when it is identified that the candidate virtual machine starts and runs the candidate service; saves the current service status data of the target virtual machine to the service middle layer when it is identified that the target virtual machine is allocated to the user from the candidate virtual machine; performs periodic detection on the current service in the service middle layer; determines the target service as an abnormal service and determines 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; and performs exception processing on the abnormal service based on the abnormal service name in the service middle layer. The above technical solution takes the service middle layer as the core, does not need to detect the virtual machine, but performs periodic monitoring on the specific service, which can improve the comprehensiveness and reliability of virtual machine service detection.

[0063] Embodiment 3

[0064] Figure 3 This is a structural diagram of a virtual machine service detection device provided according to the third embodiment of the present application, which can be applied to the situation of periodic detection and abnormal processing of virtual machines of the cloud cryptographic service platform. The virtual machine service detection device can be implemented in the form of hardware and / or software, and the virtual machine service detection device can be configured in a computer device, such as a server. Figure 3 As shown, the device comprises:

[0065] A first data saving module 310 is used to save the candidate service state data of the candidate service to a pre-configured service middle layer when it is identified that the candidate virtual machine is started and running the candidate service;

[0066] The second data saving module 320 is used to save the current service state data of the target virtual machine to the service middle layer when identifying that the target virtual machine is allocated to the user from the candidate virtual machines;

[0067] The service detection module 330 is used to perform periodic detection on the current service in the service middle layer, and when an abnormality is identified in the current service, perform abnormal processing on the abnormal service based on the service middle layer.

[0068] The embodiment of the present application saves the candidate service status data of the candidate service to the pre-configured service middle layer when it is identified that the candidate virtual machine starts and runs the candidate service; saves the current service status data of the target virtual machine to the service middle layer when it is identified that the target virtual machine is allocated to the user from the candidate virtual machine; periodically detects the current service in the service middle layer, and when it is identified that the current service is abnormal, performs exception handling on the abnormal service based on the service middle layer. The above technical solution takes the service middle layer as the core, does not need to detect the virtual machine, but performs periodic monitoring on the specific service, which can improve the comprehensiveness and reliability of virtual machine service detection.

[0069] Optionally, the service detection module 330 includes:

[0070] an abnormal service determination unit, configured to determine the target service as an abnormal service and determine an abnormal service name of the abnormal service when the target service status data of the target service in the current service cannot be detected;

[0071] The abnormal service processing unit is used to perform abnormal processing on the abnormal service based on the service middle layer and according to the abnormal service name.

[0072] Optionally, the service middle layer includes a namespace and at least one user service group; accordingly, the abnormal service processing unit includes:

[0073] A service group determination subunit, configured to determine, from at least one user service group, an abnormal service group to which the abnormal service belongs;

[0074] The service name verification subunit is used to perform consistency verification on the abnormal service name and the candidate service names in the abnormal service group to obtain a service name verification result;

[0075] The exception handling subunit is used to perform exception handling on abnormal services according to the service name verification result and namespace.

[0076] Optional exception handling subunit, specifically used to:

[0077] If the service name verification result is passed, the abnormal service will be replaced by the service with the same name as the abnormal service in the abnormal service group;

[0078] If the service name verification result fails, the backup service in the namespace will replace the abnormal service.

[0079] Optionally, the exception handling subunit is further specifically used for:

[0080] If the service name verification result fails, if there is no backup service in the namespace, a new virtual machine is added to the abnormal service group;

[0081] Obtaining service status data of the abnormal service from a preset database, and importing the service status data of the abnormal service into a new virtual machine;

[0082] When it is identified that the new virtual machine is started and the service is running, the service state data of the new virtual machine is saved to the service middle layer.

[0083] The virtual machine service detection device provided in the embodiment of the present application can execute the virtual machine service detection method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing each virtual machine service detection method.

[0084] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0085] Embodiment 4

[0086] Figure 4 It is a structural diagram of an electronic device 410 that implements the virtual machine service detection method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0087] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In RAM413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, ROM412 and RAM413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0088] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0089] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as a virtual machine service detection method.

[0090] In some embodiments, the virtual machine service detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the virtual machine service detection method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured as a virtual machine service detection method in any other appropriate manner (e.g., by means of firmware).

[0091] Various implementations 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 chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0092] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable virtual machine service detection device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0093] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0094] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0095] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0096] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0097] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.

[0098] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art 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 in the protection scope of this application.

Claims

1. A virtual machine service detection method, characterized in that: include: When it is identified that the candidate virtual machine is started and the candidate service is running, the candidate service state data of the candidate service is saved to a pre-configured service middle layer; When it is identified that a target virtual machine is allocated to a user from the candidate virtual machines, the current service state data of the target virtual machine is saved to the service intermediate layer; The current service in the service middle layer is periodically detected, and when an abnormality is identified in the current service, an abnormality handling is performed on the abnormal service based on the service middle layer.

2. The method according to claim 1, characterized in that When it is identified that the current service is abnormal, based on the service intermediate layer, abnormal service is handled abnormally, including: In the case that the target service state data of the target service in the current service cannot be detected, determining the target service as an abnormal service, and determining an abnormal service name of the abnormal service; Based on the service middle layer, and according to the abnormal service name, the abnormal service is subjected to abnormal processing.

3. The method according to claim 2, characterized in that The service middle layer includes a namespace and at least one user service group; accordingly, based on the service middle layer, according to the abnormal service name, performing abnormal processing on the abnormal service includes: Determine the abnormal service group to which the abnormal service belongs from the at least one user service group; Performing consistency check on the abnormal service name and candidate service names in the abnormal service group to obtain a service name check result; According to the service name verification result and the namespace, the abnormal service is subjected to abnormal processing.

4. The method according to claim 3, characterized in that The performing exception handling on the abnormal service according to the service name verification result and the namespace includes: If the service name verification result is passed, replacing the abnormal service with a service in the abnormal service group that has the same name as the abnormal service; If the service name verification result is failed, the abnormal service is replaced by the backup service in the namespace.

5. The method according to claim 4, characterized in that The method further comprises: In the case where the service name verification result fails, if there is no backup service in the namespace, adding a new virtual machine in the abnormal service group; Acquire the service status data of the abnormal service from a preset database, and import the service status data of the abnormal service into the new virtual machine; When it is identified that the new virtual machine is started and runs a service, the service state data of the new virtual machine is saved to the service middle layer.

6. A virtual machine service detection device, characterized in that: include: A first data saving module is used to save the candidate service state data of the candidate service to a pre-configured service middle layer when it is identified that the candidate virtual machine starts and runs the candidate service; A second data saving module is used to save the current service state data of the target virtual machine to the service intermediate layer when identifying that the target virtual machine is allocated to the user from the candidate virtual machines; The service detection module is used to perform periodic detection on the current service in the service middle layer, and when an abnormality is identified in the current service, perform abnormal processing on the abnormal service based on the service middle layer.

7. The device according to claim 6, characterized in that The service detection module comprises: an abnormal service determining unit, configured to determine the target service as an abnormal service and determine an abnormal service name of the abnormal service when the target service state data of the target service in the current service cannot be detected; The abnormal service processing unit is used to perform abnormal processing on the abnormal service based on the service intermediate layer and according to the abnormal service name.

8. An electronic device, characterized in that: include: one or more processors; A memory for storing 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 according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the virtual machine service detection method according to any one of claims 1 to 5 is implemented.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the virtual machine service detection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Cloud service scheduling and recovering method based on fault detection and terminal device

    CN110502326A

  • High-availability BMC service operation implementation method, system and computer equipment

    CN118069330A

  • High availability service virtual machine in virtualization environment

    US20170185445A1