A method, device and storage medium for intelligently adjusting the size of a network card receive ring

By building a nonlinear dynamic system model, predicting and adjusting the size of the network card receiving ring, the problem of failure to optimize the size of the network card receiving ring according to the real-time network status in the prior art is solved, and the accuracy of the test results is improved.

CN119854249BActive Publication Date: 2025-06-20POWERLEADER COMPUTER SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510329973.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-06-20
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

The prior art failed to automatically optimize the size of the network card receiving ring according to the real-time network status during the network card receiving ring test, resulting in inaccurate test results.

Method used

By obtaining the current bandwidth utilization, delay, packet loss rate and network card reception ring size, defining nonlinear functions to build a nonlinear dynamic system model, predicting the network card reception ring size in the next cycle, and adjusting the adaptive adjustment factor and model parameters according to the feedback error and loss function, and dynamically adjusting the network card reception ring size.

Benefits of technology

It realizes intelligently adjusting the size of the network card receiving ring according to the real-time network status, and improves the accuracy of the network card receiving ring test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854249B_ABST
    Figure CN119854249B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, apparatus, and storage medium for intelligently adjusting the size of a network card receive ring. The current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size for one cycle are obtained. Based on a non-linear dynamic system model, the network card receive ring size for the next cycle is predicted according to an adaptive adjustment factor, the current bandwidth utilization rate, the current latency, the current packet loss rate, and the current network card receive ring size, resulting in a predicted network card receive ring size. The adaptive adjustment factor is adjusted according to the feedback error and a non-linear function, and the parameters of the non-linear dynamic system model are adjusted according to a loss function. The size of the network card receive ring is adjusted based on the predicted network card receive ring size. According to the current bandwidth utilization rate, the current latency, the current packet loss rate, and the current network card receive ring size, the size of the network card receive ring is intelligently adjusted, and by optimizing the adjustment of the adaptive adjustment factor and the parameters of the non-linear dynamic system model, the accuracy of the network card receive ring test results is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technologies, and particularly to a method, apparatus, and storage medium for intelligently adjusting the size of a network card receive ring. Background Art

[0002] The network card receive ring, also known as the receive queue or receive buffer, is a key component in a network interface controller (NIC, i.e., network card). The network card receive ring is responsible for temporarily storing the data packets received from the network. When data packets arrive at the network card, they are first placed in the network card receive ring and then processed by the operating system or driver and passed to the corresponding application. In related network card receive ring testing technologies, the size of the network card receive ring cannot be automatically optimized according to the real-time network status (such as bandwidth, latency, packet loss rate, etc.) during the network card receive ring testing process, resulting in inaccurate test results. Summary of the Invention

[0003] The present invention provides a method, apparatus, and storage medium for intelligently adjusting the size of a network card receive ring, aiming to solve at least one of the technical problems existing in the prior art.

[0004] The technical solution of the present invention is a method for intelligently adjusting the size of a network card receive ring, including:

[0005] Obtaining the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size in one period;

[0006] Defining a non-linear function describing the mutual influence of network states;

[0007] Constructing a non-linear dynamic system model according to the non-linear function;

[0008] Based on the non-linear dynamic system model, predicting the network card receive ring size in the next period according to an adaptive adjustment factor, the current bandwidth utilization rate, the current latency, the current packet loss rate, and the current network card receive ring size to obtain a predicted network card receive ring size;

[0009] Obtaining a feedback error, and adjusting the adaptive adjustment factor according to the feedback error and the non-linear function;

[0010] Based on a weight coefficient, calculating a loss function according to a bandwidth target value, the current bandwidth utilization rate, the current latency, and the current packet loss rate, and adjusting the parameters of the non-linear dynamic system model according to the loss function;

[0011] Adjusting the size of the network card receive ring based on the predicted network card receive ring size.

[0012] According to some embodiments of the present invention, the non-linear function includes a first non-linear function describing the influence of the network state on the current bandwidth utilization rate, a second non-linear function describing the influence of the network state on the current delay, a third non-linear function describing the influence of the network state on the current packet loss rate, and a fourth non-linear function describing the influence of the network state on the current network card receive ring size;

[0013] Constructing the non-linear dynamic system model according to the non-linear function includes:

[0014] Construct the non-linear dynamic system model according to the first non-linear function, the second non-linear function, the third non-linear function and the fourth non-linear function.

[0015] According to some embodiments of the present invention, adjusting the adaptive adjustment factor according to the feedback error and the non-linear function includes:

[0016] Multiply the learning rate by the feedback error and the non-linear function in sequence to obtain a first intermediate value;

[0017] Add the original adaptive adjustment factor to the first intermediate value to determine the adaptive adjustment factor;

[0018] It is expressed as:

[0019] ,

[0020] In the formula, is the learning rate, is the original adaptive adjustment factor, is the feedback error, is the adaptive adjustment factor.

[0021] According to some embodiments of the present invention, the adaptive adjustment factor includes a first adaptive adjustment factor, a second adaptive adjustment factor and a third adaptive adjustment factor;

[0022] The learning rate includes a first learning rate, a second learning rate and a third learning rate;

