Method and device for intelligently adjusting size of receiving ring of network card and storage medium

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 network card receiving ring in the prior art based on the real-time network status is solved, and the accuracy of the test results is improved.

CN119854249AActive Publication Date: 2025-04-18POWERLEADER COMPUTER SYST CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the network card receiving ring size cannot be automatically optimized based on real-time network status, 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

Improve the accuracy of the network card receiving ring test results, ensuring that the size of the network card receiving ring is optimized according to the actual network load and status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854249A_ABST
    Figure CN119854249A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for intelligently adjusting the size of a network card receiving ring and a storage medium, and the method comprises the steps: obtaining the current bandwidth utilization rate, the current delay, the current packet loss rate and the current size of the network card receiving ring of a period; predicting the size of the network card receiving ring in the next period according to the self-adaptive adjustment factor, the current bandwidth utilization rate, the current delay, the current packet loss rate and the current size of the network card receiving ring to obtain the predicted size of the network card receiving ring, and adjusting the self-adaptive adjustment factor according to the feedback error and the nonlinear function. Adjusting parameters of the nonlinear dynamic system model according to the loss function, and adjusting the size of the network card receiving ring based on the predicted size of the network card receiving ring. According to the present bandwidth utilization rate, the present delay, the present packet loss rate and the present network card receiving ring size, the size of the network card receiving ring is intelligently adjusted, and the accuracy of the network card receiving ring test result is improved by optimizing and adjusting the adaptive adjustment factor and the nonlinear dynamic system model parameter.
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 technology, and in particular to a method, a device and a storage medium for intelligently adjusting the size of a network card receiving ring. Background Art

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

[0003] The present invention provides a method, a device and a storage medium for intelligently adjusting the size of a network card receiving 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 receiving ring, comprising:

[0005] Get the current bandwidth utilization, current delay, current packet loss rate and current network card receiving ring size for a period;

[0006] Define nonlinear functions that describe the mutual influence of network states;

[0007] Constructing a nonlinear dynamic system model according to the nonlinear function;

[0008] 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;

[0009] Acquire a feedback error, and adjust the adaptive adjustment factor according to the feedback error and the nonlinear function;

[0010] 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;

[0011] The size of the network card receiving ring is adjusted based on the predicted network card receiving ring size.

[0012] According to some embodiments of the present invention, 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;

[0013] The step of constructing a nonlinear dynamic system model according to the nonlinear function comprises:

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

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

[0016] Multiplying the learning rate, the feedback error and the nonlinear function in sequence to obtain a first intermediate value;

[0017] Adding 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 values ​​include a first-first intermediate value, a first-second intermediate value, and a first-third intermediate value;

[0024] 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;

[0025] The step of multiplying the learning rate, the feedback error and the nonlinear 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 comprises:

[0026] 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;

[0027] 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;

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

[0029] According to some embodiments of the present invention, the 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:

[0030] Based on the nonlinear dynamic system model, multiplying the first adaptive adjustment factor by the current bandwidth utilization to obtain a second intermediate value;

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

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

[0033] 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;

[0034] It is expressed as:

[0035] ,

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

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

[0038] 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:

[0039] ,

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

[0041] According to some embodiments of the present invention, the weight coefficient includes 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 delay, is the current bandwidth utilization, is the bandwidth target value.

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

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

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

[0048] The technical solution of the present invention also relates to a device for intelligently adjusting the size of a network card receiving ring, which is used to execute a method for intelligently adjusting the size of a network card receiving ring as described above, wherein the device for intelligently adjusting the size of a network card receiving ring comprises:

[0049] 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;

[0050] 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;

[0051] 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;

[0052] 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;

[0053] 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;

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

[0055] The technical solution of the present invention also 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 the method for intelligently adjusting the size of a network card receiving ring as described above.

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

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

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

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

[0060] Figure 2 This is an optional flow chart for adjusting the size of a network card receiving ring based on predicting the size of the network card receiving ring in an embodiment of the present invention.

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

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

[0063] It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly fixed or connected to the other feature, or it may be indirectly fixed or connected to the other feature. In addition, the descriptions of up, down, left, right, top, bottom, etc. used in the present invention are only relative to the relative positional relationship of the 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 those generally understood by those skilled in the art. The terms used in this specification are only for describing specific embodiments, not for limiting the present invention. The term "and / or" used herein includes any combination of one or more related listed items.

