Virtual machine network detection method, device, equipment, storage medium and program

By monitoring the logical routers and switches in the southbound database, creating and detecting bound ports for service nodes and virtual machine networks, and using data path and port binding tables for periodic detection, the problem of low efficiency in virtual machine network connectivity detection is solved, improving detection accuracy and overall service performance.

CN121125662BActive Publication Date: 2026-02-13JINAN INSPUR DATA TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511675862.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-02-13
Estimated Expiration
2045-11-14

AI Technical Summary

Technical Problem

In existing technologies, virtual machine network connectivity detection often affects the overall performance of virtual machine services, resulting in low detection efficiency. Especially in large-scale cluster environments, the southbound database OVN-SB has limited ability to handle high concurrency and big data, leading to cluster instability.

Method used

Monitor the logical routers created in the southbound database, determine their associated logical switches, create a Layer 2 gateway logical switch port for detection, and bind it to the detection service node and virtual machine network. Perform periodic connectivity checks based on the data path binding table and port binding table, and adjust the network configuration parameters of the virtual machines.

Benefits of technology

It enables automated detection of virtual machine network connectivity, reduces the impact on cloud platform performance, improves detection accuracy and efficiency, ensures high availability of detection services, reduces database pressure, optimizes resource allocation and management, and solves the problem of low detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125662B_ABST
    Figure CN121125662B_ABST
Patent Text Reader

Abstract

The application discloses a kind of detection methods, device, equipment, storage medium and program of virtual machine network, it is related to cloud platform technical field, comprising: listen to the logical router created in south database, and determine the logical switch associated with logical router;In the case where logical router and logical switch establish connection relationship, create exchange port for logical router for detecting second layer gateway logic, and binding exchange port with detection service node, virtual machine network;In the case where determining that target virtual machine in virtual machine network needs detection, according to the binding result determining the data path binding table and port binding table corresponding to target virtual machine;Periodic detection is carried out to the network used by the target virtual machine based on the data path binding table, the port binding table, to adjust the configuration parameter of the target virtual machine according to detection result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of cloud platform, in particular, relate to a virtual machine network detection method and device, equipment, storage medium and program. BACKGROUND

[0002] In the cloud computing environment, as a key component of the infrastructure, the stability and connectivity of the network are crucial to the quality of cloud services. With the continuous development and popularization of virtualization technology, Network Function Virtualization (NFV) has become the mainstream trend in cloud data centers, aiming to provide flexible and elastic network services. Open Stack, as a leading open source cloud infrastructure management platform, its Neutron component is responsible for managing network resources, while Open Virtual Network (OVN) as the backend of Neutron, realizes the virtualization of network functions and provides a high-performance network virtualization solution. Although the combination of Neutron and OVN has been able to meet the virtual network management needs in large-scale cloud environments, in the face of virtual machine connectivity detection scenarios, the detection scheme in the related technology usually relies on OVN-SB (southbound database) to share detection results, but OVN-SB as a lightweight database, has limited ability to handle high concurrency and large data, especially in large-scale cluster environments, frequent read-write operations will bring huge pressure to the database, which may further lead to instability of the cluster.

[0003] In view of the problem that in the related technology, virtual machine network connectivity detection often affects the overall virtual machine service performance, resulting in low detection efficiency of virtual machine network, no effective solution has been proposed so far. SUMMARY

[0004] Embodiments of the present application provide a virtual machine network detection method and device, equipment, storage medium and program, to at least solve the problem that in the related technology, virtual machine network connectivity detection often affects the overall virtual machine service performance, resulting in low detection efficiency of virtual machine network.

[0005] According to one embodiment of the present application, a detection method of a virtual machine network is provided, comprising: listening to a logical router created in a southbound database, and determining a logical switch associated with the logical router; in a case where the logical router and the logical switch establish a connection relationship, creating a switching port for detecting a second layer gateway logic for the logical router, and binding the switching port with a detection service node and a virtual machine network; in a case where it is determined that a target virtual machine in the virtual machine network needs to be detected, determining a data path binding table and a port binding table corresponding to the target virtual machine according to a binding result; and periodically detecting a network used by the target virtual machine based on the data path binding table and the port binding table, so as to adjust a configuration parameter of the target virtual machine according to a detection result.

[0006] According to another embodiment of the present application, a detection device of a virtual machine network is provided, comprising: a first determination module configured to listen to a logical router created in a southbound database, and determine a logical switch associated with the logical router; a binding module configured to, in a case where the logical router and the logical switch establish a connection relationship, create a switching port for detecting a second layer gateway logic for the logical router, and bind the switching port with a detection service node and a virtual machine network; a second determination module configured to, in a case where it is determined that a target virtual machine in the virtual machine network needs to be detected, determine a data path binding table and a port binding table corresponding to the target virtual machine according to a binding result; and a detection module configured to periodically detect a network used by the target virtual machine based on the data path binding table and the port binding table, so as to adjust a configuration parameter of the target virtual machine according to a detection result.

[0007] According to still another embodiment of the present application, a computer readable storage medium is further provided, and the computer readable storage medium stores a computer program, wherein the computer program is configured to execute steps in any one of the method embodiments when running.

[0008] According to still another embodiment of the present application, an electronic device is further provided, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to execute steps in any one of the method embodiments.

[0009] According to still another embodiment of the present application, a computer program product is further provided, comprising a computer program, and the computer program is executed by a processor to implement steps in any one of the method embodiments.

[0010] Through the present application, the creation event of the logical router in the southbound database is focused on listening, and then the logical switch associated with the logical router is quickly determined. On the basis of the connection between the logical router and the logical switch, the second layer gateway logical switch port for network detection is automatically created and bound with the detection service node and the virtual machine network. The target virtual machine needing detection is identified in the virtual machine network, and based on the previous binding result, the data path binding table and the port binding table associated with the target virtual machine are accurately determined. The data path binding table and the port binding table provided by the second determination module are used to periodically detect the network used by the target virtual machine. The detection result will be used to adjust the network configuration parameters of the target virtual machine, such as network path, virtual local area network (VLAN) allocation, etc., to ensure the network connectivity of the virtual machine. By using the above scheme, the automatic detection of the network connectivity of the virtual machine is realized, the influence on the performance of the cloud platform is reduced, the accuracy and efficiency of the detection are improved, and the high availability of the detection service is ensured. The dependence on the southbound database is reduced, the cluster instability problem caused by the excessive pressure of the database is avoided, and the resource allocation and management of the detection service node are optimized, solving the problem that the virtual machine network connectivity detection often affects the overall virtual machine service performance, resulting in low detection efficiency of the virtual machine network. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0012] Figure 1 is a hardware structure block diagram of a server device of a virtual machine network detection method according to an embodiment of the present application;

[0013] Figure 2 is a flow chart of a virtual machine network detection method according to an embodiment of the present application;

[0014] Figure 3 is an architecture schematic diagram of a virtual machine operation management system according to an embodiment of the present application;

[0015] Figure 4 is a structure block diagram of a virtual machine network detection system according to an embodiment of the present application. DETAILED DESCRIPTION

[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0017] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0018] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0019] As an optional implementation, the method embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a server device for a virtual machine network detection method according to an embodiment of this application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the image. Processor 102 (processor 102 may include, but is not limited to, a central processing unit (CPU), microprocessor (MCU), or programmable logic device (FPGA), etc.) and memory 104 for storing data. The server device may also include transmission device 106 for communication functions and input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0020] The memory 104 can be used to store computer programs, such as software programs of application software and modules, for example, a computer program corresponding to the detection method of the virtual machine network in the embodiments of the present application. The processor 102 performs various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to a server device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0021] The transmission device 106 is used to receive or send data via a network. The specific examples of the above network can include a wireless network provided by a communication provider of a server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, RF) module which is used to communicate with the Internet in a wireless manner.

[0022] In the embodiments, a detection method of a virtual machine network is provided, Figure 2 is a flowchart of the detection method of the virtual machine network according to the embodiments of the present application, as shown in Figure 2 The flowchart includes the following steps:

[0023] In step S202, a logical router created in a southbound database is listened to, and a logical switch associated with the logical router is determined; this step is the starting point of the entire detection process, which involves listening to the southbound database (OVN-SB) storing the real-time network status of the open virtual network. When the Neutron component detects that a new logical router is created in the database, the logical switch associated with the router is automatically identified, which is to establish a connection between the router and the switch later and build a basis for detecting the network. Ensure that the detection can respond to changes in the network architecture in time, and prepare for the subsequent connectivity detection.