[0023] The first intermediate value includes a first-first intermediate value, a first-second intermediate value and a first-third intermediate value;

[0024] The original adaptive adjustment factor includes an original first adaptive adjustment factor, an original second adaptive adjustment factor and an original third adaptive adjustment factor;

[0025] The step of multiplying the learning rate by the feedback error and the non-linear function in sequence to obtain a first intermediate value; and adding the original adaptive adjustment factor to the first intermediate value to determine the adaptive adjustment factor includes:

[0026] Multiply the first learning rate by the feedback error and the first non - linear function in sequence to obtain the first intermediate value, and add the original first adaptive adjustment factor to the first intermediate value to determine the first adaptive adjustment factor;

[0027] Multiply the second learning rate by the feedback error and the second non - linear function in sequence to obtain the second intermediate value, and add the original second adaptive adjustment factor to the second intermediate value to determine the second adaptive adjustment factor;

[0028] Multiply the third learning rate by the feedback error and the third non - linear function in sequence to obtain the third intermediate value, and add the original third adaptive adjustment factor to the third intermediate value to determine the third adaptive adjustment factor.

[0029] According to some embodiments of the present invention, based on the non - linear dynamic system model, predicting the network card receive ring size of the next cycle according to the adaptive adjustment factor, the current bandwidth utilization rate, the current delay, the current packet loss rate and the current network card receive ring size, to obtain the predicted network card receive ring size, includes:

[0030] Based on the non - linear dynamic system model, multiply the first adaptive adjustment factor by the current bandwidth utilization rate to obtain a second intermediate value;

[0031] Multiply the second adaptive adjustment factor by the square of the current delay to obtain a third intermediate value;

[0032] Multiply the third adaptive adjustment factor by the cube of the current packet loss rate to obtain a fourth intermediate value;

[0033] Add the current network card receive ring size to the second intermediate value, the third intermediate value and the fourth intermediate value in sequence to obtain the predicted network card receive ring size;

[0034] Expressed as:

[0035] ,

[0036] Wherein, is the predicted network card receive ring size, is the current network card receive ring size, is the first adaptive adjustment factor, is the current bandwidth utilization rate, is the second adaptive adjustment factor, is the current delay, is the third adaptive adjustment factor, is the current packet loss rate.

[0037] According to some embodiments of the present invention, the obtaining of the feedback error includes:

[0038] Subtracting the current network card receive ring size from the predicted network card receive ring size to obtain the feedback error, expressed as:

[0039] ,

[0040] In the formula, is the predicted network card receive ring size, is the current network card receive ring size, is the feedback error.

[0041] According to some embodiments of the present invention, the weight coefficients include a first weight coefficient, a second weight coefficient, and a third weight coefficient;

[0042] The loss function is expressed as:

[0043] ,

[0044] In the formula, is the first weight coefficient, is the second weight coefficient, is the third weight coefficient, is the loss function, is the current packet loss rate, is the current latency, is the current bandwidth utilization rate, is the bandwidth target value.

[0045] According to some embodiments of the present invention, the adjusting of the network card receive ring size based on the predicted network card receive ring size includes:

[0046] Subtracting the current network card receive ring size from the predicted network card receive ring size to obtain a judgment value;

[0047] If the judgment value is greater than the adjustment threshold, then adjust the size of the network card receive ring to the predicted network card receive ring size, otherwise do not change the size of the network card receive ring.

[0048] The technical solution of the present invention further relates to a device for intelligently adjusting the size of the network card receive ring, which is used to execute a method for intelligently adjusting the size of the network card receive ring as described above. The device for intelligently adjusting the size of the network card receive ring includes:

[0049] A data collection module, configured to obtain the current bandwidth utilization rate, the current latency, the current packet loss rate, and the current network card receive ring size in one cycle;

[0050] A non-linear dynamic system modeling module, configured to construct the non-linear dynamic system model according to the non-linear function describing the mutual influence of the network states; the data collection module is electrically connected to the non-linear dynamic system modeling module;

[0051] A network card receive ring prediction module, configured to predict the network card receive ring size in the next cycle; the non-linear dynamic system modeling module is electrically connected to the network card receive ring prediction module;

[0052] An adaptive adjustment module, configured to adjust the adaptive adjustment factor; the adaptive adjustment module is electrically connected to the network card receive ring prediction module;

[0053] An optimization module, configured to adjust the non-linear dynamic system model parameters; the optimization module is electrically connected to the non-linear dynamic system modeling module;

[0054] A network card receive ring adjustment module, configured to adjust the size of the network card receive ring; the network card receive ring prediction module is electrically connected to the network card receive ring adjustment module.

[0055] The technical solution of the present invention further relates to an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements a method for intelligently adjusting the network card receive ring size as described above.

[0056] The technical solution of the present invention further relates to a storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements a method for intelligently adjusting the network card receive ring size as described above.

