Method and device for acquiring virtual ring data, electronic equipment and storage medium

By acquiring historical input/output information and using predictive models to adjust the host polling frequency, the problems of virtual machines being unable to obtain virtual ring data in a timely manner and infinite loop polling were solved, optimizing resource utilization and improving system performance and stability.

CN122173199APending Publication Date: 2026-06-09JINAN INSPUR DATA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2026-02-06
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, virtual machines may fail to acquire virtual ring data in a timely manner, leading to low performance, or they may engage in infinite loop polling, resulting in wasted processor resources.

Method used

By acquiring historical input/output information, the frequency of host polling access to the virtual ring is adjusted using a predictive model, dynamically matching the input/output status of the current time period, canceling the event notification mechanism, and adding threshold judgment logic to optimize resource utilization.

Benefits of technology

It optimizes the utilization of processor resources, improves system response speed and stability, and avoids wasting processor resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173199A_ABST
    Figure CN122173199A_ABST
Patent Text Reader

Abstract

The application discloses a virtual ring data acquisition method and device, electronic equipment and a storage medium, and relates to the technical field of virtual machines. The method comprises the following steps: acquiring a plurality of historical input and output information corresponding to a target moment of a virtual ring between a host and a virtual machine in a historical time period and a first polling frequency at which the host polls the virtual ring; inputting the target moment and a historical data size into a preset prediction model to predict a predicted data size corresponding to the target moment in a current time period; acquiring an actual data size of input and output data sent by the virtual machine to the virtual ring at the target moment in the current time period; adjusting the polling frequency according to the predicted data size, the actual data size and the first polling frequency to obtain a target polling frequency; and polling the virtual ring according to the target polling frequency to acquire virtual ring data. The application can solve the problems of poor virtual machine performance caused by the failure to acquire virtual ring data in time and processor resource waste caused by the dead loop polling to acquire virtual data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of virtual machine technology, and in particular to methods, apparatus, electronic devices and storage media for acquiring virtual ring data. Background Technology

[0002] With the development of virtualization technology, the demand for disk performance within virtual machines is increasing, especially in the field of real-time data processing. Efficient data acquisition methods can directly affect the overall performance of the system, making the efficiency of data acquisition and processing increasingly important.

[0003] In related technologies, there are two methods for acquiring virtual ring (vring) data in the input / output path. One method relies on external notifications to acquire vring data. This method, due to its dependence on external signals, cannot acquire vring data in a timely manner, resulting in low virtual machine performance. The second method uses an infinite loop to continuously poll, processing data as soon as it is generated. This method can significantly improve performance, but the infinite loop polling excessively consumes processor resources, especially when the input / output frequency is low, leading to serious waste of processor resources. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and storage medium for acquiring virtual ring data, in order to at least solve the problems in related technologies where the inability to acquire virtual ring data in a timely manner leads to low virtual machine performance, or where infinitely looping the acquisition of virtual data results in wasted processor resources.

[0005] This application provides a method for acquiring virtual ring data, applied to a host. The method includes: acquiring multiple historical input / output information corresponding to a target time of the virtual ring between the host and the virtual machine within a historical time period, and a first polling frequency for the host to poll the virtual ring. The target time is the arrival time of historical input / output data sent by the virtual machine to the virtual ring, and each piece of historical input / output information includes the historical data volume of historical input / output data sent by the virtual machine to the virtual ring at each target time; inputting the target time and the historical data volume into a preset prediction model to predict the predicted data volume corresponding to the target time within the current time period; acquiring the actual data volume of input / output data sent by the virtual machine to the virtual ring at the target time within the current time period; adjusting the polling frequency for the host to poll the virtual ring according to the predicted data volume, the actual data volume, and the first polling frequency to obtain a target polling frequency; and polling the virtual ring according to the target polling frequency to acquire virtual ring data.