[0024] Step S204, in the case that the logical router establishes a connection relationship with the logical switch, create a switch port for detecting the second layer gateway logic for the logical router, and bind the switch port with a detection service node, a virtual machine network; that is, once the association of the logical router and the logical switch is determined, a second layer gateway logical switch port (L2 Gateway LogicalSwitch Port) for connectivity detection will be automatically created on the logical router. These ports will be bound to a specific detection service node responsible for detection, and connected with the relevant virtual machine network. By creating and binding the detection port, the connectivity of the virtual machine network can be detected in a non-intrusive manner, while avoiding direct operation on the original service node and reducing performance impact.

[0025] Step S206, in the case that it is determined that a target virtual machine in the virtual machine network needs to be detected, determine the data path binding table and the port binding table corresponding to the target virtual machine according to the binding result;

[0026] It can be understood that, based on the previous binding operation, it is determined which target virtual machines need to be detected for connectivity. In order to efficiently perform the detection, the data path binding table and the port binding table related to the target virtual machine are found. The data path binding table provides mapping information between the virtual machine and the physical network device, and the port binding table records the association of the virtual machine port and the logical network resource. Through these two tables, the detection service can accurately identify the network resource that needs to be detected, and improve the pertinence and efficiency of the detection.

[0027] Step S208, periodically detecting the network used by the target virtual machine based on the data path binding table and the port binding table, to adjust the configuration parameters of the target virtual machine according to the detection result.

[0028] That is, after mastering the network information of the target virtual machine, the detection service will periodically detect the connectivity of the virtual machine network. This process is based on the data path binding table and the port binding table, and evaluates the network connectivity between virtual machines by sending specific network probe packets or using other detection techniques, such as Ping test. The detection result will be used to adjust the configuration parameters of the target virtual machine, for example, if a network path interruption is detected, the network path can be automatically reconfigured or the VLAN allocation can be adjusted to ensure the connectivity and stability of the virtual machine network.

[0029] By focusing on monitoring the creation events of logical routers in the southbound database (OVN-SB), the system quickly identifies the logical switches associated with each logical router. Once a connection is established between the logical router and the logical switch, a Layer 2 gateway logical switch port for network detection is automatically created and bound to the detection service node and the virtual machine network. The system identifies the target virtual machine to be detected within the virtual machine network and, based on the previous binding results, accurately determines the data path binding table and port binding table associated with the target virtual machine. Using the data path binding table and port binding table provided by the second determination module, periodic connectivity checks are performed on the network used by the target virtual machine. The detection results are used to adjust the network configuration parameters of the target virtual machine, such as network paths and virtual LAN allocation, to ensure network connectivity. This approach achieves automated detection of virtual machine network connectivity while reducing the impact on cloud platform performance, improving detection accuracy and efficiency, and ensuring high availability of the detection service. It reduces the dependence on the OVN-SB database, avoids cluster instability issues that may be caused by excessive database pressure, and optimizes the resource allocation and management of the detection service nodes. It also solves the problem that virtual machine network connectivity detection often affects the overall virtual machine service performance, resulting in low efficiency of virtual machine network detection.

[0030] In one exemplary embodiment, periodic detection of the network used by the target virtual machine based on a data path binding table and a port binding table includes: determining at least three interface types for detecting access to the target virtual machine based on the data path binding table and the port binding table, wherein the at least three interface types include: a first interface type corresponding to the first result of all detection service nodes detecting the target virtual machine after obtaining a first time point; a second interface type corresponding to the second result of detection service nodes detecting the target virtual machine before deleting the second time point in the southbound database; and a third interface type corresponding to the third result of the Internet packet explorer interface detecting the target virtual machine; setting time point parameters for the at least three interface types using historical detection data stored in the southbound database; and controlling the target interfaces corresponding to the at least three interface types to periodically detect the network used by the target virtual machine using the time point parameters.

[0031] Specifically, based on existing data path binding tables and port binding tables, three different detection interface types can be determined to support periodic detection of the network connectivity of the target virtual machine.

[0032] Firstly, the first interface type focuses on the results of connectivity detection of target virtual machines by all detection service nodes starting from a specific time point (first time point). The design of this interface type allows the detection process or application to quickly retrieve the latest detection records, thereby providing the network administrator with the latest network status report. To achieve this, we store historical detection data in the southbound database, and by analyzing these data, we can set a reasonable time point parameter to ensure the freshness and timeliness of the detection results.

[0033] Secondly, the second interface type focuses on clearing outdated detection data, i.e., detection results that occurred before another specific time point (second time point). This design not only improves the performance of the database, avoiding read-write delays caused by storing large amounts of historical data, but also ensures that the detection process or application can focus on the current and future network status rather than past data, thereby improving the response speed and efficiency of detection.

[0034] Finally, the third interface type is the Internet Packet Explorer interface, which is used to periodically check the activity of target virtual machines, i.e., whether they can respond to external network packets. This mechanism ensures that the detection process or application can timely discover network anomalies of virtual machines, such as disconnection or configuration errors, and take timely repair measures. The time point parameter plays a key role here, controlling the frequency and timing of the probe, ensuring that it does not interfere with the normal work of virtual machines too frequently, and does not miss the fault window due to too long detection intervals.

[0035] In summary, through the above interface types and the use of time point parameters, efficient and dynamic monitoring of the network connectivity of target virtual machines is achieved, while limiting the query depth and range of the database, reducing the burden on the database, and ensuring the stability of the detection process or application and the overall performance of the cloud platform. In addition, through the combination of periodic detection and the probe mechanism, effective management of network resources can be achieved, ensuring that the network configuration of virtual machines is always in the best state, and responding quickly to changes in network topology or fluctuations in virtual machine status.

[0036] In an exemplary embodiment, before or after listening to the logical router created in the southbound database, the above method further comprises: listening to the physical host private information table item in the southbound database, wherein the physical host private information table item is used to record the network status of the virtual machine network associated with the physical host; determining whether the target virtual machine corresponds to a target physical host deployed with a detection service according to the external identifier field in the physical host private information table item, and updating the node information corresponding to the detection service node in the southbound database based on the determination result.

[0037] It needs to be noted that not only the related events of logical routers are concerned, but also the monitoring and utilization of physical host private information are further strengthened to enhance the intelligent scheduling and resource management capabilities of the detection service. The physical host private information table item (Chassis_Private) plays a key role, which records the real-time state of the virtual machine network on the physical host, including but not limited to the binding situation of the virtual machine port, network connectivity and other important information.

[0038] By continuously monitoring the changes of the physical host private information table item, the detection process or application can immediately grasp the state of the physical host, especially the deployment situation of the detection service. Specifically, a specific marker (such as the probe-server attribute) is searched in the external identifier field of the table item to determine whether the target physical host has deployed the detection service. This information is crucial for the efficient utilization of the detection service, as it directly affects the allocation and execution of detection tasks.

[0039] Based on this determination result, the node information of the detection service node in the southbound database will be dynamically updated to reflect the latest detection service deployment status. This includes two cases: one is when a new detection service goes online, the information of the service node will be automatically registered and added to the database, which helps to expand the detection coverage and improve the comprehensiveness and accuracy of connectivity detection; the second is when the detection service fails or is removed, the related node information will be marked as pending for disposal in time, so that these unavailable service nodes will not be considered in the subsequent detection task allocation, thereby avoiding resource waste and ensuring the high availability of the detection service and the stability of the cluster.

[0040] Through the above design strategy, not only the flexibility and response speed of the detection service are enhanced, but also the detection task can be executed on the appropriate service node, even in a complex network architecture and numerous physical hosts in the cloud environment, the detection efficiency and accuracy can be maintained. In this way, the excessive dependence on the central database in the traditional detection scheme is effectively alleviated, the database pressure is reduced, and the robustness of the detection service and the overall operation and maintenance efficiency are improved through real-time updating of node information.

[0041] In an example embodiment, based on the determination result, the node information corresponding to the detection service node in the southbound database is updated, and the above method further comprises: in the case where the determination result indicates that the target physical host has deployed the detection service and the detection service adds a new detection service node, obtaining first node data corresponding to the new detection service node, and updating the node information using the first node data; in the case where the determination result indicates that the target physical host has not deployed the detection service and the detection service reduces the detection service node, obtaining second node data corresponding to the reduced detection service node, and updating the node information using the second node data.