[0057] The beneficial effects of the present invention include: first, obtaining the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size in one period, defining a non-linear function describing the mutual influence of network states, constructing a non-linear dynamic system model according to the non-linear function, then based on the non-linear dynamic system model, predicting the network card receive ring size in the next period according to the adaptive adjustment factor, current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size, obtaining the predicted network card receive ring size, acquiring the feedback error, adjusting the adaptive adjustment factor according to the feedback error and the non-linear function, calculating the loss function based on the weight coefficient according to the bandwidth target value, current bandwidth utilization rate, current latency, and current packet loss rate, adjusting the parameters of the non-linear dynamic system model according to the loss function, and adjusting the size of the network card receive ring based on the predicted network card receive ring size. According to the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size, the size of the network card receive ring is intelligently adjusted, and by optimizing and adjusting the adaptive adjustment factor and the parameters of the non-linear dynamic system model, the accuracy of the network card receive ring test results is improved.

[0058] In addition, the additional aspects and advantages of the present invention will be partially given in the following description, partially become apparent from the following description, or be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 is an optional flowchart of a method for intelligently adjusting the size of the network card receive ring in an embodiment of the present invention.

[0060] Figure 2 is an optional flowchart of adjusting the size of the network card receive ring based on the predicted network card receive ring size in an embodiment of the present invention.

[0061] Figure 3 is a schematic diagram of a device for intelligently adjusting the size of the network card receive ring in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0062] The following will clearly and completely describe the concept, specific structure, and technical effects generated by the present invention in combination with the embodiments and the drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0063] It should be noted that, unless otherwise specified, when a certain feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. In addition, the up, down, left, right, top, bottom, etc. descriptions used in the present invention are only relative to the mutual positional relationship of the various components of the present invention in the drawings.

[0064] In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this technology belongs. The terms used in the description of this specification are only for describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any combination of one or more of the related listed items.

[0065] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, without departing from the scope of the present invention, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element.

[0066] Referring to Figure 1 As shown, in some embodiments, the method for intelligently adjusting the size of the network card receive ring includes, but is not limited to, steps 101 to 107, and each step will be introduced in turn below.

[0067] Step 101: Obtain the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size for one period.

[0068] It should be noted that one period can be in seconds or in minutes. The bandwidth utilization rate is the current usage rate of the network bandwidth, with the unit of Mbps. The latency is the response latency of the network request, with the unit of milliseconds. The packet loss rate is the proportion of lost data packets in the total data packets during network transmission, with the unit of %. The network card receive ring size is the size of the network card receive ring, which is usually related to the size of the system receive buffer.

[0069] In a specific embodiment, a monitoring tool is used to obtain the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size for one period in real time.

[0070] Step 102: Define a non-linear function that describes the mutual influence of network states.

[0071] It should be noted that the network states include bandwidth utilization rate, latency, packet loss rate, and network card receive ring size.

[0072] Step 103: Construct a non-linear dynamic system model according to the non-linear function.

[0073] In some embodiments, the non-linear function includes a first non-linear function that describes the influence of network states on the current bandwidth utilization rate, a second non-linear function that describes the influence of network states on the current latency, a third non-linear function that describes the influence of network states on the current packet loss rate, and a fourth non-linear function that describes the influence of network states on the current network card receive ring size;

[0074] Construct a non - linear dynamic system model according to non - linear functions, including: constructing a non - linear dynamic system model according to the first non - linear function, the second non - linear function, the third non - linear function, and the fourth non - linear function.

[0075] Specifically, the bandwidth utilization rate, latency, packet loss rate, and network card receive ring size affect each other, and this kind of influence is non - linear. Use non - linear functions to construct a non - linear dynamic system model to describe the mutual relationship between the bandwidth utilization rate, latency, packet loss rate, and network card receive ring size.

[0076] Among them, use to represent the first non - linear function, which is to describe the influence of the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size on the current bandwidth utilization rate. Use to represent the second non - linear function, which is to describe the influence of the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size on the current latency. Use to represent the third non - linear function, which is to describe the influence of the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size on the current packet loss rate. Use to represent the fourth non - linear function, which is to describe the influence of the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size on the current network card receive ring size.

[0077] In a specific embodiment, the update process in the non - linear dynamic system model is expressed as:

[0078] ,

[0079] ,

[0080] ,

[0081] ,

[0082] In the formula, is the first random perturbation, is the second random perturbation, is the third random perturbation, is the fourth random perturbation, is the bandwidth utilization rate of the next period, is the latency of the next period, is the packet loss rate of the next period, is the network card receive ring size of the next period, is the current bandwidth utilization rate, is the current latency, is the current packet loss rate, It is the receive ring size of the current network card.

[0083] Among them, is the time status. For example used in on, is the delay of the current cycle. used in on, is the delay of the next cycle.

[0084] Specifically, the first random perturbation, the second random perturbation, the third random perturbation, and the fourth random perturbation are unpredictable external factors.

[0085] In a specific embodiment, the code for defining the non - linear function describing the mutual influence of network states is as follows:

[0086] # Define the non - linear function of network state change

[0087] def f1(B, L, P, R):

[0088] return B * L * 0.01 + P * 0.1 + R * 0.02

[0089] def f2(B, L, P, R):

[0090] return L * 0.5 + P * 0.2 + R * 0.03

[0091] def f3(B, L, P, R):

[0092] return P * 0.3 + B * 0.05 + R * 0.04

[0093] def f4(B, L, P, R):