[0006] This application also provides a virtual ring data acquisition device, applied to a host. The virtual ring data acquisition device includes: an acquisition module, used to acquire multiple historical input / output information corresponding to a target time of the virtual ring between the host and the virtual machine within a historical time period, and a first polling frequency of the host polling the virtual ring. The target time is the arrival time of historical input / output data sent by the virtual machine to the virtual ring, and each piece of historical input / output information includes the historical data volume of historical input / output data sent by the virtual machine to the virtual ring at each target time; a prediction module, used to input the target time and the historical data volume into a preset prediction model to predict the predicted data volume corresponding to the target time within the current time period; the acquisition module is also used to acquire the actual data volume of input / output data sent by the virtual machine to the virtual ring at the target time within the current time period; and a processing module, used to adjust the polling frequency of the host polling the virtual ring according to the predicted data volume, the actual data volume, and the first polling frequency to obtain a target polling frequency; and to poll the virtual ring according to the target polling frequency to acquire virtual ring data.

[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described methods for acquiring virtual ring data.

[0008] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described methods for acquiring virtual ring data.

[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described methods for acquiring virtual ring data.

[0010] This application allows for the prediction of the amount of data arriving at the virtual ring at a target time based on multiple historical input / output information. Therefore, the predicted data amount and the actual data amount can be compared to determine the accuracy of the prediction. Furthermore, based on the predicted data amount, the actual data amount, and the first polling frequency, the polling frequency of the host accessing the virtual ring is adjusted, ensuring that the target polling frequency matches the input / output state of the virtual ring in the current time period. This optimizes resource utilization and improves performance, avoids wasting processor resources, and enhances system response speed and stability. Attached Figure Description

[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A topology diagram of a virtual ring data acquisition system provided in this application embodiment;

[0013] Figure 2 A flowchart illustrating a method for acquiring virtual ring data provided in an embodiment of this application; Figure 3 A flowchart illustrating another method for acquiring virtual ring data provided in this application embodiment; Figure 4 A device structure block diagram of a virtual ring data acquisition device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0014] 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.

[0015] 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.

[0016] 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.

[0017] This application's embodiments apply to scenarios where virtual machines and hosts communicate via a virtual ring.

[0018] In related technologies, there are two main methods for a host to acquire virtual ring data. One method relies on external notifications, which can lead to delays in acquiring virtual ring data due to its dependence on external signals, resulting in low virtual machine performance. The other method uses an infinite loop to continuously poll, processing data as soon as it is generated. This method can significantly improve performance, but the infinite loop polling excessively consumes processor resources, especially when the input / output frequency is low, leading to severe waste of processor resources.

[0019] To address the aforementioned technical problems, this application provides a method for acquiring virtual ring data. This method adjusts the polling frequency based on the input and output states of the virtual ring, which can improve performance and reduce the waste of host processor resources.

[0020] The following is based on Figure 1 Taking the virtual ring data acquisition system shown as an example, the method provided in this application embodiment will be described.

[0021] like Figure 1 As shown, Figure 1 This is a topology diagram of a virtual ring data acquisition system provided in an embodiment of this application. Figure 1 In the virtual ring data acquisition system 100, there are host 101, virtual machine 102 and client 103.

[0022] The host 101 (also known as the virtual ring data acquisition device) can be any device with computing and communication functions. For example, the host 101 can be a server or a cloud server.

[0023] Virtual machine 102 can be a virtual machine of host 101. Virtual machine 102 and host 101 communicate through a virtual ring.

[0024] Client 103 can be any device with communication and display functions.

[0025] Figure 1 The virtual ring data acquisition system illustrated is for illustrative purposes only and is not intended to limit the technical solutions of this application. Those skilled in the art should understand that, in specific implementations, the virtual ring data acquisition system may include more virtual machines, without limitation.

[0026] Embodiments of this application provide a method for acquiring virtual ring data, applicable to... Figure 1 The host shown is as follows: Figure 2 As shown, Figure 2 This is a flowchart illustrating a method for acquiring virtual ring data according to an embodiment of this application. The method for acquiring virtual ring data includes the following steps: S201, obtain multiple historical input / output information of the target time corresponding to the virtual ring between the host and the virtual machine within the historical time period, as well as the first polling frequency of the host's polling access to the virtual ring.

[0027] The target time is the arrival time of the historical input / output data sent by the virtual machine to the virtual ring. For example, the target time is 10:15.

[0028] Each historical input / output (IP) record includes the historical data volume of the historical I / O data sent by the virtual machine to the virtual ring at each target time. Optionally, each historical I / O record may also include historical I / O stress metrics for the virtual ring.

[0029] For example, the host obtains multiple historical input / output information for the target time corresponding to the virtual ring between the host and the virtual machine within a historical time period, as well as the first polling frequency of the host's polling access to the virtual ring. For instance, the multiple historical input information refers to the historical data volume of historical input / output data sent by the virtual machine to the virtual ring at 10:15 AM every day within the historical time period.

[0030] S202: Input the target time and the amount of historical data into the preset prediction model to predict the amount of predicted data corresponding to the target time within the current time period.

[0031] The preset prediction model has the function of predicting the amount of data corresponding to the target time within the current time period, that is, predicting the upcoming input and output pressure of the virtual machine. The preset prediction model can be a regression-type prediction model, such as a linear regression model.

[0032] For example, the host inputs the target time and the amount of historical data into a preset prediction model to predict the amount of data corresponding to the target time within the current time period.

[0033] Optionally, the host can also input the target time and historical input / output pressure indicators into a preset prediction model to predict the predicted input / output pressure indicators corresponding to the target time within the current time period.

[0034] S203, obtain the actual amount of input and output data sent by the virtual machine to the virtual ring at the target time within the current time period.

[0035] For example, the host obtains the actual amount of input and output data sent by the virtual machine to the virtual ring at the target time within the current time period.

[0036] Optionally, the host can also obtain the actual input / output pressure indicators of the input / output data sent by the virtual machine to the virtual ring at the target time within the current time period.

[0037] S204. Based on the predicted data volume, the actual data volume, and the first polling frequency, adjust the polling frequency of the host's polling access to the virtual ring to obtain the target polling frequency.

[0038] The target polling frequency is less than or equal to the maximum polling frequency and greater than or equal to the minimum polling frequency.

[0039] In some optional implementations, the host calculates the difference between the predicted data volume and the actual data volume to obtain a prediction deviation value; if the prediction deviation value is less than or equal to a first threshold and greater than a second threshold, then the first polling frequency is determined as the target polling frequency; or, if the prediction deviation value is greater than the first threshold, or if the prediction deviation value is less than or equal to the second threshold, then an adjustment ratio is determined based on the prediction deviation value and the actual data volume; and the first polling frequency is adjusted to the target polling frequency according to the adjustment ratio.

[0040] The first or second threshold can be set according to the actual situation and is not restricted.

[0041] In one example, if the host predicts that the amount of data is greater than the actual amount of data and the prediction deviation is greater than a first threshold, then the ratio between the prediction deviation and the actual amount of data is calculated to determine the adjustment ratio; or, if the predicted amount of data is less than the actual amount of data and the prediction deviation is less than or equal to a second threshold, then the ratio between the prediction deviation and the actual amount of data is calculated to determine the adjustment ratio.

[0042] Furthermore, the host calculates the product between the adjustment ratio and the first polling frequency to obtain the first frequency change; the difference between the first polling frequency and the first frequency change is calculated to determine the target polling frequency.

[0043] Optionally, if the prediction deviation value is less than or equal to the first threshold and greater than or equal to the second threshold, the weight value of each parameter in the preset prediction model is modified according to the prediction deviation value to obtain a new prediction model.

[0044] Understandably, after determining the target polling frequency, the host can use the actual input / output pressure of the virtual machine to fine-tune the parameters of the functions in the preset prediction model. When the prediction deviation is within an acceptable range, the polling frequency is not directly adjusted; instead, the model is optimized by modifying the parameter weights, allowing the prediction model to continuously learn the changing patterns of the actual load. This subtle iterative approach allows the model to gradually adapt to subtle changes in the system over long-term operation (such as hardware aging or slow iteration of business models), avoiding a decrease in prediction accuracy due to model rigidity. When the deviation is within a reasonable range, the polling frequency itself does not need to be adjusted; only the internal parameters of the model are optimized. This avoids unnecessary frequency changes from interfering with system stability and reduces the additional resource overhead (such as processor computing costs and data transmission jitter) caused by frequent adjustments to the polling strategy.

[0045] Optionally, in some optional implementations, the host calculates the difference between the predicted input / output pressure index and the actual input / output pressure index to obtain a prediction deviation value; if the prediction deviation value is less than or equal to a first threshold and greater than a second threshold, then the first polling frequency is determined as the target polling frequency; or, if the prediction deviation value is greater than the first threshold, or if the prediction deviation value is less than or equal to the second threshold, then an adjustment ratio is determined based on the prediction deviation value and the actual input / output pressure index; and the first polling frequency is adjusted to the target polling frequency according to the adjustment ratio.

[0046] Understandably, by comparing predicted and actual input / output pressure metrics, the deviation of system load can be sensed in real time, allowing the polling frequency to dynamically match actual business pressure. When the deviation is within a reasonable range, the first polling frequency is maintained to ensure basic stability; when the deviation exceeds a reasonable range, the ratio is dynamically adjusted to avoid resource waste or performance inadequacy caused by inaccurate predictions. In actual business operations, the input / output pressure of virtual machines may fluctuate due to sudden requests (such as peak traffic) or prediction model errors. By setting a first threshold and a second threshold, acceptable deviations and deviations requiring adjustment are distinguished, which avoids frequent adjustments caused by small fluctuations (reducing system overhead) and allows for timely responses when significant deviations occur, ensuring system stability under dynamic loads.

[0047] S205: Poll the virtual ring according to the target polling frequency to obtain virtual ring data.

[0048] In some alternative implementations, during the process of polling the virtual ring at the target polling frequency, when a first message is received from the client, access to the virtual ring is stopped. The first message indicates that it is not necessary to continue acquiring virtual ring data. Alternatively, during the process of polling the virtual ring at the target polling frequency, if no virtual ring data is acquired within a preset time period, access to the virtual ring is stopped.

[0049] Understandably, infinite polling of the virtual ring consumes a lot of processor resources. When the input / output pressure of the virtual ring is low, a large number of meaningless polling accesses will occur, resulting in a waste of processor resources. If no new data is obtained during the polling access for a long time and the set threshold is exceeded, the infinite polling access will be paused to free up processor resources. If no new data is obtained during the polling access for a short period of time but the preset time period is not exceeded, the loop will continue until the preset time period is reached, at which point the loop will pause.

[0050] based on Figure 2The method shown can obtain multiple historical input / output information of the virtual ring between the host and the virtual machine at a target time within a historical time period, as well as the first polling frequency of the host's polling access to the virtual ring. The target time is the arrival time of the historical input / output data sent by the virtual machine to the virtual ring. The target time and the amount of historical data are input into a preset prediction model to predict the amount of predicted data corresponding to the target time within the current time period. The actual amount of input / output data sent by the virtual machine to the virtual ring at the target time within the current time period is obtained. Based on the predicted data amount, the actual data amount, and the first polling frequency, the polling frequency of the host's polling access to the virtual ring is adjusted to obtain the target polling frequency. The virtual ring is polled according to the target polling frequency to obtain virtual ring data.

[0051] Since the amount of data arriving at the virtual ring at the target time can be predicted using multiple historical input / output information, the predicted data amount and the actual data amount can be compared to determine whether the predicted data amount is accurate. Based on the predicted data amount, the actual data amount, and the first polling frequency, the polling frequency of the host accessing the virtual ring can be adjusted so that the target polling frequency matches the input / output state of the virtual ring in the current time period. This achieves optimized resource utilization and performance improvement, avoids and reduces the waste of processor resources, and improves the system's response speed and stability.

[0052] Optionally, embodiments of this application provide yet another method for acquiring virtual ring data, such as... Figure 3 As shown, Figure 3 The following is a flowchart illustrating another method for acquiring virtual ring data provided in this application embodiment. The method for acquiring virtual ring data includes the following steps: S301, obtain the buffer size of the virtual ring, the maximum amount of data sent by the virtual machine to the virtual ring per second, the maximum latency of the service corresponding to the input and output data sent by the virtual machine to the virtual ring, the maximum utilization of the host's processor, the total number of virtual machines on the host, and the time taken for the host to perform word polling access operation.

[0053] S302 determines the maximum and minimum polling frequencies for host access to the virtual ring based on buffer size, large data volume, maximum latency, maximum utilization, total number of virtual machines, and time consumption.

[0054] In one optional embodiment, the first polling frequency is obtained by calculating the ratio between the maximum amount of data sent per second by the virtual machine to the virtual ring and the buffer size; the second polling frequency is obtained by calculating the ratio between a preset value and the maximum latency; the third polling frequency is obtained by calculating the product between the total number of virtual machines on the host and the time taken for the host to perform a single polling access operation, and the ratio between the maximum utilization and the product; the first polling frequency, the second polling frequency and the third polling frequency are compared, and the minimum polling frequency among the first polling frequency, the second polling frequency and the third polling frequency is determined as the maximum polling frequency for the host to access the virtual ring.

[0055] The default value is 1.

[0056] In one example, the minimum polling frequency is obtained by multiplying the maximum polling frequency by a preset ratio.

[0057] The preset ratio can be set according to actual needs and is not limited. For example, the preset ratio can be 20%.

[0058] Understandably, the maximum polling frequency is determined through multi-dimensional constraints such as buffer size, maximum data volume, maximum latency, and processor utilization. This avoids buffer overflows (through the first polling frequency limit), excessive business latency (through the second polling frequency limit), or processor overload (through the third polling frequency limit) caused by excessively high polling frequencies, ensuring stable virtual ring data transmission within safe boundaries. Using the minimum polling frequency calculated by multiple parameters as the upper limit avoids the waste of processor resources caused by excessive polling, while maintaining processor utilization within a reasonable range based on the actual load conditions such as the total number of virtual machines and the time consumed per polling session, thus balancing data processing needs and resource consumption.

[0059] This application provides another method for acquiring virtual ring data. The host can configure the acquisition method of virtual ring data, canceling the passive acquisition of data through event notification and instead actively querying and acquiring data in a loop. In the logic for acquiring virtual ring data, an infinite loop is created. This loop only exits when a stop signal is received; otherwise, it continuously checks whether new data exists in the virtual ring. The polling frequency of the host's access to the virtual ring is adjusted in real time. A threshold judgment logic is added; if the loop duration exceeds a certain threshold, the loop is paused to free up processor resources, saving host processor resources when the input / output pressure is low and avoiding unnecessary resource consumption.

[0060] Understandably, combining historical and real-time monitoring of virtual machine data volumes, and using machine learning models to predict the input / output pressure on the virtual machine, allows for timely adjustments to the polling frequency for acquiring virtual ring data, thus balancing virtual machine storage performance and host processor load. This involves replacing the traditional passive reliance on upper-layer notification mechanisms for data acquisition in the virtual ring with active polling; secondly, a threshold mechanism is added to stop polling after a certain period of inactivity, preventing unnecessary waste of processor resources; and finally, real-time adjustment of the polling frequency achieves a balance between virtual machine storage performance and processor resource load.

[0061] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0062] Embodiments of this application also provide a virtual ring data acquisition device, applied to the aforementioned host; as... Figure 4 As shown, Figure 4 A device structure block diagram of a virtual ring data acquisition apparatus provided in this application embodiment; the virtual ring data acquisition apparatus includes: The acquisition module 401 is used to acquire multiple historical input / output information corresponding to the target time of the virtual ring between the host and the virtual machine within a historical time period, as well as the first polling frequency of the host polling access to the virtual ring. The target time is the arrival time of the historical input / output data sent by the virtual machine to the virtual ring. Each piece of historical input / output information includes the historical data volume of the historical input / output data sent by the virtual machine to the virtual ring at each target time.

[0063] The prediction module 402 is used to input the target time and the amount of historical data into a preset prediction model to predict the amount of predicted data corresponding to the target time within the current time period.

[0064] The acquisition module 401 is also used to acquire the actual amount of input and output data sent by the virtual machine to the virtual ring at the target time within the current time period.

[0065] The processing module 403 is used to adjust the polling frequency of the host's polling access to the virtual ring according to the predicted data volume, the actual data volume and the first polling frequency to obtain the target polling frequency; and to poll the virtual ring according to the target polling frequency to obtain virtual ring data.

[0066] In some optional implementations, the processing module 403 is specifically used to calculate the difference between the predicted data volume and the actual data volume to obtain a prediction deviation value; if the prediction deviation value is less than or equal to a first threshold and greater than a second threshold, then the first polling frequency is determined as the target polling frequency; or, if the prediction deviation value is greater than the first threshold, or if the prediction deviation value is less than or equal to the second threshold, then an adjustment ratio is determined based on the prediction deviation value and the actual data volume; and the first polling frequency is adjusted to the target polling frequency according to the adjustment ratio.

[0067] In some optional implementations, the processing module 403 is specifically used to calculate the ratio between the prediction deviation value and the actual data volume and determine the adjustment ratio if the predicted data volume is greater than the actual data volume and the prediction deviation value is greater than a first threshold; or, if the predicted data volume is less than the actual data volume and the prediction deviation value is less than or equal to a second threshold, calculate the ratio between the prediction deviation value and the actual data volume and determine the adjustment ratio.

[0068] In some optional implementations, the processing module 403 is specifically used to calculate the product between the adjustment ratio and the first polling frequency to obtain the first frequency change; and to calculate the difference between the first polling frequency and the first frequency change to determine the target polling frequency.

[0069] In some optional implementations, the processing module 403 is further configured to modify the weight value of each parameter in the preset prediction model according to the prediction deviation value if the prediction deviation value is less than or equal to the first threshold and greater than or equal to the second threshold, so as to obtain a new prediction model.

[0070] In some optional implementations, the processing module 403 is further configured to, during the process of polling the virtual ring at the target polling frequency, stop accessing the virtual ring when it receives a first message sent from the client, the first message indicating that it is not necessary to continue acquiring virtual ring data; or, during the process of polling the virtual ring at the target polling frequency, if no virtual ring data is acquired within a preset time period, stop accessing the virtual ring.

[0071] In some optional implementations, the target polling frequency is less than or equal to the maximum polling frequency and greater than or equal to the minimum polling frequency. The acquisition module 401 is further used to acquire the buffer size of the virtual ring, the maximum amount of data sent by the virtual machine to the virtual ring per second, the maximum latency of the service corresponding to the input and output data sent by the virtual machine to the virtual ring, the maximum utilization of the host's processor, the total number of virtual machines on the host, and the time taken for the host to perform a word polling access operation. The processing module 403 is further used to determine the maximum and minimum polling frequencies of the host accessing the virtual ring based on the buffer size, the amount of data, the maximum latency, the maximum utilization, the total number of virtual machines, and the time taken.

[0072] For a description of the features in the embodiment corresponding to the virtual ring data acquisition device, please refer to the relevant description in the embodiment corresponding to the virtual ring data acquisition method, which will not be repeated here.

[0073] Embodiments of this application also provide an electronic device, such as... Figure 5 As shown, Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes a processor 10 and a memory 20, in which a computer program is stored. The processor 10 is configured to run the computer program to execute the steps in any of the above-described embodiments of the method for acquiring virtual ring data.

[0074] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described embodiments of the method for acquiring virtual ring data when it is run.

[0075] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0076] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the method for acquiring virtual ring data.