[0042] In this embodiment, the policy for managing the detection service node information is further refined, aiming to achieve immediate response to the addition or deletion of detection services and accurate update of database information. When a change in the physical host private information table item (Chassis_Private) is detected and it is confirmed through analysis of the external identifier field that the target physical host has deployed a detection service, a series of update mechanisms will be triggered to ensure that the information related to the service node in the southbound database (such as OVN-SB) is kept up-to-date.

[0043] Specifically, when a detection service adds a new service node, the first node data related to the new node is automatically obtained, including but not limited to the node's IP address, port number, service status and other key information. Subsequently, these first node data will be used to update the node information of the corresponding service node in the southbound database, so that the database can timely reflect the addition of the new node, and thus consider this new resource in the subsequent detection task allocation process, achieving efficient utilization and performance optimization of the detection service.

[0044] On the contrary, if the determination result indicates that the target physical host does not deploy a detection service and the detection service reduces a service node, a different update strategy will be adopted. In this case, the second node data related to the reduced service node is collected, including the node's identification information, the last detection time, the status flag, etc., which is used to update or remove the corresponding node information in the database. This mechanism ensures that there are no invalid or outdated service node records in the database, avoiding the allocation of tasks to non-existent or no longer valid nodes in the detection task scheduling, thereby improving the efficiency and accuracy of detection task allocation, and also reducing the waste of resources due to inaccurate node information.

[0045] Through the above update mechanism, the detection service node changes can be dynamically adapted, whether it is an increase or a decrease, and the real-time update of database information and the precise scheduling of detection tasks can be ensured. This not only enhances the flexibility and response capability of the detection service, but also further improves the overall efficiency and stability of the cloud platform network connectivity detection, providing a more robust and reliable virtual machine network environment for users.

[0046] In an exemplary embodiment, after obtaining the first node data corresponding to the new detection service node, including: in the case that the same target node information as the first node information already exists in the node information, temporarily not updating the node information with the first node data; in the case that the same target node information as the first node information does not exist in the node information, writing the first node data to the southbound database and marking the first node data as to-be-updated usage data.

[0047] In this embodiment, the processing flow of newly detected service node information is carefully designed to avoid repeated updates and resource conflicts, while ensuring the accuracy and real-time nature of the database information. After successfully obtaining the first node data corresponding to the newly detected service node, the node information in the database is first checked to determine whether there is target node information that is identical to the first node data. This checking step is crucial as it helps maintain the neatness and efficiency of the database, preventing query delays and storage waste caused by unnecessary duplicate data.

[0048] If there is already target node information identical to the first node data in the node information of the database, a "do not update" strategy will be adopted, i.e., the existing information will not be overwritten or modified using the first node data. The reason behind this decision logic is that repeated node information updates can interfere with normal detection service scheduling, causing chaos in resource allocation and even affecting the accuracy and timeliness of detection. Therefore, only when it is confirmed that there is no identical node information in the database, will the subsequent update operation be performed.

[0049] Once it is confirmed that there is no identical information in the database, the first node data will be written into the southbound database and marked as "to-be-updated usage data". This marking mechanism provides a foundation for the subsequent detection service node high availability strategy, ensuring that new node information can be correctly identified and utilized. For example, in the health monitoring and fault switching process of the detection service node, the new node information marked as "to-be-updated usage data" will be preferentially used for task allocation, ensuring the continuity and efficiency of the detection service.

[0050] By implementing the above strategy, intelligent judgment and avoidance of information duplication can be achieved when introducing new detection service nodes, ensuring that the node information in the database is always up-to-date and non-redundant, thereby providing a solid data foundation for the allocation and execution of detection tasks, improving the operation efficiency and user experience of the entire cloud platform. At the same time, this mechanism also enhances the high availability of the detection service, ensuring the stability and accuracy of detection even in a dynamic node environment.

[0051] In one exemplary embodiment, after obtaining the second node data corresponding to the reduced detection service node, the above method further comprises: in the case where there is no target node information identical to the second node information in the node information, determining that the node information has been updated; in the case where there is target node information identical to the second node information in the node information, marking the second node data as to-be-discarded usage data.

[0052] In the embodiment, when a certain service node is detected to be removed and the second node data corresponding thereto is successfully acquired, a rigorous database information checking and updating process is immediately started. If it is found in the checking process that the node information of the database no longer contains the target node information matching the second node data, it indicates that the information updating of the database has been completed, i.e., the previous removal operation has been recorded by the database. At this time, no additional processing is required, and this step verifies the real-time and integrity of the database, ensuring its reliability as a core resource for detection task scheduling.

[0053] However, if the target node information consistent with the second node data is still found in the node information, it means that the database has not yet reflected the fact that the node is reduced. In this case, the operation of "marking as to be abandoned usage data" is taken, i.e., the node information is specially marked in the database, indicating that its state has changed to no longer available. This strategy not only avoids problems that may be caused by directly deleting data, such as accidental data loss or consistency problems, but also provides a basis for subsequent advanced management decisions. For example, based on such marked information, the allocation of detection tasks can be automatically adjusted to ensure that detection requests are no longer sent to nodes marked as "to be abandoned", avoiding resource waste and potential detection failures.

[0054] Through the dynamic information updating and abandonment marking mechanism in the above embodiment, the increase and decrease of detection service nodes can be flexibly responded to, the accuracy and timeliness of the database information can be maintained, and the efficient scheduling and execution of detection tasks can be ensured.

[0055] In an example embodiment, at least three interface types corresponding to the target interface of the target virtual machine usage network are periodically detected by a time point parameter, including: determining a first detection result based on a first interface type and a time point parameter; in the case that the first detection result is completed storage, determining a second detection result by a second interface type and a time point parameter; in the case that the virtual machine service corresponding to the southbound database is determined to be running normally by a third interface type, determining the memory information to be released of the southbound database according to the second detection result.

[0056] That is, the entire detection process revolves around the three interface types, and through the ingenious time point control, the continuity of the detection and the timeliness of the data are ensured.

[0057] First, by the first interface type, combined with the set time point parameter (for example, a specific starting time), the first detection result is determined. In this stage, all detection service nodes from the time point will be focused on collecting and analyzing the data of the target virtual machine network connectivity detection. The acquisition of the first detection result is the starting point of the detection process, which provides basic information for subsequent detection and resource management.

[0058] Subsequently, after the first detection result is successfully stored, a second detection result will be determined using the second interface type, also based on the time point parameter. The second detection result here mainly focuses on cleaning up expired detection data, i.e. deleting all detection records before a second time point (such as a cutoff time). This process not only helps to keep the database clean and avoid the accumulation of redundant data, but also ensures that the detection service can quickly locate the latest network status, improving the response speed and accuracy of detection.

[0059] Finally, through the third interface type, the running state of the detection service is periodically checked to ensure that the virtual machine service in the southbound database is running normally. In this step, a specific probe interface is called to verify the health of the service. Once it is confirmed that all detection services are running well, the second detection result will be further determined based on the memory information to be released in the southbound database. This is because the cleaning work of the second detection result releases part of the storage space of the database, and by analyzing this information, it can intelligently determine which memory space can be safely recycled, thereby reducing the storage pressure of the database and improving its overall performance and stability.

[0060] In summary, through the precise control of the time point parameter, the embodiment realizes the whole process management of the target virtual machine network connectivity detection, from data collection to result storage, to data cleaning and resource optimization, forming a closed-loop, efficient detection and database resource management mechanism. This method not only improves the efficiency and accuracy of detection, but also effectively reduces the burden of the cloud platform database, providing strong technical support for maintaining the network health and performance stability of the cloud environment.

[0061] In one example embodiment, after periodic detection of the network used by the target virtual machine based on the datapath binding table and the port binding table, the above method further comprises: in the case where there is an unbound port table entry in the port binding table, obtaining other detection service nodes in the virtual machine network that are not bound, and associating the other detection service nodes with the unbound port table entry.