[0094] return R * 0.1 + B * 0.07 + L * 0.02

[0095] Specifically, the numerical values in the code (such as 0.01, 0.1, 0.02, 0.5, etc.) are the fourth weight coefficients used to describe the mutual influence between network states. The selection of these numerical values is based on the understanding of network behavior and experience settings.

[0096] Among them, 0.01(B*L*0.01): The bandwidth utilization rate (B) and latency (L) are interrelated; a higher bandwidth utilization rate may lead to an increase in latency, and the increase in latency in turn affects the bandwidth usage efficiency; here, 0.01 is a fourth weight coefficient, indicating that in each second of update, the impact of the bandwidth utilization rate and latency on their own changes is relatively small.

[0097] Among them, 0.1(P*0.1): The overall impact of the packet loss rate (P) on the bandwidth utilization rate (B), latency (L), packet loss rate (P), and network card receive ring size (R) is relatively significant; a higher packet loss rate will exacerbate network congestion and lead to performance degradation; the fourth weight coefficient of 0.1 indicates that the packet loss rate has a certain impact on network state changes, but it is not the dominant factor.

[0098] Among them, 0.02(R*0.02): The impact of the network card receive ring size (R) on the short-term change of the bandwidth utilization rate (B) is relatively small; the fourth weight coefficient of 0.02 indicates that within the current time period, the change in the network card receive ring size has a weak impact on the bandwidth, but in the long run, it may accumulate a certain impact.

[0099] Among them, 0.5(L*0.5): The impact of latency (L) on its own future changes is relatively significant; a higher latency will cause subsequent latency to increase further, forming a vicious cycle; the fourth weight coefficient of 0.5 indicates that latency has a strong impact on its own changes in each second of update.

[0100] Among them, 0.2(P*0.2): The packet loss rate (P) has a certain impact on the short-term change of latency (L); a higher packet loss rate may lead to retransmission latency of data packets, thereby affecting the overall latency; the fourth weight coefficient of 0.2 indicates that the impact of the packet loss rate on latency changes is moderate.

[0101] Among them, 0.03(R*0.03): The impact of the network card receive ring size (R) on the short-term change of latency (L) is relatively small; the fourth weight coefficient of 0.03 indicates that the change in the network card receive ring size has a weak impact on latency in the short term, but in the long run, it may accumulate a certain impact.

[0102] The remaining values in the code follow the same pattern.

[0103] It should be understood that the fourth weight coefficient can be further adjusted according to the specific network environment and application scenarios. Among them, when the network state is good, it is necessary to reduce the fourth weight coefficients of 0.1 (the impact of the current packet loss rate on the current bandwidth utilization rate) and 0.5 (the impact of the current latency on the current latency) to reduce network fluctuations. For example, adjust 0.1 (the impact of the current packet loss rate on the current bandwidth utilization rate) to 0.08 and 0.5 (the impact of the current latency on the current latency) to 0.4.

[0104] Among them, when the network state is poor, the fourth weight coefficient of 0.1 (the influence of the current packet loss rate on the current bandwidth utilization rate) and 0.5 (the influence of the current delay on the current delay) needs to be increased to respond to network changes more quickly. For example, adjust 0.1 (the influence of the current packet loss rate on the current bandwidth utilization rate) to 0.12 and 0.5 (the influence of the current delay on the current delay) to 0.6. By adjusting the fourth weight coefficient, it is possible to better adapt to different network environments and achieve more accurate non-linear dynamic system modeling.

[0105] Step 104: Based on the non-linear dynamic system model, predict the network card receive ring size of the next cycle according to the adaptive adjustment factor, the current bandwidth utilization rate, the current delay, the current packet loss rate, and the current network card receive ring size to obtain the predicted network card receive ring size.

[0106] Specifically, the adaptive adjustment factor is used to perform weighted adjustment according to the influence degree of different network parameters, and the prediction result of the network card receive ring size of the next cycle is optimized by adjusting the adaptive adjustment factor.

[0107] Step 105: Obtain the feedback error and adjust the adaptive adjustment factor according to the feedback error and the non-linear function.

[0108] Specifically, the non-linear dynamic system model is corrected by adjusting the adaptive adjustment factor to optimize the predicted network card receive ring size.

[0109] In some embodiments, adjusting the adaptive adjustment factor according to the feedback error and the non-linear function includes: multiplying the learning rate by the feedback error and the non-linear function in sequence to obtain a first intermediate value; adding the original adaptive adjustment factor and the first intermediate value to determine the adaptive adjustment factor;

[0110] Expressed as:

[0111] ,

[0112] In the formula, is the learning rate, is the original adaptive adjustment factor, is the feedback error, is the adaptive adjustment factor.

[0113] Specifically, represents the first non-linear function, represents the second non-linear function, represents the third non-linear function, represents the fourth non-linear function, is the current bandwidth utilization rate, is the current delay, is the current packet loss rate, is the receiving ring size of the current network card. is the time status. is the quantity. By adjusting the adaptive adjustment factor, the accuracy of the network card receiving ring test result is improved.