[0065] It should be understood that although the terms first, second, third, etc. may be used to describe various elements in the present invention, 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] Reference Figure 1 As shown, in some embodiments, the method for intelligently adjusting the size of the network card receiving ring includes but is not limited to steps 101 to 107, and each step is introduced in turn below.

[0067] Step 101: Obtain the current bandwidth utilization, current delay, current packet loss rate and current network card receiving ring size of a period.

[0068] It should be noted that a cycle can be measured in seconds or minutes. Bandwidth utilization is the current utilization rate of network bandwidth, measured in Mbps. Latency is the response delay of network requests, measured in milliseconds. Packet loss rate is the ratio of data packets lost in network transmission to total data packets, measured in %. NIC receive ring size is the size of the NIC receive ring, which is usually related to the system receive buffer size.

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

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

[0071] It should be noted that the network status includes bandwidth utilization, delay, packet loss rate and network card receiving ring size.

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

[0073] In some embodiments, the nonlinear function includes a first nonlinear function describing the effect of the network state on the current bandwidth utilization, a second nonlinear function describing the effect of the network state on the current delay, a third nonlinear function describing the effect of the network state on the current packet loss rate, and a fourth nonlinear function describing the effect of the network state on the current network card receiving ring size;

[0074] Constructing a nonlinear dynamic system model according to the nonlinear function includes: constructing a nonlinear dynamic system model according to a first nonlinear function, a second nonlinear function, a third nonlinear function and a fourth nonlinear function.

[0075] Specifically, bandwidth utilization, delay, packet loss rate and network card receiving ring size will affect each other, and this influence is nonlinear. A nonlinear dynamic system model is constructed using nonlinear functions to describe the relationship between bandwidth utilization, delay, packet loss rate and network card receiving ring size.

[0076] Among them, use Represents the first nonlinear function, which describes the influence of current bandwidth utilization, current delay, current packet loss rate and current network card receiving ring size on current bandwidth utilization. Represents the second nonlinear function, which describes the impact of current bandwidth utilization, current delay, current packet loss rate and current network card receiving ring size on current delay. Represents the third nonlinear function, which describes the influence of current bandwidth utilization, current delay, current packet loss rate and current network card receiving ring size on the current packet loss rate. represents the fourth nonlinear function, which is used to describe the influence of the current bandwidth utilization, the current delay, the current packet loss rate and the current network card receiving ring size on the current network card receiving ring size.

[0077] In a specific embodiment, the updating process in the nonlinear 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 of the next cycle, is the delay for the next cycle, is the packet loss rate of the next cycle, is the network card receiving ring size for the next cycle, is the current bandwidth utilization, is the current delay, is the current packet loss rate, The current network card receiving ring size.

[0083] in, is the time state. Use in superior, is the delay of the current cycle. Use in superior, is the delay to the next cycle.

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

[0085] In a specific embodiment, the code for defining a nonlinear function that describes the mutual influence of network states is as follows:

[0086] # Define a nonlinear function for network state changes