[0077] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described embodiments of the virtual ring data acquisition method.

[0078] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0079] The foregoing has provided a detailed description of a method, apparatus, electronic device, and storage medium for acquiring virtual ring data provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for acquiring virtual ring data, characterized in that, Applied to a host, the method includes: The system acquires multiple historical input / output information corresponding to the target time of the virtual ring between the host and the virtual machine within a historical time period, as well as the first polling frequency of the host polling the virtual ring. The target time is the arrival time of the historical input / output data sent by the virtual machine to the virtual ring. Each piece of historical input / output information includes the historical data volume of the historical input / output data sent by the virtual machine to the virtual ring at each target time. Input the target time and the amount of historical data into a preset prediction model to predict the amount of predicted data corresponding to the target time in the current time period. Obtain the actual amount of input and output data sent by the virtual machine to the virtual ring at the target time within the current time period; Based on the predicted data volume, the actual data volume, and the first polling frequency, the polling frequency of the host accessing the virtual ring is adjusted to obtain the target polling frequency; The virtual ring is accessed in a polling manner according to the target polling frequency to obtain virtual ring data.

2. The method according to claim 1, characterized in that, The step of adjusting the polling frequency of the host's polling access to the virtual ring based on the predicted data volume, the actual data volume, and the first polling frequency to obtain the target polling frequency includes: Calculate the difference between the predicted data volume and the actual data volume to obtain the prediction deviation value; If the prediction deviation value is less than or equal to the first threshold and greater than the second threshold, then the first polling frequency is determined as the target polling frequency; Alternatively, if the prediction deviation value is greater than the first threshold, or if the prediction deviation value is less than or equal to the second threshold, then an adjustment ratio is determined based on the prediction deviation value and the actual data volume. According to the adjustment ratio, the first polling frequency is adjusted to the target polling frequency.