[0114] In some embodiments, the adaptive adjustment factor includes a first adaptive adjustment factor, a second adaptive adjustment factor, and a third adaptive adjustment factor; the learning rate includes a first learning rate, a second learning rate, and a third learning rate; the first intermediate value includes a first one intermediate value, a first two intermediate value, and a first three intermediate value; the original adaptive adjustment factor includes an original first adaptive adjustment factor, an original second adaptive adjustment factor, and an original third adaptive adjustment factor;

[0115] Multiply the learning rate by the feedback error and the non - linear function in sequence to obtain the first intermediate value; add the original adaptive adjustment factor to the first intermediate value to determine the adaptive adjustment factor, including:

[0116] Multiply the first learning rate by the feedback error and the first non - linear function in sequence to obtain the first one intermediate value, and add the original first adaptive adjustment factor to the first one intermediate value to determine the first adaptive adjustment factor;

[0117] Multiply the second learning rate by the feedback error and the second non - linear function in sequence to obtain the first two intermediate value, and add the original second adaptive adjustment factor to the first two intermediate value to determine the second adaptive adjustment factor;

[0118] Multiply the third learning rate by the feedback error and the third non - linear function in sequence to obtain the first three intermediate value, and add the original third adaptive adjustment factor to the first three intermediate value to determine the third adaptive adjustment factor.

[0119] Specifically, by adjusting the first adaptive adjustment factor, the second adaptive adjustment factor, and the third adaptive adjustment factor, the accuracy of the network card receiving ring test result is improved.

[0120] In some embodiments, based on the non - linear dynamic system model, predict the network card receiving ring size of the next cycle according to the adaptive adjustment factor, the current bandwidth utilization rate, the current delay, the current packet loss rate, and the current network card receiving ring size, to obtain the predicted network card receiving ring size, including:

[0121] Based on the non - linear dynamic system model, multiply the first adaptive adjustment factor by the current bandwidth utilization rate to obtain the second intermediate value;

[0122] Multiply the second adaptive adjustment factor by the square of the current delay to obtain the third intermediate value;

[0123] Multiply the third adaptive adjustment factor by the cube of the current packet loss rate to obtain the fourth intermediate value;

[0124] Add the current network card receive ring size to the second intermediate value, the third intermediate value, and the fourth intermediate value in sequence to obtain the predicted network card receive ring size;

[0125] It is expressed as:

[0126] ,

[0127] In the formula, is the predicted network card receive ring size, is the current network card receive ring size, is the first adaptive adjustment factor, is the current bandwidth utilization rate, is the second adaptive adjustment factor, is the current latency, is the third adaptive adjustment factor, is the current packet loss rate.

[0128] Among them, means that the period is seconds, or minutes. is the time state, such as used on , is the network card receive ring size of the current period. used on , is the predicted network card receive ring size of the next period.

[0129] Specifically, according to the real-time network performance, that is, the current bandwidth utilization rate, the current latency, the current packet loss rate, and the current network card receive ring size, the size of the network card receive ring is intelligently adjusted, avoiding the limitations of manual intervention in the traditional network card receive ring test method. Through the above real-time feedback mechanism, the size of the network card receive ring is dynamically adjusted to ensure that the network card receive ring value can be optimized according to the actual network load and status during the network card receive ring test, improving the accuracy of the network card receive ring test.

[0130] In some embodiments, obtaining the feedback error includes: subtracting the current network card receive ring size from the predicted network card receive ring size to obtain the feedback error, which is expressed as:

[0131] ,

[0132] In the formula, is the predicted network card receive ring size, is the current network card receive ring size, is the feedback error. is the time state.

[0133] It can be understood that every time the size of the network card receive ring in the next cycle is predicted, the feedback error is calculated according to the predicted size of the network card receive ring, and then the adaptive adjustment factor is adjusted according to the feedback error, improving the accuracy of the network card receive ring test results.

[0134] Step 106: Based on the weight coefficients, calculate the loss function according to the bandwidth target value, the current bandwidth utilization rate, the current latency, and the current packet loss rate, and adjust the parameters of the non-linear dynamic system model according to the loss function.

[0135] Specifically, the loss function is used to evaluate the difference or error between the predicted output of the model and the actual target value. By continuously adjusting the parameters of the model, the loss function can be minimized, thereby improving the prediction accuracy of the model.

[0136] In some embodiments, the weight coefficients include a first weight coefficient, a second weight coefficient, and a third weight coefficient; the loss function is expressed as:

[0137] ,

[0138] In the formula, is the first weight coefficient, is the second weight coefficient, is the third weight coefficient, is the loss function, is the current packet loss rate, is the current latency, is the current bandwidth utilization rate, is the bandwidth target value, is the time state.

[0139] Specifically, adjust the parameters of the non-linear dynamic system model according to the loss function to minimize the packet loss rate and latency and maximize the bandwidth utilization rate, thereby improving the accuracy of the network card receive ring test results.

[0140] Step 107: Adjust the size of the network card receive ring based on the predicted size of the network card receive ring.

[0141] Referring to Figure 2 shown, adjusting the size of the network card receive ring based on the predicted size of the network card receive ring includes, but is not limited to, the following steps 201 to 202.

