Load balancing and dynamic resource scheduling system for cloud-native micro-service cluster
Patent Information
- Application Number
- CN202611045143.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]本申请的目的在于提供面向云原生微服务集群的负载均衡与动态资源调度系统,旨在克服现有技术中因依赖应用层吞吐均值统计而无法感知微秒级流量加速度突变的缺陷,提升微服务集群在高并发突发工况下的物理层抗突发能力与运行稳定性
[0021] By extracting traffic acceleration parameters, it is possible to obtain accurate perception of micro-traffic change trends in advance without increasing the processing burden of the application layer. By introducing a compensation coefficient that dynamically matches the absolute value of the difference, the temporarily stored data packets are re-injected into the protocol stack at a controlled rate, avoiding secondary overload during the recovery phase and compressing the fluctuation range of end-to-end response latency during traffic peaks into an extremely narrow bandwidth.
Smart Images

Figure CN122933541A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network congestion control technology, specifically a load balancing and dynamic resource scheduling system for cloud-native microservice clusters. Background Technology
[0002] Existing load balancing and resource scheduling technologies typically follow the rule of statistically analyzing the average request throughput within a fixed time window at the network access layer, using it at the second or minute level. This statistical average is then used as the core basis for measuring the load status of the underlying hardware network interface card and triggering rate limiting and resource scheduling decisions. The implicit assumption is that the statistical average within the window can linearly and equivalently represent the actual load status of the hardware within that period. This assumption has long dominated the design logic of the status acquisition node.
[0003] The inherent flaw of this statistical method stems from the irreversible smoothing effect of the mean operation on the transient derivative information within the time series: there is an inherent mismatch in sampling granularity between the wide time window and the influx of microsecond-level messages, causing the mean operation to completely absorb the drastic changes in flow acceleration that actually exist within the window. The system no longer has the ability to perceive micro-transient changes at the mathematical level. This flaw is rooted in the scale mismatch between the statistical quantity itself and the physical transient process, and cannot be bridged by improving computing power or shortening the statistical period.
[0004] This leads to a continuous accumulation of directional risks, causing transient packet backlogs to exceed the physical capacity limits of the network interface card's ring buffer and the kernel protocol stack buffer. This results in underlying queue overflows, silent packet dropping, and retransmission timeouts in the upper-layer transmission control protocol, causing a non-linear increase in end-to-end response latency. How to accurately detect and preemptively physically block microsecond-level traffic acceleration mutations at the network access layer without relying on application-layer throughput average statistics has become a pressing technical problem. Summary of the Invention
[0005] The purpose of this application is to provide a load balancing and dynamic resource scheduling system for cloud-native microservice clusters, aiming to overcome the shortcomings of existing technologies that cannot detect microsecond-level traffic acceleration changes due to reliance on application layer throughput average statistics, and to improve the physical layer's ability to withstand sudden changes and the operational stability of microservice clusters under high-concurrency and sudden operating conditions.
[0006] The objective of this application can be achieved through the following technical solution: Firstly, a load balancing and dynamic resource scheduling system for cloud-native microservice clusters, comprising the following modules:
[0007] The data acquisition module is used to obtain the cumulative throughput sequence of the target cluster within continuous discrete time slices at the network access layer;
[0008] The extraction module is used to obtain the flow acceleration parameters corresponding to the target time slice based on the characteristics of the change in throughput difference between adjacent time slices in the cumulative throughput sequence.
[0009] The vector construction module is used to construct a state feature vector representing the micro-flow mutation trend based on the flow acceleration parameters corresponding to the target time slice and several previous historical time slices.
[0010] The data processing module is used to perform element-level aligned synchronous weighting operations on the state feature vector based on a preset time decay weight to obtain a surge response value that characterizes a continuous surge trend.
[0011] The determination module is used to temporarily store the underlying address identifier of the target data packet in a preset kernel isolation buffer when the surge response value is greater than the preset security dissipation boundary, and otherwise generate a compensation coefficient that matches the difference between the surge response value and the security dissipation boundary.
[0012] The service processing module is used to re-inject the underlying address identifier temporarily stored in the kernel isolation buffer into the kernel protocol stack space that is of the same origin as the regular message for service processing when the traffic acceleration parameter of the target time slice and the surge response value meet the preset traffic fallback conditions.
[0013] Secondly, the load balancing and dynamic resource scheduling method for cloud-native microservice clusters includes the following steps:
[0014] Obtain the cumulative throughput sequence of the target cluster within consecutive discrete time slices at the network access layer, and based on the characteristics of the throughput difference change between adjacent time slices in the cumulative throughput sequence, obtain the traffic acceleration parameter corresponding to the target time slice.
[0015] Based on the flow acceleration parameters corresponding to the target time slice and several previous historical time slices, a state feature vector characterizing the micro-flow mutation trend is constructed.
[0016] Based on a preset time decay weight, the state feature vector is subjected to element-level aligned synchronous weighting to obtain a surge response value that characterizes a continuous surge trend.
[0017] When the surge response value is greater than the preset security dissipation boundary, the underlying address identifier of the target data packet is temporarily stored in the preset kernel isolation buffer; otherwise, a compensation coefficient matching the difference between the surge response value and the security dissipation boundary is generated.
[0018] When the traffic acceleration parameter of the target time slice and the surge response value meet the preset traffic fallback condition, the underlying address identifier temporarily stored in the kernel isolation buffer is re-injected into the kernel protocol stack space of the same origin as the regular message for business processing based on the compensation coefficient.
[0019] Thirdly, a computer storage medium stores computer-executable instructions, which, when executed, implement the load balancing and dynamic resource scheduling system for cloud-native microservice clusters described in the first aspect.
[0020] Compared with the prior art, the beneficial effects of this application are:
[0021] By extracting traffic acceleration parameters, it is possible to obtain accurate perception of micro-traffic change trends in advance without increasing the processing burden of the application layer. By introducing a compensation coefficient that dynamically matches the absolute value of the difference, the temporarily stored data packets are re-injected into the protocol stack at a controlled rate, avoiding secondary overload during the recovery phase and compressing the fluctuation range of end-to-end response latency during traffic peaks into an extremely narrow bandwidth.
[0022] By monitoring the reversal frequency of the compensation coefficient and dynamically stretching the characteristic dimension and weight gradient of the reference attenuation vector, the system is able to suppress periodic oscillations in specific frequency bands, thereby improving the system's steady-state operation capability under complex operating conditions. Attached Figure Description
[0023] Figure 1 This is a schematic diagram illustrating the steps of the load balancing and dynamic resource scheduling method for cloud-native microservice clusters proposed in this application.
[0024] Figure 2 This is a schematic diagram of the load balancing and dynamic resource scheduling system for cloud-native microservice clusters proposed in this application. Detailed Implementation
[0025] The technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but only to illustrate selected embodiments of this application.
[0026] Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item has been defined in one figure, it does not need to be further defined and explained in subsequent figures. The terms first, second, etc. are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0027] In high-concurrency distributed systems targeting cloud-native microservice clusters, especially in application scenarios highly sensitive to latency, such as high-frequency financial transaction microservice gateways, existing mainstream load balancing and resource scheduling technologies, such as conventional rate limiting modules based on reverse proxy components or resource scheduling components based on the horizontal scaling mechanism of container orchestration platforms, generally follow the rule of calculating the average request throughput in a fixed window at the second or minute level at the status collection node. This approach implies a key assumption: the statistical mean within the time window can linearly and equivalently represent the actual carrying status of the underlying hardware network interface card within that period.
[0028] However, under normal operating conditions such as high-frequency trading, traffic exhibits strong microsecond-level micro-burst physical characteristics due to the broadcasting of matching engines or the arrival of batch orders. The existing architecture thus falls into the mean-averaging fallacy: the microsecond-level surge in packets is completely smoothed out by the statistical mean within a large second-level window. For example, a large number of packets may flood in within a millisecond, while no packets arrive for nearly a second. The second-level mean will therefore appear low, and the monitoring system will determine that the current load is within a safe range. However, the underlying network interface hardware has actually endured a transient impact far exceeding its physical processing limits within that millisecond, and the system is completely unaware of the transient derivative changes within the micro-time slice.
[0029] Because this unique physical characteristic cannot be perceived, under normal operating conditions, transient packet backlog can easily exceed the allocation limit of the network card's ring buffer or the kernel protocol stack socket buffer, ultimately causing underlying queue overflow, large-scale silent packet loss, and in turn triggering severe transmission control protocol retransmission timeouts at the application layer. The end-to-end response latency exhibits a non-linear increase, causing a cascading failure of high-frequency gateway services. This is a long-standing systemic bottleneck in this field.
[0030] There is a common technical bias among those skilled in the art that the only solution to handle massive, high-frequency requests is to increase the computing power of load balancing components and reduce the statistical window. However, due to the physical barrier of switching between operating system kernel mode and user mode contexts, once the statistical window in any user mode falls below the millisecond level, its polling overhead will overwhelm the system first. This has limited existing technologies to the scope of averaged monitoring, and they have never been able to reach the microscopic, real physical characteristics. How to achieve accurate perception and preemptive physical blocking of microsecond-level traffic acceleration mutations at the network access layer without relying on application layer throughput average statistics has become an urgent technical problem to be solved.
[0031] Therefore, such as Figure 1 As shown, this application provides a load balancing and dynamic resource scheduling method for cloud-native microservice clusters, including the following steps:
[0032] Obtain the cumulative throughput sequence of the target cluster within consecutive discrete time slices at the network access layer, and based on the characteristics of the throughput difference change between adjacent time slices in the cumulative throughput sequence, obtain the traffic acceleration parameter corresponding to the target time slice.
[0033] Based on the flow acceleration parameters corresponding to the target time slice and several previous historical time slices, a state feature vector characterizing the micro-flow mutation trend is constructed.
[0034] Based on a preset time decay weight, the state feature vector is subjected to element-level aligned synchronous weighting to obtain a surge response value that characterizes a continuous surge trend.
[0035] When the surge response value is greater than the preset security dissipation boundary, the underlying address identifier of the target data packet is temporarily stored in the preset kernel isolation buffer; otherwise, a compensation coefficient matching the difference between the surge response value and the security dissipation boundary is generated.
[0036] When the traffic acceleration parameter of the target time slice and the surge response value meet the preset traffic fallback condition, the underlying address identifier temporarily stored in the kernel isolation buffer is re-injected into the kernel protocol stack space of the same origin as the regular message for business processing based on the compensation coefficient.
[0037] In another implementation, such as Figure 2 As shown, this application also provides a load balancing and dynamic resource scheduling system for cloud-native microservice clusters, including the following modules:
[0038] The data acquisition module is used to obtain the cumulative throughput sequence of the target cluster within continuous discrete time slices at the network access layer;
[0039] The extraction module is used to obtain the flow acceleration parameters corresponding to the target time slice based on the characteristics of the change in throughput difference between adjacent time slices in the cumulative throughput sequence.
[0040] The vector construction module is used to construct a state feature vector representing the micro-flow mutation trend based on the flow acceleration parameters corresponding to the target time slice and several previous historical time slices.
[0041] The data processing module is used to perform element-level aligned synchronous weighting operations on the state feature vector based on a preset time decay weight to obtain a surge response value that characterizes a continuous surge trend.
[0042] The determination module is used to temporarily store the underlying address identifier of the target data packet in a preset kernel isolation buffer when the surge response value is greater than the preset security dissipation boundary, and otherwise generate a compensation coefficient that matches the difference between the surge response value and the security dissipation boundary.
[0043] The service processing module is used to re-inject the underlying address identifier temporarily stored in the kernel isolation buffer into the kernel protocol stack space that is of the same origin as the regular message for service processing when the traffic acceleration parameter of the target time slice and the surge response value meet the preset traffic fallback conditions.
[0044] I. Obtaining the cumulative throughput sequence of the underlying hardware network access layer;
[0045] The input to this step is the newly arrived raw network data packets from the direct memory access ring buffer at the bottom layer of the network card's receive queue, and the hardware arrival timestamp provided by the server's high-precision hardware clock; the output is a cumulative throughput sequence that is strictly aligned with physical time and exhibits a monotonically increasing characteristic. By sinking the data acquisition probe down to the operating system kernel network card driver layer and performing hardware counting in microsecond-level steps, this invention avoids the smoothing effect of application-layer statistical windows on transient traffic characteristics, enabling the acquisition accuracy of traffic status to break through to the hardware physical level.
[0046] Specifically, this invention uses a probe program deployed in the operating system kernel driver layer to capture inbound packets entering the network access layer in real time and extract the hardware arrival timestamps corresponding to the inbound packets. The hardware interrupt capture and timestamp reading mechanism of this probe program belongs to the existing technical means in the field of operating system kernel programming. Those skilled in the art can refer to the general kernel driver development specifications to complete the deployment of the probe and the reading of the hardware timestamps.
[0047] Based on a preset base time step, the hardware arrival timestamp is periodically aligned to determine the target time slice identifier to which the inbound message belongs. That is, by mapping the hardware arrival timestamp to the base time step, the continuous physical time axis is discretized into a sequence of consecutive time slices, and each inbound message is uniquely assigned to a specific time slice according to its arrival time.
[0048] Based on the target time slice identifier, addressing is performed in a preset kernel-mode concurrent shared memory area, and an atomic increment operation is performed on the global message counter that is hit, generating the cumulative throughput sequence. This kernel-mode concurrent shared memory area is a standard kernel data structure that supports multi-core concurrent lock-free access. The atomic increment operation ensures that the counting process will not result in data loss or duplicate counting due to race conditions in high-concurrency interrupt scenarios, which is a conventional low-level operation that can be implemented by existing kernel programming specifications.
[0049] The resulting cumulative throughput sequence, with the base time step as the smallest granularity, completely preserves every instantaneous fluctuation during the message arrival process, providing zero-loss underlying basic data for subsequent steps to extract micro-traffic features without introducing any user-space context switching overhead.
[0050] It should be noted that the kernel driver layer probe acquisition method used in this step differs from the existing method of periodically polling the network card status by a user-space program. Context switching between the user-space program and the operating system kernel consumes a fixed number of processor clock cycles. If the user-space statistics window is less than milliseconds, the processor overhead caused by frequent context switching will overwhelm the system's processing capacity before the traffic statistics themselves. This is the fundamental reason why existing technologies have long been limited to second- or minute-level statistics windows and have never been able to reach microsecond-level granularity.
[0051] This invention pushes the entire data acquisition process down to the kernel driver layer, so that the packet arrival counting process is completed entirely at the kernel-mode atomic operation level, without involving any context switching between user mode and kernel mode. This makes microsecond-level granularity traffic statistics feasible in engineering. This underlying architecture choice is a prerequisite for this invention to achieve micro-level traffic acceleration perception.
[0052] II. Extraction of flow acceleration parameters corresponding to the target time slice;
[0053] The input to this step is the target time slice and the cumulative throughput corresponding to its adjacent historical time slices in the cumulative throughput sequence output above; the output is the flow acceleration parameter characterizing the influx acceleration. By performing a second-order difference operation on the message arrival rates of adjacent time slices, this invention transforms the originally imperceptible transient flow changes into quantifiable acceleration characteristics, providing a raw input with clear physical meaning for subsequent catastrophic burst determination.
[0054] Specifically, this invention extracts the throughput difference between adjacent discrete time slices in the cumulative throughput sequence to determine the message arrival rate of the corresponding time slice: Let the first cumulative throughput within the target time slice be... The second cumulative throughput within the first historical time slice adjacent to the target time slice is The third cumulative throughput within the second historical time slice adjacent to the first historical time slice is The time step corresponding to the target time slice is The message arrival rate corresponding to the target time slice is:
[0055] ;
[0056] The message arrival rate corresponding to the first historical time slice adjacent to the target time slice is:
[0057] ;
[0058] Based on this, the flow acceleration parameters corresponding to the target time slice are extracted based on the second-order difference change trajectory between adjacent message arrival rates. :
[0059] ;
[0060] in, , , The units are all message counts. This represents the time step corresponding to the target time slice, in microseconds. This calculation result... This objectively characterizes the physical acceleration state of network data packets entering the underlying hardware receive queue:
[0061] The numerator quantifies the change in arrival rate by performing a difference on the arrival rates of two adjacent messages, while the denominator... Let be the square of the time step, so that the entire expression corresponds strictly to the physical acceleration in terms of dimensions. When When the value is significantly greater than zero, it precisely indicates that network traffic is exhibiting a steep, non-linear deterioration trend.
[0062] III. Construction of state feature vectors characterizing the trend of micro-flow mutations;
[0063] The input to this step is the multiple flow acceleration parameters output continuously as described above; the output is a state feature vector arranged in time sequence to characterize the micro-flow change trend. By constructing the state feature vector by arranging the flow acceleration parameters of multiple consecutive time slices in time sequence, the system obtains the necessary time dimension context for observing the micro-flow change trend, avoiding the risk of misjudgment caused by judging based solely on isolated values of a single time slice.
[0064] Specifically, this invention arranges and combines the flow acceleration parameters corresponding to a preset number of consecutive historical time slices and a target time slice according to time sequence: extracting the flow acceleration parameters corresponding to the target time slice. and adjacent to the target time slice The flow acceleration parameters corresponding to each historical time slice are arranged in chronological order to construct a state feature vector. .
[0065] In one embodiment, The value of is 2, meaning the state feature vector is composed of elements arranged in chronological order. , , The flow acceleration parameters consist of three components, corresponding to the second historical time slice preceding the target time slice, the first historical time slice, and the target time slice itself. The number of elements in the state feature vector strictly corresponds to the number of time decay weights in the baseline decay vector, together forming the input basis for subsequent element-wise weighted operations.
[0066] IV. Weighted generation of surge response values;
[0067] The inputs to this step are the state feature vector output above and the system's preset baseline decay vector; the output is the surge response value characterizing a continuous surge trend. By introducing the baseline decay vector and performing a Hadamard product weighted operation on the state feature vector, this invention suppresses the transient numerical jitter in the flow acceleration parameter, which exhibits alternating fluctuations due to the sliding window mechanism of the transmission control protocol. This allows the system to respond only to real catastrophic bursts exhibiting continuous positive high acceleration, unlike existing flow-limiting logic that directly sets a threshold for a single transient feature.
[0068] Specifically, the present invention obtains a reference decay vector that includes a preset time decay weight. The number of time decay weights in the baseline decay vector strictly corresponds to the number of flow acceleration parameters in the state feature vector, and the weight elements are set monotonically increasing in chronological order, so that the flow acceleration parameter closest to the current moment obtains the highest physical confidence. In the aforementioned... In a specific embodiment where the value is 2, the reference decay vector consists of three time decay weights arranged in chronological order. , , The three elements satisfy the requirements. and .
[0069] The state feature vector and the reference decay vector are subjected to element-wise aligned synchronous weighting, that is, the state feature vector and the reference decay vector are extracted and subjected to Hadamard product operation according to the time-series corresponding elements to generate the corresponding coupled response vector.
[0070] ;
[0071] in, The state feature vector constructed above, This is the reference attenuation vector obtained in this step. This represents the Hadamard product operator, which performs element-wise aligned term-by-term multiplication on two vectors of the same dimension. This is the coupled response vector.
[0072] Subsequently, the elements within the coupled response vector are algebraically summed to obtain the surge response value. ;
[0073] in, The first element in the state feature vector arranged in chronological order One flow acceleration parameter, The first in the reference decay vector arranged in chronological order Each time decay weight, This represents the number of historical time slices that are consecutively adjacent to the target time slice.
[0074] This weighted summation mathematically suppresses high-frequency white noise that alternates between positive and negative values: because the weights are set to monotonically increase, the summation process cancels out the alternating positive and negative elements in the state feature vector, only when multiple consecutive time slices exhibit a definite positive high acceleration. Only then will it be continuously amplified;
[0075] Conversely, if the acceleration characteristics exhibit transient fluctuations, the weighted results will cancel each other out during the summation process, preventing them from accumulating into a threatening value. This results in a surge in the response value. It is no longer an isolated transient variable, but has physical properties that characterize a continuous surge trend, eliminating the possibility of the system accidentally tripping due to a single point of sudden jump.
[0076] It should be noted that the micro-traffic mutation trend represented by the state feature vector constructed above and the continuous surge trend represented by the surge response value generated in this step are not redundant descriptions, but rather constitute a progressive relationship from initial observation to threat assessment. The state feature vector is the result of the system's indiscriminate collection of traffic from the underlying network interface card, objectively recording all the original fluctuations in traffic acceleration within multiple consecutive time slices. It includes both real bursts that may trigger avalanches and harmless high-frequency jitter caused by the sliding window mechanism of the transmission control protocol, and does not inherently possess the ability to distinguish between them.
[0077] The surge response value is a qualitative conclusion derived by the system after weighted calculation using the Hadamard product. It is the only truly destructive feature retained after removing harmless jitter from the aforementioned original observations. The former provides the original feature space required for the latter's calculation; without the former, the latter would have nothing to rely on. The latter provides the former with the ability to filter and qualitatively assess; without the latter, the former would be unable to be used for actual flow limiting decisions due to frequent misjudgments. This progressive causal chain from original features to threat assessment ensures that this invention can both perceive the real fluctuations of underlying hardware traffic with microsecond-level precision and maintain a high degree of confidence in the judgment results while maintaining extremely high perception accuracy. Both are indispensable.
[0078] In one embodiment, to address the possibility that micro-network traffic might resonate with fixed system sampling slices, after generating the compensation coefficients, within a preset observation time window, multiple consecutively generated compensation coefficients are combined according to their generation order to obtain a compensation coefficient set; the total number of state transitions between zero and positive values in this compensation coefficient set is then counted. Divide the total number of observations by the preset time length of the observation window. Generate compensation coefficient reversal frequency:
[0079] ;
[0080] The compensation coefficient inversion frequency is compared with a preset system oscillation threshold. By comparison, decision factors are obtained. When the reversal frequency of the compensation coefficient, which represents the decision factors, is less than or equal to the system oscillation threshold, the number of elements and the gradient of the numerical difference of the baseline decay vector are kept unchanged. Under normal low-frequency fluctuation conditions, maintaining a shorter number of dimensions can ensure the system's extremely rapid and sensitive response to the real flood peak, avoiding response lag caused by an excessively long observation window.
[0081] When the reversal frequency of the decision factor characterization compensation coefficient exceeds the preset system oscillation threshold, it is determined that the current system is in an oscillation state of high-frequency switching between isolation and release. At this time, the number of elements in the baseline decay vector is increased, and the numerical difference gradient between adjacent preset time decay weights is simultaneously reduced to generate the target decay vector. Simultaneously, the number of historical time slices continuously adjacent to the target time slice is increased. This is done so that the number of elements in the subsequent state feature vector is the same as the number of elements in the target decay vector.
[0082] For example, the original three-dimensional baseline attenuation vector has values of 0.2, 0.3, and 0.5, with adjacent weight gradient differences of 0.1 and 0.2. After triggering stretching and reorganization, the generated five-dimensional target attenuation vector has values of 0.12, 0.16, 0.20, 0.24, and 0.28, with adjacent weight gradient differences being synchronously compressed to a uniform 0.04, while the total weight sum remains constant at 1. The reduction in gradient difference at the signal processing level is equivalent to lowering the cutoff frequency of the low-pass filter, preventing the system from overly relying on extremely recent instantaneous accelerations and instead distributing decision weights more evenly over a longer historical period, thus smoothing out micro-flow oscillations in specific frequency bands from a physical perspective.
[0083] The number of elements in the target decay vector is used as a sampling control parameter and fed back to the upstream front node that extracts the state feature vector. The upstream front node is controlled to extract the flow acceleration parameter corresponding to the time span based on the sampling control parameter, construct an updated state feature vector that strictly matches the dimension of the target decay vector, and perform element-level aligned synchronous weighting operation on the updated state feature vector using the target decay vector to obtain the updated surge response value.
[0084] This feedback process directly points the pointer of the original baseline attenuation vector stored in the underlying probe memory mapping to the newly generated target attenuation vector, achieving hot replacement of the front-end perception structure based on the result features without interrupting the normal network throughput. This allows the system to quickly escape the resonance state and return to the stable smooth compensation release range.
[0085] V. Interception and temporary storage when the surge response value exceeds the safe dissipation boundary;
[0086] The input for this step is a surge response value that exceeds the preset security dissipation boundary, and the currently intercepted target data packet; the output is the underlying address identifier of the target data packet that has been temporarily stored in the kernel isolation buffer.
[0087] By performing physical-level address redirection on data packets before they are allocated to application-layer socket buffer memory, this invention avoids the depletion of computing power and system freeze caused by continuous memory allocation in the kernel, fundamentally different from the existing technology of allocating memory first and then discarding or limiting it.
[0088] Specifically, in response to the surge in response value exceeding a preset safety dissipation boundary, this invention generates an interception and redirection instruction in the system kernel mode: interrupting the normal flow of allocating memory space for the target data packet to the application-layer socket buffer. That is, before the network card hardware triggers an interrupt and the kernel protocol stack allocates a socket buffer memory structure for the data packet, the kernel-mode interception and redirection instruction forcibly terminates the memory allocation process. The application-layer socket buffer is a standard memory structure reserved by the operating system kernel for application-layer processes to receive network data. It is a well-known component of existing computer networks. This invention, by intercepting the allocation of this memory structure before it is allocated, eliminates the overhead of memory allocation and protocol stack parsing that would otherwise be required.
[0089] Based on the interception and redirection instruction, the underlying address identifier of the currently intercepted target data packet is temporarily stored in a preset kernel isolation buffer. This buffer is a lock-free ring data structure pre-allocated in kernel mode, supporting lock-free writing in high-concurrency scenarios. Those skilled in the art can implement it by referring to existing lock-free ring buffer design specifications. Simultaneously, a redirection status code is returned to the underlying network interface card driver corresponding to the network access layer, ending the data flow of the target data packet in the application layer protocol stack. Through this process, without discarding any packets, the impact of micro-burst floods on conventional transmission control protocol connection tracking and microservice application layer threads is cut off, ensuring the throughput stability of existing connections.
[0090] It should be noted that the physical-level isolation achieved in this step is fundamentally different from existing logical-layer filtering methods such as traditional firewalls or access control lists. Traditional logical-layer filtering methods allow or discard packets according to preset filtering rules after the packets have completed memory allocation and entered the protocol stack parsing process. Their interception action occurs after resource consumption has already occurred, and it does not reduce the memory allocation and protocol stack parsing overhead caused by massive micro-burst packets.
[0091] The interception and redirection instructions of this invention operate at an earlier stage, before the data packet has been allocated application layer socket buffer memory. This ensures that the target data packet never incurs application layer memory allocation and protocol stack parsing overhead throughout its entire lifecycle. Thus, it achieves the blocking of micro-burst traffic at the source of physical resource consumption rather than at the logical judgment stage. This difference constitutes one of the core technical features that distinguish this invention from existing flow limiting technologies.
[0092] VI. Generation of compensation coefficients when the surge response value is less than or equal to the safety dissipation boundary;
[0093] The input for this step is a surge response value that is less than or equal to a preset safety dissipation boundary; the output is a compensation coefficient that dynamically matches the absolute value of the difference. By performing a dimensional mapping on the absolute value of the difference between the safety dissipation boundary and the surge response value, this invention transforms the abstract flow acceleration parameter into a specific compensation coefficient that can directly drive data extraction, thus solving the inherent dimensional discrepancy between capacity-type and rate-type indicators.
[0094] Specifically, in response to the surge response value being less than or equal to the safety dissipation boundary, the present invention calculates the absolute value of the difference between the safety dissipation boundary and the surge response value: ;
[0095] in, To define the physical processing limits of the network interface card (NIC) based on the preset safety dissipation boundary, For the surge response value generated above, It is the absolute value of the difference between the two.
[0096] because The physical dimension of the output is derived from the flow acceleration parameter, while the dimension of the compensation coefficient to be output is the application layer data packet extraction frequency. There is a cross-dimensional dimensional difference between the two. Therefore, this invention further obtains a preset dimensional mapping coefficient. The dimension mapping coefficient is used to characterize the baseline conversion ratio from the underlying network traffic acceleration parameters to the application layer packet extraction frequency. The absolute value of the difference is multiplied by the dimension mapping coefficient to generate a compensation coefficient that dynamically matches the absolute value of the difference.
[0097] ;
[0098] The compensation coefficient represents the actual available throughput margin within the current time slice of the network access layer. By performing the multiplication operation of the dimensional mapping coefficients, the cross-dimensional dimensional discrepancy is eliminated, allowing the compensation coefficient to be directly used as the upper limit of the rate for subsequent data extraction actions, rather than an intermediate abstract quantity that requires further conversion.
[0099] It should be noted that the absolute value of the difference originates from the deformation of the flow acceleration parameter in terms of physical dimensions, and its unit is the number of packets per unit time squared; while the compensation coefficient drives the specific action of the kernel polling task to extract packets one by one, and its unit is the number of packets per unit time. The two differ in terms of the order of dimensions by a time dimension.
[0100] Dimensional mapping coefficient The introduction of this coefficient is precisely to bridge this order difference by setting a benchmark conversion ratio, so that the absolute value of the difference, after being linearly mapped by this coefficient, can simultaneously correspond to a directly executable extraction rate in both numerical and physical sense.
[0101] VII. Re-injection of underlying address identifiers based on compensation coefficients;
[0102] The inputs to this step are the compensation coefficients generated above and the underlying address identifier temporarily stored in the kernel isolation buffer; the output is the target data packet that is re-injected into the system kernel protocol stack and processed from the same source as a regular message.
[0103] By setting flow drop conditions that include both acceleration trend and absolute water level, and executing controlled release at a frequency not exceeding the compensation coefficient, this invention avoids secondary congestion avalanches caused by the concentrated dumping of temporary messages, which is different from the two crude release methods in the prior art: one-time return after the flood peak or fixed low-speed dripping.
[0104] Specifically, the present invention determines a preset flow drop condition: the flow drop condition is that the flow acceleration parameter corresponding to the target time slice is less than or equal to zero, and the surge response value is less than or equal to half of the safety dissipation boundary;
[0105] The first criterion confirms from the perspective of traffic change trend that the most intense acceleration phase of the flood peak has passed. The second criterion confirms from the perspective of absolute capacity level that the system has sufficient remaining processing capacity. Both criteria must be met simultaneously to confirm that the traffic decline condition has been met, thus avoiding high-frequency interception and release state switching caused by the system immediately releasing temporary data when the surge response value is just below the safe dissipation boundary.
[0106] In response to and When the traffic fallback condition is met, the present invention initiates a preset kernel polling task, extracts the temporarily stored underlying address identifiers from the kernel isolation buffer continuously according to the data extraction frequency whose value does not exceed the compensation coefficient, and sends them to the system kernel protocol stack to trigger the service processing of the target data packet, so that the target data packet eventually returns to the same source and is processed by the service process in the same manifold space where the regular message is located.
[0107] In one specific embodiment, the kernel polling task checks in each loop whether the number of extracted data has reached the upper limit of the compensation coefficient. If the number of underlying address identifiers temporarily stored in the isolation buffer is less than the upper limit, the data is extracted according to the actual remaining number in the buffer without being forcibly supplemented to the upper limit value. This ensures that the actual usable amount of temporarily stored data is taken into account while ensuring that the system's safe processing capacity is not exceeded.
[0108] Through the above technical solutions, the present invention can achieve the following technical effects:
[0109] 1) In view of the shortcomings of existing technologies that cannot detect microsecond-level traffic acceleration changes due to reliance on application layer throughput average statistics, this invention sinks the data acquisition probe to the kernel network card driver layer and extracts traffic acceleration parameters in microsecond steps, so that the system can obtain accurate perception of micro traffic change trends before protocol stack parsing, thereby compressing the overflow rate of the network card ring buffer caused by micro-bursts to a level close to zero.
[0110] 2) In view of the shortcomings of the existing technology, which is susceptible to high-frequency white noise interference and thus leads to misjudgment of current limiting, the present invention performs a weighted operation of the Hadamard product on the state feature vector and the reference attenuation vector to suppress the transient numerical jitter of alternating fluctuations. This enables the system to respond only to real catastrophic bursts that present continuous positive acceleration, which significantly improves the noise resistance of the current limiting determination process.
[0111] 3) In view of the shortcomings of the existing technology, which is that the fixed rate of interception and discard or recovery and release is prone to causing secondary congestion avalanche, the present invention introduces a compensation coefficient that is dynamically matched with the absolute value of the difference, and re-injects the data packets temporarily stored in the kernel isolation buffer into the protocol stack at a controlled rate. This avoids secondary overload in the recovery phase without discarding any packets, and compresses the fluctuation range of end-to-end response latency during traffic peaks into an extremely narrow band.
[0112] 4) In view of the ping-pong effect defect in the existing technology where the fixed time window is prone to high-frequency switching of the current limiting state when facing periodic harmonic interference, the present invention monitors the reversal frequency of the compensation coefficient and dynamically stretches the characteristic dimension and weight gradient of the reference attenuation vector, so that the system can adaptively suppress the periodic oscillation of a specific frequency band and improve the steady-state operation capability of the system under complex working conditions.
[0113] In another embodiment, this application also provides a computer storage medium storing computer-executable instructions, which, when executed, implement the load balancing and dynamic resource scheduling method for cloud-native microservice clusters.
[0114] The above embodiments are only used to illustrate the technical methods of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of this application without departing from the spirit and scope of the technical methods of this application.
Claims
1. A load balancing and dynamic resource scheduling system for cloud-native microservice clusters, characterized in that, Includes the following modules: The data acquisition module is used to obtain the cumulative throughput sequence of the target cluster within continuous discrete time slices at the network access layer; The extraction module is used to obtain the flow acceleration parameters corresponding to the target time slice based on the characteristics of the change in throughput difference between adjacent time slices in the cumulative throughput sequence. The vector construction module is used to construct a state feature vector representing the micro-flow mutation trend based on the flow acceleration parameters corresponding to the target time slice and several previous historical time slices. The data processing module is used to perform element-level aligned synchronous weighting operations on the state feature vector based on a preset time decay weight to obtain a surge response value that characterizes a continuous surge trend. The determination module is used to temporarily store the underlying address identifier of the target data packet in a preset kernel isolation buffer when the surge response value is greater than the preset security dissipation boundary, and otherwise generate a compensation coefficient that matches the difference between the surge response value and the security dissipation boundary. The service processing module is used to re-inject the underlying address identifier temporarily stored in the kernel isolation buffer into the kernel protocol stack space that is of the same origin as the regular message for service processing when the traffic acceleration parameter of the target time slice and the surge response value meet the preset traffic fallback conditions.
2. The load balancing and dynamic resource scheduling system for cloud-native microservice clusters according to claim 1, characterized in that, The process of obtaining flow acceleration parameters includes: The first cumulative throughput within the target time slice is extracted sequentially from the cumulative throughput sequence. The second cumulative throughput within the first historical time slice adjacent to the target time slice and the third cumulative throughput within the second historical time slice adjacent to the first historical time slice. ; Based on the first cumulative throughput, the second cumulative throughput, the third cumulative throughput, and the time step corresponding to the target time slice. Obtain the flow acceleration parameters corresponding to the target time slice. ; 。 3. The load balancing and dynamic resource scheduling system for cloud-native microservice clusters according to claim 1, characterized in that, The process of obtaining surge response values includes: Extract the flow acceleration parameters corresponding to the target time slice and the flow acceleration parameters corresponding to the k consecutive historical time slices adjacent to the target time slice, and arrange them according to the chronological order of the corresponding time slices to generate a state feature vector; The state feature vector is subjected to a Hadamard product operation with a reference decay vector composed of preset time decay weights for the corresponding time slices, and the elements in the resulting coupled response vector are algebraically summed to obtain the surge response value. ; ; The i-th flow acceleration parameter in the state feature vector, arranged in chronological order. It is the i-th time decay weight in the reference decay vector arranged in chronological order.
4. The load balancing and dynamic resource scheduling system for cloud-native microservice clusters according to claim 1, characterized in that, The process of temporarily storing the underlying address identifier of the target data packet in the kernel isolation buffer includes: When the surge response value exceeds the preset safety dissipation boundary, the flow of the target data packet to the application layer socket buffer is interrupted, the underlying address identifier of the target data packet is mapped and transferred to the preset kernel isolation buffer, a redirection status code is returned to the underlying network card driver corresponding to the network access layer, and the data flow of the target data packet in the application layer protocol stack is terminated.
5. The load balancing and dynamic resource scheduling system for cloud-native microservice clusters according to claim 1, characterized in that, The process of generating compensation coefficients includes: When the surge response value is less than or equal to the preset safety dissipation boundary, the absolute value of the difference between the surge response value and the preset safety dissipation boundary is obtained, and it is multiplied by the preset dimension mapping coefficient to generate a compensation coefficient that characterizes the actual available throughput margin in the current time slice of the network access layer.
6. The load balancing and dynamic resource scheduling system for cloud-native microservice clusters according to claim 3, characterized in that, After generating the compensation coefficients, the following is also included: Within a preset observation time window, multiple compensation coefficients generated consecutively are combined according to the order in which they were generated to obtain a set of compensation coefficients. The total number of times the values in the compensation coefficient set cross between zero and positive values is counted, and the total number of times is divided by the preset time length of the observation time window to generate the compensation coefficient flip frequency. When the reversal frequency of the compensation coefficient is greater than the preset system oscillation threshold, the number of element dimensions of the state feature vector and the reference decay vector corresponding to the next time slice is increased synchronously, and the numerical difference gradient between their adjacent time decay weights is reduced to generate the target decay vector. The corresponding surge response value is obtained based on the target decay vector and the state feature vector of the next time slice.
7. The load balancing and dynamic resource scheduling system for cloud-native microservice clusters according to claim 1, characterized in that, The process of re-injecting the underlying address identifier into the kernel protocol stack space for business processing includes: The flow rate fallback condition is: the flow rate acceleration parameter of the target time slice is less than or equal to zero, and the surge response value is less than or equal to half of the safety dissipation boundary. When the traffic fallback condition is met, a preset kernel polling task is started to continuously extract the temporarily stored underlying address identifier from the kernel isolation buffer at a data extraction frequency that does not exceed the compensation coefficient, and send it to the kernel protocol stack space to trigger the service processing of the target data packet.
8. The load balancing and dynamic resource scheduling system for cloud-native microservice clusters according to claim 1, characterized in that, The process of obtaining the cumulative throughput sequence includes: By deploying a probe program in the operating system kernel driver layer, inbound packets entering the network access layer are captured in real time, and the arrival timestamps corresponding to the inbound packets are extracted. Based on a preset time step, period alignment processing is performed on the arrival timestamp to obtain the time slice identifier to which the inbound message belongs. Based on the time slice identifier, addressing is performed in the preset kernel-mode concurrent shared memory area, and the global packet counter that is hit by the address is incremented to generate a cumulative throughput sequence.
9. A load balancing and dynamic resource scheduling method for cloud-native microservice clusters, characterized in that, Includes the following steps: Obtain the cumulative throughput sequence of the target cluster within consecutive discrete time slices at the network access layer, and based on the characteristics of the throughput difference change between adjacent time slices in the cumulative throughput sequence, obtain the traffic acceleration parameter corresponding to the target time slice. Based on the flow acceleration parameters corresponding to the target time slice and several previous historical time slices, a state feature vector characterizing the micro-flow mutation trend is constructed. Based on a preset time decay weight, the state feature vector is subjected to element-level aligned synchronous weighting to obtain a surge response value that characterizes a continuous surge trend. When the surge response value is greater than the preset security dissipation boundary, the underlying address identifier of the target data packet is temporarily stored in the preset kernel isolation buffer; otherwise, a compensation coefficient matching the difference between the surge response value and the security dissipation boundary is generated. When the traffic acceleration parameter of the target time slice and the surge response value meet the preset traffic fallback condition, the underlying address identifier temporarily stored in the kernel isolation buffer is re-injected into the kernel protocol stack space of the same origin as the regular message for business processing based on the compensation coefficient.
10. A computer storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, they implement the load balancing and dynamic resource scheduling system for cloud-native microservice clusters as described in any one of claims 1-8.