[0062] In this example embodiment, an intelligent association mechanism is designed for the case of unbound ports that may occur in the virtual machine network connectivity detection process, aiming to optimize the utilization of detection service resources and improve the overall efficiency of detection. After the periodic network detection is completed, i.e. after a series of detection activities based on the datapath binding table (Datapath_Binding) and the port binding table (Port_Binding) are completed, the state of the port binding table is further analyzed to find possible unbound port table entries.

[0063] Unbound ports generally refer to those virtual machine network ports that have been created but have not yet been associated with any detection service node. Their existence means that network resources are not fully utilized and detection coverage is insufficient. To overcome this challenge, the virtual machine network is actively scanned to identify these unbound ports and find other available detection service nodes in the network. This process is dynamic and can quickly respond to the real-time state of the network to ensure that all ports can be effectively included in the detection range, improving the comprehensiveness and accuracy of detection.

[0064] Once the unbound port entries and their numbers are confirmed, suitable detection service nodes will be selected based on certain resource scheduling algorithms (such as the minimum binding principle), and the association between the two will be established. This association not only solves the problem of uneven distribution of detection resources, but also allows for flexible adjustment of detection task allocation according to changes in network load, preventing some detection nodes from being overloaded and affecting detection quality. By effectively pairing unbound ports with detection service nodes, idle resources in the network can be fully utilized, enhancing the overall detection capability and response speed, further improving the network connectivity detection level of the cloud platform, and ensuring stable and efficient communication between virtual machines.

[0065] In summary, the intelligent association mechanism in the present embodiment is an important component of the bridge between detection service nodes and virtual machine network ports. It achieves the maximum utilization of detection service resources through active discovery and optimal allocation of unbound ports.

[0066] In one example embodiment, after performing periodic detection on the network used by the target virtual machine based on the data path binding table and the port binding table, the above method further includes: determining the number of calls to the target virtual machine through the Internet Explorer interface during the periodic detection; in the case where the number of calls is less than a preset number, identifying the multiple detection service nodes associated with the target virtual machine as normally bound nodes; in the case where the number of calls is greater than or equal to the preset number, determining to re-bind the multiple detection service nodes associated with the target virtual machine.

[0067] In the present example embodiment, a detection service node binding state evaluation mechanism based on the number of calls is introduced to optimize the stability and efficiency of the target virtual machine network connectivity detection. After completing the periodic detection of the target virtual machine network, this mechanism comes into play by tracking the number of calls to a specific interface - the Internet Explorer (which can be regarded as a probe or tool for detecting network connectivity) to dynamically evaluate the binding state of the multiple detection service nodes related to the target virtual machine.

[0068] Specifically, the number of invocations of the above interface for detecting the network connectivity of the target virtual machine within a certain period is counted. This counting operation provides a quantitative basis for subsequent binding state evaluation. If the number of invocations is less than a preset threshold number, it usually implies that the multiple detection service nodes associated with the target virtual machine are stable and have not appeared abnormal situations, so these nodes will be marked as "normal binding nodes", indicating that their current binding state is valid and does not need to be adjusted.

[0069] However, if the number of invocations reaches or exceeds the preset threshold, it may indicate that there are some unstable factors, such as network fluctuations, node failures, or sudden increases in detection requirements, affecting the normal detection. In this case, a re-binding decision process will be triggered to re-evaluate and bind the multiple detection service nodes associated with the target virtual machine. This process may involve redistributing detection requests to other more stable nodes, or dispersing the load by adding new detection service nodes to ensure the high availability of detection services and the accuracy of detection results.

[0070] Through the above mechanism, detection can flexibly respond to changes in network environment on the basis of ensuring detection continuity, automatically adjust the binding state of detection nodes, and realize dynamic optimization configuration of detection resources. This method not only improves the response ability and stability of detection services, but also provides cloud platform operation and maintenance personnel with more intuitive and more detailed network state monitoring means, which helps to discover and solve potential network problems in time, and ensures the communication quality between virtual machines and user experience.

[0071] In an exemplary embodiment, before periodically detecting the network used by the target virtual machine based on the datapath binding table and the port binding table, the above method further comprises: loading the detection service node list corresponding to the virtual machine network from the southbound database; calculating the hash value corresponding to each detection service node table entry in the detection service node list to obtain multiple node hash values; matching the target hash value corresponding to the node where the target virtual machine is located with the multiple node hash values; and determining the target detection service node that synchronizes the detection result to the target virtual machine according to the matching result.

[0072] In this exemplary embodiment, a pre-processing procedure is designed to intelligently determine which detection service nodes will be responsible for synchronizing the detection result to the target virtual machine before periodically detecting the network of the target virtual machine based on the datapath binding table (Datapath_Binding) and the port binding table (Port_Binding). The core of this procedure is to ensure efficient and accurate transmission of detection results through hash calculation and matching.

[0073] First, the detection service node list related to the virtual machine network is loaded from the south database, which contains all available detection service node information and is the basis for subsequent hash matching and node selection. After loading the node list, hash value calculation is performed on each detection service node entry in the list, which generates multiple node hash values, each corresponding to a detection service node as its unique identifier in the subsequent process.

[0074] Subsequently, the hash value corresponding to the target virtual machine node is calculated, which is called the target hash value. By matching the target hash value with the multiple node hash values calculated earlier, the detection service node related to the target virtual machine can be quickly located. This hash matching mechanism is not only fast, but also avoids potential problems such as name conflicts or format changes when directly relying on node names or addresses for matching, improving the robustness and efficiency of processing.

[0075] Finally, one or more target detection service nodes are determined based on the results of hash matching, which will be responsible for synchronizing the latest detection results to the target virtual machine. This determination process ensures that the virtual machine can obtain network status updates from the most suitable detection service node, avoiding waste of resources and delay of detection results. Through the above pre-processing, an efficient subsequent process of periodic network detection, i.e. detection result synchronization, can be provided, thereby optimizing the performance of the entire detection system and improving the accuracy and response speed of virtual machine network connectivity detection.

[0076] In summary, the detection service node selection strategy based on hash matching in this embodiment is a key step before periodic detection of virtual machine network, which realizes intelligent determination of detection result synchronization nodes by calculating and comparing hash values, providing strong technical support for network operation and maintenance of cloud platforms.

[0077] In one example embodiment, after controlling the target interface used by the target virtual machine to perform periodic detection on the network corresponding to the target interface through the time point parameter of at least three interface types, the above method further comprises: determining the detection frequency corresponding to each interface type of the at least three interface types, and the network quality parameter corresponding to the virtual machine network; in the case that the network quality parameter is greater than the preset network quality parameter, increasing the frequency corresponding to the detection frequency; in the case that the network quality parameter is less than or equal to the preset network quality parameter, reducing the frequency corresponding to the detection frequency.

[0078] In this exemplary embodiment, a strategy of dynamically adjusting the detection frequency is proposed, aiming to optimize the efficiency of periodic detection of target virtual machine network connectivity according to the actual quality parameters of the virtual machine network. After detecting the target interfaces of at least three interface types based on time point parameters, the dynamic correlation between the detection frequency of these interface types and the network quality parameters will be analyzed in depth to achieve intelligent and efficient network state monitoring.

[0079] The determination of detection frequency is based on the functional characteristics and importance of each interface type, which refers to the number of detections of the target virtual machine network through a specific interface within a certain time. For example, the first interface type may frequently detect the real-time connectivity of the network, while the second interface type may be used to periodically clean up expired detection data, and the third interface type is responsible for detecting the health status of the service. The detection frequency of each interface type is pre-set according to its role and demand in monitoring network health.

[0080] The network quality parameters corresponding to the virtual machine network include key indicators such as network latency, packet loss rate, and bandwidth utilization, which directly reflect the current state and performance of the network. The pre-set network quality parameter is a threshold value used to distinguish between good and bad network quality.

[0081] When the network quality parameter is detected to exceed the pre-set threshold, i.e. the network performs better than expected, it will automatically increase the detection frequency of the interface type directly related to network connectivity. The logic behind this strategy is that in a high-quality network environment, more frequent detection can capture small changes in network status in a timely manner, helping to prevent potential network failures and ensuring stable and efficient communication between virtual machines.

[0082] Conversely, if the network quality parameter is less than or equal to the pre-set threshold, indicating poor network performance or potential problems, the detection frequency should be appropriately reduced. Reducing the detection frequency is to avoid further burdening the network under already tight network conditions due to frequent detection, causing performance degradation. At the same time, lower detection frequency can also reduce resource consumption of the detection service node, ensuring that the detection service node can maintain its stable operation in an inefficient network environment and will not crash or respond slowly due to detection activities.

