Virtual machine performance monitoring method and device, storage medium and electronic equipment
By receiving the virtual machine identification and querying time period input by the user, the log files generated by the computing node of the target virtual machine are obtained, the connection information is read and the target image is generated, which solves the problem of untimely monitoring of virtual machine performance and realizes real-time monitoring and rapid fault repair.
Patent Information
- Application Number
- CN202510427695.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the use of intermediate transmission equipment for virtual machine data connection tracking statistics leads to untimely monitoring of virtual machine performance, which leads to a long problem of fault repair time.
By receiving the virtual machine identification and query time period input by the user, the log files generated by the computing node of the target virtual machine are obtained, the connection information is read and the target image is generated, real-time log analysis and dynamic data visualization are realized, and the performance of the virtual machine is monitored.
Real-time monitoring of virtual machine connection performance, improve fault detection speed and reduce fault repair time.
Smart Images

Figure CN120256246A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical fields of cloud computing and virtualization, and in particular, to a method, device, storage medium, and electronic device for monitoring the performance of virtual machines. Background Art
[0002] Today, with the increasing popularity of cloud computing and virtualization technologies, virtual machines, as important infrastructures for hosting business applications, their performance stability and network connection quality are directly related to the user experience of cloud services and business continuity. Traditional virtual machine performance monitoring, especially in connection tracking, faces a series of technical challenges, especially when using intermediate transmission devices for data connection tracking statistics (in connection tracking, a data stream defined by a tuple represents a connection, and connection tracking is used in intermediate transmission devices to track connection status). These problems are particularly prominent.
[0003] Intermediate transmission devices, such as network switches, routers, and firewalls, etc., when performing connection tracking, mainly monitor network communication by recording the status information of each data stream (i.e., connection). This process involves a large amount of status change records and data processing. However, in the prior art, the performance monitoring of intermediate transmission devices and data connection tracking often rely on the device's own log records and analysis, resulting in problems such as untimely monitoring and data processing delays. Especially for large-scale cloud platforms, the number of connections between virtual machines and external networks may reach millions or even more, which brings huge pressure to the connection tracking ability of intermediate transmission devices. When the connection tracking data cannot be updated in a timely manner, it is difficult for operation and maintenance personnel to grasp the network status and performance indicators of virtual machines in real time. Especially when the number of virtual machine connections reaches the upper limit and there are frequent disconnections and reconstructions, it is impossible to quickly identify performance bottlenecks, resulting in an extended fault response time.
[0004] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0005] The main purpose of the present application is to provide a method, device, storage medium, and electronic device for monitoring the performance of virtual machines, so as to at least solve the technical problem in the prior art that using an intermediate transmission device to perform tracking statistics on the data connections established by a virtual machine results in untimely monitoring of the virtual machine performance, and thus easily causes a long virtual machine fault repair time.
[0006] To achieve the above object, according to one aspect of the present application, a method for monitoring the performance of a virtual machine is provided, including: receiving a virtual machine identifier input by a user and a query time period specified by the user to query the performance of the virtual machine; determining a target virtual machine specified by the user to query according to the virtual machine identifier; obtaining a log file generated by a computing node corresponding to the target virtual machine during the query time period, where the computing node is used to continuously collect performance data of the target virtual machine through a target script and output it to a specified directory to generate a log file; reading connection information of the target virtual machine during the query time period from the log file, where the connection information at least includes the number, type, establishment time, and status change information of the data connections established by the target virtual machine; generating a target image according to the connection information.
[0007] Optionally, obtaining the log file generated by the computing node corresponding to the target virtual machine during the query time period includes: detecting whether the size of the log file generated by the computing node exceeds a preset threshold; in the case where the size of the log file exceeds the preset threshold, splitting the log file into N sub-files, where N is an integer greater than 1, and the size of each sub-file does not exceed the preset threshold; sequentially obtaining each sub-file from the computing node according to the generation time of each sub-file, and after obtaining all N sub-files, merging the N sub-files into a log file.
[0008] Optionally, in the case where the size of the log file exceeds the preset threshold, splitting the log file into N sub-files includes: splitting the log file into N sub-files according to the recording time of the data in the log file, where the recording time of the data in the i-th sub-file is earlier than the recording time of the data in the (i + 1)-th sub-file, and i is a positive integer less than N.
[0009] Optionally, generating a target image according to the connection information includes: in the case where the data connections established by the target virtual machine include M types of data connections, generating M target images according to the connection information, where the j-th target image among the M target images is used to represent the number, establishment time, and status change information of the j-th type of data connection established by the target virtual machine, M is an integer greater than or equal to 1, and j is a positive integer less than or equal to M.
[0010] Optionally, generating a target image according to the connection information includes: determining the disconnection duration and reconstruction times of each data connection established by the target virtual machine during the query time period according to the status change information in the connection information; in the case where the ratio of the disconnection duration of any one data connection established by the target virtual machine during the query time period to the total duration of the query time period is greater than a preset ratio, or the reconstruction times are greater than a preset number of times, determining that the data connection is a target data connection; generating a target image according to the target data connection, where the target image is used to represent the number, type, establishment time, and status change information of the target data connection.
[0011] Optionally, before receiving the virtual machine identifier input by the user and the query time period for specifying the query of the virtual machine performance, the method for monitoring the virtual machine performance further includes: collecting the network addresses of each virtual machine in the cloud platform; generating a target script according to the network address of each virtual machine and a table query function, where the table query function is used to determine the table file data corresponding to the virtual machine corresponding to the network address with the network address as an index; deploying the target script to a computing node and setting the execution permission and execution time of the computing node for the target script.
[0012] Optionally, after deploying the target script to the computing node and setting the execution permission and execution time of the computing node for the target script, the method for monitoring the virtual machine performance further includes: generating a scheduled execution task for the target script according to the execution permission and execution time; controlling the target script to collect the performance data of the target virtual machine according to the scheduled execution task; recording the performance data collected by the target script in a log file.
[0013] To achieve the above object, according to another aspect of the present application, there is also provided a device for monitoring the performance of a virtual machine, including: a receiving unit, receiving the virtual machine identifier input by the user and the query time period for specifying the query of the virtual machine performance; a determining unit, determining the target virtual machine specified by the user to query according to the virtual machine identifier; an obtaining unit, obtaining the log file generated by the computing node corresponding to the target virtual machine during the query time period, where the computing node is used to continuously collect the performance data of the target virtual machine through the target script and output it to a specified directory to generate a log file; a reading unit, reading the connection information of the target virtual machine during the query time period from the log file, where the connection information at least includes the number, type, establishment time, and status change information of the data connections established by the target virtual machine; a generating unit, generating a target image according to the connection information.
[0014] Optionally, the obtaining unit includes: a first detection subunit, a first splitting subunit, and a first merging subunit. Among them, the first detection subunit is used to detect whether the size of the log file generated by the computing node exceeds a preset threshold; the first splitting subunit is used to split the log file into N sub-files when the size of the log file exceeds the preset threshold, where N is an integer greater than 1, and the size of each sub-file does not exceed the preset threshold; the first merging subunit is used to sequentially obtain each sub-file from the computing node according to the generation time of each sub-file, and after obtaining all N sub-files, merge the N sub-files into a log file.
[0015] Optionally, the first splitting subunit includes: a first splitting module, configured to split a log file into N sub-files according to the recording time of the data in the log file, where the recording time of the data in the i-th sub-file is earlier than that in the (i + 1)-th sub-file, and i is a positive integer less than N.
[0016] Optionally, the generating unit includes: a first generating subunit, configured to generate M target images according to connection information when the data connections established by the target virtual machine include M types of data connections, where the j-th target image among the M target images is used to represent the quantity, establishment time, and status change information of the j-th type of data connection established by the target virtual machine, M is an integer greater than or equal to 1, and j is a positive integer less than or equal to M.
[0017] Optionally, the generating unit includes: a first determining subunit, a second determining subunit, and a second generating subunit. The first determining subunit is configured to determine the disconnection duration and reconstruction times of each data connection established by the target virtual machine during a query time period according to the status change information in the connection information; the second determining subunit is configured to determine a data connection as a target data connection when the ratio of the disconnection duration of any data connection established by the target virtual machine during the query time period to the total duration of the query time period is greater than a preset ratio or the reconstruction times are greater than a preset number of times; the second generating subunit is configured to generate a target image according to the target data connection, where the target image is used to represent the quantity, type, establishment time, and status change information of the target data connection.
[0018] Optionally, the monitoring device for virtual machine performance further includes: a first acquisition unit, a first generating unit, and a first setting unit. The first acquisition unit is configured to acquire the network address of each virtual machine in the cloud platform; the first generating unit is configured to generate a target script according to the network address of each virtual machine and a table query function, where the table query function is used to determine the table file data corresponding to the virtual machine corresponding to the network address with the network address as an index; the first setting unit is configured to deploy the target script to a computing node and set the execution permission and execution time of the computing node for the target script.
[0019] Optionally, the first setting unit includes: a third generating subunit, a first acquisition subunit, and a first recording subunit. The third generating subunit is configured to generate a timed execution task of the target script according to the execution permission and execution time; the first acquisition subunit is configured to control the target script to acquire the performance data of the target virtual machine according to the timed execution task; the first recording subunit is configured to record the performance data acquired by the target script in a log file.
[0020] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium storing a computer program, wherein when the computer program runs, the device where the computer-readable storage medium is located executes the above-mentioned method for monitoring the performance of a virtual machine.
[0021] According to another aspect of the embodiments of the present application, there is also provided an electronic device including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned method for monitoring the performance of a virtual machine.
[0022] According to another aspect of the embodiments of the present application, there is also provided a computer program product including computer instructions, and when the computer instructions are executed by a processor, the steps of the above-mentioned method for monitoring the performance of a virtual machine are implemented.
[0023] In the present application, first, the virtual machine identifier input by the user and the query time period for specifying the query of the virtual machine performance are received. Secondly, the target virtual machine specified by the user is determined according to the virtual machine identifier. Then, the log file generated by the computing node corresponding to the target virtual machine during the query time period is obtained, where the computing node is used to continuously collect the performance data of the target virtual machine through the target script and output it to the specified directory to generate a log file. Then, the connection information of the target virtual machine during the query time period is read from the log file, where the connection information at least includes the number, type, establishment time, and status change information of the data connections established by the target virtual machine. Finally, a target image is generated according to the connection information, that is, through real-time log analysis and dynamic data visualization, the purpose of real-time monitoring and accurate evaluation of the virtual machine connection performance is achieved, thereby realizing the technical effect of improving the virtual machine fault detection speed and reducing the fault repair time, and further solving the technical problem in the prior art that the use of an intermediate transmission device to track and count the data connections established by the virtual machine results in untimely monitoring of the virtual machine performance and thus long virtual machine fault repair time. Description of the Drawings
[0024] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0025] Figure 1 Shows a hardware structure block diagram of a computer terminal for implementing the method for monitoring the performance of a virtual machine;
[0026] Figure 2 Is a flowchart of an optional method for monitoring the performance of a virtual machine according to an embodiment of the present application;
[0027] Figure 3 It is a schematic diagram of an optional monitoring device for virtual machine performance according to an embodiment of the present application;
[0028] Figure 4 It is a block diagram of an electronic device according to an embodiment of the present application. Specific embodiments
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0030] It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0031] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) collected in the present application are information and data authorized by the user or fully authorized by all parties. And the collection, storage, use, processing, transmission, provision, disclosure, and application of relevant data and other processing all comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse. For example, an interface is set between the present system and relevant users or institutions to provide corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0032] According to an embodiment of the present application, an embodiment of a method for monitoring virtual machine performance is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0033] It should be noted that an intelligent monitoring system can be used as the execution entity of the method for monitoring virtual machine performance in the embodiments of the present application. It can be understood that the method for monitoring virtual machine performance provided by the embodiments of the present application can also be executed by other systems or devices as the execution entity, and the embodiments of the present application do not make specific limitations in this regard.
[0034] The method embodiments provided by the present application can be executed on a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing the method for monitoring virtual machine performance is shown. As Figure 1 shown, the computer terminal 10 (or mobile device) may include one or more (shown as 102a, 102b,..., 102n in the figure) processors 102 (the processor 102 may include, but is not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may further include more or fewer components than those Figure 1 shown, or have a different configuration from that Figure 1 shown.
[0035] It should be noted that the above one or more processors 102 and / or other data processing circuits are generally referred to as "data processing circuits" in this article. The data processing circuit can be embodied in whole or in part as software, hardware, firmware, or any other combination. In addition, the data processing circuit can be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 10 (or mobile device). As the method for monitoring virtual machine performance involved in the embodiments of the present application, the data processing circuit is a kind of processor control (such as the selection of a variable resistor terminal path connected to an interface).
[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage devices corresponding to the virtual machine performance monitoring method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the above-mentioned virtual machine performance monitoring method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the computer terminal 10 through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.
[0037] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include the wireless network provided by the communication provider of the computer terminal 10. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0038] The display can be a touch-screen liquid crystal display (LCD), and this liquid crystal display enables the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0039] Under the above operating environment, the present application provides a virtual machine performance monitoring method as Figure 2 shown. Figure 2 is a flowchart of an optional virtual machine performance monitoring method according to an embodiment of the present application. As Figure 2 shown, the method includes the following steps:
[0040] Step S201, receive the virtual machine identifier input by the user and the query time period specified by the user to query the performance of the virtual machine.
[0041] Optionally, the virtual machine identifier refers to a tag used to uniquely identify each virtual machine, which can be the name, ID, or IP address of the virtual machine, etc.
[0042] Optionally, the query time period refers to the time range for which the user wants to know the performance data. For example, "the past 24 hours". The main function of this step is to obtain the specific needs of the user, that is, which virtual machine performance data the user wants to query and the time range of the data, so that subsequent processing can be carried out targeted.
[0043] Optionally, the intelligent monitoring system obtains the specific requirements of the user, that is, which virtual machines' performance data the user wants to query and the time range of the data, so that subsequent processing can be carried out targeted.
[0044] Step S202, determine the target virtual machine specified by the user according to the virtual machine identifier.
[0045] Optionally, the target virtual machine is the virtual machine selected by the user through the above virtual machine identifier.
[0046] Optionally, the intelligent monitoring system uses the virtual machine identifier provided by the user to narrow the query scope to a specific virtual machine, avoiding indiscriminate data processing for all virtual machines on the entire cloud platform, and improving efficiency and accuracy.
[0047] Step S203, obtain the log file generated by the computing node corresponding to the target virtual machine during the query time period.
[0048] In step S203, the computing node is used to continuously collect the performance data of the target virtual machine through the target script and output it to the specified directory to generate a log file.
[0049] Optionally, the computing node refers to the physical server or cluster in the cloud platform responsible for running virtual machines, and each virtual machine will run on a specific computing node.
[0050] Optionally, the target script is a script deployed on the computing node, which is used to continuously collect the performance data of the target virtual machine, including the number of connection traces, etc., such as a shell script (a script file written in the Shell language, which is a program composed of a series of Shell commands and functions).
[0051] Optionally, the log file is a performance data file collected and output by the target script, including the performance data of the virtual machine within the specified time period.
[0052] Step S204, read the connection information of the target virtual machine during the query time period from the log file.
[0053] In step S204, the connection information at least includes the number, type, establishment time, and status change information of the data connections established by the target virtual machine.
[0054] Optionally, by determining the computing node where the target virtual machine is located, the intelligent monitoring system can accurately find and read the relevant log file generated by the computing node during the query time period to obtain the performance data of the virtual machine.
[0055] Optionally, the connection information refers to the connection tracking data of the target virtual machine within the specified query time period, including the number of connections, types (such as UDP (User Datagram Protocol), ICMP (Internet Control Message Protocol)), establishment time, and status change information (such as connection establishment, connection disconnection, etc.).
[0056] Optionally, the intelligent monitoring system extracts information related to connection performance from the log files obtained in the previous steps, providing a data basis for generating charts subsequently.
[0057] Step S205: Generate a target image based on the connection information.
[0058] Optionally, the target image is the finally generated chart or graphical report, which can intuitively display the change trend of the connection performance of the target virtual machine within the query time period.
[0059] Optionally, the intelligent monitoring system sorts out and visualizes the connection information read from the log files to generate charts that are easy to understand and analyze.
[0060] From the content of steps S201 to S205, it can be seen that in this application, first, the virtual machine identifier input by the user and the query time period for which the user specifies to query the performance of the virtual machine are received. Secondly, the target virtual machine specified by the user for query is determined according to the virtual machine identifier. Then, the log file generated by the computing node corresponding to the target virtual machine within the query time period is obtained, where the computing node is used to continuously collect the performance data of the target virtual machine through the target script and output it to the specified directory to generate the log file. Then, the connection information of the target virtual machine within the query time period is read from the log file, where the connection information at least includes the number, type, establishment time, and status change information of the data connections established by the target virtual machine. Finally, a target image is generated based on the connection information, that is, through real-time log analysis and dynamic data visualization, the purpose of real-time monitoring and accurate evaluation of the connection performance of the virtual machine is achieved, thereby realizing the technical effect of improving the virtual machine fault detection speed and reducing the fault repair time, and further solving the technical problem in the prior art that the use of intermediate transmission devices to track and count the data connections established by the virtual machine results in untimely monitoring of the virtual machine performance and thus long virtual machine fault repair time.
[0061] In an alternative embodiment, the intelligent monitoring system first detects whether the size of the log file generated by the computing node exceeds a preset threshold. Then, in the case where the size of the log file exceeds the preset threshold, the log file is split into N sub-files, where N is an integer greater than 1, and the size of each sub-file does not exceed the preset threshold. Then, according to the generation time of each sub-file, each sub-file is sequentially obtained from the computing node. After obtaining all N sub-files, the N sub-files are merged into a log file.
[0062] Optionally, the intelligent monitoring system first monitors the size of the log file generated by the computing node to determine whether it exceeds a preset threshold. The preset threshold is a maximum log file size limit set by the system, such as 100MB, to avoid a single log file being too large and affecting the data reading and processing speed. When it is detected that the size of the log file exceeds the preset threshold, the system automatically splits the log file into N sub-files, where N is an integer greater than 1, to ensure that the size of each sub-file does not exceed the preset threshold. For example, if the preset threshold is 100MB, a 150MB log file may be split into two sub-files, each with a size not exceeding 100MB. When splitting, the system will distribute the log entries into different sub-files according to the timestamps of the log content to ensure the continuity and integrity of the data. After that, the system will sequentially obtain these sub-files from the computing node according to the generation time of each sub-file. For example, if the two sub-files respectively record the connection performance data from 8 am to 12 noon and from 12 noon to 4 pm, the system will first obtain the data from 8 am to 12 noon and then obtain the data from 12 noon to 4 pm to ensure that the order of data collection is consistent with the order of event occurrence. Finally, after obtaining all N sub-files, the intelligent monitoring system merges these sub-files into a single log file for subsequent unified processing and analysis. At the same time, during the merging process, the system will check the timestamps of each sub-file to ensure the correct chronological order of the data and avoid duplicate or missing data.
[0063] As can be seen from the above, by monitoring the log file size, automatically splitting and re-merging the log file, the intelligent monitoring system not only avoids the problem of a single log file being too large and affecting the data reading and processing speed, but also ensures the continuity and integrity of the data, enabling the operation and maintenance personnel to effectively monitor and analyze the performance of the virtual machine based on accurate and timely data.
[0064] In an alternative embodiment, the intelligent monitoring system splits the log file into N sub-files according to the recording time of the data in the log file, where the recording time of the data in the i-th sub-file is earlier than the recording time of the data in the (i + 1)-th sub-file, and i is a positive integer less than N.
[0065] Optionally, the intelligent monitoring system continuously collects and records the connection performance data of the target virtual machine. These data include, but are not limited to, the number of connections, types, establishment time, and status change information, and are written into one or more log files. The system reads the log files and identifies the timestamp of each record therein, which is the specific time point when the data is recorded. Subsequently, the system sorts these records in chronological order to prepare for subsequent splitting operations. According to the splitting strategy set by the system, the intelligent monitoring system splits the log files into N sub-files, where N is an integer greater than 1. Here, the splitting principle is that the data recording time in the i-th sub-file is earlier than that in the (i + 1)-th sub-file, and i is a positive integer less than N. For example, if N = 7, the performance data for a week can be split into 7 sub-files, with each sub-file corresponding to the data for one day, thereby ensuring that the data within each sub-file is arranged in chronological order, the time data between sub-files does not overlap, and after each sub-file is generated, the intelligent monitoring system stores it in the specified directory of the computing node, and the naming will include the corresponding date or time information.
[0066] As can be seen from the above, by splitting the log files into N sub-files in chronological order, the intelligent monitoring system avoids the excessive size of a single log file, reduces the latency of data reading and processing, and improves the overall system performance.
[0067] In an alternative embodiment, when the data connections established by the target virtual machine include M types of data connections, the intelligent monitoring system generates M target images according to the connection information. Among them, the j-th target image among the M target images is used to characterize the number of the j-th type of data connections established by the target virtual machine, the establishment time, and the status change information, where M is an integer greater than or equal to 1, and j is a positive integer less than or equal to M.
[0068] Optionally, the intelligent monitoring system first identifies the type of data connection established by the target virtual machine by reading the connection information in the log file. For example, the target virtual machine has established multiple types of data connections, including M types such as UDP, TCP, ICMP (Internet Control Message Protocol), where M is an integer greater than or equal to 1. For each type of data connection, the system extracts relevant connection performance data from the log file. These data at least include the number of data connections, the establishment time, and the status change information, such as the establishment, disconnection, or reconnection of the connection. Then, for the M types of data connections, the system will generate M target images, each image specifically used to characterize the performance of one type of data connection. Specifically, for the j-th type of data connection, where j is a positive integer less than or equal to M, the system will generate the j-th target image, showing the visualization results of the number, establishment time, and status change information of the j-th type of data connection established by the target virtual machine. For example, if M = 3, it means the system will generate 3 images, corresponding to the performance of UDP, TCP, and ICMP data connections respectively.
[0069] Optionally, the intelligent monitoring system displays the M target images on the user interface, and the operation and maintenance personnel can quickly identify the performance trends of each type of data connection based on these images, such as the fluctuations in the number of connections and the changes in the connection status. In addition, the images also include a time axis, showing the establishment of data connections in chronological order, enabling the operation and maintenance personnel to conduct more in-depth analysis and diagnosis based on the images of a specific time period.
[0070] As can be seen from the above, the intelligent monitoring system's performance analysis for different data connection types enables the operation and maintenance personnel to have a more comprehensive and in-depth understanding of the network communication status of the virtual machine. Each target image focuses on one type of data connection, not only clearly showing the dynamic changes in the number of connections but also providing the time information of connection establishment and status changes, which is extremely crucial for identifying potential network problems or performance bottlenecks. And by generating multiple target images for different data connection types, the accuracy and effectiveness of virtual machine performance monitoring are significantly improved.
[0071] In an alternative embodiment, the intelligent monitoring system first determines the disconnection duration and the reconstruction times of each data connection established by the target virtual machine during the query time period according to the status change information in the connection information. Then, when the ratio of the disconnection duration of any one of the data connections established by the target virtual machine to the total duration of the query time period during the query time period is greater than a preset ratio, or the reconstruction times are greater than a preset number, it is determined that the data connection is a target data connection. Finally, a target image is generated according to the target data connection, where the target image is used to represent the quantity, type, establishment time, and status change information of the target data connection.
[0072] Optionally, the intelligent monitoring system reads the status change information in the connection information in the log file generated by the target virtual machine on the computing node, including the disconnection duration and the reconstruction times of the data connection. Here, the disconnection duration refers to the time that the data connection remains in the disconnected state, and the reconstruction times refer to the number of times that the data connection recovers from the disconnected state to the normal state during the query time period.
[0073] Optionally, the intelligent monitoring system analyzes the extracted status change information to determine the disconnection duration and the reconstruction times of each data connection during the query time period. Here, the query time period is specified by the operation and maintenance personnel and is a specific time range for analyzing the performance of the virtual machine. If the ratio of the disconnection duration of any one of the data connections to the total duration of the query time period during the query time period is greater than a preset ratio (for example, the preset ratio is 0.2, indicating that the disconnection time of the data connection accounts for more than 20% of the total query time), or the reconstruction times are greater than a preset number (for example, the preset number is 5 times, indicating that the reconstruction times of the data connection exceed 5 times during the query time period), then the data connection is identified as a target data connection. For each identified target data connection, the intelligent monitoring system generates a target image, which represents the quantity, type, establishment time, and status change information of the target data connection. The target image is displayed in the form of a chart, curve, heat map, etc., so that the operation and maintenance personnel can intuitively see which data connection types, when, and how frequently abnormal disconnection or reconstruction behaviors occur.
[0074] As can be seen from the above, by analyzing the disconnection duration and the reconstruction times, the intelligent monitoring system can accurately identify the data connections that are abnormally disconnected or frequently reconstructed during the query time period, providing key objects for fault troubleshooting for the operation and maintenance personnel. Moreover, the generation and display of the target image make complex performance data intuitive and easy to understand, helping the operation and maintenance personnel quickly understand the network communication status of the virtual machine, respond to and handle potential performance problems in a timely manner. At the same time, according to the setting of the preset ratio and the preset number, potential performance risks can be warned in advance, allowing the operation and maintenance personnel to take preventive measures before the problem deteriorates, improving the stability of the cloud platform and the user experience.
[0075] In an alternative embodiment, the intelligent monitoring system first collects the network addresses of each virtual machine in the cloud platform, and then generates a target script according to the network addresses of each virtual machine and a table query function, where the table query function is used to determine the table file data corresponding to the virtual machine corresponding to the network address with the network address as an index, and then deploys the target script to the computing node and sets the execution permission and execution time of the computing node for the target script.
[0076] Optionally, the intelligent monitoring system first traverses all virtual machines in the cloud platform to collect the network address information of each virtual machine. The network address refers to the IP address, which is the key information for identifying and locating virtual machines in the network. The system obtains these network addresses by means of the management API (Application Programming Interface) of the cloud platform or directly querying the virtual machine configuration information. Then, a target script is generated according to the network address information of each virtual machine and a preset table query function. The table query function is a data processing mechanism that uses the network address as an index to query the table file data of the virtual machine corresponding to the network address from the database or data table of the cloud platform. These data include the configuration information, running status, performance metrics, etc. of the virtual machine. Then, the generated target script is deployed to the computing node. And to ensure the secure execution of the script and the accurate collection of data, the intelligent monitoring system sets the execution permission of the computing node for the target script, including but not limited to read permission, execution permission, etc., to ensure that the script can access and read the performance data of the virtual machine.
[0077] Optionally, the intelligent monitoring system can also set the execution time of the target script. For example, the script can be scheduled to execute during off-peak hours every day to avoid affecting the normal operation of the virtual machine while ensuring the regular update of data and continuous monitoring.
[0078] As can be seen from the above, through the generation and deployment of automated scripts, the intelligent monitoring system can collect the performance data of the connection tracking count of each virtual machine in the cloud platform regularly and automatically, reducing manual intervention, improving the efficiency and accuracy of data collection. By combining the network address and the table query function, the system can quickly locate and query the table file data of the target virtual machine, avoiding the unnecessary overhead of full-scale data retrieval, optimizing the data processing process, and improving the system performance. At the same time, by setting the execution permission and execution time of the script for the computing node, the security of script execution and the standardization of data collection are ensured, avoiding data loss or system interference caused by improper permissions or improper execution timing.
[0079] In an alternative embodiment, the intelligent monitoring system generates a scheduled execution task for the target script based on the execution permission and execution time, then controls the target script to collect the performance data of the target virtual machine according to the scheduled execution task, and finally records the performance data collected by the target script in a log file.
[0080] Optionally, the execution permission ensures that the script can access and read the performance data of the virtual machine, avoiding data collection failures caused by insufficient permissions; the execution time is set based on the operation and maintenance strategy and the running status of the cloud platform. For example, the script is selected to be executed during off-peak hours to reduce the impact on the performance of the virtual machine.
[0081] Optionally, the intelligent monitoring system generates a scheduled execution task according to the execution permission of the target script on the computing node and the preset execution time. The scheduled execution task is implemented through the scheduled task scheduling mechanism of the computing node to ensure that the target script automatically runs at the set time point without manual intervention. The intelligent monitoring system automatically controls the target script to run at the specified time point according to the generated scheduled execution task, collects the connection number performance data of the target virtual machine. Subsequently, the performance data collected by the target script will be recorded in the log file on the computing node after being processed. The recording method of the log file usually includes time and data content, which is convenient for subsequent data analysis and troubleshooting.
[0082] As can be seen from the above, the intelligent monitoring system can automatically and regularly collect the performance data of the target virtual machine by setting a scheduled execution task, reducing the complexity and error rate of manual operations, improving the efficiency and accuracy of data collection. At the same time, the clear execution permission setting ensures the security and compliance of data collection, avoiding data leakage or system anomalies caused by improper permission configuration. Finally, the collected performance data is recorded in the log file, providing convenience for the long-term storage and retrospective analysis of data, enhancing the transparency of operation and maintenance and the reliability of performance evaluation.
[0083] The embodiment of the present application also provides a monitoring device for the performance of a virtual machine. It should be noted that the monitoring device for the performance of a virtual machine in the embodiment of the present application can be used to execute the monitoring method for the performance of a virtual machine provided in the embodiment of the present application. The following introduces the monitoring device for the performance of a virtual machine provided in the embodiment of the present application.
[0084] According to the embodiment of the present application, there is also provided a device for implementing the above-mentioned monitoring device for the performance of a virtual machine, Figure 3 which is a schematic diagram of an alternative monitoring device for the performance of a virtual machine according to the embodiment of the present application, as Figure 3 shown, the device includes: a receiving unit 301, a determining unit 302, an obtaining unit 303, a reading unit 304, and a generating unit 305.
[0085] Optionally, a receiving unit 301 is configured to receive a virtual machine identifier input by a user and a query time period specified by the user for querying the performance of the virtual machine; a determining unit 302 is configured to determine a target virtual machine specified by the user to be queried according to the virtual machine identifier; an obtaining unit 303 is configured to obtain a log file generated by a computing node corresponding to the target virtual machine during the query time period, where the computing node is configured to continuously collect performance data of the target virtual machine through a target script and output the performance data to a specified directory to generate a log file; a reading unit 304 is configured to read connection information of the target virtual machine during the query time period from the log file, where the connection information at least includes the number, type, establishment time, and status change information of data connections established by the target virtual machine; a generating unit 305 is configured to generate a target image according to the connection information.
[0086] Optionally, the obtaining unit 303 includes: a first detection subunit, a first splitting subunit, and a first merging subunit. The first detection subunit is configured to detect whether the size of a log file generated by the computing node exceeds a preset threshold; the first splitting subunit is configured to, when the size of the log file exceeds the preset threshold, split the log file into N sub-files, where N is an integer greater than 1, and the size of each sub-file does not exceed the preset threshold; the first merging subunit is configured to sequentially obtain each sub-file from the computing node according to the generation time of each sub-file, and after obtaining all N sub-files, merge the N sub-files into a log file.
[0087] Optionally, the first splitting subunit includes: a first splitting module configured to split the log file into N sub-files according to the recording time of data in the log file, where the recording time of data in the i-th sub-file is earlier than the recording time of data in the (i + 1)-th sub-file, and i is a positive integer less than N.
[0088] Optionally, the generating unit 305 includes: a first generating subunit configured to, when the data connections established by the target virtual machine include M types of data connections, generate M target images according to the connection information, where the j-th target image among the M target images is used to represent the number, establishment time, and status change information of the j-th type of data connection established by the target virtual machine, M is an integer greater than or equal to 1, and j is an integer less than or equal to M.
[0089] Optionally, the generating unit 305 includes: a first determining subunit, a second determining subunit, and a second generating subunit. The first determining subunit is configured to determine the disconnection duration and the reconstruction times of each data connection established by the target virtual machine during the query time period according to the status change information in the connection information; the second determining subunit is configured to determine that the data connection is a target data connection when the ratio of the disconnection duration of any one data connection established by the target virtual machine during the query time period to the total duration of the query time period is greater than a preset ratio, or the reconstruction times is greater than a preset number; the second generating subunit is configured to generate a target image according to the target data connection, where the target image is used to represent the quantity, type, establishment time, and status change information of the target data connection.
[0090] Optionally, the monitoring device for virtual machine performance further includes: a first collecting unit, a first generating unit, and a first setting unit. The first collecting unit is configured to collect the network addresses of each virtual machine in the cloud platform; the first generating unit is configured to generate a target script according to the network address of each virtual machine and a table query function, where the table query function is used to determine the table file data corresponding to the virtual machine corresponding to the network address with the network address as an index; the first setting unit is configured to deploy the target script to the computing node and set the execution permission and execution time of the computing node for the target script.
[0091] Optionally, the first setting unit includes: a third generating subunit, a first collecting subunit, and a first recording subunit. The third generating subunit is configured to generate a timed execution task of the target script according to the execution permission and the execution time; the first collecting subunit is configured to control the target script to collect the performance data of the target virtual machine according to the timed execution task; the first recording subunit is configured to record the performance data collected by the target script in a log file.
[0092] An embodiment of the present application may provide an electronic device. Figure 4 It is a structural block diagram of an electronic device according to an embodiment of the present application. As Figure 4 shown, the electronic device may include: one or more ( Figure 4 only one is shown in the figure) processors 402, a memory 404, a storage controller, and a peripheral interface, where the peripheral interface is connected to a radio frequency module, an audio module, and a display.
[0093] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and devices in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above-mentioned methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely set relative to the processor, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and their combinations.
[0094] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: receiving the virtual machine identifier input by the user and the query time period specified by the user to query the performance of the virtual machine; determining the target virtual machine specified by the user to query according to the virtual machine identifier; obtaining the log file generated by the computing node corresponding to the target virtual machine during the query time period, where the computing node is used to continuously collect the performance data of the target virtual machine through the target script and output it to a specified directory to generate a log file; reading the connection information of the target virtual machine during the query time period from the log file, where the connection information at least includes the number, type, establishment time, and status change information of the data connections established by the target virtual machine; generating a target image according to the connection information.
[0095] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: detecting whether the size of the log file generated by the computing node exceeds a preset threshold; in the case where the size of the log file exceeds the preset threshold, splitting the log file into N sub-files, where N is an integer greater than 1, and the size of each sub-file does not exceed the preset threshold; sequentially obtaining each sub-file from the computing node according to the generation time of each sub-file, and after obtaining all N sub-files, merging the N sub-files into a log file.
[0096] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: splitting the log file into N sub-files according to the recording time of the data in the log file, where the recording time of the data in the i-th sub-file is earlier than the recording time of the data in the (i + 1)-th sub-file, and i is a positive integer less than N.
[0097] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: when the data connections established by the target virtual machine include M types of data connections, generate M target images according to the connection information, where the j-th target image among the M target images is used to characterize the number, establishment time, and status change information of the j-th type of data connection established by the target virtual machine, M is an integer greater than or equal to 1, and j is a positive integer less than or equal to M.
[0098] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: determine the disconnection duration and reconstruction times of each data connection established by the target virtual machine during the query time period according to the status change information in the connection information; when the ratio of the disconnection duration of any one of the data connections established by the target virtual machine to the total duration of the query time period is greater than the preset ratio, or the reconstruction times are greater than the preset times, determine that this data connection is the target data connection; generate a target image according to the target data connection, where the target image is used to characterize the number, type, establishment time, and status change information of the target data connection.
[0099] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: collect the network addresses of each virtual machine in the cloud platform; generate a target script according to the network address of each virtual machine and the table query function, where the table query function is used to determine the table file data corresponding to the virtual machine corresponding to the network address with the network address as the index; deploy the target script to the computing node and set the execution permission and execution time of the computing node for the target script.
[0100] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: generate a timed execution task for the target script according to the execution permission and execution time; control the target script to collect the performance data of the target virtual machine according to the timed execution task; record the performance data collected by the target script in the log file.
[0101] Those of ordinary skill in the art can understand that Figure 4 the structure shown is only schematic, and the electronic device can also be a terminal device such as a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and a Mobile Internet Device (MID), a PAD, etc. Figure 4 It does not limit the structure of the above electronic device. For example, the electronic device may further include more or fewer components (such as a network interface, a display device, etc.) than those shown in Figure 4 or have a different configuration from that shown in Figure 4 shown.
[0102] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and this program can be stored in a computer-readable storage medium. The storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, etc.
[0103] An embodiment of the present application also provides a storage medium. Optionally, in this embodiment, the above storage medium can be used to store the program code executed by the method for monitoring the performance of the virtual machine provided in the first embodiment above.
[0104] Optionally, in this embodiment, the above storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
[0105] The present application also provides a computer program product, which is suitable for executing a program for the steps of the method for monitoring the performance of the virtual machine when executed on a data processing device.
[0106] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0107] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0108] In the several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0109] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, may exist separately as individual physical units, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0111] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, may be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs that can store program codes.
[0112] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for monitoring the performance of a virtual machine, characterized in that, Including: Receiving a virtual machine identifier input by a user and a query time period specified by the user for querying the performance of the virtual machine; Determining a target virtual machine specified by the user for query according to the virtual machine identifier; Obtaining a log file generated by a computing node corresponding to the target virtual machine during the query time period, wherein the computing node is used to continuously collect performance data of the target virtual machine through a target script and output the performance data to a specified directory to generate the log file; Reading connection information of the target virtual machine during the query time period from the log file, wherein the connection information at least includes the number, type, establishment time, and status change information of data connections established by the target virtual machine; Generating a target image according to the connection information.
2. The method for monitoring the performance of a virtual machine according to claim 1, wherein Obtaining a log file generated by a computing node corresponding to the target virtual machine during the query time period includes: Detecting whether the size of the log file generated by the computing node exceeds a preset threshold; In the case where the size of the log file exceeds the preset threshold, splitting the log file into N sub-files, where N is an integer greater than 1, and the size of each sub-file does not exceed the preset threshold; Sequentially obtaining each of the sub-files from the computing node according to the generation time of each sub-file, and after obtaining all N sub-files, merging the N sub-files into the log file.
3. The monitoring method for virtual machine performance according to claim 2, wherein In the case where the size of the log file exceeds the preset threshold, splitting the log file into N sub-files includes: Splitting the log file into the N sub-files according to the recording time of data in the log file, wherein the recording time of data in the i-th sub-file is earlier than the recording time of data in the (i + 1)-th sub-file, and i is a positive integer less than N.
4. The monitoring method for virtual machine performance according to claim 1, characterized in that Generating a target image according to the connection information includes: In the case where the data connections established by the target virtual machine include M types of data connections, generating M target images according to the connection information, wherein the j-th target image among the M target images is used to characterize the number, establishment time, and status change information of the j-th type of data connection established by the target virtual machine, M is an integer greater than or equal to 1, and j is an integer less than or equal to M.
5. The monitoring method for virtual machine performance according to claim 1, characterized in that, Generating a target image according to the connection information includes: Determining the disconnection duration and reconstruction times of each data connection established by the target virtual machine during the query time period according to the status change information in the connection information; In the case where the ratio of the disconnection duration of any data connection established by the target virtual machine during the query time period to the total duration of the query time period is greater than a preset ratio, or the reconstruction times are greater than a preset number of times, determining that the data connection is a target data connection; Generating the target image according to the target data connection, wherein the target image is used to characterize the number, type, establishment time, and status change information of the target data connection.
6. The monitoring method for virtual machine performance according to claim 1, wherein Before receiving a virtual machine identifier input by a user and a query time period specified by the user for querying the performance of the virtual machine, the method for monitoring the performance of the virtual machine further includes: Collect the network addresses of each virtual machine in the collection cloud platform; Generate the target script according to the network addresses of each virtual machine and a table query function, where the table query function is used to determine the table file data corresponding to the virtual machine corresponding to the network address with the network address as an index; Deploy the target script to the computing node and set the execution permission and execution time of the computing node for the target script.
7. The monitoring method for virtual machine performance according to claim 6, wherein After deploying the target script to the computing node and setting the execution permission and execution time of the computing node for the target script, the virtual machine performance monitoring method further includes: Generate a scheduled execution task of the target script according to the execution permission and the execution time; Control the target script to collect the performance data of the target virtual machine according to the scheduled execution task; Record the performance data collected by the target script in the log file.
8. A monitoring device for virtual machine performance, characterized in that Comprising: A receiving unit, which receives the virtual machine identifier input by the user and the query time period specified by the user to query the performance of the virtual machine; A determining unit, which determines the target virtual machine specified by the user to query according to the virtual machine identifier; An obtaining unit, which obtains the log file generated by the computing node corresponding to the target virtual machine during the query time period, where the computing node is used to continuously collect the performance data of the target virtual machine through a target script and output it to a specified directory to generate the log file; A reading unit, which reads the connection information of the target virtual machine during the query time period from the log file, where the connection information at least includes the number, type, establishment time, and status change information of the data connections established by the target virtual machine; A generating unit, which generates a target image according to the connection information.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, where when the executable program runs, it controls the device where the computer-readable storage medium is located to execute the virtual machine performance monitoring method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, Comprising one or more processors and a memory, where the memory is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the virtual machine performance monitoring method according to any one of claims 1 to 7.
11. A computer program product, comprising computer instructions, characterized in that, When the computer instructions are executed by a processor, the steps of the virtual machine performance monitoring method according to any one of claims 1 to 7 are implemented.