[0142] Step 201: Subtract the current size of the network card receive ring from the predicted size of the network card receive ring to obtain a judgment value.

[0143] Step 202: If the judgment value is greater than the adjustment threshold, adjust the size of the network card receive ring to the predicted size of the network card receive ring; otherwise, do not change the size of the network card receive ring.

[0144] It is understandable that, based on the predicted size of the network card receive ring, the configuration of the network card receive ring is adjusted, and an adjustment threshold is set to ensure that the network card receive ring is neither too large nor too small, avoiding performance fluctuations of the network card receive ring caused by excessive adjustment.

[0145] In a specific embodiment, the code for adjusting the size of the network card receive ring based on the predicted size is as follows:

[0146] # Adjust the receive ring size

[0147] def adjust_ring_size(R, R_predicted, threshold=5):

[0148] if abs(R_predicted - R) > threshold:

[0149] R = R_predicted

[0150] return R

[0151] # Example adjustment

[0152] def adjust_ring(R, R_predicted):

[0153] return adjust_ring_size(R, R_predicted)

[0154] It can be seen that the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size of a period are obtained, a non-linear function describing the mutual influence of network states is defined, a non-linear dynamic system model is constructed based on the non-linear function, and then based on the non-linear dynamic system model, the network card receive ring size of the next period is predicted according to the adaptive adjustment factor, current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size to obtain the predicted network card receive ring size. The feedback error is obtained, the adaptive adjustment factor is adjusted according to the feedback error and the non-linear function, the loss function is calculated based on the weight coefficient according to the bandwidth target value, current bandwidth utilization rate, current latency, and current packet loss rate, and the parameters of the non-linear dynamic system model are adjusted according to the loss function. The size of the network card receive ring is adjusted based on the predicted network card receive ring size. According to the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size, the size of the network card receive ring is intelligently adjusted, and by optimizing and adjusting the adaptive adjustment factor and the parameters of the non-linear dynamic system model, the accuracy of the network card receive ring test results is improved.

[0155] In a specific embodiment, the startup code is as follows:

[0156] def main():

[0157] netname = "eth0" # Network card name

[0158] current_ring_size = 512 # Initial receive ring size

[0159] prev_ring_size = current_ring_size # Record the previous receive ring size

[0160] for _ in range(10): # Simulate multiple iterations

[0161] print(f"\nCurrent receive ring size: {current_ring_size}")

[0162] current_ring_size = adjust_network_card(netname, current_ring_size, prev_ring_size)

[0163] prev_ring_size = current_ring_size # Update the previous receive ring size

[0164] time.sleep(2)

[0165] if __name__ == "__main__":

[0166] main()

[0167] In a specific embodiment, when the current bandwidth utilization rate (B) = 80 Mbps, the current latency (L) = 20 ms, the current packet loss rate (P) = 1%, the current network card receive ring size (R) = 150, the adaptive adjustment factor = [0.1, 0.05, 0.02], the learning rate = [0.01, 0.01, 0.01], and the adjustment threshold (threshold) = 5, the bandwidth target value is set to 90, the first weight coefficient, the second weight coefficient, and the third weight coefficient are set to 0.5, 0.3, and 0.2 respectively, and the size of the network card receive ring is adjusted to 152. This is a scenario where the network state is good, the bandwidth utilization rate is high, and the latency and packet loss rate are low. At this time, the goal is to maintain the stability of the network card receive ring size and avoid over-adjustment.

[0168] In a specific embodiment, the current bandwidth utilization rate (B) = 30 Mbps, the current latency (L) = 45 ms, the current packet loss rate (P) = 4%, the current network card receive ring size (R) = 120, the adaptive adjustment factor = [0.2, 0.1, 0.05], the learning rate = [0.02, 0.02, 0.02], when the adjustment threshold (threshold) = 10, the bandwidth target value is set to 90, the first weight coefficient, the second weight coefficient, and the third weight coefficient are set to 0.6, 0.4, and 0.3 respectively, and the size of the network card receive ring is adjusted to 130. This is a scenario where the network state is poor, the bandwidth utilization rate is low, and the latency and packet loss rate are high. At this time, the goal is to relieve network congestion by adjusting the size of the network card receive ring.

[0169] In a specific embodiment, the current bandwidth utilization rate (B) = 95 Mbps, the current latency (L) = 40 ms, the current packet loss rate (P) = 3%, the current network card receive ring size (R) = 180, the adaptive adjustment factor = [0.15, 0.08, 0.03], the learning rate = [0.015, 0.015, 0.015], when the adjustment threshold (threshold) = 8, the bandwidth target value is set to 90, the first weight coefficient, the second weight coefficient, and the third weight coefficient are set to 0.5, 0.4, and 0.3 respectively, and the size of the network card receive ring is adjusted to 175. This is a scenario where the bandwidth utilization rate is high, but the latency and packet loss rate are also high. At this time, the goal is to reduce the latency and packet loss rate by adjusting the size of the network card receive ring, while trying to maintain the bandwidth utilization rate.

[0170] Refer to Figure 3 As shown, an embodiment of the present invention further provides a device for intelligently adjusting the size of the network card receive ring, which is used to execute the above method for intelligently adjusting the size of the network card receive ring. The device for intelligently adjusting the size of the network card receive ring includes:

[0171] A data collection module, which is used to obtain the current bandwidth utilization rate, current latency, current packet loss rate, and current network card receive ring size in one cycle;

[0172] A non - linear dynamic system modeling module, which is used to construct a non - linear dynamic system model according to the non - linear function describing the mutual influence of network states; the data collection module is electrically connected to the non - linear dynamic system modeling module;

[0173] A network card receive ring prediction module, which is used to predict the size of the network card receive ring in the next cycle; the non - linear dynamic system modeling module is electrically connected to the network card receive ring prediction module;

[0174] An adaptive adjustment module, which is used to adjust the adaptive adjustment factor; the adaptive adjustment module is electrically connected to the network card receive ring prediction module;

[0175] An optimization module for adjusting the parameters of a non-linear dynamic system model; the optimization module is electrically connected to the non-linear dynamic system modeling module;

[0176] A network card receive ring adjustment module for adjusting the size of the network card receive ring; the network card receive ring prediction module is electrically connected to the network card receive ring adjustment module.

[0177] An embodiment of the present invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the method for intelligently adjusting the size of the network card receive ring as described above is implemented. The electronic device can be any intelligent terminal including a computer, etc.

[0178] An embodiment of the present invention also provides a storage medium, which stores a computer program, and when the computer program is executed by a processor, the method for intelligently adjusting the size of the network card receive ring as described above is implemented.

[0179] It should be recognized that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or computer instructions stored in a non-transitory computer-readable memory. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, for this purpose, the program can run on a dedicated integrated circuit programmed for this purpose.

[0180] In addition, the operations of the processes described herein can be performed in any suitable order, unless otherwise indicated herein or otherwise clearly contradicted by the context. The processes described herein (or variations and / or combinations thereof) can be executed under the control of one or more computer systems configured with executable instructions, and can be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executed commonly on one or more processors, by hardware, or a combination thereof. The computer program includes multiple instructions executable by one or more processors.

[0181] Further, the method may be implemented in any type of computing platform operably connected to a suitable one, including but not limited to personal computers, minicomputers, mainframes, workstations, network or distributed computing environments, separate or integrated computer platforms, or communicating with charged particle tools or other imaging devices, etc. Aspects of the present invention may be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into the computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer and, when read by the storage medium or device, can be used to configure and operate the computer to perform the processes described herein. Additionally, the machine-readable code, or portions thereof, may be transmitted via wired or wireless networks. When such media include instructions or programs that implement the above-described steps in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention may also include the computer itself.

[0182] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the transformed data represents physical and tangible objects, including a specific visual depiction of the physical and tangible objects produced on the display.

[0183] As described above, only the preferred embodiments of the present invention are given, and the present invention is not limited to the above-described embodiments. As long as the same means are used to achieve the technical effects of the present invention, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention. Within the scope of protection of the present invention, its technical solutions and / or implementation manners may have various different modifications and changes.

Claims

1. A method for intelligently adjusting the size of a network card receiving ring, characterized in that: include: Get the current bandwidth utilization, current delay, current packet loss rate and current network card receiving ring size for a period; Define nonlinear functions that describe the mutual influence of network states; Constructing a nonlinear dynamic system model according to the nonlinear function; Based on the nonlinear dynamic system model, predicting the network card receiving ring size of the next cycle according to the adaptive adjustment factor, the current bandwidth utilization, the current delay, the current packet loss rate and the current network card receiving ring size, to obtain the predicted network card receiving ring size; Acquire a feedback error, and adjust the adaptive adjustment factor according to the feedback error and the nonlinear function; Based on the weight coefficient, a loss function is calculated according to the bandwidth target value, the current bandwidth utilization, the current delay and the current packet loss rate, and the nonlinear dynamic system model parameters are adjusted according to the loss function; Adjusting the size of the network card receiving ring based on the predicted network card receiving ring size; The nonlinear function includes a first nonlinear function describing the influence of the network state on the current bandwidth utilization, a second nonlinear function describing the influence of the network state on the current delay, a third nonlinear function describing the influence of the network state on the current packet loss rate, and a fourth nonlinear function describing the influence of the network state on the current network card receiving ring size; Constructing a nonlinear dynamic system model according to the nonlinear function includes: The nonlinear dynamic system model is constructed according to the first nonlinear function, the second nonlinear function, the third nonlinear function and the fourth nonlinear function.

2. The method for intelligently adjusting the size of a network card receiving ring according to claim 1, characterized in that: The step of adjusting the adaptive adjustment factor according to the feedback error and the nonlinear function comprises: Multiplying the learning rate, the feedback error and the nonlinear function in sequence to obtain a first intermediate value; Adding the original adaptive adjustment factor to the first intermediate value to determine the adaptive adjustment factor; It is expressed as: , In the formula, is the learning rate, is the original adaptive adjustment factor, is the feedback error, is the adaptive adjustment factor, is the current bandwidth utilization, is the current delay, is the current packet loss rate, is the current network card receiving ring size, is the nonlinear function.