[0083] Through the above mechanism of dynamically adjusting the detection frequency, detection can more intelligently respond to fluctuations in the network environment, not only achieving more fine-grained network state monitoring in good network conditions, but also avoiding unnecessary resource waste when the network quality is poor, ensuring the efficiency of detection activities and the stability of the detection service. This adaptive network detection strategy provides strong technical support for network operation and optimization of cloud platforms, helping to improve the reliability and user experience of virtual machine networks.

[0084] In one exemplary embodiment, before binding the switch port with the detection service node, the virtual machine network, the above method further comprises: receiving a health report uploaded periodically by the detection service node; identifying the detection service node as a forbidden binding node in the case that the health report indicates that the detection service node is in a fault state; identifying the detection service node as a standby binding node in the case that the health report indicates that the detection service node is in a non-operational state.

[0085] In the present exemplary embodiment, a health state monitoring and node binding control mechanism is introduced, aiming to ensure that the detection service node is in a healthy and available state before binding the switch port with the detection service node, the virtual machine network. This mechanism continuously evaluates the operational state of the node by receiving health reports uploaded periodically by the detection service node, and intelligently determines the binding eligibility of the node, ensuring the stability and reliability of network detection.

[0086] Firstly, health reports from the detection service nodes are received periodically, which contain key information such as the current operational state, resource usage, and detection task execution efficiency of the nodes. By analyzing these health reports, the health level of each detection service node can be grasped in real time, providing important basis for subsequent node binding decisions.

[0087] If the health report reveals that a certain detection service node is in a fault state, such as node hardware failure, software exception, or unstable network connection, the detection service node will be quickly identified as a "forbidden binding node". This means that the node will not be selected for binding with the switch port and the virtual machine network until the fault is resolved, avoiding the potential negative impact of the faulty node on the quality and overall performance of network detection.

[0088] On the contrary, if a detection service node is shown in the health report as a non-operational state, i.e., the node is not currently performing any detection tasks, but its hardware and software environment are in good condition, it will be identified as a "standby binding node". These standby nodes can be quickly enabled when needed for network detection tasks, improving the flexibility and utilization of detection resources, ensuring a quick response to sudden detection needs, and also providing preparation for the replacement of faulty nodes.

[0089] Through the above mechanism, the health state of the detection service node can be accurately evaluated before binding the switch port with the detection service node, the virtual machine network, ensuring that only healthy and available nodes participate in binding, thereby improving the accuracy and efficiency of network detection, reducing the risk of detection failure caused by binding faults or non-operational state nodes, and providing a robust guarantee for virtual machine network connectivity detection in cloud environments. This method not only optimizes the management of detection resources, but also improves the overall stability and user experience of detection.

[0090] In an example embodiment, after creating a switch port for detecting the second layer gateway logic for the logical router, the method further comprises: analyzing the current binding state of the switch port to confirm whether it has been successfully bound with the target detection service node and the virtual machine network; in the case that the analysis result shows that the switch port is not bound or the binding fails, automatically selecting an available detection service node and trying to rebind; after the rebinding succeeds, recording the latest binding information of the switch port and updating the data path binding table and the port binding table to ensure that the subsequent detection activities can be based on the latest binding state.

[0091] In an example embodiment, after periodically detecting the network used by the target virtual machine based on the data path binding table and the port binding table, the method further comprises: according to the detection result, evaluating the connectivity quality of the target virtual machine network and generating a corresponding quality report; in the case that the connectivity quality is lower than a preset threshold, automatically triggering a network repair mechanism, wherein the network repair mechanism is used to restore network connectivity through optimization of the path mode and / or adjustment of the configuration parameters; after the network repair operation is completed, re-performing the periodic detection to verify the repair effect, and adjusting the network configuration parameters of the target virtual machine according to the new detection result.

[0092] In an example embodiment, in the case that it is determined that the target virtual machine in the virtual machine network needs to be detected, the method further comprises: predicting the network demand change within the target time period based on the network usage of the target virtual machine and the historical detection data; and dynamically adjusting the binding strategy in the data path binding table and the port binding table according to the prediction result.

[0093] In an example embodiment, after dynamically adjusting the binding strategy in the data path binding table and the port binding table according to the prediction result, the method further comprises: monitoring the performance parameters of the virtual machine network in real time; and in the case that the performance parameters are lower than a preset detection parameter, sending prompt information to the user of the target virtual machine that the virtual machine needs to be configured and optimized.

[0094] The execution subject of the above steps can be a server, a terminal, a cloud platform, etc., but is not limited thereto.

[0095] In order to facilitate understanding of the embodiments of the present application, the related scenarios are explained and described, but the present application is not limited thereto.

[0096] As an optional implementation, the optional embodiment of the present application proposes a method for creating associated resources by listening to the virtual machine network through an asynchronous process, solving the problem of affecting the performance of the original resource operation. By designing the overall interaction framework and processing flow of the detection service, the detection function is realized, and the original function is affected to a small extent.

[0097] Optionally, the process design of the detection service includes: adding a sub-process network probe Network-probe process in a neutron-server service, which is used to automatically create a detection network related open virtual network resource. A detection service node is scheduled to bind to each router. It is also used to periodically obtain detection results from each detection service. In the original application programming interface (API) worker in the neutron-server service, listening to the detection service reporting is added, and detection service information is recorded. A neutron-probe-server service is added, which is used to be deployed in the detection service node, mainly provides a REST interface service for the neutron-server to obtain detection results. It is also used to actually send messages to detect virtual machine connectivity.

[0098] As an optional implementation, Figure 3 is a schematic diagram of process interaction of the detection service according to an embodiment of the application; the specific interaction content is as follows:

[0099] 1, reporting detection service information; 2, notifying detection service information; 3, storing available detection service nodes; 4, notifying the creation of a logical router; 5, obtaining available detection service nodes, initializing available virtual local area networks, and assigning to detection ports; 6, connecting a detection network on a logical router, creating a detection network, a detection port, etc.; 7, obtaining detection ports bound to the node, virtual machine information, etc.; 8, obtaining detection results.

[0100] That is, through the above interaction process, most of the processing is put into the new process sub-process Network-probe and the new service neutron-probe-server, reducing the impact on the original application programming interface worker, and reducing the pressure on the original northbound database ovn-nb and southbound database ovn-sb in the original database.

[0101] Optionally, the sub-process Network-probe process is a new process added in the neutron-server service, which mainly has the following functions: 1, listening to the creation of a logical router (Logical_Router) of a southbound database service, automatically corresponding to the logical router and connecting, and automatically creating an L2 gateway logical switch port (l2gatewayLogica_Switch_Port) for detection. Schedule the L2 gateway port (detection port) to bind the detection node and the virtual local area network. 2, periodically obtain detection results of the detection node. 3, probe the detection node service state and do high availability processing.

[0102] The implementation of the process is: based on the process neutron_lib.worker.BaseWorker, a NetworkProbeWorker sub-process is added, which corresponds to the description "network probe" for pulling up a new process. A Network-probe sub-process is added in neutron. When implementing the plug-in method, the get_workers method returns [NetworkProbeWorker()] to implement the neutron-server to pull up the Network-probe process when starting.

[0103] Design of process connection to southbound database: the process no longer inherits the method of application programming interface worker process connection to southbound database, because the application programming interface worker process connection to southbound database listens to too many tables, and the sub-process Network-probe process only needs to listen to logical router, logical switch (Logical_Switch), logical router port (Logical_Router_Port), and logical switch port (Logical_Switch_Port). Therefore, the design is that when the plug-in sub-process Network-probe listens to the sub-process Network-probe, a southbound database connection is newly initialized, and the table items of the southbound database are listened to on demand. In event processing, only the creation and deletion of logical routers are processed. Unnecessary memory occupation and event processing occupation are reduced.

[0104] Resource creation design: when creating a detection port and an L2 gateway port, the external identification external_ids in the logical switch port is written with the router identification router_id, which is convenient for detecting the association between the detection virtual machine and the service.

