A method for achieving high availability of serial port devices in a kvm virtualization environment

CN116248551BActive Publication Date: 2024-11-19BOZHI XINAN (CHENGDU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310246619.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-15
Publication Date
2024-11-19
Estimated Expiration
2043-03-15

AI Technical Summary

Technical Problem

[0002]host机的串口设备连接外部设备,在普通的host机与kvm虚拟化环境的串口设备映射中是属于一次性的操作,即配置好host机与kvm虚拟化环境中串口设备的映射关系,启动kvm虚拟化环境后一次性在kvm虚拟化环境中创建一串口设备,业务程序部署在kvm虚拟化环境中,操作的串口设备是kvm虚拟化中的串口设备,当kvm虚拟化环境重启之后,串口设备容易失效;当kvm虚拟化环境中的程序连接高波特率操作串口时,串口设备容易出现假死的情况;当kvm虚拟化环境中的串口出现假死之后,业务程序无法主动去恢复串口设备,从而导致程序无法将数据从kvm虚拟化环境发到外部设备中

Benefits of technology

[0020] Compared with the existing technology, the beneficial effects of the present invention are: the present invention realizes the monitoring of serial port devices through the agent module deployed in host and kvm virtualization. The agent module monitors and manages the serial port devices in the environment, and completes The two-way message communication between the agent module in the host and the agent module in the kvm virtualization environment realizes the monitoring and management of the serial port device through the above settings; ensuring the high availability of the serial port device in the kvm virtualization environment; preventing the serial port device from Failures in the kvm virtualization environment will have an impact on the business; reducing manual troubleshooting of problems caused by the use of serial port equipment in the kvm virtualization environment will allow more time to focus on the use of serial port equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248551B_ABST
    Figure CN116248551B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of network communication of computer security equipment, and in particular to a method for realizing high availability of serial port equipment in a KVM virtualization environment. The present invention realizes monitoring of serial port equipment by an agent module deployed in a host and a KVM virtualization, wherein the agent module monitors and manages the serial port equipment in the environment, and completes two-way message communication between the agent module in the host and the agent module in the KVM virtualization environment, that is, monitoring and management of the serial port equipment are realized through the above-mentioned setting; high availability of the serial port equipment in the KVM virtualization environment is ensured; failure of the serial port equipment in the KVM virtualization environment is prevented from affecting services; and manual troubleshooting of problems caused by the use of serial port equipment in the KVM virtualization environment is reduced, so that more time is spent on focusing on the services of using the serial port equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication of computer security equipment, and in particular to a method for realizing high availability of serial port equipment in a KVM virtualization environment. Background Art

[0002] The serial port device of the host machine is connected to the external device. In the serial port device mapping between the ordinary host machine and the kvm virtualization environment, it is a one-time operation. That is, the mapping relationship between the serial port device of the host machine and the kvm virtualization environment is configured. After starting the kvm virtualization environment, a serial port device is created in the kvm virtualization environment at one time. The business program is deployed in the kvm virtualization environment. The serial port device operated is the serial port device in the kvm virtualization. When the kvm virtualization environment is restarted, the serial port device is prone to failure; when the program in the kvm virtualization environment connects to the high baud rate operation serial port, the serial port device is prone to pseudo-death; when the serial port in the kvm virtualization environment is pseudo-dead, the business program cannot actively restore the serial port device, resulting in the program being unable to send data from the kvm virtualization environment to the external device. The data of the external device first reaches the host machine through the serial port, and then passes through the host machine to the kvm virtualization environment. If the serial port device in the virtualization environment cannot work properly, the data from the outside cannot reach the kvm virtualization environment. Summary of the invention

[0003] The purpose of the present invention is to provide a method for realizing high availability of serial port devices in a KVM virtualization environment, so as to improve the stability of serial port devices in a host machine and a KVM virtualization environment, that is, to realize high availability of serial port devices. By adopting a serial port high availability solution, it is possible to find abnormal communication of serial port devices connected to a host machine, as well as abnormal mapping of serial port devices between a host machine and a KVM virtualization environment. When a communication abnormality occurs in a serial port device, the connection and mapping of the serial port device are actively reset to restore the connectivity of the serial port device. A business program running in the KVM virtualization environment uses the serial port device again through a retry mechanism, thereby ensuring the connectivity and high availability of the business.

[0004] To achieve the above object, the present invention provides the following technical solution: a method for realizing high availability of serial port devices in a KVM virtualization environment, comprising the following steps:

[0005] Step S1, deploying an agent module for monitoring the serial port and the kvm virtualization environment on the host machine, the deployment is used to monitor serial port communication, receive notification messages sent by the agent module program running in the kvm virtual environment, and distribute specific operations according to the notification messages;

[0006] Step S2: When the serial port device fails, the service program can perform a retries operation based on the last failure point.

[0007] Step S3, deploying an agent module in the kvm virtualization environment to monitor the communication status of the serial port devices in the kvm virtualization environment, and at the same time communicating with the agent module monitoring program of the host in step S1;

[0008] Step S4, the agent module deployed in the host manages the reset operation of the serial port device in the host machine, sends ping, and receives pong test data operations;

[0009] Step S5, the agent module deployed in the kvm virtualization environment manages the reset operation in the serial port device in the kvm virtualization, sends ping, and receives pong test data operations;

[0010] Step S6: If the agent module deployed in the host machine finds that the serial port device fails, it resets the corresponding failed serial port device in the host machine and notifies the agent module in the KVM virtualization environment that uses the serial port device; the agent module in the KVM virtualization environment receives the notification message from its host, resets the corresponding serial port device according to the notification message, uses the service of the serial port device to terminate the currently executed task and uses the retry mechanism to execute the task;

[0011] Step S7, if the agent module deployed in the kvm virtualization environment finds that the corresponding serial port device fails, it sends a notification to the agent module in the host to inquire whether the serial port device in the host also fails; if the agent in the host detects that the serial port fails, the operation of step S6 is executed; if the serial port device in the host is normal, a feedback message is given to the agent module program in the kvm virtualization environment that communicates with it, and the agent module in the kvm virtualization environment only resets the serial port device in the current virtualization environment and performs a connectivity test. After the test is completed, the business program is notified to terminate the currently executed task and use the retry mechanism to execute the task.

[0012] Preferably, there are two situations in which the monitoring serial port is deployed on the host machine in step S1, specifically:

[0013] The host machine is equipped with multiple serial port devices. When used in multiple KVM virtualizations, each serial port is independently mapped to the KVM virtualization for independent use;

[0014] When the host has only one serial port device, when used in multiple KVM virtualizations, the independent serial port device is mapped to each KVM virtual machine.

[0015] Preferably, the notification message in step S1 specifically includes SERIAL_ERROR, SERIAL_HANG and SERIAL_TIMEOUT.

[0016] Preferably, the specific operation of distributing according to the notification message in step S1 includes:

[0017] When SERIAL_ERROR is received, it indicates that the serial port device has an error and the serial port device in the virtualization cannot work properly. The host machine restarts the virtual machine serial port device sent. After the restart is successful, the SERIAL_RESTARTED message is sent to the agent module. After receiving the notification, the agent module notifies the business process in the virtual machine to retry the business service;

[0018] When SERIAL_HANG and SERIAL_TIMEOUT are received, it indicates that the serial port queue may be blocked. The host clears the queue of the serial port and waits for the serial port to work normally. Then, it sends a SERIAL_FIXED message to the agent module. After receiving the notification, the agent module notifies the business process in the virtual machine to retry the business service.

[0019] Preferably, in step S2, the business program is divided into the smallest granularity.

[0020] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention realizes monitoring of serial port devices by deploying agent modules in host and KVM virtualization, the agent module monitors and manages the serial port devices in the environment, and completes two-way message communication between the agent module in the host and the agent module in the KVM virtualization environment, that is, the monitoring and management of serial port devices are realized through the above settings; the high availability of serial port devices in the KVM virtualization environment is ensured; the failure of serial port devices in the KVM virtualization environment is prevented from affecting the business; the manual troubleshooting of problems caused by the use of serial port devices in the KVM virtualization environment is reduced, and more time is used to focus on the business of using serial port devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of the workflow of the present invention;

[0022] Figure 2 It is a schematic diagram of the independent use of the multi-serial port device of the present invention;

[0023] Figure 3This is a schematic diagram of a single serial port device sharing method of the present invention. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] See also Figure 1-3 The present invention provides a technical solution: a method for realizing high availability of serial port devices in a KVM virtualization environment, comprising the following steps:

[0026] Step S1, deploying an agent module for monitoring the serial port and the kvm virtualization environment on the host machine, the deployment is used to monitor serial port communication, receive notification messages sent by the agent module program running in the kvm virtual environment, and distribute specific operations according to the notification messages;

[0027] Step S2: When the serial port device fails, the service program can perform a retries operation based on the last failure point.

[0028] Step S3, deploying an agent module in the kvm virtualization environment to monitor the communication status of the serial port devices in the kvm virtualization environment, and at the same time communicating with the agent module monitoring program of the host in step S1;

[0029] Step S4, the agent module deployed in the host manages the reset operation of the serial port device in the host machine, sends ping, and receives pong test data operations;

[0030] Step S5, the agent module deployed in the kvm virtualization environment manages the reset operation in the serial port device in the kvm virtualization, sends ping, and receives pong test data operations;

[0031] Step S6: If the agent module deployed in the host machine finds that the serial port device fails, it resets the corresponding failed serial port device in the host machine and notifies the agent module in the KVM virtualization environment that uses the serial port device; the agent module in the KVM virtualization environment receives the notification message from its host, resets the corresponding serial port device according to the notification message, uses the service of the serial port device to terminate the currently executed task and uses the retry mechanism to execute the task;

[0032] Step S7, if the agent module deployed in the kvm virtualization environment finds that the corresponding serial port device fails, it sends a notification to the agent module in the host to inquire whether the serial port device in the host also fails; if the agent in the host detects that the serial port fails, the operation of step S6 is executed; if the serial port device in the host is normal, a feedback message is given to the agent module program in the kvm virtualization environment that communicates with it, and the agent module in the kvm virtualization environment only resets the serial port device in the current virtualization environment and performs a connectivity test. After the test is completed, the business program is notified to terminate the currently executed task and use the retry mechanism to execute the task.