[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 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 values ​​is based on the understanding and experience of network behavior.

[0096] Among them, 0.01 (B*L*0.01): bandwidth utilization (B) and latency (L) are interrelated; higher bandwidth utilization may lead to increased latency, and increased latency will affect the efficiency of bandwidth utilization; the 0.01 here is a fourth weight coefficient, indicating that in the update per second, the impact of bandwidth utilization and latency on their own changes is relatively small.

[0097] Among them, 0.1(P*0.1): The packet loss rate (P) has a significant overall impact on bandwidth utilization (B), latency (L), packet loss rate (P) and network card receive ring size (R); a higher packet loss rate will aggravate 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 status changes, but it is not the dominant factor.

[0098] Among them, 0.02 (R*0.02): the short-term change of the network card receiving ring size (R) has a relatively small impact on the bandwidth utilization (B); the fourth weight coefficient of 0.02 indicates that in the current time period, the change of the network card receiving 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 delay (L) on its own future changes is more significant; higher delay will lead to further increase in subsequent delays, forming a vicious circle; the fourth weight coefficient of 0.5 means that delay has a strong impact on its own changes in each second update.

[0100] Among them, 0.2(P*0.2): the packet loss rate (P) has a certain impact on the short-term variation of the delay (L); a higher packet loss rate may cause data packet retransmission delays, which in turn affects the overall delay; the fourth weight coefficient of 0.2 indicates that the packet loss rate has a moderate impact on the delay variation.

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

[0102] The rest of the values ​​in the code are similar.

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

[0104] When the network status is poor, the fourth weight coefficients of 0.1 (the impact of the current packet loss rate on the current bandwidth utilization) and 0.5 (the impact of the current delay on the current delay) need to be increased to respond to network changes more quickly. For example, 0.1 (the impact of the current packet loss rate on the current bandwidth utilization) is adjusted to 0.12, and 0.5 (the impact of the current delay on the current delay) is adjusted to 0.6. By adjusting the fourth weight coefficient, it is possible to better adapt to different network environments and achieve more accurate nonlinear dynamic system modeling.

[0105] Step 104: Based on the nonlinear dynamic system model, the network card receiving ring size of the next cycle is predicted 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.

[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 receiving ring size in the next period is optimized by adjusting the adaptive adjustment factor.

[0107] Step 105: Obtain feedback error, and adjust the adaptive adjustment factor according to the feedback error and the nonlinear function.

[0108] Specifically, the nonlinear dynamic system model is corrected by adjusting the adaptive adjustment factor, and the size of the network card receiving ring is optimized and predicted.

[0109] In some embodiments, adjusting the adaptive adjustment factor according to the feedback error and the nonlinear function includes: 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;

[0110] It is 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 nonlinear function, represents the second nonlinear function, represents the third nonlinear function, represents the fourth nonlinear function, is the current bandwidth utilization, is the current delay, is the current packet loss rate, The current network card receiving ring size. For the time status. 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-intermediate value, a first-second intermediate value, and a first-third 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] The learning rate is multiplied by the feedback error and the nonlinear function in sequence to obtain a first intermediate value; the original adaptive adjustment factor is added to the first intermediate value to determine the adaptive adjustment factor, including:

[0116] The first learning rate is multiplied by the feedback error and the first nonlinear function in sequence to obtain a first intermediate value, and the original first adaptive adjustment factor is added to the first intermediate value to determine the first adaptive adjustment factor;

[0117] The second learning rate is multiplied by the feedback error and the second nonlinear function in sequence to obtain a first intermediate value and a second intermediate value, and the original second adaptive adjustment factor is added to the first intermediate value to determine the second adaptive adjustment factor;

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

[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 nonlinear dynamic system model, the network card receiving ring size of the next cycle is predicted 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, including:

[0121] Based on the nonlinear dynamic system model, multiplying the first adaptive adjustment factor by the current bandwidth utilization to obtain a second intermediate value;

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

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

[0124] The current network card receiving ring size is sequentially added to the second intermediate value, the third intermediate value, and the fourth intermediate value to obtain the predicted network card receiving ring size;

[0125] It is expressed as:

[0126] ,

[0127] In the formula, To predict the size of the network card receiving ring, 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.

[0128] in, The meaning is that a cycle is seconds, or minute. For time states, such as Use in superior, The network card receiving ring size of the current cycle. Use in superior, The predicted network card receive ring size for the next cycle.

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

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

[0131] ,

[0132] In the formula, To predict the size of the network card receiving ring, is the current network card receiving ring size, is the feedback error. For the time status.

[0133] It is understandable that each time the network card receiving ring size of the next cycle is predicted, the feedback error is calculated according to the predicted network card receiving ring size, and then the adaptive adjustment factor is adjusted according to the feedback error, thereby improving the accuracy of the network card receiving ring test result.

[0134] Step 106: 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.

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

[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 delay, is the current bandwidth utilization, is the bandwidth target value, For the time status.

[0139] Specifically, the parameters of the nonlinear dynamic system model are adjusted according to the loss function to minimize the packet loss rate and delay and maximize the bandwidth utilization, thereby improving the accuracy of the network card receiving ring test results.

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

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

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

[0143] Step 202: 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.

[0144] It is understandable that the NIC receiving ring is configured and adjusted based on the predicted size of the NIC receiving ring, and an adjustment threshold is set to ensure that the NIC receiving ring is not too large or too small, thereby avoiding performance fluctuations of the NIC receiving ring due to excessive adjustment.

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

[0146] # Adjust the receiving 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, current delay, current packet loss rate and current network card receiving ring size of a cycle are obtained, a nonlinear function describing the mutual influence of network status is defined, a nonlinear dynamic system model is constructed according to the nonlinear function, and then based on the nonlinear dynamic system model, the network card receiving ring size of the next cycle is predicted 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, and the predicted network card receiving ring size is obtained, and the feedback error is obtained. The adaptive adjustment factor is adjusted according to the feedback error and the nonlinear function, and the loss function is calculated according to the bandwidth target value, the current bandwidth utilization, the current delay and the current packet loss rate based on the weight coefficient. The nonlinear dynamic system model parameters are adjusted according to the loss function, and the size of the network card receiving ring is adjusted based on the predicted network card receiving ring size. According to the current bandwidth utilization, the current delay, the current packet loss rate and the current network card receiving ring size, the size of the network card receiving ring is intelligently adjusted, and the accuracy of the network card receiving ring test result is improved by optimizing and adjusting the adaptive adjustment factor and the nonlinear dynamic system model parameters.

[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 last receiving ring size

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

[0161] print(f"\nCurrent receiving 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 last receive ring size

[0164] time.sleep(2)

[0165] if __name__ == "__main__":

[0166] main()

[0167] In a specific embodiment, when the current bandwidth utilization (B) = 80Mbps, the current delay (L) = 20ms, the current packet loss rate (P) = 1%, the current network card receiving 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 network card receiving ring size is adjusted to 152. This is a scenario with a good network status, high bandwidth utilization, low delay and packet loss rate. The goal at this time is to maintain the stability of the network card receiving ring size and avoid excessive adjustment.

[0168] In a specific embodiment, the current bandwidth utilization (B) = 30Mbps, the current delay (L) = 45ms, the current packet loss rate (P) = 4%, the current network card receiving ring size (R) = 120, the adaptive adjustment factor = [0.2, 0.1, 0.05], the learning rate = [0.02, 0.02, 0.02], and 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 receiving ring is adjusted to 130. This is a scenario where the network status is poor, the bandwidth utilization is low, and the delay and packet loss rate are high. The goal at this time is to alleviate network congestion by adjusting the network card receiving ring size.

[0169] In a specific embodiment, the current bandwidth utilization (B) = 95Mbps, the current delay (L) = 40ms, the current packet loss rate (P) = 3%, the current network card receiving ring size (R) = 180, the adaptive adjustment factor = [0.15, 0.08, 0.03], the learning rate = [0.015, 0.015, 0.015], and 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 receiving ring is adjusted to 175. This is a scenario with high bandwidth utilization, but high delay and packet loss rate. The goal at this time is to reduce the delay and packet loss rate by adjusting the network card receiving ring size while trying to maintain bandwidth utilization.

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

[0171] The data collection module is used to obtain the current bandwidth utilization, current delay, current packet loss rate and current network card receiving ring size of a cycle;

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

[0173] The network card receiving ring prediction module is 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;

[0174] An adaptive adjustment module, used for adjusting an adaptive adjustment factor; the adaptive adjustment module is electrically connected to the network card receiving ring prediction module;

[0175] An optimization module, used for adjusting the parameters of the nonlinear dynamic system model; the optimization module is electrically connected to the nonlinear dynamic system modeling module;

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

[0177] The embodiment of the present invention also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned method of intelligently adjusting the size of the network card receiving ring when executing the computer program. The electronic device can be any intelligent terminal including a computer.

[0178] An embodiment of the present invention further provides a storage medium storing a computer program. When the computer program is executed by a processor, the method for intelligently adjusting the size of a network card receiving ring is implemented.

[0179] It should be appreciated that the method steps in the embodiments of the present invention can be implemented or implemented by computer hardware, a combination of hardware and software, or by 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 process or object-oriented programming language to communicate with a computer system. However, if necessary, the program can be implemented in an assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, the program can be run on a programmed ASIC for this purpose.

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

[0181] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or portions thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above 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 can also include the computer itself.

[0182] The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a 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 converted data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on the display.

[0183] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention. Within the scope of protection of the present invention, its technical scheme and / or implementation method may have various 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; The size of the network card receiving ring is adjusted based on the predicted network card receiving ring size.

2. The method for intelligently adjusting the size of a network card receiving ring according to claim 1, characterized in that: 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.

3. The method for intelligently adjusting the size of a network card receiving ring according to claim 2, 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.

4. The method for intelligently adjusting the size of a network card receiving ring according to claim 3, 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.

5. The method for intelligently adjusting the size of a network card receiving ring according to claim 4, 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.

6. 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.

7. 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.

8. 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.

9. 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 8, 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.

10. 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 8 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

  • Cross-domain communication network intelligent service rate mapping and switching method

    CN119211963A

  • Predictive control systems and methods with offline gains learning and online control

    US20210096518A1