[0105] Binding detection nodes: each L2 gateway port needs to be bound to a detection node for detection. The sub-process Network-probe process selects a node for binding according to the available detection nodes recorded by the application programming interface worker process according to the minimum binding principle. If there is no node and virtual local area network binding, the detection port is empty, and waits for the router to be removed, the detection port to be unbound, or a new detection node to be added.

[0106] Detection node detection: the sub-process Network-probe periodically detects whether there is a new detection service node, and writes it to the database. If a new detection service node is found, it is checked whether there is a detection port that is not bound to a detection node, and the detection port is bound. The sub-process Network-probe periodically calls the detection service probe interface. If the detection node probe interface cannot be called for 3 times in a row, all detection ports bound to the detection node are re-bound.

[0107] Southbound database event multi-node processing design: the current design starts a sub-process Network-probe process for each neutron-server service, and the neutron-server service can run on multiple nodes. Therefore, there can be multiple sub-process Network-probe processes in a cluster. In order to avoid repeated processing, a new hash ring group named sub-process Network-probe is added in neutron, and each sub-process Network-probe process registers as a member of the group. Through hash resource identification, it is determined which node processes the event. In terms of hash ring member keep-alive update, it is different from the original ml2 hash ring member keep-alive in the application programming interface work process, which is updated by the Maintenance maintenance process. The sub-process Network-probe process is updated periodically by itself to avoid the occurrence of member false death.

[0108] Acquiring detection result process design: since there can be multiple sub-process Network-probe processes, there is still a conflict problem when acquiring detection results from each detection node. Since the newly designed sub-process Network-probe is not connected to the southbound database, it cannot use the hash ring selection method. At each period, the current detection node list is obtained from the database, and the matching member is calculated by calculating the hash value. When the matching member is the current node, the current node acquires the detection result from the detection node.

[0109] Sub-process Network-probe-server service: a neutron-probe-server service is added for deployment on the detection service node. The main functions include: designing the neutron-probe-server service to use the REST interface service to provide the detection result for the neutron-server, avoiding using the southbound database to provide the result, and causing the southbound database cluster to be unstable. It is also used to actually send messages to detect virtual machine connectivity.

[0110] Service registration: design neutron-probe-server to connect southbound database, write its service address and provided API service port into the Chassis_Private table of southbound database external_ids: probe-server = xxx, to realize the reporting of its own service. Neutron-server application programming interface work process acquires all detection node services by acquiring Chassis_Private table data.

[0111] Security design: neutron-probe-server provides detection results, in order to ensure that the caller is neutron-server, you can configure the trusted source address, only for the source address of the configuration item, provide results. At the same time, the design of sub-process Network-probe-server only provides hypertext transfer protocol secure service, request must be encrypted bidirectionally, encryption certificate must be issued by the same certificate authority.

[0112] As an optional implementation, the process of obtaining the virtual machine to be detected includes: connecting to the southbound database, listening to the Datapath_Binding table and the Port_Binding table. The specific steps include:

[0113] I. Get all Port_Binding from the southbound database, with the condition that type = l2gateway and chassis is the current node.

[0114] II. Traverse the Port_Binding list obtained in step I to obtain router_id from externl_ids, and obtain Datapath_Binding corresponding to all routers according to router_id.

[0115] III. Get all Port_Binding, with the condition that type = patch, and optionally, datapath is the Datapath_Binding obtained in step II, to obtain all router interfaces.

[0116] IV. Traverse the Port_Binding list obtained in step III to obtain the peer attribute from the options, to obtain all logical switch interfaces corresponding to the router interfaces.

[0117] V. Traverse all logical switch interfaces to obtain the corresponding datapath, to obtain all Datapath_Binding corresponding to the logical switches.

[0118] VI. Get all Port_Binding, with the condition that type = empty string and the corresponding datapath is the Datapath_Binding obtained in step V, to obtain all virtual machine ports. Provide detection results Design neutron-probe-server to detect the network of virtual machines according to the configuration period, and store the detection results in the memory. Provide detection results through REST API, and provide the following 3 interfaces.

[0119] Interface 1: Return all results after t1 according to the provided time t1.

[0120] Interface 2: delete the result before t2 time in memory according to the provided time t2.

[0121] Interface 3: provide ping interface for neutron-server to ping the current service.

[0122] When neutron-server service gets the detection result, set t1 time according to the result stored in the database, call interface 1 to get the detection result, store the detection result, set t2 according to the result, call interface 2 to inform the release of memory. Through the design of 2 interfaces, avoid neutron-server restart and less get the result. Also avoid storing the detection result all the time, causing the detection result to occupy too much memory.

[0123] The specific design of the application programming interface work process includes: since the original neutron-server service contains the application programming interface process and has listened to the southbound database. Then the main adjustment process is to listen to the southbound database table item Chassis_Private, judge whether the node is a detection node by getting whether Chassis_Privateexternal_ids contains the probe-server attribute, and get the address of the service provided according to the probe-server value.

[0124] When it is found that the detection node is increased: if the node information exists, do not process. If it does not exist, write the node information into the database and mark it as to be used. When it is found that the detection node is reduced: if the node information does not exist, do not process. If it exists, mark the node information as to be discarded.

[0125] Through application of the above embodiments, the open virtual network is interfaced under the neutron architecture, and the detection service is connected with the virtual machine network. The new detection service is realized by adding a new sub-process Network-probe process, without affecting the performance of the original application programming interface process. Through the architecture design, only the connection to the southbound database is added, and the pressure on the original open virtual network cluster is reduced as much as possible. Meanwhile, the open virtual network resources required for automatically connecting the detection network are created by the new process listening to the logical router, without using the original in-process notification mode, so as to reduce the influence on the original router operation. The new process is proposed to separately use the southbound database connection, so as to accurately monitor the resources and reduce the pressure on the southbound database. The application programming interface working process is proposed to listen to the southbound database, record the detection service, and use the new process for binding and scheduling, without introducing a new connection to the southbound database and introducing much pressure processing to the application programming interface working process. The new process is proposed to detect the service alive and detect the port binding node switching, so as to realize high availability of the detection service. The detection service is proposed to provide the detection result by using the rest interface, without introducing additional pressure to the open virtual network cluster. The detection service is proposed to provide a method for releasing memory, so as to guarantee efficient use of server or cloud platform resources.

[0126] Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and necessary general hardware platforms, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application or the parts that make contributions to the related art can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to execute the methods described in the various embodiments of the present application.

[0127] In the present embodiment, a virtual machine network detection device is also provided, which is used to implement the above embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and is contemplated.

[0128] Figure 4 is a structural block diagram of the virtual machine network detection device according to the embodiments of the present application, as shown in Figure 4 , the device comprises:

[0129] The first determining module 42 is used to monitor the logical routers created in the southbound database and determine the logical switches associated with the logical routers;

[0130] The binding module 44 is used to create a switching port for detecting the second-layer gateway logic for the logical router when the logical router and the logical switch establish a connection relationship, and bind the switching port to the detection service node and the virtual machine network;

[0131] The second determining module 46 is used to determine the data path binding table and port binding table corresponding to the target virtual machine based on the binding result when it is determined that the target virtual machine in the virtual machine network needs to be detected.

[0132] The detection module 48 is used to periodically detect the network used by the target virtual machine based on the data path binding table and the port binding table, so as to adjust the configuration parameters of the target virtual machine according to the detection results.

[0133] The aforementioned device focuses on monitoring the creation events of logical routers in the Southbound Database (OVN-SB) to quickly identify the logical switches associated with those routers. Once a connection is established between the logical router and the logical switch, a Layer 2 gateway logical switch port for network detection is automatically created and bound to the detection service node and the virtual machine network. The target virtual machine to be detected is identified within the virtual machine network, and based on the previous binding results, the data path binding table and port binding table associated with the target virtual machine are accurately determined. Using the data path binding table and port binding table provided by the second determination module, periodic connectivity checks are performed on the network used by the target virtual machine. The detection results are used to adjust the network configuration parameters of the target virtual machine, such as network paths and VLAN allocation, to ensure network connectivity. This approach achieves automated detection of virtual machine network connectivity while reducing the impact on cloud platform performance, improving detection accuracy and efficiency, and ensuring high availability of the detection service. It reduces the dependence on the OVN-SB database, avoids cluster instability issues that may be caused by excessive database pressure, and optimizes the resource allocation and management of the detection service nodes. It also solves the problem that virtual machine network connectivity detection often affects the overall virtual machine service performance, resulting in low efficiency of virtual machine network detection.