[0033] Furthermore, there are two situations in which the monitoring serial port is deployed on the host in step S1, specifically:

[0034] The host machine is equipped with multiple serial port devices. When used in multiple KVM virtualizations, each serial port is independently mapped to the KVM virtualization for independent use;

[0035] When the host has only one serial port device, when used in multiple KVM virtualizations, the independent serial port device is mapped to each KVM virtual machine.

[0036] Furthermore, the notification message in step S1 specifically includes SERIAL_ERROR, SERIAL_HANG and SERIAL_TIMEOUT.

[0037] Furthermore, the specific operations of distributing according to the notification message in step S1 include:

[0038] When SERIAL_ERROR is received, it indicates that the serial port device has an error and the serial port device in the virtualization cannot work properly. The host machine restarts the virtual machine serial port device sent. After the restart is successful, the SERIAL_RESTARTED message is sent to the agent module. After receiving the notification, the agent module notifies the business process in the virtual machine to retry the business service;

[0039] When SERIAL_HANG and SERIAL_TIMEOUT are received, it indicates that the serial port queue may be blocked. The host clears the queue of the serial port and waits for the serial port to work normally. Then, it sends a SERIAL_FIXED message to the agent module. After receiving the notification, the agent module notifies the business process in the virtual machine to retry the business service.

[0040] Furthermore, in step S2, the business program is divided into the smallest granularity.