3. The method according to claim 2, characterized in that, If the prediction deviation value is greater than the first threshold, or if the prediction deviation value is less than or equal to the second threshold, then an adjustment ratio is determined based on the prediction deviation value and the actual data volume, including: If the predicted data volume is greater than the actual data volume, and the prediction deviation value is greater than the first threshold, then the ratio between the prediction deviation value and the actual data volume is calculated to determine the adjustment ratio; Alternatively, if the predicted data volume is less than the actual data volume, and the prediction deviation value is less than or equal to the second threshold, then the ratio between the prediction deviation value and the actual data volume is calculated to determine the adjustment ratio.

4. The method according to claim 3, characterized in that, Adjusting the first polling frequency to the target polling frequency according to the adjustment ratio includes: The product of the adjustment ratio and the first polling frequency is calculated to obtain the first frequency change. Calculate the difference between the first polling frequency and the change in the first frequency to determine the target polling frequency.

5. The method according to claim 4, characterized in that, The method further includes: If the prediction deviation value is less than or equal to the first threshold and greater than or equal to the second threshold, then the weight value of each parameter in the preset prediction model is modified according to the prediction deviation value to obtain a new prediction model.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: During the process of accessing the virtual ring in a polling manner according to the target polling frequency, when a first message is received from the client, access to the virtual ring is stopped. The first message is used to indicate that it is not necessary to continue to obtain the virtual ring data. Alternatively, if no virtual ring data is obtained within a preset time period during the process of polling the virtual ring at the target polling frequency, access to the virtual ring will be stopped.