[0134] Optionally, the detection module is further configured to determine at least three interface types for detecting the target virtual machine based on the data path binding table and the port binding table, wherein the at least three interface types include a first interface type corresponding to a first result of detection of the target virtual machine by all detection service nodes after a first time point, a second interface type corresponding to a second result of detection of the target virtual machine by the detection service nodes before a second time point at which the second result is deleted from the southbound database, and a third interface type corresponding to a third result of a ping operation on the target virtual machine by an internet packet explorer; set time point parameters of the at least three interface types based on historical detection data stored in the southbound database; and control target interfaces corresponding to the at least three interface types to periodically detect a network used by the target virtual machine based on the time point parameters.

[0135] Optionally, the detection module is further configured to listen to a physical host private information table item in the southbound database before or after a logical router is created in the southbound database, wherein the physical host private information table item is used to record a network state of a virtual machine network associated with a physical host; determine whether a target physical host corresponding to the target virtual machine is deployed with a detection service based on an external identifier field in the physical host private information table item; and update node information corresponding to a detection service node in the southbound database based on a determination result.

[0136] Optionally, the detection module is further configured to, in a case where the determination result indicates that the target physical host is deployed with the detection service and the detection service adds a new detection service node, acquire first node data corresponding to the new detection service node, and update the node information based on the first node data; and in a case where the determination result indicates that the target physical host is not deployed with the detection service and the detection service reduces a detection service node, acquire second node data corresponding to the reduced detection service node, and update the node information based on the second node data.

[0137] Optionally, the detection module further includes an updating unit configured to, after the first node data corresponding to the new detection service node is acquired, temporarily not update the node information based on the first node data in a case where the node information already includes partial node information identical to the first node data; and in a case where the node information does not include the partial node information identical to the first node data, write the first node data into the southbound database and mark the first node data as to-be-updated data.

[0138] Optionally, the detection module further comprises a marking unit configured to, after obtaining the second node data corresponding to the reduction detection service node, determine that the node information has been updated in a case where there is no partial node information same as the second node information in the node information; and mark the second node data as to-be-discarded usage data in a case where there is partial node information same as the second node information in the node information.

[0139] Optionally, the detection module is further configured to determine a first detection result based on the first interface type and the time point parameter; determine a second detection result based on the second interface type and the time point parameter in a case where the first detection result is stored; and determine memory information to be released by the southbound database according to the second detection result in a case where the virtual machine service corresponding to the southbound database is determined to be running normally through the third interface type.

[0140] Optionally, the apparatus further comprises an association module configured to, after periodically detecting the network used by the target virtual machine based on the data path binding table and the port binding table, obtain other detection service nodes that are not bound in the virtual machine network in a case where there is a port table entry that is not bound in the port binding table, and associate the other detection service nodes with the port table entry that is not bound.

[0141] Optionally, the apparatus further comprises a first identification module configured to, after periodically detecting the network used by the target virtual machine based on the data path binding table and the port binding table, determine a number of times of calling the target virtual machine through an Internet Control Message Protocol (ICMP) interface in the periodic detection; identify a plurality of detection service nodes associated with the target virtual machine as normally bound nodes in a case where the number of times is less than a preset number of times; and determine to re-bind the plurality of detection service nodes associated with the target virtual machine in a case where the number of times is greater than or equal to the preset number of times.

[0142] Optionally, the apparatus further comprises a calculation module configured to, before periodically detecting the network used by the target virtual machine based on the data path binding table and the port binding table, load a list of detection service nodes corresponding to the virtual machine network from the southbound database; calculate a hash value corresponding to each detection service node table entry in the list of detection service nodes to obtain a plurality of node hash values; match a target hash value corresponding to a node where the target virtual machine is located with the plurality of node hash values; and determine a target detection service node that synchronizes a detection result to the target virtual machine according to a matching result.

[0143] Optionally, the detection module is further configured to determine a detection frequency corresponding to each of the at least three interface types, and a network quality parameter corresponding to the virtual machine network; in a case where the network quality parameter is greater than a preset network quality parameter, increase the frequency corresponding to the detection frequency; in a case where the network quality parameter is less than or equal to the preset network quality parameter, decrease the frequency corresponding to the detection frequency.

[0144] Optionally, the device further comprises a second identification module configured to, before binding the switching port with the detection service node and the virtual machine network, receive a health report uploaded by the detection service node periodically; in a case where the health report indicates that the detection service node is in a failure state, identify the detection service node as a forbidden binding node; in a case where the health report indicates that the detection service node is in a non-running state, identify the detection service node as a standby binding node.

[0145] Optionally, the device further comprises a recording module configured to, after creating the switching port for detecting the second layer gateway logic for the logical router, analyze a current binding state of the switching port to confirm whether the switching port has been successfully bound with a target detection service node and a virtual machine network; in a case where the analysis result indicates that the switching port is not bound or the binding fails, automatically select an available detection service node and attempt to rebind; after the rebinding succeeds, record latest binding information of the switching port, and update the data path binding table and the port binding table to ensure that subsequent detection activities can be performed based on the latest binding state.

[0146] Optionally, the recording module further comprises a repairing unit configured to, after periodically detecting a network used by the target virtual machine based on the data path binding table and the port binding table, evaluate a connectivity quality of the target virtual machine network according to a detection result, and generate a corresponding quality report; in a case where the connectivity quality is lower than a preset threshold, automatically trigger a network repairing mechanism, wherein the network repairing mechanism is configured to restore network connectivity by optimizing a path mode and / or adjusting a configuration parameter mode; after a network repairing operation is completed, re-perform the periodic detection to verify a repairing effect, and adjust a network configuration parameter of the target virtual machine according to a new detection result.

[0147] Optionally, the second determination module further comprises a strategy unit configured to, after determining that a target virtual machine in the virtual machine network needs to be detected, predict a network demand change within a target time period based on a network usage of the target virtual machine and historical detection data; and dynamically adjust a binding strategy in the data path binding table and the port binding table according to a prediction result.

[0148] Optionally, the second determining module further comprises a prompting unit configured to monitor performance parameters of the virtual machine network in real time after dynamically adjusting the binding strategy in the data path binding table and the port binding table according to the prediction result; and send prompt information that the virtual machine needs to be configured and optimized to a user of the target virtual machine if the performance parameters are lower than preset detection parameters.

[0149] It should be noted that the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: the modules are located in the same target processor; or the modules are located in different target processors in any combination.

[0150] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the above method embodiments when running.

[0151] In an example embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0152] Embodiments of the present application also provide an electronic device, which comprises a target memory storing a computer program and a target processor configured to run the computer program to execute the steps in any of the above method embodiments.

[0153] Embodiments of the present application also provide a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps in any of the above method embodiments.

[0154] Embodiments of the present application also provide another computer program product, which comprises a non-volatile computer readable storage medium storing a computer program, and the computer program is executed by a processor to implement the steps in any of the above method embodiments.

[0155] Embodiments of the present application also provide a computer program, which comprises computer instructions stored in a computer readable storage medium; a processor of a computer device reads the computer instructions from the computer readable storage medium, and executes the computer instructions to make the computer device execute the steps in any of the above method embodiments.

[0156] The specific examples in the embodiments can refer to the examples described in the above embodiments and exemplary embodiments, and the embodiments will not be repeated here.

[0157] The skilled person can further realize that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0158] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices, and they can be realized by program codes executable by computing devices, so that they can be stored in storage devices and executed by computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be made into individual integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.

[0159] The above describes in detail the detection method, device, equipment, storage medium and program of the virtual machine network provided by the present application. The principles and implementation manners of the present application are described by applying specific examples. The above example is only used to help understand the method and core idea of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A method of detecting a virtual machine network, characterized by, The method comprises: monitoring a logical router created in a southbound database, and determining a logical switch associated with the logical router; in a case where the logical router and the logical switch establish a connection relationship, creating a switch port for detecting second layer gateway logic for the logical router, and binding the switch port with a detection service node and a virtual machine network; in a case where it is determined that a target virtual machine in the virtual machine network needs to be detected, determining a data path binding table and a port binding table corresponding to the target virtual machine according to a binding result; periodically detecting a network used by the target virtual machine based on the data path binding table and the port binding table, to adjust a configuration parameter of the target virtual machine according to a detection result; wherein periodically detecting the network used by the target virtual machine based on the data path binding table and the port binding table comprises: determining at least three interface types for detecting the target virtual machine based on the data path binding table and the port binding table, wherein the at least three interface types comprise: a first interface type corresponding to a first result of detection of the target virtual machine by all detection service nodes after a first time point, a second interface type corresponding to a second result of detection of the target virtual machine by the detection service node before a second time point of deletion of the southbound database, and a third interface type corresponding to a third result of detection of the target virtual machine by an internet packet explorer interface; setting time point parameters of the at least three interface types through historical detection data stored in the southbound database; controlling a target interface corresponding to the at least three interface types to periodically detect the network used by the target virtual machine through the time point parameters.