[0041] The present invention realizes monitoring of serial port devices through agent modules deployed in host and KVM virtualization. The agent module monitors and manages the serial port devices in the environment, and completes two-way message communication between the agent module in the host and the agent module in the KVM virtualization environment, that is, the monitoring and management of serial port devices are realized through the above settings; the high availability of serial port devices in the KVM virtualization environment is guaranteed; the failure of serial port devices in the KVM virtualization environment is prevented from affecting the business; the manual troubleshooting of problems caused by the use of serial port devices in the KVM virtualization environment is reduced, and more time is used to focus on the business of using serial port devices.

[0042] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for achieving high availability of serial port devices in a kvm virtualization environment, characterized in that: The following steps are involved: Step S1, deploying an agent module for monitoring the serial port and the kvm virtualization environment on the host machine, the deployment is used to monitor serial port communication, receive notification messages sent by the agent module program running in the kvm virtual environment, and distribute specific operations according to the notification messages; Step S2: When the serial port device fails, the service program can perform a retries operation based on the last failure point. Step S3, deploying an agent module in the kvm virtualization environment to monitor the communication status of the serial port devices in the kvm virtualization environment, and at the same time communicating with the agent module monitoring program of the host in step S1; Step S4, the agent module deployed in the host manages the reset operation of the serial port device in the host machine, sends ping, and receives pong test data operations; Step S5, the agent module deployed in the kvm virtualization environment manages the reset operation in the serial port device in the kvm virtualization, sends ping, and receives pong test data operations; Step S6: If the agent module deployed in the host machine finds that the serial port device fails, it resets the corresponding failed serial port device in the host machine and notifies the agent module in the KVM virtualization environment that uses the serial port device; the agent module in the KVM virtualization environment receives the notification message from its host, resets the corresponding serial port device according to the notification message, uses the service of the serial port device to terminate the currently executed task and uses the retry mechanism to execute the task; Step S7, if the agent module deployed in the kvm virtualization environment finds that the corresponding serial port device fails, it sends a notification to the agent module in the host to inquire whether the serial port device in the host also fails; if the agent in the host detects that the serial port fails, the operation of step S6 is executed; if the serial port device in the host is normal, a feedback message is given to the agent module program in the kvm virtualization environment that communicates with it, and the agent module in the kvm virtualization environment only resets the serial port device in the current virtualization environment and performs a connectivity test. After the test is completed, the business program is notified to terminate the currently executed task and use the retry mechanism to execute the task.

2. A method for achieving high availability of serial port devices in a KVM virtualization environment according to claim 1, characterized in that: There are two situations in which the monitoring serial port is deployed on the host in step S1, specifically: The host machine is equipped with multiple serial port devices. When used in multiple KVM virtualizations, each serial port is independently mapped to the KVM virtualization for independent use; When the host has only one serial port device, when used in multiple KVM virtualizations, the independent serial port device is mapped to each KVM virtual machine.

3. A method for achieving high availability of serial port devices in a KVM virtualization environment according to claim 1, characterized in that: The notification message in step S1 specifically includes SERIAL_ERROR, SERIAL_HANG and SERIAL_TIMEOUT.

4. A method for achieving high availability of serial port devices in a KVM virtualization environment according to any one of claims 1 to 3, characterized in that: The specific operations of distributing according to the notification message in step S1 include: When SERIAL_ERROR is received, it indicates that the serial port device has an error and the serial port device in the virtualization cannot work properly. The host machine restarts the virtual machine serial port device sent. After the restart is successful, the SERIAL_RESTARTED message is sent to the agent module. After receiving the notification, the agent module notifies the business process in the virtual machine to retry the business service; When SERIAL_HANG and SERIAL_TIMEOUT are received, it indicates that the serial port queue may be blocked. The host clears the queue of the serial port and waits for the serial port to work normally. Then, it sends a SERIAL_FIXED message to the agent module. After receiving the notification, the agent module notifies the business process in the virtual machine to retry the business service.

5. A method for achieving high availability of serial port devices in a KVM virtualization environment according to claim 1, characterized in that: In step S2, the business program is divided into the smallest granularity.