7. The method according to claim 6, characterized in that, The target polling frequency is less than or equal to the maximum polling frequency and greater than or equal to the minimum polling frequency, and the method further includes: The following parameters are obtained: the buffer size of the virtual ring, the maximum amount of data sent by the virtual machine to the virtual ring per second, the maximum latency of the service corresponding to the input and output data sent by the virtual machine to the virtual ring, the maximum utilization of the host's processor, the total number of virtual machines on the host, and the time taken for the host to perform a word polling access operation. Based on the buffer size, the large data volume, the maximum latency, the maximum utilization, the total number of virtual machines, and the time consumed, the maximum polling frequency and minimum polling frequency of the host accessing the virtual ring are determined.

8. A device for acquiring virtual ring data, characterized in that, Applied to a host computer, the device for acquiring virtual ring data includes: The acquisition module is used to acquire multiple historical input / output information corresponding to the target time of the virtual ring between the host and the virtual machine within a historical time period, as well as the first polling frequency of the host polling the virtual ring. The target time is the arrival time of the historical input / output data sent by the virtual machine to the virtual ring. Each piece of historical input / output information includes the historical data volume of the historical input / output data sent by the virtual machine to the virtual ring at each target time. The prediction module is used to input the target time and the amount of historical data into a preset prediction model to predict the amount of predicted data corresponding to the target time within the current time period. The acquisition module is also used to acquire the actual amount of input and output data sent by the virtual machine to the virtual ring at the target time within the current time period; The processing module is configured to adjust the polling frequency of the host's polling access to the virtual ring based on the predicted data volume, the actual data volume, and the first polling frequency to obtain a target polling frequency; and to poll the virtual ring according to the target polling frequency to obtain virtual ring data.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the method for acquiring virtual ring data as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the method for acquiring virtual ring data as described in any one of claims 1 to 7.