Method and device for adjusting network queue parameters, computer readable medium and computer program product
By calculating network pressure in real time and adjusting network queue parameters, the problem of network queue parameters being unable to adapt to demand in real time is solved, and rapid self-healing of network performance and improvement of service quality are achieved. It is suitable for a variety of network environments.
Patent Information
- Application Number
- CN202410796935.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2044-06-19
AI Technical Summary
Existing technologies are unable to adjust network queue parameters in real time according to specific circumstances, resulting in network processing bottlenecks and packet loss, affecting service quality.
By obtaining the network queue load data of the target device, the network pressure is calculated in real time, and the network queue parameters are adjusted according to the pressure, including system-level and process-level parameters, to achieve automatic and efficient parameter adjustment.
Without the need for manual intervention, it can quickly respond to sudden network performance bottlenecks, effectively prevent packet loss, improve service quality, and is applicable to various scenarios such as cloud computing environments, Internet of Things applications, and mobile communication networks.
Smart Images

Figure CN120602432A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network queue technology, and more particularly to a method and device for adjusting network queue parameters, a computer-readable medium, and a computer program product. Background Art
[0002] When a device receives and sends network data packets, it can use a network queue for buffering. The network queue parameters have a significant impact on the device's network performance.
[0003] In some related technologies, it is impossible to adjust network queue parameters in real time according to specific circumstances, resulting in some situations (such as when the network load surges) where the network queue parameters are insufficient to maintain normal business operations, resulting in network processing bottlenecks, packet loss, etc., affecting service quality. Summary of the Invention
[0004] The present disclosure provides a method and device for adjusting network queue parameters, a computer-readable medium, and a computer program product.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for adjusting network queue parameters, comprising:
[0006] Obtaining network queue load data of a target device; the network queue load data represents a load condition of a network queue in the network device, the network queue being used to cache network data packets;
[0007] determining network pressure based on the network queue load data;
[0008] Adjust the network queue parameters of the target device according to the network pressure.
[0009] In a second aspect, an embodiment of the present disclosure provides a device for adjusting network queue parameters, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any one of the methods for adjusting network queue parameters of the embodiments of the present disclosure.
[0010] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements any one of the methods for adjusting network queue parameters of the embodiments of the present disclosure.
[0011] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements any method of adjusting network queue parameters in the embodiment of the present disclosure.
[0012] In the embodiments of the present disclosure, the network pressure can be calculated based on the specific network queue load data in the target device, and the network queue parameters can be adjusted according to the network pressure. Therefore, the network queue parameters can be automatically, efficiently and in real time adjusted without manual intervention to adapt to the needs. When faced with sudden bottlenecks in network performance, a quick response can be made to achieve rapid self-healing, effectively prevent packet loss, and improve service quality. Moreover, the embodiments of the present disclosure have a wide range of applications and can be used in various scenarios (such as cloud computing environments, Internet of Things applications, mobile communication networks, etc.), and can provide guarantees for the smooth operation of various applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In the accompanying drawings of the embodiments of the present disclosure:
[0014] Figure 1 A flowchart of a method for adjusting network queue parameters provided by an embodiment of the present disclosure;
[0015] Figure 2 A flowchart of another method for adjusting network queue parameters provided by an embodiment of the present disclosure;
[0016] Figure 3 A block diagram of a device for adjusting network queue parameters provided by an embodiment of the present disclosure;
[0017] Figure 4 A block diagram of a computer-readable medium according to an embodiment of the present disclosure;
[0018] Figure 5 A schematic diagram of module division of another device for adjusting network queue parameters provided by an embodiment of the present disclosure;
[0019] Figure 6 A logical process diagram of another method for adjusting network queue parameters provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] To enable those skilled in the art to better understand the technical solutions of the present disclosure, the method and device for adjusting network queue parameters, computer-readable media, and computer program products provided by embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0021] The present disclosure will be described more fully hereinafter with reference to the accompanying drawings, but the illustrated embodiments may be embodied in different forms, and the present disclosure should not be construed as limited to the embodiments set forth below. Rather, these embodiments are provided so that the present disclosure will be thorough and complete and will fully understand the scope of the present disclosure to those skilled in the art.
[0022] The accompanying drawings of the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the detailed embodiments, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing the detailed embodiments with reference to the accompanying drawings.
[0023] The present disclosure may be described with reference to plan views and / or cross-sectional views by way of ideal schematic views of the present disclosure. Therefore, the exemplary illustrations may be modified according to manufacturing techniques and / or tolerances.
[0024] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0025] The terms used in this disclosure are only used to describe specific embodiments and are not intended to limit the disclosure. As used in this disclosure, the term "and / or" includes any and all combinations of one or more related enumerated items. As used in this disclosure, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. As used in this disclosure, the terms "comprising" and "made of" specify the presence of the features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof.
[0026] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meanings as those commonly understood by those skilled in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined in this disclosure.
[0027] The present disclosure is not limited to the embodiments shown in the drawings, but includes modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the drawings have schematic properties, and the shapes of the regions shown in the drawings illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.
[0028] Various network devices (such as mobile phones, tablets, etc.) often need to send and receive network data packets through the network. In order to ensure the orderly processing of network data packets and the stability of network services, a network queue can be used to cache them. That is, the network data packets to be processed are cached in the network queue and processed in the network queue in a first-in-first-out order.
[0029] Therefore, the settings of network queue parameters (such as network queue length, exception handling method, etc.) will have a great impact on the network performance of the device.
[0030] Some related technologies allow for the configuration of network queue parameters for the device's operating system, known as "system-level network queue parameters." However, these system-level network queue parameters can only be pre-set by the operator with several sets of "default values" based on various application scenarios. Only one set of default values can be selected at a time, and these system-level network queue parameters may not be suitable for the specific device and may not meet specific requirements.
[0031] In other related technologies, applications running on a device can set network queue parameters for their own processes, also known as "process-level network queue parameters." However, applications cannot perceive the overall (low-level) network conditions of the device and, therefore, cannot readily set network queue parameters that meet specific network conditions.
[0032] As a result, relevant technologies are unable to adjust network queue parameters in real time according to specific circumstances, resulting in some situations (such as when network load surges) where network queue parameters are insufficient to maintain normal business operations, leading to network processing bottlenecks, packet loss, etc., affecting service quality.
[0033] In a first aspect, an embodiment of the present disclosure provides a method for adjusting network queue parameters.
[0034] The disclosed embodiments are used to control and adjust network queue parameters in a target device.
[0035] Among them, the network queue is used to cache network data packets. It can be various specific types of queues, such as process (application) socket receive queue, system ARP queue, IP fragment reassembly queue, network card driver ring buffer, etc.
[0036] In the disclosed embodiment, the target device is a device such as a mobile phone or a tablet computer that can connect to the Internet, so it can send, receive and process data (network data packets) through the network; and the network data packets can be cached by the network queue in the target device, and the network queue parameters are the parameters used by the network queue, such as the network queue length, exception handling method, etc.
[0037] Reference Figure 1 The method for adjusting network queue parameters in an embodiment of the present disclosure includes:
[0038] S101: Obtain network queue load data of a target device.
[0039] The network queue load data represents the load condition of the network queue in the network device.
[0040] S102: Determine network pressure based on network queue load data.
[0041] S103: Adjust the network queue parameters of the target device according to the network pressure.
[0042] In the disclosed embodiments, data on the load condition of the network queue of the target device (network queue load data) is obtained in real time (e.g., monitored), such as the arrival rate of network data packets in the network queue, the network queue length, the continuous proportion of queue pressure, and other indicators; and based on the above network queue load data, an indicator (network stress) representing the current network load condition of the target device can be calculated; thus, based on the network stress, the network queue parameters of the target device can be adjusted so that the network queue operating according to the adjusted network queue parameters can meet the requirements of the current network load condition.
[0043] There are various specific ways to obtain network pressure based on network queue load data.
[0044] For example, the network pressure can be obtained according to the network queue load data through a preset pressure assessment model. The pressure assessment model can comprehensively consider network queue load data such as the arrival rate of network data packets, the number of times / duration that the queue is in a pressure state, and the number of times / duration that the queue is in an overflow state within a certain period of time. According to the preset weight value for each data, the network pressure is calculated by weighted average and other methods (for example, a value between 0 and 100, a larger value indicates a higher load).
[0045] There are various specific ways to adjust the network queue parameters of the target device.
[0046] For example, when network pressure indicates that the network queue's resources are overloaded, the network queue length may be increased so that more network data packets can be cached in the network queue to avoid packet loss; or, when network pressure indicates that the network queue's resources are surplus, the network queue length may be reduced to avoid the network queue occupying cache resources that are not actually used.
[0047] In the embodiments of the present disclosure, the network pressure can be calculated based on the specific network queue load data in the target device, and the network queue parameters can be adjusted according to the network pressure. Therefore, the network queue parameters can be automatically, efficiently and in real time adjusted without manual intervention to adapt to the needs. When faced with sudden bottlenecks in network performance, a quick response can be made to achieve rapid self-healing, effectively prevent packet loss, and improve service quality. Moreover, the embodiments of the present disclosure have a wide range of applications and can be used in various scenarios (such as cloud computing environments, Internet of Things applications, mobile communication networks, etc.), and can provide guarantees for the smooth operation of various applications.
[0048] In some embodiments, adjusting the network queue parameters of the target device according to the network pressure (S103) includes:
[0049] S103A: Adjust system-level network queue parameters and / or process-level network queue parameters of the target device according to network pressure.
[0050] As one embodiment of the present disclosure, the adjusted network queue parameters can be network queue parameters of the operating system of the target device as a whole (system-level network queue parameters), or network queue parameters related to a specific process (process-level network queue parameters).
[0051] For example, the cause of the current network pressure can be further analyzed. If the network pressure is caused by the target device as a whole, the system-level network queue parameters can be adjusted by modifying the specified / proc parameters; or, if the network pressure is caused by a specific process (application), the process can be notified to actively modify its corresponding network queue parameters (process-level network queue parameters) through signals, shared memory, etc.
[0052] Therefore, the embodiments of the present disclosure can adapt to various different situations. For example, when the application scenarios are different, the system-level network queue parameters can be further adjusted to improve the overall resource management and responsiveness of the target device; and for different running applications, their specific needs can be met through refined process-level network queue parameters to improve the resource utilization efficiency and performance of the application.
[0053] In some embodiments, reference Figure 2 , adjusting the network queue parameters of the target device according to the network pressure (S103) includes:
[0054] S103B1. Determine an adjustment factor based on network pressure.
[0055] The adjustment factor represents the ratio of the adjustment value of the network queue parameter to the original value of the network queue parameter.
[0056] S103B2. Adjust the network queue parameters of the target device according to the adjustment factor.
[0057] As one method of an embodiment of the present disclosure, an "adjustment factor" may be calculated in a predetermined manner based on network pressure. The adjustment factor indicates the "proportional" adjustment that should be made to the specific value of the current network queue parameter (such as increasing the network queue length by 10%, etc.), so that the network queue parameter can be adjusted accordingly according to the adjustment factor.
[0058] There are various specific ways to obtain the adjustment factor according to network pressure.
[0059] For example, an adjustment factor or the like may be obtained according to network pressure mapping through a preset mapping function (such as linear mapping, logarithmic transformation, Sigmoid transformation, etc.).
[0060] It should be understood that the embodiments of the present disclosure are not limited to the above specific methods. For example, the specific values of the adjusted network queue parameters can also be directly calculated according to the network pressure.
[0061] In some embodiments, reference Figure 2 , determining the adjustment factor (S103B1) based on network pressure includes:
[0062] S103B11. Obtain an initial adjustment factor based on the network pressure mapping.
[0063] S103B12. Smoothing the initial adjustment factor according to historical adjustment factor information to obtain an adjustment factor.
[0064] The historical adjustment factor information includes a plurality of adjustment factors that have been used previously.
[0065] After adjusting the network queue parameter of the target device according to the adjustment factor (S103B2), the method further includes:
[0066] S103B3. Record the adjustment factor in the historical adjustment factor information.
[0067] As one approach in an embodiment of the present disclosure, the adjustment factor used each time can be "recorded" in historical adjustment factor information. Accordingly, when calculating the adjustment factor, an "initial adjustment factor" can be directly calculated based on network pressure. This initial adjustment factor can then be "smoothed" based on historical adjustment factor information to obtain the final used (and recorded) adjustment factor.
[0068] The initial adjustment factor can also be obtained by "mapping" the network pressure, such as performing linear mapping, logarithmic transformation, Sigmoid transformation, etc. according to the network pressure.
[0069] The purpose of "smoothing" is to make the adjustment factor calculated this time as close as possible to the adjustment factor used previously (that is, the curve is as smooth as possible), thereby preventing drastic fluctuations in the adjustment factor and avoiding drastic fluctuations in network performance due to excessive adjustments to network queue parameters.
[0070] In some embodiments, the historical adjustment factor information also includes a network performance change corresponding to the adjustment factor, where the network performance change corresponding to the adjustment factor represents a change in the network performance of the target device relative to before adjustment after the network queue parameters of the target device are adjusted according to the adjustment factor.
[0071] Reference Figure 2 , recording the adjustment factor in the historical adjustment factor information (S103B3) includes:
[0072] S103B31. Obtain the current network performance of the target device, determine a network performance change corresponding to the adjustment factor based on the current network performance and the network performance of the target device before adjustment, and record the adjustment factor and the corresponding network performance change in the historical adjustment factor information.
[0073] As a method of an embodiment of the present disclosure, before and after each adjustment using the adjustment factor, the overall network performance of the target device can be recorded separately, and the change in the adjusted network performance relative to the network performance before the adjustment (network performance change) is calculated, and the network performance change is recorded together with the adjustment factor in the historical adjustment factor information. In this way, in the process of smoothing the initial adjustment factor, in addition to referring to the adjustment factor, the corresponding network performance change is also referred to, thereby obtaining an adjustment factor with better smoothing effect.
[0074] Among them, network performance is a performance indicator that represents the overall network situation of the target device, which can be comprehensively obtained based on indicators such as packet loss rate, throughput, and delay (such as weighted average).
[0075] There are various specific ways to perform smoothing.
[0076] For example, the adjustment factors (and corresponding changes in network performance) can be analyzed according to the sequence of usage time to establish a model for the change of adjustment factors over time, and then the smoothed adjustment factors can be predicted based on the historically used adjustment factors (and corresponding changes in network performance) and the initial adjustment factors.
[0077] In some embodiments, reference Figure 2 , determining the network pressure according to the network queue load data (S101) includes:
[0078] S101A: In response to the network queue load data meeting a preset first condition, determine the network pressure according to the network queue load data.
[0079] As one method of an embodiment of the present disclosure, the network pressure may be calculated accordingly only when the network queue load data meets a preset first condition (which represents that the resources of the network queue are very likely to be overloaded or surplus, such as network queue pressure occurring or network queue overflow exceeding a predetermined number of times within a time period), thereby reducing unnecessary calculations.
[0080] For example, the socket receive queue of an application can be monitored. When the network queue usage ratio exceeds a preset threshold (such as 90%), the queue pressure is recorded once. When the network queue usage ratio exceeds 100%, a queue overflow is recorded once. If queue pressure and queue overflow occur continuously within a preset period (such as the number of times exceeds the preset threshold), the network pressure calculation will be started accordingly.
[0081] In some embodiments, reference Figure 2 , adjusting the network queue parameters of the target device according to the network pressure (S102) includes:
[0082] S102A: In response to the network pressure meeting a preset second condition, adjust the network queue parameters of the target device according to the network pressure.
[0083] As one method of an embodiment of the present disclosure, when calculating network pressure, the network queue parameters of the target device may be adjusted accordingly according to the network pressure (such as calculating an adjustment factor and adjusting the network queue parameters according to the adjustment factor) only when the calculated network pressure meets a preset second condition (which represents that the network load is very large or very small, such as the network pressure exceeds a preset threshold, or is less than another preset threshold), thereby avoiding overly frequent adjustments to the network queue parameters.
[0084] Secondly, refer to Figure 3 An embodiment of the present disclosure provides a device for adjusting network queue parameters, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any method of adjusting network queue parameters in the embodiment of the present disclosure.
[0085] Thirdly, refer to Figure 4 An embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon. When the computer program is executed by a processor, any method of adjusting network queue parameters according to the embodiment of the present disclosure is implemented.
[0086] Fourthly, refer to Figure 5 An embodiment of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements any method of adjusting network queue parameters in the embodiment of the present disclosure.
[0087] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, which can realize information exchange between the memory and the processor, including but not limited to the data bus (Bus), etc.
[0088] Example 1:
[0089] The following is an exemplary introduction to a method for adjusting network queue parameters according to an embodiment of the present disclosure.
[0090] Reference Figure 5 The method for adjusting network queue parameters of an embodiment of the present disclosure may be performed by a device for adjusting network queue parameters, which may be divided into a pressure monitoring module A100, a network queue tuning module A110, and a performance feedback module A120.
[0091] In the embodiment of the present disclosure, the pressure monitoring module A100 is used to monitor the load of the network queue in the device system in real time, periodically obtain and record relevant data (network queue load data), and when it is determined that the network queue resources are overloaded or in excess, calculate the network pressure, notify and trigger the network queue tuning module A110.
[0092] Reference Figure 5 In the embodiment of the present disclosure, the pressure monitoring module A100 may include a state recording unit A101 and a pressure assessment unit A102. The state recording unit A101 is used to provide data to the pressure assessment unit A102. The pressure assessment unit A102 is used to calculate network pressure based on the received data and, in response to a specific state or state change, to notify the network queue tuning module A110.
[0093] Exemplarily, the status recording unit A101 can insert a monitoring point in the kernel protocol stack message enqueue process. The monitoring point periodically collects and analyzes basic indicators such as the arrival rate of network data packets and the network queue usage ratio. At the same time, the pressure monitoring threshold interface (for example: / proc interface) is exposed to the user, and the user can flexibly configure the sensitivity to network pressure according to business conditions.
[0094] For example, in one embodiment, a user may configure a usage threshold of a socket receiving network queue of an application to 90%, so that within a specified period, the monitoring point is responsible for recording and judging at the point where the message is enqueued: when the network queue usage exceeds the threshold (90%), the network queue pressure is recorded once; when the network queue usage exceeds 100%, a network queue overflow is recorded once; wherein, if network queue pressure and network queue overflow occur continuously for a period of time (the first condition), the count of the network queue being in a continuous pressure state and overflow state is updated, and when the period ends, the number of network data packets reached within the period is updated, and the above data is sent to the pressure evaluation unit A102 in the form of parameter transfer, triggering the evaluation unit A102 to calculate the network pressure based on these data.
[0095] Illustratively, the pressure assessment unit A102 may calculate the current network pressure based on the above data according to a preset pressure assessment model, and send a network queue tuning signal to the network queue tuning module A110 when the network pressure deviates from the normal fluctuation range (the second condition).
[0096] Among them, the pressure assessment model can comprehensively consider multiple influencing factors (network queue load data) such as the arrival rate of network data packets within a period, the number / duration of the network queue being in a pressure state, and the number / duration of the network queue being in an overflow state.
[0097] For example, in one embodiment, the stress assessment model may be a weighted average model, which calculates the network stress according to the following formula:
[0098]
[0099] Where n is the number of influencing factors, ci is the normalized value of the i-th influencing factor (the value range is 0 to 1); wi is the weight value of the i-th influencing factor, and the value range of each wi is 0 to 100, and That is, the sum of the weight values is 100; thus, the network stress between 0 and 100 can be calculated.
[0100] When assigning weight values to each influencing factor, a rule-based approach can be used to adjust the weight values of the network queue overflow factor, network queue pressure factor, etc. according to the packet arrival rate within the period, service type, etc.; a statistical learning-based approach can also be used to train the optimal weight value combination through supervised learning.
[0101] Therefore, after the network stress is calculated, the status of the network queue can be evaluated based on it.
[0102] For example, it can be considered that when the network pressure stress is in the range of 0 to 20, it means that the network queue resources are in excess, and the network queue reduction strategy should be triggered (the network queue parameters of the network queue should be adjusted to reduce the network queue); when the network pressure stress is in the range of 60 to 100, it means that the network queue resources are overloaded (high pressure), and the network queue expansion strategy should be triggered (the network queue parameters of the network queue should be adjusted to increase the network queue), and a tuning request should be actively sent to the network queue tuning module A110. A tuning request is actively sent to the network queue tuning module A110; when the network pressure stress is in the range of 20 to 60, it is considered that the network queue resources are moderately utilized and no adjustment is required (that is, the second condition is not met).
[0103] In the disclosed embodiment, the network queue tuning module A110 is used to calculate an adjustment factor according to the network pressure (in the tuning request) from the pressure monitoring module A100, and to adjust and configure network queue parameters according to the adjustment factor.
[0104] Reference Figure 5The network queue tuning module A110 in the disclosed embodiment includes a parameter calculation unit A111 and a parameter configuration unit A112. The parameter calculation unit A111 provides tuning decisions based on data analysis, while the parameter configuration unit A112 converts these decisions into actual network queue parameter adjustments.
[0105] Exemplarily, the parameter calculation unit A111 receives a tuning request from the pressure monitoring module A100, determines the current tuning strategy (reducing the network queue strategy or expanding the network queue strategy) through the network pressure stress, calculates the initial adjustment factor, and comprehensively considers the adjustment factors used in each previous tuning, the network performance changes after adjustment (network performance changes) and other feedback records (historical adjustment factor information), smoothes the initial adjustment factor, and obtains the final adjustment factor used.
[0106] For example, in one embodiment, the initial adjustment factor can be obtained by mapping the network stress, such as by using linear mapping, logarithmic transformation, Sigmoid transformation, etc. When smoothing the initial adjustment factor, a time series analysis method can be used to establish a model of how the adjustment factor changes over time. Then, based on historical data and influencing factors, the value of the smoothed adjustment factor is predicted and recorded for subsequent configuration operations by the parameter configuration unit A112.
[0107] Exemplarily, the parameter configuration unit A112 is used to maintain and adjust all network queue parameters, which specifically include system-level network queue parameters and / or process-level network queue parameters. First, the current system-level network queue parameters and / or process-level network queue parameters, as well as the adjustment factors provided by the parameter calculation unit A111, are obtained to calculate the tuned system-level network queue parameters and / or process-level network queue parameters (such as network queue length), and then the parameter configuration is performed within the range allowed by the system; then, the parameter configuration unit A112 verifies whether the configuration is effective, including verifying whether the configured parameters meet the process resource limits and the system global resource limits. If the configuration fails, it may be that the current parameters are out of the adjustment range, and thus need to be fed back to the parameter calculation unit A111 to facilitate adaptive adjustment.
[0108] For example, in one embodiment, the adjustment of system-level network queue parameters can be achieved by modifying specified / proc parameters; for process-level network queue parameters, the process can be notified to actively modify the corresponding network queue parameters through signals, shared memory, etc.
[0109] In the disclosed embodiment, the performance feedback module A120 is used to evaluate the performance changes of the network before and after adjustment (network performance changes), and specifically feeds back the smoothing message to the network queue tuning module A110 so that it can smooth the initial adjustment factor to ensure the stability and performance of the system.
[0110] In the embodiments of the present disclosure, refer to Figure 5 The performance feedback module A120 includes a performance evaluation unit A121 and a tuning history record unit A122, which together provide a comprehensive evaluation of network performance. The performance evaluation unit A121 provides real-time feedback on network performance, while the tuning history record unit A122 records changes in network performance before and after tuning to facilitate adjustments to the network queue optimization strategy (smoothing process).
[0111] Exemplarily, after the parameter configuration unit A112 completes the configuration, the performance evaluation unit A121 uses relevant tools to monitor the network performance of the operating system, or the process actively executes network performance testing internally to obtain changes in parameters such as the network packet loss rate before and after adjustment.
[0112] For example, in one embodiment, the performance evaluation unit A121 may use tools such as iperf, iftop, and traceroute to obtain network performance.
[0113] The performance evaluation unit A121 can be used primarily in two scenarios. The first is the development phase, during which it monitors the network's overall packet loss rate, throughput, latency, and other indicators. Under relatively stable basic service scenarios, it comprehensively evaluates network performance and, through repeated optimization, determines the optimal stable values of network queue parameters. The second is the regular deployment phase, during which it focuses on evaluating the network's packet loss rate. This allows for early prediction and dynamic adjustments to prevent packet loss in the event of unexpected stress.
[0114] Exemplarily, the tuning history recording unit A122 records the network performance of the system after the parameter adjustment, and compares it with the network performance before the tuning to obtain the change in network performance.
[0115] For example, in one embodiment, after the parameter adjustment is completed, the tuning history recording unit A122 will record the network performance at different time points, and draw a historical curve of network performance changes based on these data to help analyze the effect of the parameter adjustment, adjust the optimization strategy of the optimization algorithm according to the characteristics of the historical data, and feed back the message to the network queue tuning module A110.
[0116] For example, refer to Figure 6 A method for adjusting network queue parameters according to an embodiment of the present disclosure may include the following steps:
[0117] B210: Start the above pressure monitoring module, network queue tuning module, and performance feedback module to ensure that the modules operate normally in coordination with each other.
[0118] B220: The pressure monitoring module periodically monitors the operating status of the network queue and calculates the network pressure. When the network pressure exceeds the normal fluctuation range, the network queue tuning module is triggered to perform tuning.
[0119] B230: The network queue tuning module calculates the initial adjustment factor based on pressure monitoring data, and smoothes the initial adjustment factor by taking into account feedback records such as changes in network performance and pressure. It then performs network queue tuning based on the smoothed adjustment factor and monitors the results.
[0120] B240: The performance feedback module evaluates network performance changes before and after parameter adjustments, records parameter adjustment history, and sets a minimum adjustment interval to guide and coordinate a smooth tuning process.
[0121] For example, refer to Figure 6 This embodiment takes adjusting the process-level socket receive buffer as an example to describe in detail the method for adjusting network queue parameters in the embodiment of the present disclosure, which may include the following steps:
[0122] The first step is to start the upper-layer business process and initialize various resources of the network queue tuning device, including pressure monitoring data (network packet arrival rate within a period, number of times / duration of the network queue in the pressure state, number of times / duration of the network queue in the overflow state), network queue adjustment factor, pressure assessment model parameters, etc.
[0123] The second step is to add a monitoring point to the socket packet receiving process of the kernel protocol stack's transport layer. During normal business operation, the real-time usage percentage of the network queue of the business process (e.g., a socket) is collected. When the network queue usage percentage exceeds the user-configured threshold ratio, the network queue pressure status is recorded. If the network queue usage percentage exceeds the threshold ratio repeatedly, the count of the number of times the network queue is continuously in the pressure state is recorded and updated. When the network queue usage percentage exceeds the current system / process configured limit, the network queue overflow status is recorded. If the network queue usage percentage exceeds the limit repeatedly, the count of the number of times the network queue is continuously in the overflow state is recorded and updated. Subsequently, the network pressure of the current network queue is periodically evaluated, and key influencing factors are normalized. The network stress is calculated using a weighted average sum of these influencing factors.
[0124] The third step is to determine the network stress status and calculate the network queue adjustment factor. This factor is then smoothed based on feedback from network performance indicators and stress changes, and the adjusted network queue parameter size is calculated. An adjustment signal is sent to notify the process to use setsockopt() to adjust the SO_RCVBUF receive buffer parameter. A query is then performed to verify that the configuration has taken effect. If the configuration fails, it indicates that the match is outside the adjustment range, requiring recalculation of the tuning factor to facilitate adaptive adjustments.
[0125] In the fourth step, after parameter adjustments are completed, use relevant monitoring tools to monitor network performance metrics such as the packet loss rate during process execution. Simultaneously, use the network pressure calculation method from the second step to reassess network queue pressure, recording changes in system pressure before and after the adjustments. If pressure is alleviated, reduce the tuning factor; if pressure persists, increase the tuning factor. This network performance metric and historical network pressure information are fed back into the tuning factor calculation model from the third step to guide the calculation of the tuning factor there.
[0126] For example, refer to Figure 6 In the embodiment of the present disclosure, the process of calculating the adjustment factor may include the following steps:
[0127] C310: Define stress assessment factors (influence factors) and periodically monitor the data, such as the network packet arrival rate within a period, the number of times / duration the network queue is in stress state, and the number of times / duration the network queue is in overflow state.
[0128] C320: Trains the stress assessment model, inputs stress assessment factors, and outputs network stress.
[0129] C330: Implements intelligent tuning based on pressure perception and performance feedback. It trains a tuning calculation model, inputs network queue pressure, obtains the expansion factor or reduction factor for network queue tuning, and outputs the parameter value after network queue tuning.
[0130] C340: After completing the tuning, the tuning factors are further smoothed based on the network performance feedback before and after the tuning.
[0131] During the specific implementation of this algorithm, the implementation of the pressure assessment model and the tuning calculation model includes but is not limited to rule-based methods, machine learning methods, etc. Those skilled in the art can make reasonable choices based on actual conditions.
[0132] Those skilled in the art will appreciate that all or some of the steps, systems, and functional modules / units in the apparatus disclosed above may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0133] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation.
[0134] Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; compact disc (CD-ROM), digital versatile disc (DVD) or other optical disc storage; magnetic cassettes, tapes, disk storage or other magnetic storage; any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0135] The present disclosure has disclosed example embodiments, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A method for adjusting network queue parameters, comprising: Get the target device's network queue load data; The network queue load data represents the load of a network queue in a network device, where the network queue is used to cache network data packets; determining network pressure based on the network queue load data; Adjust the network queue parameters of the target device according to the network pressure.
2. The method according to claim 1, wherein The adjusting the network queue parameters of the target device according to the network pressure includes: Adjust the system-level network queue parameters and / or process-level network queue parameters of the target device according to the network pressure.
3. The method according to claim 1, wherein The adjusting the network queue parameters of the target device according to the network pressure includes: determining an adjustment factor according to the network pressure; the adjustment factor represents a ratio of the adjustment value of the network queue parameter to the original value of the network queue parameter; The network queue parameter of the target device is adjusted according to the adjustment factor.
4. The method according to claim 3, wherein: Determining the adjustment factor according to the network pressure includes: obtaining an initial adjustment factor according to the network pressure mapping; The adjustment factor is obtained by smoothing the initial adjustment factor according to historical adjustment factor information; the historical adjustment factor information includes a plurality of previously used adjustment factors; After adjusting the network queue parameter of the target device according to the adjustment factor, the method further includes: The adjustment factor is recorded in the historical adjustment factor information.
5. The method according to claim 4, wherein The historical adjustment factor information also includes a network performance change corresponding to the adjustment factor, where the network performance change corresponding to the adjustment factor represents a change in the network performance of the target device relative to before the adjustment after the network queue parameter of the target device is adjusted according to the adjustment factor; Recording the adjustment factor in the historical adjustment factor information includes: obtaining the current network performance of the target device, determining the network performance change corresponding to the adjustment factor based on the current network performance and the network performance of the target device before adjustment, and recording the adjustment factor and the corresponding network performance change in the historical adjustment factor information.
6. The method according to claim 1, wherein Determining the network pressure according to the network queue load data includes: In response to the network queue load data meeting a preset first condition, the network pressure is determined according to the network queue load data.
7. The method according to claim 1, wherein The adjusting the network queue parameters of the target device according to the network pressure includes: In response to the network pressure meeting a preset second condition, adjusting a network queue parameter of the target device according to the network pressure.
8. A device for adjusting network queue parameters, comprising a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements the method for adjusting network queue parameters as described in any one of claims 1 to 7.
9. A computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for adjusting network queue parameters according to any one of claims 1 to 7 is implemented.
10. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the method for adjusting network queue parameters according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Router queue control system based on congestion identification and control method thereof
CN101997776A
Data processing method and device, electronic equipment and storage medium
CN117729157A
Method and apparatus for obtaining an attenuation factor
US20090116486A1
End-to-end quality of service optimization and reporting
US20140355439A1
Capacity management based on backlog information
US20150222560A1