3. The method for intelligently adjusting the size of a network card receiving ring according to claim 2, characterized in that: The adaptive adjustment factors include a first adaptive adjustment factor, a second adaptive adjustment factor and a third adaptive adjustment factor; The learning rate includes a first learning rate, a second learning rate and a third learning rate; The first intermediate values ​​include a first-first intermediate value, a first-second intermediate value, and a first-third intermediate value; The original adaptive adjustment factors include an original first adaptive adjustment factor, an original second adaptive adjustment factor and an original third adaptive adjustment factor; The learning rate is multiplied by the feedback error and the nonlinear function in sequence to obtain a first intermediate value; Adding the original adaptive adjustment factor to the first intermediate value to determine the adaptive adjustment factor includes: Multiplying the first learning rate, the feedback error and the first nonlinear function in sequence to obtain the first-first intermediate value, and adding the original first adaptive adjustment factor to the first-first intermediate value to determine the first adaptive adjustment factor; Multiplying the second learning rate, the feedback error and the second nonlinear function in sequence to obtain the first two intermediate values, and adding the original second adaptive adjustment factor to the first two intermediate values ​​to determine the second adaptive adjustment factor; The third learning rate is multiplied with the feedback error and the third nonlinear function in sequence to obtain the first three intermediate values, and the original third adaptive adjustment factor is added to the first three intermediate values ​​to determine the third adaptive adjustment factor.

4. The method for intelligently adjusting the size of a network card receiving ring according to claim 3, characterized in that: The method of predicting the network card receiving ring size of the next cycle based on the nonlinear dynamic system model according to the adaptive adjustment factor, the current bandwidth utilization, the current delay, the current packet loss rate and the current network card receiving ring size to obtain the predicted network card receiving ring size includes: Based on the nonlinear dynamic system model, multiplying the first adaptive adjustment factor by the current bandwidth utilization to obtain a second intermediate value; multiplying the second adaptive adjustment factor by the square of the current delay to obtain a third intermediate value; Multiplying the third adaptive adjustment factor by the cube of the current packet loss rate to obtain a fourth intermediate value; Adding the current network card receiving ring size to the second intermediate value, the third intermediate value, and the fourth intermediate value in sequence to obtain the predicted network card receiving ring size; It is expressed as: , In the formula, is the predicted network card receiving ring size, is the current network card receiving ring size, is the first adaptive adjustment factor, is the current bandwidth utilization, is the second adaptive adjustment factor, is the current delay, is the third adaptive adjustment factor, is the current packet loss rate.

5. The method for intelligently adjusting the size of a network card receiving ring according to claim 1, characterized in that: The obtaining of feedback error comprises: The feedback error is obtained by subtracting the current network card receiving ring size from the predicted network card receiving ring size, which is expressed as: , In the formula, is the predicted network card receiving ring size, is the current network card receiving ring size, is the feedback error.

6. The method for intelligently adjusting the size of a network card receiving ring according to claim 1, characterized in that: The weight coefficients include a first weight coefficient, a second weight coefficient, and a third weight coefficient; The loss function is expressed as: , In the formula, is the first weight coefficient, is the second weight coefficient, is the third weight coefficient, is the loss function, is the current packet loss rate, is the current delay, is the current bandwidth utilization, is the bandwidth target value.

7. The method for intelligently adjusting the size of a network card receiving ring according to claim 1, characterized in that: Adjusting the size of the network card receiving ring based on the predicted network card receiving ring size includes: Subtract the predicted network card receiving ring size from the current network card receiving ring size to obtain a judgment value; If the judgment value is greater than the adjustment threshold, the size of the network card receiving ring is adjusted to the predicted network card receiving ring size; otherwise, the size of the network card receiving ring is not changed.

8. A device for intelligently adjusting the size of a network card receiving ring, used to execute the method for intelligently adjusting the size of a network card receiving ring as claimed in any one of claims 1 to 7, characterized in that: The device for intelligently adjusting the size of the network card receiving ring includes: A data collection module, used to obtain the current bandwidth utilization, the current delay, the current packet loss rate and the current network card receiving ring size of a cycle; A nonlinear dynamic system modeling module, used for constructing the nonlinear dynamic system model according to the nonlinear function describing the mutual influence of the network states; the data collection module is electrically connected to the nonlinear dynamic system modeling module; A network card receiving ring prediction module, used to predict the size of the network card receiving ring in the next cycle; the nonlinear dynamic system modeling module is electrically connected to the network card receiving ring prediction module; An adaptive adjustment module, used for adjusting the adaptive adjustment factor; the adaptive adjustment module is electrically connected to the network card receiving ring prediction module; An optimization module, used for adjusting the nonlinear dynamic system model parameters; the optimization module is electrically connected to the nonlinear dynamic system modeling module; The network card receiving ring adjustment module is used to adjust the size of the network card receiving ring; the network card receiving ring prediction module is electrically connected to the network card receiving ring adjustment module.

9. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a method for intelligently adjusting the size of a network card receiving ring according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Network card test method and device and machine readable memory medium

    CN107547304A

  • Wireless local area network modulation code adaptive selection method based on reinforcement learning and wireless equipment

    CN112468265A