2. The method of claim 1, wherein, Before or after monitoring the logical router created in the southbound database, the method further comprises: monitoring a physical host private information table item in the southbound database, wherein the physical host private information table item is used to record a network state of a virtual machine network associated with a physical host; determining whether a target physical host corresponding to the target virtual machine deploys a detection service according to an external identifier field in the physical host private information table item, and updating node information corresponding to a detection service node in the southbound database based on a determination result.

3. The method of claim 2, wherein, Updating the node information corresponding to the detection service node in the southbound database based on the determination result comprises: in a case where the determination result indicates that the target physical host has deployed the detection service, and the detection service adds a new detection service node, obtaining first node data corresponding to the new detection service node, and updating the node information using the first node data; in a case where the determination result indicates that the target physical host has not deployed the detection service, and the detection service reduces a detection service node, obtaining second node data corresponding to the reduced detection service node, and updating the node information using the second node data.

4. The method of claim 3, wherein, After obtaining the first node data corresponding to the new detection service node, the method comprises: In a case where the same part of node information as the first node data exists in the node information, the first node data is not used to update the node information; In a case where the same part of node information as the first node data does not exist in the node information, the first node data is written into the southbound database, and the first node data is marked as to-be-updated usage data.

5. The method of claim 3, wherein, After the second node data corresponding to the reduction detection service node is acquired, the method further comprises: In a case where the same part of node information as the second node information does not exist in the node information, it is determined that the node information has been updated; In a case where the same part of node information as the second node information exists in the node information, the second node data is marked as to-be-discarded usage data.

6. The method of claim 1, wherein, Periodic detection of a network used by the target virtual machine by the target interface corresponding to the at least three interface types is controlled by the time point parameter, comprising: determining a first detection result based on the first interface type and the time point parameter; in a case where the first detection result is completed storage, determining a second detection result by the second interface type and the time point parameter; in a case where it is determined that the virtual machine service corresponding to the southbound database is running normally through the third interface type, determining memory information to be released by the southbound database according to the second detection result.

7. The method of claim 1, wherein, After periodic detection of the network used by the target virtual machine based on the data path binding table and the port binding table, the method further comprises: in a case where there is an unbound port table item in the port binding table, acquiring other detection service nodes unbound in the virtual machine network, and associating the other detection service nodes with the unbound port table item.

8. The method of claim 1, wherein, After periodic detection of the network used by the target virtual machine based on the data path binding table and the port binding table, the method further comprises: determining the number of calls of the target virtual machine through the internet explorer interface in periodic detection; in a case where the number of calls is less than a preset number, marking multiple detection service nodes associated with the target virtual machine as normally bound nodes; in a case where the number of calls is greater than or equal to a preset number, determining to rebind multiple detection service nodes associated with the target virtual machine.

9. The method of claim 1, wherein, Before periodic detection of the network used by the target virtual machine based on the data path binding table and the port binding table, the method further comprises: loading a detection service node list corresponding to the virtual machine network from the southbound database; calculating a hash value corresponding to each detection service node table item in the detection service node list to obtain multiple node hash values; matching a target hash value corresponding to a node where the target virtual machine is located with the multiple node hash values; determining a target detection service node for synchronizing detection results to the target virtual machine according to the matching result.

10. The method of claim 1, wherein, After periodic detection of the network used by the target virtual machine by the target interface corresponding to the at least three interface types is controlled by the time point parameter, the method further comprises: determining a detection frequency corresponding to each of the at least three interface types, and a network quality parameter corresponding to the virtual machine network; in a case where the network quality parameter is greater than a preset network quality parameter, increasing a frequency corresponding to the detection frequency; in a case where the network quality parameter is less than or equal to the preset network quality parameter, decreasing the frequency corresponding to the detection frequency.

11. The method of claim 1, wherein, Before binding the exchange port with the detection service node and the virtual machine network, the method further comprises: receiving a health report uploaded by the detection service node periodically; in a case where the health report to the detection service node is in a failure state, identifying the detection service node as a forbidden binding node; in a case where the health report to the detection service node is in a non-running state, identifying the detection service node as a standby binding node.

12. The method of claim 1, wherein, After creating the exchange port for detecting the second layer gateway logic for the logical router, the method further comprises: analyzing a current binding state of the exchange port to confirm whether it has been successfully bound with a target detection service node and a virtual machine network; in a case where the analysis result shows that the exchange port is not bound or the binding fails, automatically selecting an available detection service node and attempting to rebind; after the rebinding succeeds, recording latest binding information of the exchange port, and updating the data path binding table and the port binding table to ensure that subsequent detection activities can be based on the latest binding state.

13. The method of claim 12, wherein, After periodically detecting a network used by the target virtual machine based on the data path binding table and the port binding table, the method further comprises: according to the detection result, evaluating a connectivity quality of the target virtual machine network, and generating a corresponding quality report; in a case where the connectivity quality is lower than a preset threshold, automatically triggering a network repair mechanism, wherein the network repair mechanism is used to restore network connectivity by optimizing a path mode and / or adjusting a configuration parameter mode; after the network repair operation is completed, re-performing the periodic detection to verify the repair effect, and adjusting a network configuration parameter of the target virtual machine according to a new detection result.

14. The method of claim 1, wherein, After determining that a target virtual machine in the virtual machine network needs to be detected, the method further comprises: based on a network usage of the target virtual machine and historical detection data, predicting a network demand change within a target time period; according to a prediction result, dynamically adjusting a binding strategy in the data path binding table and the port binding table.

15. The method of claim 14, wherein, After dynamically adjusting the binding strategy in the data path binding table and the port binding table according to the prediction result, the method further comprises: monitoring performance parameters of the virtual machine network in real time; in a case where the performance parameters are lower than a preset detection parameter, sending prompt information that the virtual machine needs to be configured and optimized to a usage object of the target virtual machine.

16. A detection apparatus of a virtual machine network, characterized by comprising: comprises: a first determination module configured to listen to a logical router created in a southbound database, and determine a logical switch associated with the logical router; The binding module is configured to create a switch port for detecting a second layer gateway logic for the logical router and bind the switch port with a detection service node and a virtual machine network when the logical router establishes a connection relationship with the logical switch; The second determining module is configured to determine a data path binding table and a port binding table corresponding to a target virtual machine according to the binding result when it is determined that the target virtual machine in the virtual machine network needs to be detected; The detection module is configured to periodically detect a network used by the target virtual machine based on the data path binding table and the port binding table, and adjust configuration parameters of the target virtual machine according to a detection result. The detection module is further configured to determine at least three interface types for detecting the target virtual machine based on the data path binding table and the port binding table, wherein the at least three interface types include a first interface type corresponding to a first result of detection of the target virtual machine by all detection service nodes after a first time point, a second interface type corresponding to a second result of detection of the target virtual machine by the detection service nodes before a second time point of deletion of a southbound database, and a third interface type corresponding to a third result of a ping of the target virtual machine by an internet packet explorer interface; time point parameters of the at least three interface types are set through historical detection data stored in the southbound database; and a target interface corresponding to the at least three interface types is controlled to periodically detect a network used by the target virtual machine through the time point parameters.

17. An electronic device, comprising: Comprising: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the detection method of the virtual machine network as claimed in any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement the steps of the detection method of the virtual machine network as claimed in any one of claims 1 to 15.

19. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the detection method of the virtual machine network as claimed in any one of claims 1 to 15.

Citation Information

Patent Citations

  • Method, device and equipment for testing open type virtual network cluster and medium

    CN118433061A

  • Virtual machine network connectivity test method and device, medium and product

    CN120528842A